Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

alt_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

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.