发布PWM32EPRO V2.0版本

This commit is contained in:
2026-09-05 12:41:51 +08:00
parent cbb03c9d9c
commit a1b914709d
48 changed files with 4084 additions and 5254 deletions
@@ -1,779 +0,0 @@
# 12~24V 2P2N双色LED H桥驱动原理与器件设计
## 1. 文档目的
本文针对一套输入电压为12~24V的双色LED H桥驱动电路。主功率桥由2只PMOS和2只NMOS组成,另外使用2只小信号NMOS驱动高边PMOS,因此整个驱动部分共使用6只MOS管。
本文说明:
- 2P2N主桥和2只驱动MOS分别承担什么工作;
- 双色LED为什么需要H桥改变电流方向;
- 两路PWM输入怎样控制暖光、冷光和关闭状态;
- 为什么两路输入绝对不能同时为高电平;
- 为什么换向必须先输出`00`并保留死区;
- PMOS为什么需要栅极上拉电阻和下拉电阻;
- 两个电阻为什么会形成分压;
- 电阻太大或太小分别会产生什么问题;
- 12V稳压管在电路中起什么作用;
- 如何计算PMOS的栅源电压、电阻功耗和稳压管电流;
- 如果取消稳压管,应当如何重新选择电阻;
- 为什么还必须检查死区时间、MOS管尖峰和PCB布局。
本文尽量使用直观的方式说明,适合刚接触MOS管驱动电路的工程人员阅读。
---
## 2. 完整电路由哪些部分组成
![12~24V 2P2N双色LED H桥驱动原理图](images/12-24V_2P2N_H桥驱动原理图.png)
图1:本项目12~24V、2P2N主桥加2只小MOS驱动的完整原理图。
图中的主要器件分工如下:
| 器件 | 类型 | 作用 |
|---|---|---|
| Q1、Q2 | 高边PMOS(60P03) | 分别把C端、W端连接到12~24V电源 |
| Q9、Q10 | 低边NMOS(60N03) | 分别把C端、W端连接到GND |
| Q7、Q8 | 小信号NMOS(AO3400A) | 分别下拉Q1、Q2的栅极 |
| R1、R2 | 2.4kΩ上拉电阻 | 使Q1、Q2快速关断 |
| R3、R4 | 3kΩ下拉通路电阻 | 与R1、R2分压,限制高边PMOS的导通VGS |
| D1、D2 | 12V稳压管(BZT52C12) | 限制高边PMOS的栅源电压尖峰 |
| R14、R15 | 10kΩ栅源下拉电阻 | 确保Q9、Q10在控制信号悬空时保持关闭 |
### 2.1 2只高边PMOS
高边使用2只PMOS:
- 左侧PMOS负责把输出端`C`连接到12~24V电源;
- 右侧PMOS负责把输出端`W`连接到12~24V电源。
PMOS适合放在高边,是因为它的源极可以直接接正电源,栅极只需要从源极电压向下拉,就能导通。
### 2.2 2只低边NMOS
低边使用2只NMOS:
- 左侧NMOS负责把输出端`C`连接到GND;
- 右侧NMOS负责把输出端`W`连接到GND。
低边NMOS的源极接地,MCU输出高电平后比较容易直接驱动其栅极。
### 2.3 2只PMOS驱动NMOS
MCU通常只有3.3V输出,不能直接把接在12~24V电源上的PMOS栅极拉到合适电位,所以增加2只小信号NMOS:
- 左侧驱动NMOS负责下拉左侧PMOS栅极;
- 右侧驱动NMOS负责下拉右侧PMOS栅极。
这2只小MOS不直接承受LED主电流,只负责PMOS栅极的充电和放电控制。
### 2.4 负载是反向并联双色LED
双色LED连接在`C`、`W`两个H桥输出端之间。两种颜色的LED芯片方向相反:
- 电流从`C`流向`W`时,点亮一种颜色;
- 电流从`W`流向`C`时,点亮另一种颜色;
- 两个方向快速分时工作时,肉眼看到混合色或中性光。
H桥的作用不是简单提供两路独立正电压,而是改变流过双色LED的电流方向。
---
## 3. 两路输入如何控制H桥
本文把两路控制信号称为:
- `PWM_W`:驱动Q7和对角线上的Q10,形成`C→W`电流;
- `PWM_C`:驱动Q8和对角线上的Q9,形成`W→C`电流。
按照当前交叉驱动结构,一路信号会同时控制一只高边PMOS和对角线上的一只低边NMOS。
> `PWM_C`、`PWM_W`是电路网络名称。最终点亮暖色还是冷色,还取决于双色LED的实际安装方向。
### 3.1 PWM_W有效
`PWM_W=1、PWM_C=0`时:
- Q7导通并下拉Q1的栅极,使左侧高边PMOS Q1导通;
- 对角线上的右侧低边NMOS Q10导通;
- `C`端接近电源;
- `W`端接近GND;
- 电流方向为`电源 → C → LED → W → GND`。
此时点亮一个颜色。
### 3.2 PWM_C有效
`PWM_C=1、PWM_W=0`时:
- Q8导通并下拉Q2的栅极,使右侧高边PMOS Q2导通;
- 对角线上的左侧低边NMOS Q9导通;
- `W`端接近电源;
- `C`端接近GND;
- 电流方向为`电源 → W → LED → C → GND`。
此时点亮另一个颜色。
### 3.3 两路均为低电平
`PWM_C=0、PWM_W=0`时:
- 两只高边PMOS关闭;
- 两只低边NMOS关闭;
- H桥处于关闭状态;
- LED没有持续驱动电流。
换向时必须先进入这个状态。
### 3.4 两路均为高电平
`PWM_C=1、PWM_W=1`是禁止状态。
此时两组对角桥臂同时收到导通命令,可能导致同一桥臂的上管和下管同时导通,形成:
```text
电源 → 上管 → 下管 → GND
```
这条路径几乎没有LED负载限流,会产生很大的直通电流,可能造成:
- 电源异响;
- MOS管快速发热;
- 电源电压跌落;
- MCU复位或蓝牙掉线;
- MOS管损坏;
- PCB走线或电源器件损坏。
控制真值表如下:
| PWM_C | PWM_W | H桥状态 | 结果 |
|---:|---:|---|---|
| 0 | 0 | 全部关闭 | 安全关闭/换向死区 |
| 0 | 1 | C高、W低 | 电流从C流向W |
| 1 | 0 | W高、C低 | 电流从W流向C |
| 1 | 1 | 禁止状态 | 可能发生桥臂直通 |
---
## 4. 为什么换向必须设置死区
MOS管不是收到控制电平后立即完成导通或关断。栅极电容、米勒平台、驱动电阻和PCB寄生参数都会产生延迟。
如果直接执行:
```text
PWM_C有效 → PWM_W有效
```
可能出现:
- 原方向的PMOS和NMOS还没有完全关闭;
- 新方向的PMOS和NMOS已经开始导通;
- 两个方向在很短时间内重叠;
- H桥形成瞬间直通。
正确换向顺序应为:
```text
方向C导通 → 输出00 → 等待死区 → 方向W导通
方向W导通 → 输出00 → 等待死区 → 方向C导通
```
死区时间不能只根据软件定时值决定,必须结合实际MOS管栅极波形测量。对于本类低频LED PWM,可以先设置较保守的死区进行验证,再根据示波器结果缩短。
需要注意:
- 死区太短,可能发生直通;
- 死区太长,会降低最大有效占空比和LED峰值亮度;
- 调高PWM频率后,相同死区占整个周期的比例会变大;
- PMOS上拉电阻变大后,通常需要重新确认死区是否足够。
---
## 5. 先认识PMOS的三个引脚
PMOS有三个主要引脚:
- `S`:源极(Source),本电路接12V或24V电源;
- `G`:栅极(Gate),用于控制PMOS导通和关断;
- `D`:漏极(Drain),连接H桥输出端。
PMOS是否导通,主要取决于栅源电压:
```text
VGS = VG - VS
```
其中:
- `VG`是栅极对地电压;
- `VS`是源极对地电压。
假设源极接24V:
| 栅极电压VG | 栅源电压VGS | PMOS状态 |
|---:|---:|---|
| 24V | 0V | 关断 |
| 20V | -4V | 开始较明显导通 |
| 14V | -10V | 充分导通 |
| 12V | -12V | 充分导通 |
| 0V | -24V | 超过多数PMOS的栅源耐压,危险 |
> 注意:数据手册中的`VGS(th)`是“刚开始有很小电流”的开启阈值,不代表MOS管已经充分导通。
以SL60P03D为例:
- `VGS(th)`约为-1.0V至-2.2V;
- 导通电阻通常在`VGS=-4.5V`或`VGS=-10V`条件下标定;
- 栅源极绝对最大耐压为`±20V`。
所以“20V”不是开启阈值,而是不能超过的栅源极极限耐压。
---
## 6. 上拉电阻和下拉电阻分别做什么
为避免受到原理图位号差异影响,本文统一使用下面的名称:
- `RUP`:PMOS栅极到源极(电源)的上拉电阻;
- `RDOWN`:PMOS栅极到地的下拉电阻;
- `DZ`:跨接在PMOS栅极和源极之间的稳压管;
- `QDRV`:把PMOS栅极向地拉低的小信号MOS管。
简化结构如下:
```text
电源12V/24V
|
+--------- PMOS源极S
|
RUP
|
+--------- PMOS栅极G
|
RDOWN
|
QDRV
|
GND
DZ稳压管跨接在PMOS的S和G之间。
```
### 6.1 PMOS关断过程
当`QDRV`关闭后,下拉路径断开,`RUP`把PMOS栅极充电到源极电压:
```text
VG ≈ VS
VGS ≈ 0V
```
PMOS关断。
因此,`RUP`越小,给栅极电容充电的电流越大,PMOS通常关断得越快。
### 6.2 PMOS导通过程
当`QDRV`导通后,`RUP`和`RDOWN`形成从电源到地的分压回路,栅极电压下降,PMOS得到负的`VGS`并导通。
因此:
- `RUP`太小:关断快,但栅极不容易被拉低,PMOS导通电压可能不足;
- `RUP`太大:PMOS容易得到较大的负`VGS`,但栅极充电慢,关断时间增加;
- `RDOWN`太小:PMOS导通更充分,但电流和电阻功耗增加;
- `RDOWN`太大:功耗降低,但PMOS导通电压减小。
两个电阻必须综合考虑,不能只追求其中一个方向。
---
## 7. 没有稳压管时如何计算
先忽略稳压管,假设`QDRV`已经完全导通。
栅极电压为:
```text
VG = VCC × RDOWN / (RUP + RDOWN)
```
PMOS栅源电压的绝对值为:
```text
|VGS| = VCC × RUP / (RUP + RDOWN)
```
回路电流为:
```text
I = VCC / (RUP + RDOWN)
```
两个电阻的功耗分别为:
```text
PUP = I² × RUP
PDOWN = I² × RDOWN
```
### 7.1 当前原理图:24V、上拉2.4kΩ、下拉3kΩ
```text
VCC = 24V
RUP = 2.4kΩ
RDOWN = 3kΩ
```
计算结果:
```text
VG = 24 × 3 / (2.4 + 3) ≈ 13.33V
VGS = 13.33 - 24 ≈ -10.67V
I = 24 / 5.4k ≈ 4.44mA
PUP = I² × 2.4k ≈ 47mW
PDOWN = I² × 3k ≈ 59mW
```
所以栅极并不会被拉到0V,而是被两个电阻分压到约13.33V。
PMOS得到约-10.67V的栅源电压,能够充分导通。这个数值没有达到12V稳压管的击穿电压,因此D1/D2在稳定导通状态下基本不工作,主要用于处理换向尖峰。
### 7.2 当前原理图:12V、上拉2.4kΩ、下拉3kΩ
同样的电阻在12V输入下:
```text
VG = 12 × 3 / (2.4 + 3) ≈ 6.67V
VGS = 6.67 - 12 ≈ -5.33V
I = 12 / 5.4k ≈ 2.22mA
PUP ≈ 12mW
PDOWN ≈ 15mW
```
此时PMOS仍然可以可靠导通,而且12V稳压管在正常稳定状态下不会反向击穿。
---
## 8. 稳压管的真正作用
12V稳压管跨接在PMOS的源极和栅极之间,主要作用是限制`|VGS|`。
### 8.1 正常关断时
PMOS栅极被`RUP`拉到源极电压:
```text
VGS ≈ 0V
```
稳压管不工作。
### 8.2 正常导通时
栅极被下拉,`|VGS|`逐渐增大。
当`|VGS|`接近稳压管的击穿电压后,稳压管开始反向导通,把`|VGS|`限制在大约12V附近。
24V输入、12V稳压管钳位时,理想状态约为:
```text
VS ≈ 24V
VG ≈ 12V
VGS ≈ -12V
```
### 8.3 换向尖峰出现时
H桥换向会受到以下因素影响:
- MOS管栅极电容;
- 米勒电容;
- PCB走线电感;
- LED和供电线路电感;
- MOS管体二极管反向恢复;
- 电源母线尖峰。
这些因素可能让`VGS`在很短时间内超过正常分压值。稳压管可以吸收部分栅源尖峰,避免PMOS栅极氧化层承受过高电压。
### 8.4 正向栅源尖峰
如果换向时栅极瞬间高于源极,稳压管会像普通二极管一样正向导通,把正向`VGS`限制在约0.7V至1V附近。
### 8.5 稳压管不能保护什么
栅源稳压管只能保护PMOS的`VGS`,不能保护PMOS的漏源极`VDS`。
例如:
- 电源为24V;
- PMOS的`VDS`额定值为-30V。
这时漏源极只有约6V的理论尖峰余量。电源母线仍需考虑:
- TVS管;
- 就近低ESR电容;
- 较短、较宽的功率走线;
- 减小H桥电流环路面积;
- 必要时使用耐压更高的MOS管。
---
## 9. 为什么稳压管不是接上就一定能稳定在12V
稳压管必须获得足够的反向电流,才能进入比较稳定的击穿区。
为了说明稳压管为什么需要足够电流,下面使用“上拉1.2kΩ、下拉1kΩ”作为对比算例。这不是图1当前采用的2.4kΩ、3kΩ参数。
假设:
```text
VCC = 24V
VZ = 12V
RUP = 1.2kΩ
RDOWN = 1kΩ
```
钳位后栅极约为12V。
下拉电阻电流:
```text
IDOWN = 12V / 1kΩ = 12mA
```
上拉电阻电流:
```text
IUP = (24V - 12V) / 1.2kΩ = 10mA
```
稳压管电流约为:
```text
IZ = IDOWN - IUP = 12mA - 10mA = 2mA
```
因此,1.2kΩ上拉加1kΩ下拉时,稳压管大约只有2mA电流。
这通常可以产生一定的钳位作用,但实际电压未必正好是12.00V。稳压管的标称电压、测试电流、动态电阻和温度特性需要查看具体厂家的数据手册。
如果上拉和下拉都是1kΩ:
```text
IUP = 12mA
IDOWN = 12mA
IZ ≈ 0mA
```
此时稳压管几乎没有剩余电流,不能指望它进入稳定的反向击穿状态。
对于图1当前的2.4kΩ上拉和3kΩ下拉,在24V正常导通时,计算得到`|VGS|≈10.67V`,低于12V,因此稳压管不会持续击穿。这正是更合适的状态:正常工作由电阻分压确定栅极电压,稳压管只处理异常瞬态。
---
## 10. 为什么电阻不能只考虑关断速度
MOS管的栅极不是普通的纯电阻负载,可以把它理解为一个需要充电和放电的电容。
SL60P03D的典型参数包括:
- 输入电容`CISS`约为1988pF;
- 总栅极电荷`Qg`约为35nC(特定测试条件下);
- 米勒电荷`Qgd`约为8.8nC。
PMOS关断时,`RUP`负责给栅极充电。可以先用RC时间常数粗略估算:
```text
τ ≈ RUP × CISS
```
例如:
| RUP | 估算时间常数τ |
|---:|---:|
| 1.2kΩ | 约2.4μs |
| 2.2kΩ | 约4.4μs |
| 2.4kΩ | 约4.8μs |
| 3.6kΩ | 约7.2μs |
实际关断时间还受到栅极电荷、米勒平台、漏极电压变化和PCB寄生参数影响,不能只用一个RC公式定论。
### 10.1 RUP太大
可能产生:
- PMOS关断变慢;
- 换向时上管尚未完全关断,下管已经开启;
- H桥上下管短暂直通;
- 电源出现大电流尖峰;
- MOS管异常发热;
- 电路发出异响;
- 严重时损坏MOS管或电源。
### 10.2 RUP太小
可能产生:
- PMOS关断速度加快;
- 但下拉时大量电流被RUP分走;
- 栅极下拉不够,PMOS的负`VGS`不足;
- PMOS没有充分导通,导通电阻增大;
- 驱动回路静态功耗增加;
- 电阻和驱动管温升增加。
所以“上拉电阻越小越安全”并不成立。
---
## 11. 电阻功耗不能只按照死区时间计算
这是非常容易出现的误区。
死区时间,例如25μs或50μs,表示换向时两边都关闭的保护时间。它不代表上拉、下拉电阻只通电25μs或50μs。
当PMOS保持导通时:
- `QDRV`持续导通;
- `RUP`、`RDOWN`和稳压管可能持续有电流;
- 电阻功耗会持续整个PMOS导通阶段。
因此必须分别检查:
1. 正常导通期间的连续或平均功耗;
2. 换向尖峰期间的瞬时脉冲功耗。
### 11.1 对比算例:24V钳位在12V、RUP=1.2kΩ、RDOWN=1kΩ
钳位时:
```text
PUP = 12² / 1.2k ≈ 120mW
PDOWN = 12² / 1k ≈ 144mW
PZ = 12V × 2mA ≈ 24mW
```
普通0603电阻常见连续额定功率约为0.1W,但不同厂家、环境温度和PCB焊盘条件会有差异。
因此:
- 120mW和144mW不能简单地当成“只有50μs”;
- 如果PMOS长时间保持导通,电阻可能接近连续承受该功耗;
- 建议使用0805封装,或使用多个电阻分担功耗;
- 最终必须查看所选电阻的数据手册和降额曲线。
图1当前采用2.4kΩ上拉和3kΩ下拉,24V稳定工作时功耗分别约为47mW和59mW,不会出现上述持续钳位功耗;但0603电阻仍应考虑环境温度和功率降额。
---
## 12. 取消稳压管时如何选择电阻
如果决定不安装稳压管,就必须完全依靠电阻分压限制`VGS`。
设计时应检查最坏情况:
```text
|VGS|max = VCC,max × RUP,max / (RUP,max + RDOWN,min)
```
必须同时考虑:
- 电源最高电压;
- 电源启动和负载突卸尖峰;
- 电阻误差;
- 温度;
- 驱动管导通压降;
- PCB寄生参数。
### 12.1 同时兼容12V和24V的参考值
可以考虑:
```text
RUP = 2.4kΩ
RDOWN = 3kΩ
```
计算结果:
| 输入电压 | 栅源电压VGS | 回路电流 |
|---:|---:|---:|
| 12V | 约-5.33V | 约2.22mA |
| 24V | 约-10.67V | 约4.44mA |
24V时电阻功耗:
```text
PUP ≈ 47mW
PDOWN ≈ 59mW
```
这个组合具有以下特点:
- 12V输入时仍能获得约-5.33V驱动;
- 24V输入时约为-10.67V;
- 正常功耗低于1.2kΩ加1kΩ方案;
- 2.4kΩ上拉的关断速度仍然较快;
- 不需要依靠稳压管在正常工作时持续击穿。
即使使用这个分压,保留稳压管仍然有价值:它在正常工作时不导通,只在异常尖峰时保护PMOS。
---
## 13. 两种方案对比
### 方案A:电阻分压加稳压管
优点:
- 对栅源尖峰有额外保护;
- 元件误差或异常状态下更安全;
- 可以限制`VGS`不超过约12V。
缺点:
- 必须保证稳压管具有合适的工作电流;
- 如果设计成稳压管持续击穿,会增加静态功耗;
- 电阻功耗和稳压管功耗都需要核算。
适合:
- 24V供电;
- H桥换向尖峰明显;
- 对可靠性要求较高;
- PCB空间允许增加保护器件。
### 方案B:只使用电阻分压
优点:
- 元件少;
- 不存在稳压管持续工作产生的额外功耗;
- 参数计算直观。
缺点:
- 失去栅源尖峰钳位;
- 对电源波动、电阻误差和PCB寄生参数更敏感;
- 上拉电阻开路等故障可能让`VGS`超过额定值。
适合:
- 输入电压范围明确;
- 电源尖峰受到良好控制;
- 已经通过示波器确认`VGS`安全;
- 有足够的设计余量。
---
## 14. 本电路的建议
### 14.1 如果保留12V稳压管
建议:
- 不要只根据“关断越快越好”无限减小上拉电阻;
- 计算稳压管电流,确认能够形成有效钳位;
- 按整个PMOS导通时间核算电阻平均功耗;
- 对超过或接近0.1W的电阻优先使用0805;
- 用示波器测量真实`VGS`,确认导通时约为-10V至-12V,关断时回到0V。
### 14.2 如果取消稳压管
12V至24V输入可以先测试:
```text
RUP = 2.4kΩ
RDOWN = 3kΩ
```
但必须满足:
- 实测最大负`VGS`有足够余量;
- 实测正向和反向尖峰没有接近`±20V`;
- 电源母线已经做好TVS和就近电容;
- PMOS能在下管开启前完全关断;
- 保留足够的硬件或软件死区。
### 14.3 关于死区
死区的最终取值不能仅凭计算,应根据示波器实测决定。
至少同时测量:
- 上管PMOS的`VGS`;
- 下管NMOS的`VGS`;
- H桥输出节点;
- 24V母线电压;
- 条件允许时测量桥臂电流。
判断标准是:
> 下管开始导通之前,对应上管必须已经退出导通区,并且换向过程中没有异常母线电流尖峰。
---
## 15. 初学者常见误区
### 误区一:PMOS的20V是开启阈值
错误。20V通常是栅源极最大耐压。真正的`VGS(th)`一般只有约1V至3V,但这个电压只能让MOS管刚刚开始导通。
### 误区二:栅极下拉后一定是0V
错误。如果存在上拉和下拉电阻,栅极由两个电阻分压,不会自然等于0V。
### 误区三:装了12V稳压管,VGS就一定是-12V
错误。稳压管必须获得足够的反向电流,实际钳位电压还受到电流、温度和器件误差影响。
### 误区四:上拉电阻越小,电路越安全
错误。上拉电阻减小会加快关断,但也会降低PMOS导通时的负`VGS`,并增加静态功耗。
### 误区五:电阻的高功耗只持续死区时间
错误。PMOS导通期间,分压回路可能持续有电流。必须按照实际占空比和最坏工作状态核算平均功耗。
### 误区六:栅源稳压管可以保护整个MOS管
错误。它主要保护`VGS`,不能代替24V母线TVS,也不能阻止`VDS`超过MOS管额定值。
---
## 16. 最终检查清单
原理图确定后,至少完成以下检查:
- [ ] 确认PMOS的`VGS(th)`、推荐驱动电压和`VGS(max)`;
- [ ] 计算12V和24V下的正常`VGS`;
- [ ] 计算最高电源电压和电阻误差下的最坏`VGS`;
- [ ] 计算上拉、下拉电阻连续功耗;
- [ ] 计算稳压管正常电流和功耗;
- [ ] 检查0603/0805电阻的额定功率和降额曲线;
- [ ] 测量PMOS栅极对源极波形,而不是只测栅极对地;
- [ ] 检查换向时是否有正向或反向`VGS`尖峰;
- [ ] 检查上下管是否发生交叉导通;
- [ ] 验证`PWM_C=1、PWM_W=1`在软硬件中都不会出现;
- [ ] 验证每次方向切换都经过`00`关闭状态;
- [ ] 检查24V母线是否超过PMOS的`VDS`额定值;
- [ ] 高温、低温、最低输入和最高输入条件下重复测试。
---
## 17. 总结
PMOS栅极驱动电阻的选择,本质上是在以下四项之间寻找平衡:
1. PMOS必须得到足够的负`VGS`,保证充分导通;
2. PMOS必须快速回到`VGS≈0V`,保证及时关断;
3. 分压回路的电流和电阻功耗不能过大;
4. 栅源电压和换向尖峰不能超过MOS管额定值。
稳压管的核心作用是保护PMOS栅源极,而不是替代电阻分压,也不是控制死区。合理的设计应先用电阻比例确定正常工作点,再用稳压管处理异常和瞬态过压,最后通过示波器实测确认。
对于这套12~24V、2P2N主桥加2只驱动MOS的双色LED电路,还必须始终遵守两个基本原则:
1. `PWM_C`和`PWM_W`不能同时为高电平;
2. 两个电流方向切换时,必须先输出`00`,等待确认安全的死区后再开启另一方向。
-203
View File
@@ -1,203 +0,0 @@
# DWM22 黑盒用户测试文档
## 1. 文档信息
| 项目 | 内容 |
| --- | --- |
| 产品名称 | DWM22 |
| 测试类型 | 用户黑盒功能测试 |
| 固件校验码 | `0F9DA5A0` |
| 固件提交 | `ee68f37 DWM22量产测试` |
| APP | Ultra Life |
| 测试日期 | |
| 测试人员 | |
| 样机编号 | |
> 测试人员只根据实际操作和灯光表现判断结果,不需要查看程序、波形或内部数据。
## 2. 测试准备
- DWM22 测试样机 1 台。
- 双色 LED 灯板及 12~24V 配套电源。
- 安装最新版 Ultra Life APP 的手机 1 台。
- 433 遥控器至少 2 个;测试 5 路记忆时准备 6 个。
- 遥控距离测试场地:无遮挡、直线距离大于 12 米。
- 每个用例测试完成后,在“结果”栏填写:通过或失败。
## 3. 产品模式说明
DWM22 共 14 个产品模式,固定顺序如下:
**暖光静态 → 冷光静态 → 中性光静态 → 暖光呼吸 → 冷光呼吸 → 中性光呼吸 → 三色呼吸 → 暖冷连续渐变 → 暖冷中性渐变 → 暖光闪烁 → 冷光闪烁 → 中性光闪烁 → 暖冷中性跳变 → 三色闪烁**
- 模式 1~3 为静态模式,可以调节亮度。
- 模式 4~14 为动态模式,可以调节亮度和速度。
- 遥控器“模式+”按上述顺序向后切换,“模式-”按相反顺序返回。
- 到达模式 14 后继续按“模式+”,应停留在模式 14,不从头循环。
- 到达模式 1 后继续按“模式-”,应停留在模式 1,不跳到模式 14。
- APP 色温环属于自定义静态色温,不占用以上 14 个模式编号。
| 顺序 | 模式名称 | 产品效果说明 |
| --- | --- | --- |
| 1 | 暖光静态 | 仅暖光常亮 |
| 2 | 冷光静态 | 仅冷光常亮 |
| 3 | 中性光静态 | 暖光和冷光混合形成中性光 |
| 4 | 暖光呼吸 | 暖光由暗到亮、再由亮到暗循环 |
| 5 | 冷光呼吸 | 冷光由暗到亮、再由亮到暗循环 |
| 6 | 中性光呼吸 | 暖冷两路保持中性比例同步呼吸 |
| 7 | 三色呼吸 | 暖光、冷光、中性光依次完成呼吸 |
| 8 | 暖冷连续渐变 | 暖光与冷光互补变化,一个降低时另一个升高,全程不断光 |
| 9 | 暖冷中性渐变 | 在暖光、冷光和中性光之间平滑渐变,颜色衔接时保持亮光 |
| 10 | 暖光闪烁 | 暖光按设定速度亮灭 |
| 11 | 冷光闪烁 | 冷光按设定速度亮灭 |
| 12 | 中性光闪烁 | 中性光按设定速度亮灭 |
| 13 | 暖冷中性跳变 | 暖光、冷光、中性光直接切换,不做渐变 |
| 14 | 三色闪烁 | 暖光、冷光、中性光依次闪烁,中间包含熄灭节拍 |
## 4. 基本功能
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
| --- | --- | --- | --- | --- |
| 01 | 接通电源 | 灯具能在正常时间内点亮;无长时间不亮、异常闪烁、异响或发热 | | |
| 02 | 使用遥控器或 APP 开灯、关灯 | 开关响应正确,开关过程柔和;关灯后两路 LED 均完全熄灭 | | |
| 03 | 连续开关灯 10 次 | 每次均正常响应,无死机、失控或蓝牙广播消失 | | |
| 04 | 在暖光、冷光、中性光之间反复切换 | 颜色正确,过渡柔和,无突然增亮、突然变暗或异常颜色闪现 | | |
| 05 | 从最低亮度逐级调到最高亮度,再调回最低亮度 | 亮度变化连续、均匀,无明显顿挫、抖动或提前熄灭 | | |
| 06 | 中性光在低亮度下持续观察 30 秒 | 无肉眼可见抖动,两路混色比例稳定 | | |
## 5. 遥控器对码
对码操作:连接 DWM22,在 APP“更多”页面点击“遥控器对码”,在 5 秒倒计时内长按遥控器“亮度+”按键。
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
| --- | --- | --- | --- | --- |
| 07 | 使用未对码遥控器直接控制灯具 | 灯具不响应 | | |
| 08 | 在 APP 中进入“遥控器对码”,长按遥控器“亮度+” | 灯具给出对码闪烁反馈;APP 显示“对码成功”和已对码数量 | | |
| 09 | 对码成功后测试遥控器开关、模式和亮度按键 | 所有按键均能正常控制灯具,短按一次即可响应 | | |
| 10 | 打开对码页面但不操作遥控器,等待 5 秒 | 对码自动结束,APP 提示未收到有效信号;原有遥控器不受影响 | | |
| 11 | 将已经对码的同一个遥控器再次对码 | 可以提示对码成功,但已对码数量不增加,不重复占用位置 | | |
| 12 | 依次对码 5 个不同遥控器 | 5 个遥控器都能控制灯具,APP 显示 `5/5` | | |
| 13 | 已有 5 个遥控器后,再对码第 6 个遥控器 | 第 6 个遥控器可以使用;最早对码的遥控器被替换,其余最近 4 个仍可使用 | | |
| 14 | 对码成功后切断电源,重新上电 | 已对码遥控器仍能使用,对码数据不会因断电丢失 | | |
## 6. 遥控器清码
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
| --- | --- | --- | --- | --- |
| 15 | APP“更多”页面点击“清除遥控器” | 出现二次确认窗口,不会直接清码 | | |
| 16 | 在确认窗口点击“取消” | 遥控器数据保留,原遥控器仍可使用 | | |
| 17 | 再次进入清码并点击“清除” | 灯具给出清码反馈,APP 提示“清码成功”,已对码数量变为 0 | | |
| 18 | 清码后测试全部旧遥控器 | 所有旧遥控器均不能控制灯具 | | |
| 19 | 清码后重新对码一个遥控器 | 可以正常重新对码并控制灯具 | | |
| 20 | 清码后断电重启,再测试旧遥控器 | 清码结果被记忆,旧遥控器仍不能控制灯具 | | |
## 7. 遥控距离
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
| --- | --- | --- | --- | --- |
| 21 | 在无遮挡环境下,将遥控器与灯具距离拉到 12 米以上 | 在大于 12 米的位置仍可正常控制,判定距离合格 | | 实测距离:____m |
| 22 | 在 12 米位置,分别短按开关、模式+、模式-、亮度+、亮度-各 10 次 | 按键能可靠响应,不能依赖连续按两次或刻意延长短按时间;建议每个按键至少 9 次一次响应 | | |
| 23 | 改变遥控器朝向,在 12 米位置重复测试 | 不应频繁失控;正常手持方向下可以稳定操作 | | |
## 8. 模式顺序测试
先在 APP 中选择模式 1,然后使用遥控器“模式+”按顺序测试到模式 14,每个模式至少观察 20 秒。之后使用“模式-”从模式 14 反向测试回模式 1。
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
| --- | --- | --- | --- | --- |
| M01 | APP 依次点击模式 1~14 | 实际效果与 APP 模式名称一致,顺序正确 | | |
| M02 | 从模式 1 开始,遥控短按“模式+”13次 | 严格按照 1→2→…→14 切换,每次只前进一个模式 | | |
| M03 | 在模式 14 再按“模式+” | 保持模式 14,不循环回模式 1 | | |
| M04 | 从模式 14 开始,遥控短按“模式-”13次 | 严格按照 14→13→…→1 返回,每次只后退一个模式 | | |
| M05 | 在模式 1 再按“模式-” | 保持模式 1,不跳转到模式 14 | | |
| M06 | 对比 APP 选中模式、灯光效果和遥控切换结果 | 三者始终对应,不出现错位一个模式的情况 | | |
| 模式 | 效果 | 主要检查内容 | 结果 |
| --- | --- | --- | --- |
| 1 | 暖光静态 | 暖光正确,亮度稳定 | |
| 2 | 冷光静态 | 冷光正确,亮度稳定 | |
| 3 | 中性光静态 | 两路混色正确,无抖动 | |
| 4 | 暖光呼吸 | 从低到高、再从高到低,过程柔和 | |
| 5 | 冷光呼吸 | 从低到高、再从高到低,过程柔和 | |
| 6 | 中性光呼吸 | 呼吸时间与单色接近,低亮度无明显抖动,峰值亮度正常 | |
| 7 | 三色呼吸 | 暖、冷、中性依次呼吸;上一颜色降到最低后下一颜色平滑升起 | |
| 8 | 暖冷连续渐变 | 暖光降低时冷光同步升高,全程不断光、无突然跳变 | |
| 9 | 暖冷中性渐变 | 暖、冷、中性过渡自然;颜色交接时不突然变黑或异常增亮 | |
| 10 | 暖光闪烁 | 只出现暖光,节奏稳定 | |
| 11 | 冷光闪烁 | 只出现冷光,节奏稳定 | |
| 12 | 中性光闪烁 | 只出现中性光,两路比例稳定 | |
| 13 | 暖冷中性跳变 | 暖、冷、中性直接切换,颜色正确,无多余低亮度闪光 | |
| 14 | 三色闪烁 | 暖、冷、中性按设计闪烁,无错误颜色 | |
补充检查:
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
| --- | --- | --- | --- | --- |
| 24 | 在模式 1~3 之间切换 | 使用柔和过渡,不出现最后突然亮一下的现象 | | |
| 25 | 从静态模式切换到模式 4~7 | 呼吸从低亮度开始,不会直接从最高亮度开始 | | |
| 26 | 切换到模式 10~14 | 直接进入正确动态效果,不出现其他颜色或多余低亮度脉冲 | | |
| 27 | 在动态模式下调节亮度 | 动态效果整体亮度可以调节,变化正确 | | |
| 28 | 在动态模式下调节速度 1~10 | 速度变化明显且方向正确;APP 显示值与实际效果一致 | | |
| 29 | 遥控器长按模式+或模式- | 按下时先执行一次,持续按住时约每 500ms 切换一次,不快速乱跳 | | |
## 9. 掉电记忆
### 9.1 全部带记忆
在 APP“更多 → 断电设置”中选择“全部带记忆”。
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
| --- | --- | --- | --- | --- |
| 30 | 设置任意静态颜色、亮度,等待 2 秒后断电重启 | 恢复断电前的颜色和亮度 | | |
| 31 | 设置任意动态模式、亮度和速度,等待 2 秒后断电重启 | 恢复断电前的模式、亮度和速度 | | |
| 32 | 关灯后等待 2 秒,再切断电源并重新上电 | 恢复关灯状态,不应自行亮起 | | |
| 33 | 在中性光状态下改变亮度、模式或断电设置 | 保存过程中灯光不闪烁、不熄灭,蓝牙连接不中断 | | |
### 9.2 断电切换功能
在 APP“更多 → 断电设置”中选择“断电切换功能”。
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
| --- | --- | --- | --- | --- |
| 34 | 设置一个容易识别的亮度,连续断电上电 4 次 | 每次上电依次为:暖光 → 冷光 → 中性光 → 暖光 | | |
| 35 | 检查每次上电后的亮度 | 三种静态颜色均保留之前设置的亮度 | | |
| 36 | 在任意动态模式或自定义色温下断电,再上电 | 仍按暖光、冷光、中性光的固定顺序轮换,不受断电前模式影响 | | |
| 37 | 选择断电切换功能后断电重启多次 | 该设置本身被记忆,不会自动恢复为“全部带记忆” | | |
| 38 | 在 APP 中来回切换两种断电设置 | 切换时灯光不闪烁、不突变,蓝牙连接保持正常 | | |
## 10. 蓝牙控制
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
| --- | --- | --- | --- | --- |
| 39 | 打开 APP 搜索设备 | 能发现名称为 `DWM22` 的设备 | | |
| 40 | 连接 DWM22 | 可以正常进入 DWM22 控制界面,连接稳定 | | |
| 41 | APP 控制开灯和关灯 | 灯具正确响应,APP 状态与灯具一致 | | |
| 42 | APP 将亮度从 1 调到 100,再调回 1 | 灯光变化平滑,最低亮度可正常显示,无明显抖动或顿挫 | | |
| 43 | APP 拖动色温环,从暖光连续调到冷光并往返 | 色温连续变化,采用柔和过渡,无黑场、突变或错误颜色 | | |
| 44 | APP 依次选择 14 个模式 | 灯具效果与 APP 名称、图标和选中状态一致 | | |
| 45 | APP 调节动态亮度和速度 1~10 | 实际亮度和速度正确变化,界面数值正确 | | |
| 46 | 使用遥控器改变开关、模式、亮度或速度 | APP 已显示的设备状态能同步更新,不出现明显错乱 | | |
| 47 | 设置 APP 定时关机 | 到达设定时间后灯具自动关闭 | | |
| 48 | 蓝牙连接中关闭手机蓝牙或让设备断电 | APP 自动退出设备控制页,不停留在失效界面 | | |
| 49 | 恢复设备电源和手机蓝牙后重新连接 | 可以再次发现并连接,所有控制恢复正常 | | |
| 50 | 蓝牙连接状态下连续操作 5 分钟 | 无断链、无卡死、无控制延迟持续增大,灯光无异常抖动 | | |
## 11. 测试结论
| 项目 | 结论 |
| --- | --- |
| 对码功能 | □ 通过 □ 失败 |
| 清码功能 | □ 通过 □ 失败 |
| 遥控距离大于 12m | □ 通过 □ 失败 |
| 掉电记忆 | □ 通过 □ 失败 |
| 模式与灯光效果 | □ 通过 □ 失败 |
| 蓝牙控制 | □ 通过 □ 失败 |
| 整机测试结论 | □ 合格 □ 不合格 |
问题记录:
1.
2.
3.
测试人员签名:________________  日期:________________
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 KiB

@@ -397,7 +397,7 @@
/// Default Device Name /// Default Device Name
#define APP_DFLT_DEVICE_NAME ("DWM22") // #define APP_DFLT_DEVICE_NAME ("PWM32EPRO") //
#define APP_DFLT_DEVICE_NAME_LEN (sizeof(APP_DFLT_DEVICE_NAME)) #define APP_DFLT_DEVICE_NAME_LEN (sizeof(APP_DFLT_DEVICE_NAME))
#define APP_DFLT_DEVICE_NAME_LEN1 (sizeof(APP_DFLT_DEVICE_NAME1)) #define APP_DFLT_DEVICE_NAME_LEN1 (sizeof(APP_DFLT_DEVICE_NAME1))
#define APP_DFLT_DEVICE_NAME2 ("Second_test") #define APP_DFLT_DEVICE_NAME2 ("Second_test")
@@ -452,7 +452,6 @@ int main(void)
#endif #endif
// gpio_pullup_input_inter_test(); // gpio_pullup_input_inter_test();
adc_Init(); adc_Init();
external_key_init();
/* Keep RF433 GPIO initialization after the other input setup. */ /* Keep RF433 GPIO initialization after the other input setup. */
rf433_gpio_init(); rf433_gpio_init();
/* Clear any startup transition pulses after RF433 GPIO is stable. */ /* Clear any startup transition pulses after RF433 GPIO is stable. */
@@ -16,7 +16,7 @@
* Dual-color output uses one fixed 500 us frame: * Dual-color output uses one fixed 500 us frame:
* OFF -> W pulse -> OFF -> C pulse -> OFF to frame end. * OFF -> W pulse -> OFF -> C pulse -> OFF to frame end.
* The available OFF time is distributed around both direction changes and * The available OFF time is distributed around both direction changes and
* each W/C transition retains at least 25 us protection. * each W/C transition retains at least 50 us protection.
* Normal dual-color output produces one pulse per color per frame (2 kHz). * Normal dual-color output produces one pulse per color per frame (2 kHz).
* Only the low-output neutral section of three-color breathing uses PDM. * Only the low-output neutral section of three-color breathing uses PDM.
*/ */
@@ -24,8 +24,8 @@
#define BRIDGE_PWM_PERIOD 6U #define BRIDGE_PWM_PERIOD 6U
#define BRIDGE_MIX_SCALE 1000U #define BRIDGE_MIX_SCALE 1000U
#define BRIDGE_FRAME_US 500U #define BRIDGE_FRAME_US 500U
#define BRIDGE_DEADTIME_US 25U #define BRIDGE_DEADTIME_US 50U
#define BRIDGE_DUAL_ACTIVE_US 450U #define BRIDGE_DUAL_ACTIVE_US 400U
#define BRIDGE_MIN_DUAL_PULSE_US 1U #define BRIDGE_MIN_DUAL_PULSE_US 1U
#define BRIDGE_NEUTRAL_PDM_PULSE_US 50U #define BRIDGE_NEUTRAL_PDM_PULSE_US 50U
#define BRIDGE_TIMER_TICKS_PER_US 16U #define BRIDGE_TIMER_TICKS_PER_US 16U
@@ -521,7 +521,7 @@ __RAM_CODE void Bridge_Service_1ms(void)
pwm_duty = (uint16_t)((total * BRIDGE_PWM_SCALE + pwm_duty = (uint16_t)((total * BRIDGE_PWM_SCALE +
(BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE); (BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE);
/* /*
* Use the same 450 us maximum energy as mixed light for every * Use the same 400 us maximum energy as mixed light for every
* single-color output. Switching between the hardware-PWM and * single-color output. Switching between the hardware-PWM and
* Timer3 mixed-light paths therefore does not change total energy. * Timer3 mixed-light paths therefore does not change total energy.
*/ */
@@ -550,9 +550,9 @@ __RAM_CODE void Bridge_Service_1ms(void)
if (cached_w_mix != w_mix || cached_c_mix != c_mix || if (cached_w_mix != w_mix || cached_c_mix != c_mix ||
output_mode != BRIDGE_MODE_DUAL) { output_mode != BRIDGE_MODE_DUAL) {
/* /*
* Keep 50 us OFF at maximum dual-color brightness. The OFF time is * Keep 100 us OFF at maximum dual-color brightness. The OFF time is
* split evenly between W->C and C->W, which both absorbs interrupt * split evenly into 50 us for W->C and 50 us for C->W. This absorbs
* latency and spreads the two optical pulses across the 500 us frame. * interrupt latency and spreads both optical pulses across the frame.
*/ */
total_on_us = (BRIDGE_DUAL_ACTIVE_US * total + total_on_us = (BRIDGE_DUAL_ACTIVE_US * total +
(BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE; (BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE;
@@ -34,7 +34,6 @@ TASK_COMPONENTS TaskComps[] =
{0, 311, 1, app_op_flash}, //用户数据持久化 fmc_spi_read9 {0, 311, 1, app_op_flash}, //用户数据持久化 fmc_spi_read9
{0, 311, 1, xc_ota_schedule}, //保存flash数据任务 8 //最后调用的 {0, 311, 1, xc_ota_schedule}, //保存flash数据任务 8 //最后调用的
{0, 1, 1, rf433_decoder_process}, {0, 1, 1, rf433_decoder_process},
{0, 10, 10, external_key_scan}, //GPIO5 external key scan
}; };
/************************************************************************************** /**************************************************************************************
File diff suppressed because it is too large Load Diff
@@ -28,25 +28,7 @@ Project File Date: 07/29/2026
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Program Files\Keil_v5\ARM\ARMCC\Bin' *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Program Files\Keil_v5\ARM\ARMCC\Bin'
Build target 'ble-sdk-xip_scan' Build target 'ble-sdk-xip_scan'
Note: source file '..\app\src\uart.c' - object file renamed from '.\Objects\uart.o' to '.\Objects\uart_1.o'. Note: source file '..\app\src\uart.c' - object file renamed from '.\Objects\uart.o' to '.\Objects\uart_1.o'.
compiling external_key.c... compiling Rf433.c...
..\app\src\Mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode();
..\app\src\Mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode();
..\app\src\Mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM();
..\app\src\Mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM();
..\app\src\Mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing();
..\app\src\PWM.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\PWM.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\PWM.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\PWM.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types ..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void rf433_receive(); void rf433_receive();
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types ..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
@@ -59,16 +41,6 @@ compiling external_key.c...
void Delay_50us(); void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types ..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key(); void Encoder_key();
..\app\src\external_key.c: 15 warnings, 0 errors
compiling timer.c...
..\app\src\PWM.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\PWM.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\PWM.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\PWM.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types ..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode(); void choice_mode();
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types ..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
@@ -79,74 +51,6 @@ compiling timer.c...
void Stop_PWM(); void Stop_PWM();
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types ..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing(); void Set_timing();
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void rf433_receive();
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
void rf433_gpio_init();
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
void scan_433();
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
void Lock_Pwm7xd();
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key();
..\app\src\timer.c: 15 warnings, 0 errors
compiling fmc_spi.c...
..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_fmc_spi.h(230): warning: #47-D: incompatible redefinition of macro "CUR_PAGE_NUM" (declared at line 115 of "..\..\..\..\..\component\ble\modules\flash\xc6xxx_fmc_spi.h")
#define CUR_PAGE_NUM(addr) (addr / FLASH_PAGE_SIZE)
..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_fmc_spi.h(231): warning: #47-D: incompatible redefinition of macro "CUR_START_PSR" (declared at line 116 of "..\..\..\..\..\component\ble\modules\flash\xc6xxx_fmc_spi.h")
#define CUR_START_PSR(addr) (addr % FLASH_PAGE_SIZE)
..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_fmc_spi.h(237): warning: #47-D: incompatible redefinition of macro "FMC_IDLE_STATUS" (declared at line 78 of "..\..\..\..\..\component\ble\modules\flash\xc6xxx_fmc_spi.h")
#define FMC_IDLE_STATUS ((uint32_t)0x01 << 31)
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode();
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode();
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM();
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM();
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing();
..\app\src\PWM.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\PWM.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\PWM.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\PWM.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void rf433_receive();
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
void rf433_gpio_init();
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
void scan_433();
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
void Lock_Pwm7xd();
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key();
..\app\src\fmc_spi.c(179): warning: #177-D: variable "i" was declared but never referenced
uint8_t i = 0;
..\app\src\fmc_spi.c(234): warning: #167-D: argument of type "uint8_t (*)[256]" is incompatible with parameter of type "uint8_t *"
xc_fmc_spi_flash_read_page(0x1E000,&r_data, FLASH_PAGE_SIZE);
..\app\src\fmc_spi.c: 20 warnings, 0 errors
compiling uart.c...
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void rf433_receive();
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
void rf433_gpio_init();
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
void scan_433();
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
void Lock_Pwm7xd();
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key();
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types ..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT(); void _PWM_INIT();
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types ..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
@@ -155,23 +59,58 @@ compiling uart.c...
void My_ADC_Get_Value(); void My_ADC_Get_Value();
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types ..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test(); void gpio_pullup_input_inter_test();
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types ..\app\src\Rf433.c(659): warning: #223-D: function "temperature" declared implicitly
void choice_mode(); temperature((uint8_t)(((uint16_t)(255U - res_data) * 255U + 119U) / 239U));
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types ..\app\src\Rf433.c(24): warning: #177-D: variable "POWER_flag" was declared but never referenced
void set_mode(); static uint8_t POWER_flag;
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types ..\app\src\Rf433.c: 17 warnings, 0 errors
void Start_PWM(); compiling app_sec.c...
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types ..\app\src\app_sec.c(414): warning: #177-D: variable "param" was declared but never referenced
void Stop_PWM(); struct gapc_encrypt_req_ind const *param = (struct gapc_encrypt_req_ind const *)p_param;
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types ..\app\src\app_sec.c: 1 warning, 0 errors
void Set_timing(); compiling app_task.c...
..\app\src\uart.c(153): warning: #223-D: function "temperature" declared implicitly ..\app\src\app_task.c(450): warning: #223-D: function "ke_timer_set" declared implicitly
temperature(user_rx_buf[1]); ke_timer_set(APP_SECOND_ADV_START, TASK_APP, 400); // start open noconnect adv
..\app\src\uart.c(90): warning: #177-D: variable "uart_handle" was declared but never referenced ..\app\src\app_task.c(463): warning: #61-D: integer operation result is out of range
uint8_t uart_handle = UART0_IDX; value &= ~(0xff << 24);
..\app\src\uart.c(211): warning: #1-D: last line of file ends without a newline ..\app\src\app_task.c(473): warning: #223-D: function "custom_svc_add" declared implicitly
if (!custom_svc_add()) {
..\app\src\uart.c: 18 warnings, 0 errors ..\app\src\app_task.c(496): warning: #223-D: function "ke_timer_set" declared implicitly
ke_timer_set(APP_SCAN_START, TASK_APP, 10);
..\app\src\app_task.c(640): warning: #177-D: variable "p_param" was declared but never referenced
struct gapm_ext_adv_report_ind *p_param = (struct gapm_ext_adv_report_ind *)param;
..\app\src\app_task.c(688): warning: #223-D: function "xc_ble_gatt_cli_mtu_exch" declared implicitly
xc_ble_gatt_cli_mtu_exch(conidx, app_env.user_lid);
..\app\src\app_task.c(804): warning: #223-D: function "ke_timer_set" declared implicitly
ke_timer_set(APP_SCAN_STOP, TASK_APP, 200); // start open noconnect adv
..\app\src\app_task.c(818): warning: #223-D: function "ke_timer_set" declared implicitly
ke_timer_set(APP_SCAN_START, TASK_APP, 900); // start open noconnect adv
..\app\src\app_task.c(835): warning: #223-D: function "app_switch_mode" declared implicitly
app_switch_mode(app_mode);
..\app\src\app_task.c(836): warning: #940-D: missing return statement at end of non-void function "app_mode_switch_handler"
}
..\app\src\app_task.c(837): warning: #159-D: declaration is incompatible with previous "app_switch_mode" (declared at line 835)
void app_switch_mode(uint8_t mode)
..\app\src\app_task.c(845): warning: #223-D: function "ke_timer_set" declared implicitly
ke_timer_set(APP_SECOND_ADV_START, TASK_APP, 400); // start open noconnect adv
..\app\src\app_task.c(306): warning: #177-D: function "app_get_handler" was declared but never referenced
static uint8_t app_get_handler(const struct app_subtask_handlers *handler_list_desc, ke_msg_id_t msgid, void *p_param,
..\app\src\app_task.c: 13 warnings, 0 errors
compiling ota_protocol.c...
..\app\src\ota_protocol.c(35): warning: #120-D: return value type does not match the function type
return &fota_env;
..\app\src\ota_protocol.c(149): warning: #550-D: variable "sw_ver" was set but never used
uint16_t sw_ver;
..\app\src\ota_protocol.c(150): warning: #550-D: variable "rom_ver" was set but never used
uint16_t rom_ver;
..\app\src\ota_protocol.c(292): warning: #177-D: label "defult" was declared but never referenced
defult:
..\app\src\ota_protocol.c(320): warning: #223-D: function "ble_flash_later_page_erase" declared implicitly
ble_flash_later_page_erase(OTA_PARAM_ADDR);
..\app\src\ota_protocol.c: 5 warnings, 0 errors
compiling rgblight.c...
compiling ota_server.c...
compiling app_batt.c...
compiling arch_main.c... compiling arch_main.c...
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types ..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT(); void _PWM_INIT();
@@ -225,77 +164,9 @@ compiling arch_main.c...
xc_fmc_spi_init_oprt( ); xc_fmc_spi_init_oprt( );
..\app\src\arch_main.c(396): warning: #223-D: function "xc_fmc_spi_flash_wake_up" declared implicitly ..\app\src\arch_main.c(396): warning: #223-D: function "xc_fmc_spi_flash_wake_up" declared implicitly
xc_fmc_spi_flash_wake_up(); xc_fmc_spi_flash_wake_up();
..\app\src\arch_main.c(463): warning: #223-D: function "TaskProcess" declared implicitly ..\app\src\arch_main.c(462): warning: #223-D: function "TaskProcess" declared implicitly
TaskProcess(); TaskProcess();
..\app\src\arch_main.c: 27 warnings, 0 errors ..\app\src\arch_main.c: 27 warnings, 0 errors
compiling timeslice.c...
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode();
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode();
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM();
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM();
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing();
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void rf433_receive();
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
void rf433_gpio_init();
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
void scan_433();
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
void Lock_Pwm7xd();
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key();
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\timeslice.c: 15 warnings, 0 errors
compiling Rf433.c...
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void rf433_receive();
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
void rf433_gpio_init();
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
void scan_433();
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
void Lock_Pwm7xd();
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key();
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode();
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode();
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM();
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM();
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing();
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\Rf433.c(659): warning: #223-D: function "temperature" declared implicitly
temperature((uint8_t)(((uint16_t)(255U - res_data) * 255U + 119U) / 239U));
..\app\src\Rf433.c(24): warning: #177-D: variable "POWER_flag" was declared but never referenced
static uint8_t POWER_flag;
..\app\src\Rf433.c: 17 warnings, 0 errors
compiling Mode.c... compiling Mode.c...
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types ..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT(); void _PWM_INIT();
@@ -328,18 +199,72 @@ compiling Mode.c...
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types ..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key(); void Encoder_key();
..\app\src\Mode.c: 15 warnings, 0 errors ..\app\src\Mode.c: 15 warnings, 0 errors
compiling timeslice.c...
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode();
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode();
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM();
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM();
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing();
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void rf433_receive();
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
void rf433_gpio_init();
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
void scan_433();
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
void Lock_Pwm7xd();
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key();
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\timeslice.c: 15 warnings, 0 errors
compiling usr_server.c...
..\app\src\Mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode();
..\app\src\Mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode();
..\app\src\Mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM();
..\app\src\Mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM();
..\app\src\Mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing();
..\app\src\PWM.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\PWM.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\PWM.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\PWM.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\usr_server.c(275): warning: #223-D: function "ble_callback" declared implicitly
ble_callback(co_buf_data(p_data)[0],co_buf_data(p_data)[1],co_buf_data(p_data)[2],co_buf_data(p_data)[3]);
..\app\src\usr_server.c: 10 warnings, 0 errors
linking... linking...
Program Size: Code=32588 RO-data=2208 RW-data=2828 ZI-data=3856 Program Size: Code=32064 RO-data=2208 RW-data=2804 ZI-data=3856
FromELF: creating hex file... FromELF: creating hex file...
After Build - User command #1: fromelf --bin --output=app.bin .\Objects\Xinc_ble_sdk.axf After Build - User command #1: fromelf --bin --output=app.bin .\Objects\Xinc_ble_sdk.axf
After Build - User command #2: .\output_tool\ge_ota_scan.bat After Build - User command #2: .\output_tool\ge_ota_scan.bat
Size of file: 35064 bytes. Size of file: 34532 bytes.
all_size=35064 all_size=34532
dual_xip dual_xip
Addr:13000 Addr:13000
Size:0x88f8 Size:0x86e4
BAddr:0x40000 BAddr:0x40000
Acheck:0xf227e680 Acheck:0x36596580
SoftVer:0x10 SoftVer:0x10
RomVer:0x20 RomVer:0x20
LoadAddr:0x11013000 LoadAddr:0x11013000
@@ -367,7 +292,7 @@ status2=1
updata file success ! updata file success !
已复制 1 个文件。 已复制 1 个文件。
已复制 1 个文件。 已复制 1 个文件。
".\Objects\Xinc_ble_sdk.axf" - 0 Error(s), 142 Warning(s). ".\Objects\Xinc_ble_sdk.axf" - 0 Error(s), 103 Warning(s).
<h2>Software Packages used:</h2> <h2>Software Packages used:</h2>
@@ -380,7 +305,7 @@ Package Vendor: ARM
D:/Program Files/Keil_v5/ARM/Packs/ARM/CMSIS/5.9.0/Device/ARM/ARMCM0/Include D:/Program Files/Keil_v5/ARM/Packs/ARM/CMSIS/5.9.0/Device/ARM/ARMCM0/Include
<h2>Collection of Component Files used:</h2> <h2>Collection of Component Files used:</h2>
Build Time Elapsed: 00:00:08 Build Time Elapsed: 00:00:09
</pre> </pre>
</body> </body>
</html> </html>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,4 +1,4 @@
;#<FEEDBACK># ARM Linker, 5060750: Last Updated: Mon Aug 03 13:21:53 2026 ;#<FEEDBACK># ARM Linker, 5060750: Last Updated: Fri Sep 04 11:52:38 2026
;VERSION 0.2 ;VERSION 0.2
;FILE aes.o ;FILE aes.o
__asm___5_aes_c____REV16 <= USED 0 __asm___5_aes_c____REV16 <= USED 0
@@ -32,6 +32,8 @@ __asm___12_bridge_pwm_c_5817fd17____REVSH <= USED 0
;FILE external_key.o ;FILE external_key.o
__asm___14_external_key_c_af7f8d4e____REV16 <= USED 0 __asm___14_external_key_c_af7f8d4e____REV16 <= USED 0
__asm___14_external_key_c_af7f8d4e____REVSH <= USED 0 __asm___14_external_key_c_af7f8d4e____REVSH <= USED 0
external_key_init <= USED 0
external_key_scan <= USED 0
;FILE fmc_spi.o ;FILE fmc_spi.o
__asm___9_fmc_spi_c_ef98d224____REV16 <= USED 0 __asm___9_fmc_spi_c_ef98d224____REV16 <= USED 0
__asm___9_fmc_spi_c_ef98d224____REVSH <= USED 0 __asm___9_fmc_spi_c_ef98d224____REVSH <= USED 0
+1 -1
View File
@@ -1,5 +1,5 @@
PRODUCT=PWM32EPRO PRODUCT=PWM32EPRO
VERSION=V1.0 VERSION=V2.0
CHIP=XC6517 CHIP=XC6517
# Used only for checksum generation by tools/offline_burn/Xinc_mac_tool.exe. # Used only for checksum generation by tools/offline_burn/Xinc_mac_tool.exe.
Binary file not shown.