2020-11-10 03:29 AM
Hi everyone!
This is my first time with I2C on the STM32 platform so I may be missing something trivial.
I'm using an STM32WB55RG and I'm trying to use an Adafruit IS31FL3731, which works with I2C.
I ported the Arduino library (https://github.com/adafruit/Adafruit_IS31FL3731/blob/master/Adafruit_IS31FL3731.cpp) using the HAL functions.
If I use blocking functions, everything works, but if I try to use DMA for non-blocking code, the program gets stuck on HAL_I2C_STATE_BUSY_TX after having called HAL_I2C_Master_Transmit_DMA.
I've searched a bit and tried different solutions but none of them work. What's wrong with the code?
Thanks in advance
Matteo Iervasi
Solved! Go to Solution.
2020-11-22 11:59 PM
Ok I've solved it (forgot to update the thread sorry). It was a very stupid error.
Everything was ok with the configuration, interrupts, callbacks, etc., but looking with the debugger I found out that I forgot to declare the I2C_HandleTypeDef as a pointer and the definition in the library was effectively a copy.
Now everything works ok.
Best regards
Matteo Iervasi
2020-11-22 11:59 PM
Ok I've solved it (forgot to update the thread sorry). It was a very stupid error.
Everything was ok with the configuration, interrupts, callbacks, etc., but looking with the debugger I found out that I forgot to declare the I2C_HandleTypeDef as a pointer and the definition in the library was effectively a copy.
Now everything works ok.
Best regards
Matteo Iervasi