cancel
Showing results for 
Search instead for 
Did you mean: 

Jump from one Application to another STM32H743

GS1
Senior III

Hi all,

I have a problem when jumping from one application to another within my new STM32H7 system.

Explaination:

All my systems can be updated via my own bootloader (running on 0x800 0000) application, which communicates via USB port with a PC to my special Universal Flash Loader tool.

The bootloader is located at 0x8000000 (startup application) and the actual application of the system is located at 0x8080000.

At startup the bootloader checks in a separate location (0x8020000) if an application has been successfully loaded (a flag and the application start address are read from 0x8020000).

Then it jumps to the application and runs the code. In case the application should be updated, this application jumps back into the bootloader who will take care for the update procedure.

This works very well on all of my STM32F4 and F7 projects.

Now I face a hard fault error when jumping to the application from the bootloader after the application has been flashed for the first time.

In the first place I tested the final application without the separate bootloader . So the application itself is running!

I checked that the hex file is flashed to the correct areas (0x8080000 and external SPI-Flash on 0x90000000)

Before I jump to the application I disable all previously initialized peripherals and perform the following sequence:

   SCB_DisableICache();

    SCB_DisableDCache();

   HAL_MPU_Disable();

   HAL_DisableCompensationCell();

   ulStartAppl = 0x8080000;

   __DI();

   /* Jump to application */

   JumpAddress = *(__IO uint32_t*) (ulStartAppl + 4);

   Jump_To_Application = (pFunction)JumpAddress;

   /* Initialize user application's Stack Pointer */

   __set_MSP(*(__IO uint32_t*) ulStartAppl);

   Jump_To_Application();

After the jump the system goes to Hardfault and I can't figure out, what the reason might be.

P.S: When loading the bootloader and the application using the Keil ULINK Pro with ARM Compiler into the system, everything boots up correctly into the application)

Any ideas what could cause the hard fault when flashing the software separately?

10 REPLIES 10
GS1
Senior III

Thank you, guys!

System with bootloader and enduser application is working now as desired with my flash tool!

Using NVIC_SystemReset() in the enduser app. did solve the problem!