Forum Discussion
Altera_Forum
Honored Contributor
21 years agoIf you would like modify your upgrade system to use the EPCS bootloader included in the EPCS device, the loader record format is pretty simple. From boot_loader.S:
----------------- Each "program record" looks like so: 4 bytes Length L 4 bytes Address A Generally, the next L bytes are then shoveled out of flash (cfi or epcs) and stashed at authentic RAM address A. If L is zero, then A is an address to JUMP to for your application to execute. ----------------- Take a look in boot_loader.S and boot_loader_epcs_bits.S for clarification. The trick is in knowing where to write the boot image in the EPCS device. The bootloader reads the header of the design stored in the EPCS device to determine where the design ends, and the boot records begin. The process is pretty simple. Take a look in the existing or updated (see below) boot_loader_epcs_bits.S if you’re interested. If you would prefer a smaller and faster loader I've made one available on the IP forum. No guarantees as to its functionality, or suitability for your purposes. QA isn’t done with it yet. Use it at your own risk, etc., etc. The updated loader both loads faster, and fits in a single M4K. Its disadvantage in your environment is that its written to be completely re-locatable, and to compile to either an EPCS loader or a parallel flash loader. Removing some of its flexibility would easily shrink it further. A couple of notes: The ASMI device is still included in the Nios II, kit, in case you don't wish to switch to the EPCS device. Bart, I think you meant your EPCS device uses 2 M4Ks (1K of precious RAM) for the bootloader. Could you check to make sure this is the case? Alternatively, an enterprising person could replace the EPCS bootloader in their design (epcs_controller_boot_rom.hex) with one of their own making.