This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Program Counter loaded with the wrong address after chip reset

Hi all,

I have a new project using an STM32L031.   I've used MXCube to generate a startup project, and after compiling in Keil and loading the un-modified code to the board, I see that the Program Counter is loaded with an invalid address after reset.  Instead of pointing to __main in flash (at "0x080000C0"), it is loaded with "0x1FF0 0220".  So the code does not run.

When looking at the flash memory at address 0, the first long word looks correct, pointing to Ram at "0x2000 0CA0", and the Stack Pointer is loaded with that address.  But the second long word in flash is actually "0x1FF0 0221".

Looking at the Target options in Keil, the "Read/Only Memory Areas" section looks correct, the on-chip selection is checked -- IROM1: Start: 0x08000000,  Size: 0x8000

And the BOOT0 pin is grounded, the flash code is being run, just at the wrong address.

Anyone have ideas?  This is a weird one for me.

Thanks!

Parents Reply Children
No data