Altera_Forum
Honored Contributor
16 years agoCFI Flash doesn't read correcty after reset
I have a Stratix II GX with 2MBytes Flash in 8 bit mode and 512kBytes SRAM in 8 bit mode.
The Flash memory is hooked up properly, in that most of my applications run just fine, but I'm having trouble with one FPGA configuration. With the same build of FPGA I can generate one BSP 8.1 and application and load it into flash memory with the nios2-flash-programmer and everything works, it restarts properly after power cycling and it restarts properly on pressing the reset button. Unfortunately with the same BSP in version 9.0 I can program the flash memory as before and I can run my program and all works well, but then when I press the reset button it reads garbage from the flash memory and never runs the program. In each case it is trying to load the code from Flash into SRAM and run from SRAM. The code is small enough (including data) to fit in the SRAM. Debugging and Signal Tap II traces of the Flash memory suggest that when running properly the Flash memory is read from address 00000 with data in order: 3A 70 01 00 74 00 C0 04 3A 48 01 98 04 F8 FF 9C However, after pressing the reset button, the flash memory is read from address 00000 again, and the timing of the CE_n and OE_n signals is the same it reads back: 1F 00 C0 01 98 98 01 00 FF FF FF FF FF FF FF 02 If I power cycle the board it will read the contents properly again and run properly without needing another reset first. This implies that the Flash memory is not being overwritten. If I use the NiosII debugger I can read memory from address 00000 and I get back the incorrect version. Any clues?