Altera_Forum
Honored Contributor
15 years agoCreating a hex-file
It cannot be that hard:
I have a nios2 project (including onchip_ram with "Enable non-default initialization file" checked) that can be compiled to an elf-file. But i don't get any hex-file when i compile my project. I have been looking up and down in my nios-ide, have scanned the altera forums and have been questioning google for several hours. I have found serveral hints what to do but for some strange reason nothing really works. Hint 1: mem_init_install, mem_init.mk In my bsp i find the file mem_init.mk. But i really don't know what to do with it to get a hex-file. In nios ide i can do "Make targets\Create..." an manually add "mem_init_install". But afterwards when i try to invoke it by "Make targets\Build..." i get this error "make: *** No rule to make target 'mem_init_install' ". Hint 2: elf2hex When i use elf2hex (java -jar elf2hex.jar --input=Project.elf --width=32 --base=0x4000 --end=0x77FF) (base and end address come from my onchip_ram in the sopc-builder) i really get a hex-file. But when i now try to update the memory initialization files in quartus2 i get this warning "Warning: Width of data items in "onchip_ram.hex" is greater than the memory width. Wrapping data items to subsequent addresses." So the hex-file isn't ok. Changing the parameter width to "--width=4" in hope to create a hex-file that looks like the default "onchip_ram.hex" will only produce an error "Width: 4 isn't a valid width". Any help will be greatly appreciated