Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

14.1.58. alt_write_flash_block()

Prototype

int alt_write_flash_block(alt_flash_fd* fd,

int block_offset,

int data_offset,


 const void *data,

int length)

Commonly Called By

C/C++ programs

Device drivers

Thread-safe

No.

Available from ISR

No.

Include

<sys/alt_flash.h>

Description

The alt_write_flash_block() function writes one block of data of flash. The data to be written is at address data. length bytes are written to the flash fd, into the block starting at offset block_offset from the beginning of the flash address space. The data starts at offset data_offset from the beginning of the flash address space.

No check is performed on any of the parameters.

For more information, refer to “Using Flash Devices” in the "Developing Programs Using the Hardware Abstraction Layer" chapter.

Call this function only when operating in single-threaded mode.

The only valid values for the fd parameter are those returned from the alt_flash_open_dev function. If any other value is passed, the behavior of this function is undefined.

Return

The return value is zero on success and nonzero otherwise.