cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F105RB - When the program is flashed to 0x800000 the debug loses memory access.

arthhh
Associate II

Hello,

I am using uVision to code a project, and I picked up this project after another engeneer left the company. We have a DFU bootloader implementation that flashes the program at 0x8005000, and the bootloader at 0x8000000. But when I try to flash the code at 0x8000000 for development porpouses the debugger loses control. I use a STLink

4 REPLIES 4
gbm
Lead II

Did you change the memory map/linker settings to build a program to be flashed at 0x8000000? If not, it will not work, since it's linked to be located at the app address.

Also, frequently the app sets the VTOR register explicitly to its intended base address - check the SystemInit routine.

arthhh
Associate II

Yes, both are OK!

When I flash in the 0x8000000 only part of the program that does not work

gbm
Lead II

Then look for other hardcoded addresses, like config data stored in Flash below the app address.

Check what SystemInit() is doing when it sets SCB->VTOR

Watch that the code builds for the addresses expected. Look at the .MAP file, and perhaps the .AXF with Keils' FROMELF tool.

This will automatically track the basis you define for the Target (or in the scatter file)

extern uint32_t * __Vectors; // symbol from startup.s in Keil builds
 
void SystemInit(void)
{
  /* Configure the Vector Table location -------------------------------------*/
  SCB->VTOR = (uint32_t)(&__Vectors); // Smart Base Location
...

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