Forum Discussion
Hi Embedded guy, belated thanks to your response. Couldn't (unable) share project but I have solved the problem. See below:
For interest I managed to solve this problem by creating a .hex file of the SDRAM contents I was hoping the compiler/linker would include in SDRAM initialisation during the turn on initialization process. bash -x 'elf2hex...
Then I added an EPCS Serial Flash Controller in the NIOS2 design in QSys, regenerated the System HDL and rebuilt the bsp & app. I programmed an empty spot in the EPCS64 config. device with the constant bitmap data contained in the .hex file mentioned above (Chose EPCS page 64 0x400000).
Then in C code opened a flash dev (using alt_flash_open_dev() ), read the flash info (using alt_get_flash_info() ), printed out info & config. to confirm device, then read the contents using alt_read_flash() and finally closed the flash device after read was completed (using alt_flash_close_dev() ). Just to confirm read in ok I did a memory dump out through the jtag uart to the nios2-terminal for the memory region of interest and confirmed it had the data I wanted stored.
Was some problems finding the EPCS device in the system.h file as it doesn't get added until you add it in QSys and regenerate the HDL.
I hope you'll forgive me for dragging this from the archives but I think I want to do exactly what you did, by which I mean to get a bootloader to copy data from an EPCS to SDRAM and then run that code. Did you really have to write your own bootloader?
Cheeky I know, but are you prepared to share it?
Oliver