I am developing for the STM32F0 using Keil uVision.

I have a custom bootloader loaded running at address 0x08000000. I need the bootloader to jump to my main application which I flash at address 0x08003000. The ultimate goal is to allow remote updates of the main application. The bootloader code that jumps to the application is this:

JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS+4);
Jump_To_Application = (pFunction) JumpAddress;
__set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);

I am getting a hard fault in the Jump_To_Application() line, with "Cannot access memory" message given by Keil.

Within Keil, I set the IROM1 start address to be 0x08003000 in my main application's project configuration. I feel like the problem lies in some further settings within Keil. For example, should IROM2 be set to anything? Should anything be adjusted from defaults in the Keil configuration within the bootloader project?

Does anyone have any recommendations?

  • \$\begingroup\$ Do you have a valid application at the address 0x08003000? \$\endgroup\$ – Batuu Jul 10 '16 at 14:09
  • \$\begingroup\$ Can you add the relevant parts of your linker scripts (bootloader and application). \$\endgroup\$ – rfkortekaas Jul 10 '16 at 17:06
  • \$\begingroup\$ Batuu - I am using STLink to flash the application at 0x08003000. \$\endgroup\$ – maxish Jul 11 '16 at 14:42
  • \$\begingroup\$ rfkortekaas - I am assuming Keil produces based on the GUI configuration. I don't actually configure any scripts manually. Which files do you need to see? \$\endgroup\$ – maxish Jul 11 '16 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.