Altera_Forum
Honored Contributor
14 years agoalt_flash_open_dev
I would like to use the HAL APIs that already exist to write to FLASH. I am following the code outlined in the Using Flash Devices section of the May 2011 chapter 6 Developing Programs Using the Hardware Abstraction Layer document. The return code from the alt_flash_open_dev(TRISTATE_CONTROLLER_NAME) function is 0. The TRISTATE_CONTROLLER_NAME is defined in system.h and when I use the debuger the name is correct. As the name implies the TRISTATE_CONTROLLER_NAME is a tri-state controller with the flash device hanging off of it.
The alt_flash_open_dev function is calling an alt_flash_open_dev function. A list is being passed into this function and I do not see where this list is being inited, which is why the function is failing. So is there some kind of function call that I need to make before calling the alt_flash_open_dev function? The nios application is templated from the hello_world_small template. Any suggestions on how to proceed? Thanks