Download Embedded Peripherals IP User Guide

Transcript
41-12
Boot Copier File
UG-01085
2015.06.12
At the start of the memory map is the FPGA image, followed by the boot copier, the application and then
customer data. The size of the FPGA image is unknown and the exact size can only be known after the
Quartus compile. However, the Nios II Reset Vector must be set in Qsys and must point to right after the
FPGA image (i.e. the start of the boot copier).
The customer will have to determine an upper bound for the size of the FPGA image and will have to set
the Nios II Reset Vector in Qsys to start after the FPGA image(s).
Boot Copier File
The boot copier that will be used is the CFI boot copier, also known as memcpy-based boot copier. We
will provide the boot copier in one or more of the following formats: Intel HEX, Quartus HEX or SREC.
When Nios II SBT will Append a Boot Copier
The Nios II SBT tools know whether to append a boot copier based on the .text linker section location. If
the .text linker section is located in a different memory than where the reset vector points, it indicates a
code copy is required. At this scenario a boot copier is required. You can use the existing logic to generate
a programming file with or without a boot copier depending on the scenario.
Creating HEX Programming File
The Nios II Software Build Tools (SBT) application Makefile “make mem_init_generate” target is
responsible for generating memory initialization files. This includes generating programming files (SREC,
HEX) used for flashing a flash memory and files for initializing memory (DAT, HEX) in simulation.
In boot scenario 1 (Executing in place), “make mem_init_generate” should generate a HEX file containing
ELF loadable sections
In boot scenario 2 (Boot copying the code to volatile memory), “make mem_init_generate” should
generate a HEX file containing both the boot copier and ELF payload. “make mem_init_generate” is
callable from SBT.
Programming Flash
Programming the flash is done by using quartus_cpf to combine a compiled FPGA image (SOF) with an
application image (HEX file generated by Nios II SBT). The result of this combination is a (POF) which
can be programmed to the flash using the Quartus II Programmer.
In the Quartus II software, "Convert Programming File tool" (quartus_cpf) can be called by selecting File >
> Convert Programming Files.
Custom Boot Copiers
Custom boot copiers can be used. “make mem_init_generate” calls conversion tools under the hood for
creating programming files from compiled ELFs. These tools have a boot option to specify a custom boot
copier. A user will need to call these underlying conversion tools to generate a programming file with a
custom boot copier.
Executing in Place
Executing in place shouldn’t be any different than executing in place with an On-chip RAM. As long as
both the Nios II reset and exception vectors point to the flash memory, execution will happen in place.
The Nios II board support package (BSP) settings are edited to enable alt_load function to copy the
writable memory section into volatile memory and keep the read only section in the flash memory.
Altera Corporation
Altera Generic Quad SPI Controller
Send Feedback