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);
}

The error I’m getting:
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?
Was this page helpful?