Altera_Forum
Honored Contributor
16 years agousing flashprogrammer to program application image
I hope someone will have a quick answer.
Below is the script I am running to create a concatenated application image that I would like placed at location 100000 in a EPCS16. I have already loaded the factory image into the EPCS16 at location 0. Here is the programming command: nios2-flash-programmer --epcs --base 0x00101000 max_app_pg16.flash --go The problem is when go is executed it jumps to 0x0001000 which is the reset vector for the factory image. I went in and tried to change the reset vector for the application load in SOPC but sopc does not like the 100000 offset. I thought the reset vector was altered using the nios2-elf-objcopy --target srec --change-addresses 0x100000 max_app_comb.flash max_app_pg16.flash command, but apparently not. Thanks, John --------------------------------------------------------------------# H/W config image conversion echo ">> Converting sof to flash..." sof2flash --epcs --input=top.sof --output=top_hw.flash# Appcode (elf) must fall just after the H/W image (thus the --after param) echo ">> Converting elf to flash..." elf2flash --epcs --after top_hw.flash --input=max_application.elf --output=max_app.flash# Combine srec images - just cat them echo ">> Combining HW and SW flash images..." cat top_hw.flash max_app.flash >> max_app_comb.flash# Now get the flash base address (0x100000) inserted in the image echo ">> Adjusting base address for combined image..." nios2-elf-objcopy --target srec --change-addresses 0x100000 max_app_comb.flash max_app_pg16.flash echo ">> DONE making combined flash image" # nios2-flash-programmer --epcs --base 0x00101000 --erase-all max_app_pg16.flash --go