User`s manual
SDK 2 Programmer’s Guide Programming Notes
5-3
Writing Data
Data is written sequentially into the flash according to your program’s instructions. Each time data
is written, the offset address automatically moves to the next writing point. For example, if the
original offset address is 0x0100, and 20 bytes of data are stored, then the API moves the offset
address to 0x0121.
The API “flash_length( )” gets the length of the data currently stored in the flash. The return code
“-2” indicates that the bank is full. To reuse this bank, you first need to copy the data currently in
the bank to another bank. After the bank is cleared by the API, you can again write data, starting at
beginning of the bank.
Reading Data
You may use the offset address in block mode or bank:offset in bank mode to retrieve any of the
data in the flash memory.
Erasing Data
Due to the characteristic of flash, each byte in the flash can only be written once. To re-write the
same byte, you need to erase the entire bank.
Serial I/O Buffer
The internal buffer for serial I/O is located in the kernel. There are 2 KB of buffer space for
receiving data, and 4 KB for sending data.