2021-12-28 08:01 AM
Hi all, I connect to a BMS board (TI BQ4050) using the HAL SMBUS driver.
In my old platform, STM32F401, I can read registers from the BMS. Somehow, identical code on a STM32F446 fails half way through the read transaction (HAL_SMBUS_Master_Receive_IT). The master issues a write command with the register address, which is ACKed by the slave. Then the master issues a read command, which is again ACKed by the slave, but after the slave ACK, the clock stops. This works fine in my old STM32F401. Any ideas?
Read transfer with an STM32F401:
Read transfer with an STM32F446:
2021-12-28 10:43 AM
It looks like the pin is in push-pull mode, not open-drain mode. The rise time on the analog signal is significantly faster in the bottom plot. Otherwise, there is a hardware difference between the two.
> Somehow, identical code on a STM32F446 fails half way through the read transaction
This is always a difficult question because the answer is quite often that there are differences in the code that the user doesn't know about. Stay objective, debug the problem directly rather than falling back to the "everything is the same" argument.
2022-01-21 06:29 AM
Thanks. In the end the issue was cause by the usage of semihosting code in the STM32F446, it was somehow messing with interrupts. To be honest I did not get to the bottom of it. In the STM32F401 I was able to use a debug UART to ouput debug printouts so it was working fine.