Altera_Forum
Honored Contributor
20 years agoFlash Help!
We have a board that uses 2 SST39VF160 sticks of flash. These are both 1 Meg by 16-bits. They have been configured as 1 Meg by 32-bits for a total of 4 MBytes of flash capacity.
I have managed to write some drivers that allow my Nios core to read, write, and clear the flash. In my main routine, I can make the calls something like this. # include "sst_flash.h" alt_flash_fd *fd; fd = alt_flash_open_dev(FLASH_NAME); // as defined in system.h by SOPC builder if(fd) { sst_flash_erase_block(fd, offset); sst_flash_write(fd, offset, data, length); sst_flash_read(fd, offset, data_rb, length); } // end if else return -1; // just bail if the open fails. All is happy in the main routine. I have loops that run through and verify the flash contents. I have already made my own flash-programming design for this board. My flash programmer seems to download and work just fine. It seems to hang up when it tries to open the flash device. I get the following failure, see below. Feb 8, 2005 3:53:43 PM - (SEVERE) nios2-flash-programmer: Error opening target hardware Feb 8, 2005 3:53:43 PM - (SEVERE) nios2-flash-programmer: Unable to open flash-device after successfully communicating with target. I changed my alt_sys_init.c file so that it creates an instance, and initiates the flash. How do I get the system to use my flash drivers?