Hello everyone, I used a bootloader for Stm32f1xx, but if I use hal_delay after the jump function, the microcontroller stops working. I'm waiting for your help.
if (HAL_GPIO_ReadPin(button_GPIO_Port,button_Pin)==1) //mypushbutton==1
{
/* If Key is pressed */
/* Execute the IAP driver in order to re-program the Flash */
printf("\r\n\r\n");
Main_Menu();
}
// /* Keep the user application running */
else
{
if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000)
{
/* Jump to user application */
JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) ApplicationAddress);
HAL_UART_DeInit(&huart1);
HAL_UART_MspDeInit(&huart1);
HAL_RCC_DeInit();
HAL_MspDeInit();
HAL_DeInit();
HAL_PWR_DeInit();
__disable_irq();
__DSB();
Jump_To_Application();
}
}