Booting From Serial Flash

TI Flash and Boot Utilities. These packages currently available for the DM35x, DM644x, and DM646x contain a set of utilities, some for running under CCS on Windows.

booting from serial flash booting from serial flash booting from serial flash

Minnowboard:SPI Boot flash. From eLinux.org. the MinnowBoard uses a SPI based serial flash memory to load the initial code into the Intel Atom E640 series processor.

Nios II Processor Booting From Altera Serial Flash EPCQ 2015.05.26 AN-736 Subscribe Send Feedback The Altera Nios II processor is a soft processor that.

U-boot and Flash NOR, NAND SPI U-boot now has support for 3 different flash technologies: SPI serial flash newer technology, simple 4-wire serial bus.

Ultra Low Power DSP C5000 Ultra Low Power DSP Forum Firmware update on C5535 ezdsp without using code composer: booting from serial flash.

U-boot now has support for 3 different flash technologies: NOR flash traditional parallel 8-bit or 16-bit wide data bus, with a dedicated address bus. NAND flash newer technology 8-bit or 16-bit data bus, which is multiplexed with the address bus. SPI serial flash newer technology, simple 4-wire serial bus.

These different flash technologies require different device drivers to communicate with them, due to the different ways they are wired to the CPU. As a result, there are different U-boot commands used to access them. It is important to use the correct command for each type of flash device. Which Flash command sets to use.

The following table shows the appropriate command sets for each type of flash. Action NOR NAND SPI Copy Flash to RAM cp. bwl nand read eeprom read Write to Flash from RAM cp. bwl nand write eeprom write Dump Flash md. bwl nand dump eeprom read ; md. bwl Ease Flash erase nand erase n/a Write Protection protect on

nand unlock n/a Additional Info flinfo

For more information on each of these U-boot commands, then please use the help command, for example: MB680  help cp

MB680  help eeprom Writing data to Flash

The following are examples of how to burn U-boot into flash, so it may be booted from flash. In all cases, we assume that the binary to be burned is in a NFS server, and that both the NFS server, and U-boot s networking are correctly set up. In addition, we assume that we want to burn the U-boot image into the first block in flash i.e. offset zero.

NOTE: The following commands may need to be changed for your specific board, configuration, environment, etc. - they are just examples. For NOR Flash

In the case of NOR flash, the flash should be explicitly erased and if necessary unprotected, prior to writing to it. MB680  nfs  load_addr /export/u-boot.bin

MB680  cp.b  load_addr A0000000  filesize

It should be noted that by default, U-boot has 2 environment variables unprot, and update which should be automatically defined which help with burning U-boot into NOR flash. These may be used instead of the above code, as follows: MB680  nfs  load_addr /export/u-boot.bin

MB680  run update For NAND Flash

In the case of NAND flash, the flash should be explicitly erased, prior to writing to it.

In the case of NAND, then most access operations need to be multiples of certain page/block sizes. For simplicity, the following code assumes that u-boot.bin fits in 256 KiB 0x40000. However, you may use smallest figures that are appropriately aligned. MB680  nfs  load_addr /export/u-boot.bin

MB680  nand write  load_addr 0 40000 For SPI Serial Flash

In the case of SPI serial flash, U-boot will automatically erase the flash, prior to writing to it. Hence, users may just use the eeprom write command without explicitly having to erase the SPI serial flash device at all. MB680  nfs  load_addr /export/u-boot.bin

MB680  eeprom write  load_addr 0  filesize Booting The Linux Kernel up Using mkimage To Create U-Boot Images.

U-boot and Flash (NOR, NAND & SPI)

Booting Commands. Flash Memory File System Types. Optional when used with the boot system flash command 4 Serial interfaces.

RZ/A1H Group Example of Booting from Serial Flash Memory R01AN1960EJ0101 Rev.1.01 Page 7 of 56 May. 29, 2015 5. Software 5.1 Operation Overview.

How To Boot From A USB Flash Drive. For starters this is still a developing science and most people have had good luck with at least one of these methods.

Booting Nios from Serial Flash with the new Altera Serial Flash Controller. Nios II Processor Booting From Altera Serial Flash.

Booting Nios from Serial Flash with the new Altera Serial Flash Controller

This app. note can be downloaded at the following URL:

https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/an/an736.pdf

In Quartus 14.1, Altera introduced a new serial flash loader which can be used to program and load serial and quad SPI flash devices. Here is how to properly program your Nios II executable into a serial flash so that your Nios can boot from the flash. This implementation assumes that the serial flash is simply storage and that the executable will be loaded into and executed from RAM. This has been verified with an EPCS16 serial flash.

This example uses the Quartus Programmer, not the nios2-flash-programmer only because that was the flow I needed to use when I did this.

This example uses the CFI flash bootloader and eliminates some of the problems with the programming and boot flow of the old EPCS Flash controller.

An example project containing both Quartus and Nios II SW projects can be downloaded here: File:Epcq test be micro sdk.zip. This example targets the BeMicroSDK board.

This example uses the Quartus II programmer for programming the EPCS, not the Nios II Flash Programmer, as that is what was required for this specific project.

In your Nios QSys system, instantiate and configure the Altera Serial Flash Controller

In the Nios II Configuration GUI, go to the Reset vector memory field and select:

If you are also configuring the FPGA from the EPCS/Q,

Set the Nios reset vector offset to a value larger than the size, in bytes, of the FPGA programming file this is can be determined from the. map file generated with the sof2flash --save option or by generating a. rbf file and determining it s size.

If the FPGA is configuring from serial flash, the configuration data must be at address 0x0.

Be aware that compressed file sizes will differ build to build

Regenerate your QSys system and recompile in Quartus

Regenerate your Nios II BSP with the new. sopcinfo file generated above

In order to program a bootable executable into the serial flash, the compiler output must packaged into a hex format which can be loaded into the serial flash and the boot loader must be prepended to this file. This can be done directly in the Nios 2 SBT, with make, or manually with utilities provided with the SBT.

Creating the. hex File - Option 1

In Eclipse, right click your SW project, select Make Targets from the pop-up menu, and click on Build

In the Make Targets window, select mem_init_generate, then click build.

This will build the project and create a mem_init directory in the project directory. The mem_init directory will create a loadable. hex file for each memory type in the system. The hex file with the same name as the Altera Serial Flash Controller QSys instance is the file needed to create the. jic file. In the example project, this is the file epcq_controller.hex.

Creating the. hex File - Option 2

At the Nios II Shell command line run make with mem_init_generate as follows

Creating the. hex File - Option 3

Recompile your SW project in the Nios II SBT or at the command line with make.

Convert the Nios II. elf to a. flash with the elf2flash command below.

Set the base address and the reset address to the absolute address of the Nios II reset vector. This is the computed Reset vector: field in the Nios II configuration GUI. Anything else will result in a. flash file with incorrect addresses.

--boot /ip/altera/nios2_ip/altera_nios2/boot_loader_cfi.srec --save

Convert the. flash file to an Intel Hex file

nios2-elf-objcopy --input-target srec --output-target ihex

In Quartus, open the Convert Programming File utility

Set the Programming file type: to JTAG Indirect Configuration File . jic

In Input files to convert select Flash Loader, click Add Device and choose your target FPGA device

If you are configuring the FPGA from the serial flash:

In Input files to convert select SOF Data, click Add File and select your FPGA. sof file

-With SOF Data selected, click Properties, in the SOF Data Properies dialogue box:

-Set Address mode for selected pages to to Start

Set Start address 32-bit hexidecimal: to 0x0.

In Input files to convert click Add Hex Data, in the Add Hex Data dialogue box:

Set Addressing mode to Absolute addressing

Select your hex file using the button next to the Hex file field

Check Create Memory Map File. This is useful for debugging.

Generate the. jic file and program it into the serial flash with the Quartus Programmer

Plug the BeMicroSDK board into a serial port on your computer.

Program the. jic file into the BeMicroSDK board using the Quartus II Programmer.

Press the RECFG button on the BeMicroSDK board to reconfigure the Cyclone V FPGA from the serial flash.

Launch the nios2-terminal and observe the terminal output.