AnsweredAssumed Answered

STM32F4 Hard Crashes with I2C

Question asked by Snyder.Joe.001 on Mar 6, 2017
Latest reply on Mar 6, 2017 by Snyder.Joe.001

I'm having a problem where I2C is hard crashing my STM32F446RET6 (programmed in EWARM with CubeMX as a starting point).  When I2C devices are enabled, at random amounts of time (couple hours to overnight), a .25 second "heartbeat" indicator LED (in the main while loop) slows to ~1 second, and I2C communication on I2C1 & I2C2 stops.  Resetting from the NRST pin does nothing.  You have to physically remove power to get it to reset - it's as crashed as can be. 

 

I am using STM32CubeF4, Version 1.14.0, and I'm experiencing the exact same thing as this post:

https://community.st.com/thread/34172-i2c-bug-in-stm32cubef2-firmware-package-v140#comments 

 

That post has not been updated to say the problem was resolved.  I searched through my stm32f2xx_hal_i2c.c, and sure enough, the flawed code is present in mine too.  To fix it, that person reverted to STM32CubeF2 Version 1.3.0, but did not post what changes to the code made it right.

 

So, I've identified that the Cube generated code has a problem that causes the symptoms I'm observing...my question is, how do I know what revision of CubeF4 software to revert to?  At what point did this flaw occur?  Ideally, I'd just like to get a copy of a proper stm32f2xx_hal_i2c.c, and insert that into my project without rebuilding from Cube. 

Outcomes