AnsweredAssumed Answered

FLASH FastProgram allways return PGAERR ...

Question asked by Stanislav on Mar 23, 2018
Latest reply on Apr 14, 2018 by Andreas Bolsch

Device STM32L452RE on my HW board with 3V3 Vdd ...

This code is placed in RAM ...

 

//--- Program

__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_ALL_ERRORS);

 

//--- FLASH_Program_Fast

uint8_t ID;

uint32_t DstAddr = (FLASH_BASE + Addr) & 0xFFFFFFF8;

SET_BIT(FLASH->CR, FLASH_CR_FSTPG);

//--- Program the double word of the row

for(ID = 0; ID < (32 * 2); ID++)

{

 *(uint32_t *)(DstAddr) = 0xAABBCCDD;

DstAddr += 4;

}

 

// Wait for last operation to be completed

while(READ_BIT(FLASH->SR, FLASH_FLAG_BSY)) {};

 

 

if(READ_BIT(FLASH->SR, FLASH_FLAG_PGAERR)) LED_BO_Set(LED_BO_ORANGE, 1);

 

 

Where is error?

Outcomes