Altera_Forum
Honored Contributor
12 years agoReading EPCS Flash
Dear all,
We have planned to use the free space in our EPCS64 configuration IC to store user data. So we have selected the last block in our EPCS memory for the same. We have used the following method to read the data, p_epcs_fd = alt_flash_open_dev("/dev/epcs_flash_controller_0"); if (p_epcs_fd) { alt_epcs_flash_get_info(p_epcs_fd, &p_epcs_reg_info, &num_epcs_regs); epcsAddr = (p_epcs_reg_info->number_of_blocks - BOARD_DATA_BLOCK_FROM_END) * p_epcs_reg_info->block_size; alt_read_flash(p_epcs_fd, epcsaddr, &var, sizeof(var)); alt_flash_close_dev(p_epcs_fd); } but we have a doubt regarding "datatype" of epcsaddr passed in alt_read_flash() method. according to the method, it needs to be an integer but for a epcs64 device the address of last block is "0x7f0000" (8323072 dec) which is beyond the scope of integer variable. kindly let know how the method operates.