What is the error code? Have you tried writing a smaller value? is there a boundry that it appears to not write on? In all my use of it i write only block_size chunks at a time. Don't know if you have to do that or not, but all my code does. So, you would have to read the regions data structure, which
alt_flash_fd* fd;
int number_of_regions;
flash_region *regions;
fd = alt_flash_open_dev(flashName);
if (!fd)
return -EACCES;
retval = alt_get_flash_info(fd, ®ions, &number_of_regions);
if (retval) {
alt_flash_close_dev(fd);
return errno;
}
Then regions->block_size contains the size of the write blocks on the flash device.
::edited to include code tags.