2021-01-22 05:39 AM
I tried this code:
// BOOTLOADER starten -------------------------------------------------------------------------------------------
void (*SysMemBootJump)(void); // Funtkion Jump definieren
volatile uint32_t addr = 0x1FFF0000; // System Memory-Adresse für STM32G07 laden
HAL_RCC_DeInit(); // RCC auf Default setzen
SysTick->CTRL = 0; // Systick Timer zurücksetzen
SysTick->LOAD = 0; // ...
SysTick->VAL = 0; // ...
__disable_irq(); // Alle Interrupts sperren
HAL_UART_DeInit(handleuart); // UART ausschalten
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH(); // System Memory remappen
SysMemBootJump = (void (*)(void)) (*((uint32_t *)(addr + 4))); // Sprung-Adresse auf System Memory-Adresse setzen
__set_MSP(*(uint32_t *)addr); // Main Stack-Pointer setzen
SysMemBootJump(); // BOOTLOADER starten
while (1)
{
// Diese Schleife Sollte nie erreicht werden
}
This worked fine with the previous uses STM32F05. I just changed the adress of the bootloader (AN2606).
Can anybody help me?
Thanks
2021-01-23 02:19 AM
This question was asked a zillion times. Search here. In short, add code in your user programm at the very start before further initialization that scans for a signature and if that signature is found, jump to the bootloder. To get from running user program to the bootloader, set that signature and reset .
2021-01-23 06:29 AM
2021-02-02 05:58 AM
Thank you for your response. There were several problems to solve. I did it with help of the ST support.
Best regards
Bernd