2021-04-28 09:43 AM
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 );
}
2021-04-30 08:46 AM
> 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:
Note that "system memory" and "boot address" are not interchangeable.
2021-05-22 05:01 AM
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.