Forum Discussion
Altera_Forum
Honored Contributor
17 years agoHow to write in EPCS
Hello, I am a newbie with Nios II. I'm doing a robotic project with a Cyclone and an EPCS4 flash memory. I've added an EPCS controller in my SOPC Builder system. I has to read...
Altera_Forum
Honored Contributor
17 years agoHi,
Thanks again for your help ! I have a problem and I think there is something I don't understand. I try to write something in several addresses like that : alt_u8 buffer_write[16]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F}; alt_epcs_flash_write(p_epcs_fd, 0, (void*)buffer_write, 16); alt_epcs_flash_write(p_epcs_fd, 16, (void*)buffer_write, 16); alt_epcs_flash_write(p_epcs_fd, 32, (void*)buffer_write, 16); alt_epcs_flash_write(p_epcs_fd, 48, (void*)buffer_write, 16); Then I unplug my card, plug it again and try to read what I have written : alt_epcs_flash_read(p_epcs_fd, 0, (void*)buffer_read, 16); alt_epcs_flash_read(p_epcs_fd, 16, (void*)buffer_read, 16); alt_epcs_flash_read(p_epcs_fd, 32, (void*)buffer_read, 16); alt_epcs_flash_read(p_epcs_fd, 48, (void*)buffer_read, 16); In Debug mode, the first three lines give me that : "buffer_read" buffer_read[0] = 255 buffer_read[1] = 255 buffer_read[2] = 255 buffer_read[3] = 255 buffer_read[4] = 255 buffer_read[5] = 255 buffer_read[6] = 255 buffer_read[7] = 255 buffer_read[8] = 255 buffer_read[9] = 255 buffer_read[10] = 255 buffer_read[11] = 255 buffer_read[12] = 255 buffer_read[13] = 255 buffer_read[14] = 255 buffer_read[15] = 255 And the last one give me the good thing. Does alt_epcs_flash_write erase the block ? Thank you