F-7381: fail SAMA5D3 NAND write/erase instead of reporting success

ext_flash_write() and ext_flash_erase() discarded their arguments and
returned 0, so any update flow that reaches this HAL was told an
erase/program succeeded while the NAND contents were left untouched.

NAND page program and block erase are not implemented for this target;
report failure so callers that branch on the result can detect it
instead of continuing with a write that never happened. The read-only
boot path is unaffected.
pull/868/head
Daniele Lacamera 2026-08-20 22:41:25 +02:00 committed by Daniele Lacamera
parent f5401b0e23
commit 0a6a5fe360
1 changed files with 7 additions and 4 deletions

View File

@ -708,20 +708,23 @@ static void dbgu_init(void) {
int ext_flash_write(uintptr_t address, const uint8_t *data, int len)
{
/* TODO */
/* SAMA5D3 NAND page program is not implemented: this HAL only
* supports reading NAND. Report failure instead of pretending the
* data was programmed. */
(void)address;
(void)data;
(void)len;
return 0;
return -1;
}
int ext_flash_erase(uintptr_t address, int len)
{
/* TODO */
/* SAMA5D3 NAND block erase is not implemented: see ext_flash_write. */
(void)address;
(void)len;
return 0;
return -1;
}
/* SAMA5D3 NAND flash does not have an enable pin */