Skip to main content
STai.2
Associate II
Dec 10, 2020 5:58 AM UTC
Solved

HAL_I2C_Master_Transmit always returns != HAL_OK

I am using STM32 Cube MX to generate 32L443RCTx code.

In function HAL_I2C_Master_Transmit always returns != HAL_OK

Any ideas why?

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
Dec 10, 2020 12:02 PM UTC

There's a NAK at the end, i.e. the slave does not answer (it's not present, not connected, not working...)

JW

4 replies

waclawek.jan
Super User
Dec 10, 2020 6:31 AM UTC

And what is on SDA/SCL when observed using oscilloscope/LA?

JW

STai.2
STai.2Author
Associate II
Dec 10, 2020 7:30 AM UTC

Only reply 0x90

SDA/SCL As attached file

waclawek.jan
waclawek.janBest answer
Super User
Dec 10, 2020 12:02 PM UTC

There's a NAK at the end, i.e. the slave does not answer (it's not present, not connected, not working...)

JW

STai.2
STai.2Author
Associate II
Dec 14, 2020 6:06 AM UTC

Working

Thanks!​