Forum Discussion

Piste79's avatar
Piste79
Icon for New Contributor rankNew Contributor
3 years ago

Generic Serial Flash Interface

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);

}

2 Replies

  • YuanLi_S_Intel's avatar
    YuanLi_S_Intel
    Icon for Regular Contributor rankRegular Contributor

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