Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

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!

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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....
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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

    Tutorial.

    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.