Hello to the community!
A little question/report about behavior of the flash memory API embedded into the LPC5528 MCU.
I'm currently debugging some flash-related issue and while doing that noted, that the "FLASH_VerifyProgram" does not actually report neither address nor data when it meets a discrepancy. The code snippet is the following:
uint8_t buffer[512];
void flashTest(void) {
uint32_t failedAddress = 0x01234567;
uint32_t failedData = 0x89ABCDEF;
FLASH_Init(&flashConfig);
for (size_t byte = 0; byte < sizeof checkBuffer; ++byte) {
buffer[byte] = byte;
}
for (uint8_t lap = 0; lap < 10; ++lap) {
FLASH_Erase(&flashConfig, 0x0007B600, 0x4A00, kFLASH_ApiEraseKey);
FLASH_Program(&flashConfig, 0x0007B600, buffer, sizeof buffer);
if (lap == 9) {
buffer[0] += 1;
}
if (FLASH_VerifyProgram(&flashConfig, 0x0007B600,
sizeof buffer, buffer,
&failedAddress, &failedData)) {
;
}
}
As you can see, I perform a series of the erase-program operation and alter a single byte at the very end to trigger the verification error.
And the "FLASH_VerifyProgram" indeed reports an error, but both "failedAddress" and "failedData" variables remain unchanged.
Is it a bug or I don't understand something?
Best regards!
Hello @GlebPlekhotko
Sorry for the inconvenient to you. And thanks for your report.
I have taken ticket to our internal team.
Thanks.
BR
Alice