AnsweredAssumed Answered

STM32H7 custom bootloader issue

Question asked by Kevin Perminjat on May 30, 2018
Latest reply on Jun 24, 2018 by Clive Two.Zero

Hi !

 

I am working on Nucleo-144 board with the STM32H7 processor using cubeMX and developping on Ac6 System Workbench for STM32 based on Eclipse.

 

I am currently developping a Bootloader located on the first sector of the flash (0x8000000). The jump to the application is well done, i jump to the right adress and get on the Reset_Handler. I relocate the vector table in the SystemInit() function that is called before getting into the main. And i modified the linker script to have the flash start adress set correctly.

Then I get into  the SystemClock_Config() function and just before getting out, I get a HardFault.

 

My bootloader is using FreeRtos. First I used the Timer1 as Timebase source and i saw that the bit 0 of BFSR register was set (instruction bus error). Later, i tried to use the Systick as Timebase source and then it was the bit 1 of UFSR register that was set, and not BSFR register anymore.

 

I am now totally stucked and have no idea how to fix it.

 

Below, i put the code that is executed just before the jump :

 

 

SCB_DisableDCache();
SCB_DisableICache();
HAL_MPU_Disable();


HAL_RCC_DeInit();
HAL_SuspendTick();

__disable_irq();

 

SysTick->CTRL = 0;
SysTick->VAL = 0;
SysTick->LOAD = 0;

 

__set_MSP((uint32_t) *((__IO uint32_t*) APPLICATION_START_ADDR ));

 

// Use address with 4 bytes offset which specifies jump location where program start(Reset_Handler)
entryPoint = (pFunction) *(__IO uint32_t*) (APPLICATION_START_ADDR + 4);
__set_CONTROL(0);

// Launch the SW
entryPoint();

 

Can anyone tell me where it is wrong?
Thanks !

Outcomes