Forum Discussion
Altera_Forum
Honored Contributor
10 years agoReading EPCS
Hello, I am trying to read data in EPCS by the following: == char buf[65535]; alt_flash_fd* epcs = alt_flash_open_dev(EPCS_FLASH_NAME); alt_epcs_flash_read(epcs, offset, buf, length); == ...
Altera_Forum
Honored Contributor
10 years agoThanks, tony_stark.
I did read the post, but still not working. I tried below: == static flash_region *p_epcs_reg_info; static int num_epcs_regs; alt_u8 buf[16]; alt_u8 buf2[16] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F}; alt_flash_fd* epcs = alt_flash_open_dev(EPCS_FLASH_NAME); int error = alt_epcs_flash_get_info(epcs, &p_epcs_reg_info, &num_epcs_regs); alt_epcs_flash_erase_block(epcs,0); alt_epcs_flash_write_block(epcs, 0, 0, (void*)buf2, 16); alt_epcs_flash_read(epcs, 0, (void*)buf, 16); == As for p_epcs_reg_info & num_epcs_regs, I get below which seems OK: offset=0, region_size=2097152, number_of_blocks=32, block_size=65536, num_epcs_regs=1 I get error = 0, epcs is not NULL, so there seems to be no error. But I still get 0x14 for buf[0] to buf[15].. Is there anything else I should look for? Thanks in advance.