Forum Discussion

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

boot from onchip rom

Hi,

If i want to use onchip rom as a boot area, i need to extract boot loader code from elf file and convert into hex for on-chip rom which will be included in sof file. But , i don't know how to do it? I set reset address at on-chip rom in SOPC builder then use IDE to compile my code but IDE producing onchip_rom hex file whose content are all zero. why? Whether i need to consider others?

Thanks a lot.

2 Replies

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

    Hi samchou,

    > i need to extract boot loader code from elf file and convert into hex

    Try some combination of objcopy, elf2hex, etc. (as suits your taste) from the command

    line ... you may find it is much easier to understand ... since you can avoid the "magic"

    of the IDE. For example:

    $ nios2-elf-objcopy -O ihex app.elf onchip_rom.hex

    Regards,

    --Scott