Forum Discussion
Altera_Forum
Honored Contributor
21 years agoUsing alt_flash_open_dev
Hello, I have a Nios2 system that runs from flash (flash = program memory). My program needs to access flash at a certain moment, it needs to write/read some data to it. The alt_flash_open_de...
Altera_Forum
Honored Contributor
21 years agoDolphin,
You should read the post to your question by Scott. The HAL prevents you from using the drivers to access a flash you're executing from, with good reason. If you try to write to the flash the data values read from a flash become status bits, so you're next instruction fetch could fetch status bits, which is unlikely to be what you want to do. If you look in altera_avalon_cfi_flash.h you'll see how it's done. I would caution against changing this unless you understand the issue I raised above and in Scott's post. It's also curious that you're writing a ReadFlash function, why not just read from the address?