2024-04-21 11:33 PM
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.
Solved! Go to Solution.
2024-04-22 08:33 AM
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.
2024-04-22 11:21 AM
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.
2024-04-22 02:38 PM - edited 2024-04-22 02:39 PM
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?
2024-04-22 03:13 PM
I'm not looking to bury that much time into this.
2024-04-22 09:17 PM
Yes this function also return hal_error
2024-04-23 06:57 AM - edited 2024-04-23 06:59 AM
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)