Skip to main content
PHolz.1
Associate II
December 20, 2023
Solved

STM32F746BGTX bootloader jump to user application failing in HAL_Init

  • December 20, 2023
  • 3 replies
  • 1914 views
Hello,
I have a custom borad with a STM32F746BGTX and I use GFX Touch 4.20. I would like to have a bootloader and an application on the STM32F746BGTX.
I have different images in gfx Touch for the bootloader and the application.
The bootloader is stored in flash memory: 0x0800 0000 - 0x0803 FFFF
The application is saved in flash memory: 0x0804 0000 - 0x080F FFFF

I use an external Quad SPI Flash Memory (W25Q128FVSQ). I divided the RAM into 2 areas again.
The bootloader gets 3MBytes (from 0x90000000 to 0x902EE000) The application gets 13MByte (from 0x902EE000 to 0x90FFFFFF).
I want to jump from the bootloader into the application.
The process: 1. Jump from Boorloader into the application. A value is written into RAM. 2. The function is called: NVIC_SystemReset() 3. In Main() I check whether a value is stored in RAM. If there is a value in the RAM, I jump into my application This process works perfectly and the application is also started. An error then occurs in HAL_Init().

 In debug mode the uC runs up to a certain point (until Breakpoint - picture below). Then the uC disappears somewhere. But no HardDefault Handler is called, otherwise there is an error.

 

Fehler_exakt2.PNG

Can someone help me solve the problem?

 

This topic has been closed for replies.
Best answer by Mohammad MORADI ESFAHANIASL

Hello again @PHolz.1 ,

Sorry for the delay, So in this case the problem arises from the fact that you are initializing the peripherals twice. I suggest initializing it once or at least using HAL_TIM_Base_DeInit() first before initializing the timer again.

 

I hope this helps you.

3 replies

ST Employee
January 2, 2024

Hello @PHolz.1 ,

To be honest, I'm not completely sure if I understood your problem or what exactly goes wrong in HAL_Init(). Could you please provide more information about the error? And are you initializing your hardware in the Bootloader and your application? Or is the initialization only in your application?

PHolz.1
PHolz.1Author
Associate II
January 2, 2024

Hi Mohammad,

Yes, I initialize in the bootloader and in the application because I have images in GFX Touch for the bootloader and the application.

The problem arises in the HAL_InitTick() function when Timer6 is started.

picture1.PNG

picture2.PNG

 

ST Employee
February 6, 2024

Hello again @PHolz.1 ,

Sorry for the delay, So in this case the problem arises from the fact that you are initializing the peripherals twice. I suggest initializing it once or at least using HAL_TIM_Base_DeInit() first before initializing the timer again.

 

I hope this helps you.

PHolz.1
PHolz.1Author
Associate II
April 26, 2024
Hello, thanks for the suggestion. It fixed my error.

Hello,

thanks for the suggestion. It fixed my error. 

ST Employee
April 30, 2024

Glad to hear! 
Would please select it as accepted solution?