Forum Discussion
Altera_Forum
Honored Contributor
21 years agoProblem using HAL Api
Hello, I have problem using HAL api.. I just want to open device using alt_flash_open_dev() just like in "Simple Flash Access" of "The HAL Api Reference", but it always returns 0x0. Do...
Altera_Forum
Honored Contributor
21 years agoI'm using the Cyclone edition and a custom board and the flash works for me.
I have two suggestions: 1) Make sure you're not using a project where the flash is used for program storage. Check your system.h file for a# define ALT_TEXT_DEVICE FLASH, which means your program code is stored there. If you're putting your code in flash and booting it or running it from there the flash driver will not be available. It took me a while to figure this out because it's done with macros in a weird way. I think this may not be your problem, though, since you do see the device in the list after the alt_sys_init. 2) Try setting a breakpoint in alt_flash_cfi_init, which is called from alt_sys_init, and stepping through the flash driver initialization. On our target board we had some pin assignments wrong and it led to the flash not initializing properly. Andrew