Forum Discussion

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

Modifying EPCS bootloader

Skip to tl;dr at the bottom if so inclined. Background and such is there to cover some possible questions.

background:

(Developing in Q10.1)

I am developing a project with two separate firmware images(FW1, FW2) and two separate software images (SW1,SW2).

In the EPCS the images are stored as follows:

0x000000 FW1

(After FW1) SW1

0x800000 FW2

0x900000 SW2 (this location can be moved without problems)

On boot, FW1 (which includes a NIOS CPU) will load from an EPCS. The software automatically loads using the default boot loader generated by Quartus/sopc. At this time SW1 will do stuff and issue a reconfigure command via the reconfiguration component.

FW2 starts up from the reconfiguration. At this point, the default boot loader (in FW2) points (by calculating the size of FW at address 0) to SW1 and loads it. (my problem)

desired solution:

I would like to modify the boot loader hex file stored in the EPCS boot loader ram to point to my second software location.

From what I have gathered (on these forums and elsewhere) the boot loader software is compiled from the assembly code found here:

<Quartus_install_dir>\nios2eds\components\altera_nios2\boot_loader_sources\.

I would like to modify the boot loader code, recompile it, and replace the default hex file in the EPCS component. I will probably be able to figure out how to set a fixed offset to the boot loader software on my own, but help is always appreciated.

tl;dr

How exactly do you "re-compile" the boot loader software and generate the hex file? There is a makefile in the directory, but I am not sure how to use it. (just typing make using the nios2 command shell in the directory will not work)

18 Replies