Custom Boot Loading
Boot-Loader Application Notes
Search words: boot, boot-loader, boot loader, boot loading, boot-loading, boot application
(This technique of boot-loading was obtained from www.niosforum.com, search word: ‘rasdan’ (author collaborating with altera).
Caveat:
The following notes, code, ramblings and self-reminders are what was necessary to get ‘my’ application running via a boot-loader. Some notes may not apply or be reasonable for your usage. The following is not set-in-stone or necessarily even correct but should help you if you need to use a similar approach.
Normal/Standard Nios II boot-loading.
Normally, a NiosII boot-loader is automatically built as part of a NiosII project. It is provided by Altera and is written in assembly language. These assembly source files may be viewed at ‘\altera\kits\nios2\components\altera_nios2\sdk\sr c\boot_loader_sources’ on your hard-drive. See ‘boot_load_cfi_bits.s’ or ‘boot_loader_epcs_bits.s’ in the above directory.
There are two boot loaders that are provided with the NiosII IDE:
• An epcs bootloader used for booting out of an epcs serial flash.
• A CFI parallel flash bootloader.
Using either an epcs or cfi device as a booting device requires no additional work for the NiosII code writer (ie. An human). The Quartus/SOPC environment generates its own boot-loader hex file that is loaded as part of the hardware image. For example if an internal fpga memory device were named ‘onchip_memory_0’, the hex file generated and used by the hardware image would be named ‘onchip_memory_0.hex’. This hex file is the representation of the assembly language boot-loader. Therefore, the boot-loader basically lives as part of the hardware image and is therefore always available upon a power cycle or reset. Again, the standard Altera boot-loader is automatic because the Quartus/SOPC environment directly knows about the boot-loading device(epcs or cfi) flash device.
However, if one desires to boot-load from a parallel or serial port from a boot-loading device, such as an external micro-controller, Altera unfortunately has no direct solution. Therefore, we must build our own custom boot-loader solution that can receive Nios application code from an external device.
<attachment>