Flash Memory Read/Write Operations Failing on AVR32UC with Zephyr - What Could Be Missing?

hey guys, lately I was trying to perform read and write operations on the flash memory of my AVR32UC microcontroller, but I'm encountering a different issue during my trial. This’s the code I’m using:
#include <zephyr.h>
#include <device.h>
#include <storage/flash_map.h>

#define FLASH_AREA_ID 0

void main(void) {
const struct flash_area *fa;
flash_area_open(FLASH_AREA_ID, &fa);
flash_area_read(fa, 0, buffer, 16);
}
#include <zephyr.h>
#include <device.h>
#include <storage/flash_map.h>

#define FLASH_AREA_ID 0

void main(void) {
const struct flash_area *fa;
flash_area_open(FLASH_AREA_ID, &fa);
flash_area_read(fa, 0, buffer, 16);
}
The error I’m getting:
error: Failed to open flash area
error: Failed to open flash area
I've verified that the flash driver is enabled in the prj.conf file. Is there anything I'm not getting right? Any suggestion?
1 Reply
ZacckOsiemo
ZacckOsiemo3mo ago
Hmmm, where is your binding and where do you check it? The address you are reading is also iffy to me (maybe it's valid) and whre do you define your buffer?
Want results from more Discord servers?
Add your server