cancel
Showing results for 
Search instead for 
Did you mean: 

SMBUS works with STM32F401 but fails with STM32F446

jsolmen
Associate

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:

0693W00000Hpyx8QAB.png 

Read transfer with an STM32F446:

0693W00000HpyxcQAB.png

2 REPLIES 2
TDK
Guru

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.

0693W00000HpzoHQAR.png 

> 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.

If you feel a post has answered your question, please click "Accept as Solution".
jsolmen
Associate

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.