Showing results for 
Search instead for 
Did you mean: 

Cude max

Associate III


I hope this message finds you well. I am reaching out regarding an urgent matter with my STM32 CubeMX v6.1 project. I have encountered an issue with the I2C functionality that I cannot seem to resolve despite trying various approaches.

The specific problem arises with the following function:




I have attempted to implement this function across different STM microcontroller units, including STM32WB10, STM32F750, and STM32F103, but unfortunately, the issue persists consistently across all of them. It's worth noting that I have verified the hardware compatibility by successfully testing it with Arduino and ESP32 platforms.

Given that I have a project deadline looming, I urgently require your assistance in resolving this matter. Any guidance or insights you can provide would be greatly appreciated.

Thank you very much for your prompt attention to this matter. I look forward to your response.


Get a scope or analyzer on the signals and understand what's happening there.

Show ALL initialization code for I2C and the pins. Hard to debug with level of detail presented. You'll need to dig until you understand the problem.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Create a simple i2c code in stm32 cube mx with default settings.  


Run a simple hal_i2c_tresmit code. And check this code is working on cube ide. 


In my case it return me hal_error. 

Ok. Then can  you please change a bit your simple project and instead of transmit call HAL_I2C_IsDeviceReady. Will it return error too? Will it succeed if you change address to 0x6C? 


I'm not looking to bury that much time into this.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Yes this function also return hal_error 

Pavel A.
Evangelist III

Then the electric connection of the I2C device is not good. It does not respond to either of its two possible addresses.

To be sure, do another try with read access: HAL_I2C_IsDeviceReady with addresses (0x4C <<1 | 1) and (0x6C <<1 | 1)