Question
Fast programming for STM32L496 not working
I wanted to use the flash fast programming, but it does not work. If I use the normal flash programming it is working as indended.
The procedure is that I unlock the flash, erase a 2KB page and then want to fast program that page with this code:
// wait for FLASH to be ready
Board_Flash_WaitForNotBusy();
Board_Flash_ResetErrorAndStatusFlags();
// disable interrupts
__disable_irq();
// enable Fast programming
FLASH->CR = FLASH_CR_FSTPG | FLASH_CR_EOPIE | FLASH_CR_ERRIE;
// program
for(int i = 0; i < (FLASH_FAST_PROGRAM_PAGE_SIZE / sizeof(uint64_t)); i++, ptrWrite++, ptrRead++)
{
*ptrWrite = *ptrRead;
}
// wait for finishing
Board_Flash_WaitForNotBusy();
Board_Flash_WaitForProgrammingFinished();
// disable Fast programming
FLASH->CR = 0;
Board_Flash_ResetErrorAndStatusFlags();
// enable interrupts
__enable_irq();If I debug this code it happens that after writing the first 64bit that the FLASH->SR register has the value 0x2A2.
What am I doing wrong?
