Skip to main content
arthhh
Associate II
January 19, 2023
Question

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

  • January 19, 2023
  • 4 replies
  • 1648 views

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

This topic has been closed for replies.

4 replies

gbm
Super User
January 19, 2023

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.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
arthhh
arthhhAuthor
Associate II
January 19, 2023

Yes, both are OK!

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

gbm
Super User
January 19, 2023

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

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Tesla DeLorean
Guru
January 19, 2023

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..