Altera_Forum
Honored Contributor
15 years agoBootloader Elf2Hex Woes
I'm trying to do the seemingly simple task of putting the nios code in fpga ram blocks, and at power-on, the bootloader should copy the code from on-chip memory to external sram.
In the sopc I have the cpu's reset vector pointing to on-chip memory, with the nios ide set to external sram for the prog .text. Since the code and the bootloader need to be in internal ram at power-on, I use elf2hex to convert the resulting elf file, however it is not correct... it's only 2kb, where it should be the full code + the bootloader (or around 45kb). It works if in the nios ide points the .text to on-chip ram. Then the elf2hex file has the application code correct and can be used during synthesis to create a system that boots and executes from on-chip ram. But how can I have the code reside in on-chip ram, and yet also have the bootloader (also in on chip ram) *COPY* the program code over to sram and execute from there?