2 Replies Latest reply on Oct 25, 2018 3:27 AM by PaWa_3505426

    Software only works when Debugger is connected to PCB


      Hi, i've a very strange problem.


      The I2C part of my software only works, when the debugger is connected. (It fails inside the PDL Mfs_I2c_GenerateStart() function in mfs.c)

      If i download the debug version of the code, disconnect the debugger and power off / on the board, the software is running but I2C is not working.

      If i download the release version the same thing happens.

      But if i download the debug version and leave the debugger attached and the debug session running, the software works perfectly fine, as long as it can reconnect to the debugger when i power it on.


      I already checked the reset pin, but that isn't the problem. What was really strange too is, that the clock settings where different when the debugger was connected than when it wasnt. I now set the CLOCK_SETUP define to CLOCK_SETTING_NONE and setup my clock with the PDL library myself and it's now running at 160 Mhz all the time.


      What could cause I2C to fail, if the debugger is not connected? I guess it has something to do with a delay or a clock beeing different, but i can't find anything.