rt-thread/bsp/stm32/libraries/HAL_Drivers
SCZeiDan d78429eb8e
[stm32] i2c hard driver fixup:增加硬件I2C传输超时等待时间
问题:
在使用硬件 I2C 驱动进行音频模块 WM8978 配置时,发现连续 rt_i2c_transfer 进行 I2C 传输时发现,连续多次调用 rt_i2c_transfer 会出现丢包现象;溯源发现是每次使用 rt_i2c_transfer 传输2字节,传输频率过高导致底层 HAL_I2C_Master_Seq_Transmit_DMA 报错 HAL_BUSY;

现象:
rt_completion_wait超时等待完成之后,I2C仍处于HAL_I2C_STATE_BUSY_TX状态,且后续第二次运行至HAL_I2C_Master_Seq_Transmit_DMA时会直接返回HAL_BUSY,从而直接 goto out; 退出而不会再次进行超时等待;

* drv_hard_i2c.c: 修复325行缺失'}'语法错误;更改HAL_I2C_xx_Transimt_xx调用中目标设备地址值;i2c_hard_config.h: 添加STM32F系列芯片xx_DMA_CONFIG宏定义;

* 回溯I2C设备地址传参处(msg->addr<<1)修改;

* fixup: 增加硬件I2C传输延时,解决连续传输导致HAL_BUSY状态;
2024-05-04 12:51:27 -04:00
..
CMSIS/Include format stm32 drivers 2023-01-08 22:52:13 -05:00
drivers [stm32] i2c hard driver fixup:增加硬件I2C传输超时等待时间 2024-05-04 12:51:27 -04:00
nano [stm32] split stm32 drivers as normal and nano drivers 2023-12-03 21:25:00 +08:00
SConscript [stm32] split stm32 drivers as normal and nano drivers 2023-12-03 21:25:00 +08:00
drv_common.c [fix] fixup spaces and add in ci. 2024-04-10 16:04:28 +08:00
drv_common.h [stm32] split stm32 drivers as normal and nano drivers 2023-12-03 21:25:00 +08:00