AnsweredAssumed Answered

STM32F407 PGPERR PGSERR

Question asked by denehan.joe on Aug 11, 2014
Latest reply on May 9, 2018 by denehan.joe
Hi,
    I'm having a peculiar issue when jumping from my application code back to my bootloader. Before jumping back to the bootloader I disable all peripheral as shown in the code below. But when the HAL_NVIC_DisableIRQ(SysTick_IRQn); line executes the PGPERR & PGSERR ( ie SR = 0x000000C0 ) bits are set in the Flash SR register. They are not clearing when the bootloader executes and subsequent flash writes fail in the bootloader. Anyone got any explaination why this would occur? There are no flash writes taking place in the application code and the NVIC_DisableIRQ only writes to the NVIC->ICER register.
__disable_irq();
 
FATFS_UnLinkDriver(SD_Path);
 
HAL_ADC_MspDeInit(&hadc3);
HAL_CAN_DeInit(&hcan1);
HAL_I2C_MspDeInit(&hi2c2);
HAL_SD_MspDeInit(&hsd);
HAL_SPI_MspDeInit(&hspi1);
HAL_SPI_MspDeInit(&hspi2);
HAL_UART_MspDeInit(&huart2);
HAL_UART_MspDeInit(&huart3);
HAL_UART_MspDeInit(&huart6);   
HAL_NVIC_DisableIRQ(SysTick_IRQn);
 
pEntryFromProgFnc = (void(*)(void))(APPLICATION_RESET_VECTOR + 1);
 
pEntryFromProgFnc();

Outcomes