Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12595 Discussions

Generic Serial Flash Interface

Piste79
Beginner
542 Views

A question for using the generic serial flash interface. I use a CycloneV and have a small system with NIOS2 processor.  So far I use a standard SPI controller but now I would like to change the communication to the Flash to Quad. Accessing the CSR works but there are problems if I want to write more than the 4 bytes at once. As in the example, it works well, but I always want to write a page of 256 bytes on the MICRON Flash. After this sequence, the Chip Select is set back to 1 and the Flag Status Register must first be read. With normal writing of a page, the whole page is still written to the Register Command and the Flash address, without the Chip Select going to 1 in the meantime. Can anyone help?

 

Example works but only with 4 byte writing to memory:

//4byte addr page program

void write_memory()

{

  IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x4,0x00000000);

 IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x0,0x00000101);

 IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x6,0x00007002);

 IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_MEM_BASE,0x00000000,0xabcd1234);

}

0 Kudos
2 Replies
YuanLi_S_Intel
Employee
417 Views

Apologize that i dont understand the question. Are you saying that you dont wan to write 4 byte addressing?


0 Kudos
Piste79
Beginner
405 Views

I solved my problem in another way. Thank you.

0 Kudos
Reply