2023-01-19 11:45 AM
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
2023-01-19 11:56 AM
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.
2023-01-19 12:08 PM
Yes, both are OK!
When I flash in the 0x8000000 only part of the program that does not work
2023-01-19 12:28 PM
Then look for other hardcoded addresses, like config data stored in Flash below the app address.
2023-01-19 12:52 PM
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
...