Forum Discussion

JensVkb's avatar
JensVkb
Icon for Occasional Contributor rankOccasional Contributor
3 years ago

MAX 10 - Erase CFM sector - IP states "successful" yet sector not erased

I'm in the process of building remote system upgrade functionality for my MAX10. In contrary to the examples I can find, I do not want to use the NIOS II processor and my design must be VHDL only.

In my current phase, I'm trying to erase a sector of the CFM, as the on-chip flash memory guide states it's better to first erase a sector and then to re-program it.

After creating my own Avalon MM master to connect to the csr slave of the on-chip flash IP block, I was able to figure out some issues through simulation. In the simulation waveforms, I can now see the IP block setting its busy bits and setting its "erase successful" bit once done.

However, when I program my design in my MAX10 development board and execute it, the sector is not erased.

Test procedure:

1) upload my design.

2) hit a button to start the erase

3) once I see, through LED, the erase has happened and the IP block reports "successful", I powercycle my board (= disconnecting USB cable and then reconnecting it).

I would then expect the flash sector to be empty and hence my MAX10 doing nothing, as it can't find a design. However, after the reconnect, my MAX10 boots the design again. This thus shows the sector was not erased, despite the "successful" bit of the IP block.

Any pointers to start figuring out what is wrong or what I'm missing?

Attached are the settings of the FLASH IP block, my platform and the VHDL code of my Avalon MM master.

PS: I found 2 other post seemingly having the same problem, but theirs was solved by signal connections. I believe my connections to be correct as the simulation (and actual hardware) provide the expected signals/waveforms.

18 Replies