Remote system upgrade for MAX 10 with Cypress quad SPI Flash
I'm working on configuring a remote system upgrade (AN 741) with a dual image configuration using an external SPI flash to store the NIOS 2 hex (Boot option 5 from chapter 1.5.3.2 from AN 730).
Currently I'm using a custom board that has a MAX 10 FPGA and a Cypress Flash S25FS512S.
I've tested the Intel FPGA Generic quad SPI controler core II with the MT25QL512ABA Flash selected and I'm able to get the correct Flash silicon ID but read and write operations don't seem to work correctly.
Here is an example where the program writes 0xbb in memory but always reads 0xcc.
I'm able to read the correct SPI flash ID with (IORD_ALTERA_QSPI_CONTROLLER2_RDID) but It seems like the values are not being written in Flash.
memset(source, 0xbb, BUF_SIZE);
fd = alt_flash_open_dev("/dev/generic_quad_spi_controller2_0_avl_mem");
if (fd!=NULL)
{
ret_code = alt_qspi_controller2_get_info(fd, ®ions, &number_of_regions);
if(ret_code==0){
alt_printf("len %x \n",fd->length);
alt_printf("regions %x \n",number_of_regions);
alt_printf("string %s \n",fd->name);
}
silicon_id = IORD_ALTERA_QSPI_CONTROLLER2_RDID(GENERIC_QUAD_SPI_CONTROLLER2_0_AVL_CSR_BASE);
alt_printf(" %x \n",silicon_id);
ret_code = alt_qspi_controller2_write(fd, 0, source, BUF_SIZE); //writes 0xbbb
ret_code =alt_qspi_controller2_read(fd, 0, source2,BUF_SIZE); //always reads 0xccccc
if(ret_code==0){
alt_printf("source %x \n",source[0]);
alt_printf("source 2 %x \n",source2[0]);
}
alt_flash_close_dev(fd);
}As an alternative I've also tested the Generic Serial Flash interface IP core. Using this one I'm able to successfully run the reference design (UG-20161) code and read and write from the SPI Flash so I know Its not an hardware problem.
However I'm not able to generate the BSP for NIOS 2 with this IP core due to no matching memory region errors and so I can't boot from It.
SEVERE: CPU "RSU" reset memory "intel_generic_serial_flash_interface_top_0_avl_mem" has no matching memory region.
SEVERE: CPU "RSU" reset memory "intel_generic_serial_flash_interface_top_0_avl_mem" has no matching memory region.
SEVERE: nios2-bsp-generate-files failed.
This problem is similar to the one that another Forum user was having:
https://forums.intel.com/s/question/0D70P000005PLF2SAO
Is there a solution for this?
I'm using Quartus prime standard edition 18.0.