Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

Using a bootloader for NIOS II, nios2-elf-objcopy creates very large object file

Altera_Forum
Honored Contributor II
1,441 Views

Hello, 

 

I've an NIOS II application builded via the command line tools. I've now decided to run the program from the onchip_mem instead from the flash. 

Reading the AN458, it is clear that the .text and .rodata has to be set to the onchip_mem and the reset vector has to point to the flash. 

 

If I made these changes, the nios2-elf-objcopy creates then an binary output file which is 258 MB. 

Without the bootloader, this is only 25 kB. The elf-file is always 390 kB (regardless where the .text and .rodate are placed). 

 

I'm using Quartus 14.1 for building the application; FPGA is a Stratix IV. 

 

Maybe someone can help how I can debug this or any idea why the binary gets so large? 

 

Best Regards, 

Bernd
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
513 Views

Sounds like you have initialisation data for disjoint memory areas. 

look at the output of 'objdump -h' and 'objdump -p' - these should tell you which memory areas are being initialsed. 

At a guess you are trying to place code at the reset vector location.
0 Kudos
Altera_Forum
Honored Contributor II
513 Views

Thanks for your reply. It seems that the end address of the flash memory, given to elf2flash, is not correct. Changing this address seems to solve the problem. Best Regards, Bernd

0 Kudos
Reply