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 agoHello,
I just found out what the problem is. I use the following function to access flash: extern int ReadFlash (FILE* fp) __attribute__ ((section (".FPGARAM2"))); int ReadFlash (FILE* fp) { alt_flash_fd* fd=0; while (!fd) {fd = alt_flash_open_dev("/dev/Flash");} alt_flash_close_dev("/dev/Flash"); return 1;} This function is extern and located in RAM, but my function calls alt_flash_open_dev AND this function is still in FLASH. How can I solve this? best regards, Dolphin