cancel
Showing results for 
Search instead for 
Did you mean: 

MCU STM32F070RB is not going into debug mode after flashed hex file using MCU's internal bootloader

amanjunath
Associate
Posted on November 08, 2016 at 13:47

Hi,

I have written an application code in PC which programs hex file (Generated using keil microvision - Intel hex format) to STM32F070RB Microcontroller using microcontroller's internal bootloader and USART interface. The hex file flashed is working fine as expected (Tested with a small LED blink program).

But the issue is, after I used internal bootloader to flash MCU, the MCU doesn't go into debug mode even after flashing with Keil ULINK2 debugger. But the hex file flashed using debugger is also working fine as expected. Only debug is not working.

Procedure to reproduce the issue.

1. Program the MCU using its internal bootloader and USART interface

    Observation: The hex file flashed is working fine as expected (Tested with a small LED blink program)

2. Program the MCU using Keil Microvision and Keil ULINK2 debugger. 

    Observation: Able to test the hex file flashed and working fine as expected. But meanwhile some errors observed and not able to go into debug mode.

''Contents mismatch at some memory locations in flash'' and ''Flash download failed''

        

Please find the attached image.

Please help me to debug this issue.

Thanks

Manjunath

2 REPLIES 2
ST Renegade
Senior
Posted on November 08, 2016 at 14:16

Hey manjunath,

Have you checked whether your hex file is compiled as debug? In keil, there are settings, where you configure the optimization level. One of them is for debug or it's just called level 0 or so (don't remember as every tool calls it differently). Once you compile your code with these options, it should be possible to debug your app using Keil.

I hope this helps,

Renegade

Posted on November 08, 2016 at 15:59

Is this a board of your own design? Running at what voltage and speed?

Seems odd that Keil wouldn't program properly. Do you have the right programming algorithm selected?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..