AM62Ax MCU+ SDK  09.00.00

The driver takes care of all sequencing necessary to perform writes across pages and the application need not take care of the programming intricacies.

Features Supported

  • APIs to read and write to a flash offset
  • Provides API to return flash attributes like block size, page size etc
  • API for block erases

SysConfig Features

It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
  • Option to select flash type based on board
  • Supported flash devices
    • W35N01JW

Features NOT Supported


Important Usage Guidelines

  • Typically before writing to an offset, erase the block which corresponds to the offset
  • Flash writes can only be done to a page size aligned offset, otherwise the write API returns an error

Example Usage

Include the below file to access the APIs

#include <board/flash.h>

Flash Read API

uint32_t offset;
/* Set offset to read from */
offset = 0;
/* Do the read */
status = Flash_read(handle, offset, buffer, 100);

Flash Write API

uint32_t offset;
/* Set offset to write to */
offset = 0;
/* Do the write */
status = Flash_write(handle, offset, buffer, 100);

Flash Erase API

uint32_t offset, blk, page;
/* Set offset to erase */
offset = 0;
/* Find the block number corresponding to the offset */
status = Flash_offsetToBlkPage(handle, offset, &blk, &page);
/* Erase the block */
status = Flash_eraseBlk(handle,blk);



int32_t Flash_offsetToBlkPage(Flash_Handle handle, uint32_t offset, uint32_t *block, uint32_t *page)
Utility API to convert offset in bytes to (Block Num, Page Num)
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:175
int32_t Flash_eraseBlk(Flash_Handle handle, uint32_t blockNum)
Erase a block from flash.
int32_t Flash_write(Flash_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len)
Write to flash.
int32_t Flash_read(Flash_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len)
Read data from flash.