cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 I2C wont work without debugger

ojoel
Associate
Posted on August 28, 2013 at 12:45

Hi all!

Im currently working with a project that should read data from sensors using the I2C bus.

When i am using a debugger to start the program it runs at it should. Reading sensor values and putting out the data on a CAN-bus. When i remove the debugger the MCU still behaves like it should.

BUT, when i try to start the MCU after a reset (just pulling the plug) the MCU stops reading data from the sensors. Is there any background processes that the debugger prevents from running or runs that can make this error occure?

Im using a stm32f107 and reading sensor data from an MPU-6050 and a HMC5883L

Kindest regards

Joel
11 REPLIES 11
Bigdan
Associate II

For me helps10ms delay before start communication on i2c.

Sujith
Associate II

If you're using the printf function in debugger mode, try commenting it out. I faced issues with it as well, but after removing printf, everything started working fine.