2019-04-03 11:42 PM
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();
}
}
2019-04-04 12:44 AM
Don't jump from interrupt/callback context.
And when you disable interrupts at the processor level expect to have to re-enable them if you ever want to see them again.
2019-04-05 12:11 AM
thanks for your answer,
when I did what you said program is running but if I use delay function program stops working.
no problem when I use USART interrupt, but if I use a delay, processor stops working.
what do you think about this problem?