cancel
Showing results for 
Search instead for 
Did you mean: 

F411 Flash programming returns PGA & PGS Error

Dvan .8
Associate II

I'm trying to program some data into a flash sector but the HAL_FLASH_PROGRAM returns

a value of 10 which maps to pga and pgs error.

HAL_FLASH_Unlock();
uint64_t val = (uint64_t)(data->at(i) << 8 | data->at(i + 1) << 8 |
                           data->at(i + 2) << 8 | data->at(i + 3) << 8 |
                           data->at(i + 4) << 8 | data->at(i + 5) << 8 |
                           data->at(i + 6) << 8 | data->at(i + 7));
ret = HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, address + i, val);
i +=8;
HAL_FLASH_Lock();

somewhere before this code I doe call HAL_FLASHEx_Erase if I want to override data that is already stored. (But I can't get it to store just yet).

0 REPLIES 0