Altera_Forum
Honored Contributor
14 years agoUpdate bitstream and kernel in flash from Linux : A clean way to generate binary file
Hi all,
I wish to update my entire system from a running Linux by changing Flash content : changing bitstream and kernel. My flash is partitioned with 2 area : bitstream (4MB ) and kernel (4MB ). My main issue is that using altera tools to convert sof2flash and elf2flash I do not have intermediary files : raw binary files that I can write to my flash usingcp <file> /dev/mtdXI only get srec files that are not usable from Linux to Flash my external memory (as far as I know, but maybe there is a tool to write srec files from nios2-linux) Ok I have already binary file : the .sof and my zImage but : - sof2flash adds (or remove) some headers and configure bitstream loading mode : in my case active parallel
- elf2flash adds a bootloader before my zImage
- Flash my board using Altera tools (elf2flash, sof2flash and nios2-flash-programmer)
- Read back partitions from flash using
nios2-flash-programmer -B <ADD>+<SIZE> -R zImage.tmp --base=0x08000000 - use srec_cat
srec_cat -output zImage.bin -binary zImage.tmp