cancel
Showing results for 
Search instead for 
Did you mean: 

Can't debug CUBEMX generated code

eizens Poiss
Associate
Posted on February 26, 2017 at 01:52

Hey, I got Discovery F3 board, i wanted to start project which uses I2C communication, so i enabled I2C1 peripheral and generated code for EWARM IDE using CubeMX. I uploaded code on board and pressed GO in debug options, than i press HALT in debug options and i got error 'Communication error message , Target is running, failed to stop the target. Maybe the target needs to be reset' after this error i can't upload code and i got error message 'Fatal error, ST-Line, No MCU device found Session Aborted' . (after that i need to disconnect board, if i want to upload code.)

I didn't and any code to generated code. But i find that, if i comment 'MX_I2C1_Init()' , debug works and i don't get error messages. And i tried using I2C2 peripheral and also i didnt get error messages. 

If there is problem with CubeMX and its generating bad code or i have set something in options w
2 REPLIES 2
Posted on February 26, 2017 at 03:13

Are you using pins involved in the debug connection?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 26, 2017 at 11:44

yeah you are right, i looked it up in the datasheet and  I2C1 pin is used for debug ( PA14 is connected to debug chip pin STM JTCK). Thanks for help!