Showing results for 
Search instead for 
Did you mean: 
Honored Contributor I

the bootloader

I'm a beginner and i have some questions as follows: 

Does the NiosII IDE generat bootloader automatically?How can i find the bootloader in the Nios II IDE? 


thank you!
0 Kudos
3 Replies
Honored Contributor I

Searching the documentation, I only see a boot copier. Is this what you're talking about? 

Have you done a search in the docs? 


Note to do a search of ALL the pdf docs, just open a pdf in reader (6.0 and above) and click on search. tell it to search all docs in the doc directory. 


I searched for boot and read the flash programmer document. 


Tell me if you find what you're looking for. Tell me if you don't....
Honored Contributor I

Hello csuperman, 


Yes, the Nios II IDE automatically inserts the bootcopier (aka bootloader) in front of your elf image when you program your image to flash, as long as the reset is set to be in flash (via SOPC Builder) and the .elf image code section is located in RAM. The bootcopier, at reset, copies your code from flash into RAM, and begins execution out of RAM. See the following excerpt from the Nios II Flash Programmer User Guide: 


Boot-Copier Program 

When programming software content (.elf files) into flash, you can 

automatically insert a small boot-copier program immediately before 

your software contents in flash to allow the system to boot from flash. The 

Using the Nios II Flash Programmer & Instantiating Flash Memory 

boot copier will relocate your software to the address where it has been 

linked in the .elf file, then branch to it. Normally, the address to where the 

software is relocated will be occupied by a volatile memory such as a 

RAM, SDRAM, on-chip RAM, etc. 


Nios II IDE can be used to configure where the different sections 

of your software are linked in the .elf file. For more information, 

refer to Editing Project Properties in the Nios II IDE Software 



The decision of whether or not to insert a boot copier is made by the 

elf2flash utility, based on the switches --base, --end, --reset, and 

the location to which your software content is linked in the .elf file. The 

elf2flash utility will insert a boot copier in front of your software 

content when—and only when—the reset address is within flash and the 

.elf file is linked to a location outside of the flash. 

For example, if your flash memory is mapped to (0x0 – 0x7FFFFF) in 

SOPC Builder, and you have linked your software so that it is to be 

located at 0x800000 where an external RAM is mapped in SOPC Builder, 

elf2flash will insert a boot copier at address 0x0, followed by your 

software contents. Upon reset, the boot copier relocates the software 

contents from flash to the external RAM located at 0x800000 before 

executing it.
Honored Contributor I

hello friends, 


to kerri:I found the file named "boot_loader.s"<#EMO_DIR#>/biggrin.gif yestoday. It acts as flash_copier,thank you!!  

to stephen:Your answer is very helpful!! Thank you!