Skip to main content
Visitor II
April 28, 2021
Question

Why do all the IAP references for the H7 published by STM, show the wrong address?

  • April 28, 2021
  • 1 reply
  • 813 views

I wasted many, many hours because the datasheet and app notes give the wrong boot address. For those of you that need to jump to the bootloader on the H7, use the following:

// Bootloader actual start of vector table is here...

// No idea why the F&@# they don't show this in the app note.

const uint32_t bootloaderStackPtrAddr = 0x1ff09800;

const uint32_t bootloaderStartPtrAddr = bootloaderStackPtrAddr + 4;

void jumpToDfu( void )

{

 // Disable all interrupts.

 __disable_irq();

 // Shut down any running tasks / disable systick and interrupt.

 HAL_SuspendTick();

 // Set RCC to default values.

 HAL_RCC_DeInit();

 HAL_DeInit();

 // Turn off all interrupts and clear all interrupt pending flags.

 for ( uint8_t i = 0; i < 8; i++ )

 {

  NVIC->ICER[ i ]=0xFFFFFFFF;

  NVIC->ICPR[ i ]=0xFFFFFFFF;

 }

 // Re-enable global interrupts.

 __enable_irq();

 // Read and set the primary stack pointer, using the first word in the

 // bootloader vector table as the stack location.

 uint32_t bootloaderStackPtr = *(uint32_t *)bootloaderStackPtrAddr;

 __set_MSP( bootloaderStackPtr );

 // In case of privileged mode, set to use MSP.

 __set_CONTROL( 0 );

 // Load the program counter with the SystemMemory reset vector.

 void (*sysMemBootJump)( void ) = (void (*)( void ))( *(uint32_t*)bootloaderStartPtrAddr );

 sysMemBootJump();

 while( 42 );

}

    This topic has been closed for replies.

    1 reply

    Super User
    April 30, 2021

    > I wasted many, many hours because the datasheet and app notes give the wrong boot address.

    Which references?

    This one seems right to me:

    https://community.st.com/s/article/STM32H7-bootloader-jump-from-application

    So does this one:

    https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf

    0693W00000AN2RoQAL.png 

    Note that "system memory" and "boot address" are not interchangeable.

    Graduate II
    May 22, 2021

    From the screenshot above:

    > The system clock frequency is 66 MHz (using PLL clocked by the HSI)

    This seems absurd. As the HSI has frequency of 64 MHz. While technically it can be done, I don't see a point of using a PLL to rise the system frequency to 66 MHz, which is almost the same. And it's not the case on other H7 sub-series either.

    @Imen DAHMEN​ , @Amel NASRI​ , this should be checked and/or corrected.