Altera_Forum
Honored Contributor
16 years agoWriting to EPCS sectors
Hello, all,
I have been struggling with this and I hope someone can shead some light. My project has a 3C25 along with a EPCS16 device. I would like to write some data to the EPCS16 somewhere around sector 20. Every time I try to write I end up with data being written to sector 0. I should also mention that I am using the block erase, write_block and read epcs functions I noticed that the alt_epcs_flash_write_block function in the in the altera_avalon_epcs_flash_controller.c has the following comments: /* Write, assuming that someone has kindly erased the appropriate * sector(s). * Note: "block_offset" is the base of the current erase block. * "data_offset" is the absolute address (from the 0-base of this * device's memory) of the beginning of the write-destination. * This device has no need for "block_offset", but it's included for * function type compatibility. */ I am concerned about the part of the comment that says the device has no need for block offset. Like I said I want to erase and write to sector 20. alt_epcs_flash_write_block(alt_flash_dev* flash_info, int block_offset, int data_offset, const void* data, int length) I am setting the int block_offset to 20. Thanks for any suggestions. JTA1