How to enter ST USART Bootloader from Code?
Im trying to jump to bootloader section from my Code. I'm trying to update the firmware over USART with the intergrated bootloader. In my application I'm using USART2 (PA2/PA3) on a STM32L431CCU6 Microcontroller running native FreeRTOS.
My Code to initialize should work:
// Set Memory Boot Jump address
SysMemBootJump = (void (*) (void)) (*((uint32_t *) 0x1FFF0004)); //device dependent parameter System Memory + 4
// Set Display to Firmware Update Mode
display_show( FW_UPDATE );
taskENTER_CRITICAL( );
{
// vTaskSuspendAll( );
// Turn off Peripherals
HAL_TIM_Base_MspDeInit(&htim15);
HAL_RTC_MspDeInit(&hrtc);
HAL_UART_MspDeInit(&huart2);
HAL_UART_MspDeInit(&huart1);
HAL_SPI_MspDeInit(&hspi2);
HAL_SPI_MspDeInit(&hspi1);
HAL_CRC_MspDeInit(&hcrc);
// Disable Interrupts
__disable_irq();
// Remap Memory
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
// Reset Systick timer
SysTick->CTRL = 0; //reset the Systick Timer
SysTick->LOAD = 0;
SysTick->VAL = 0;
__set_PRIMASK (1);
__set_MSP(*((uint32_t *)0x1FFF0000U)); //expected stack pointer value is the value at adress 0x1FFF0000U
SysMemBootJump();
while( FOREVER );
}
taskEXIT_CRITICAL( );When I try to debugg it, I reach until the jump command and then the debugger is showing nothing anymore. So it looks like it makes the jump.
When analysing the USART interface I see that the device is receiving the 0x7F Command but does not responce on this.
My boot options are all checked:
The Bootpin BOOT0 (PH3) is connected to GND via a 10k resistor.
Do I missed something, that the bootloader does not response?
