Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

alt_flash_open_dev

Altera_Forum
Honored Contributor II
1,401 Views

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
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
743 Views

After opening the project's summary.html file that I found in the _bsp folder, I saw the information about the reduced driver options and how it effects how the flash functions will not work if the reduced driver option is selected. Disabling that option fixed the issue I was seeing. However, it increased the program size by about 8K. So, now I am looking at how to select just the flash functions that are needed. Others had talked about putting defines into the alt_sys_init but that does not work or at least I could not get it to work.

0 Kudos
Reply