AR# 50209


14.1 EDK - How do you bootload an application from Platform Flash XL on the ML605?


This answer record describes how to bootload an application from the onboard Platform Flash XL (XC128F).

This tutorial assumes an ML605, AXI_EMC, DDR3, and the AXI_uartlite.


1) Ensure the MODE pins on the ML605 are set to S2[1:6] = 10011X
  • For more information on how to do this, see the ML605 Configuration Guide (UG534).

2) Build your Hardware in XPS

3) In Base System Builder, select the ML605 for your device.

4) Select DDR, Linear Flash, and UARTLITE for your peripherals.

5) Click Next until Finished.

6) In the MHS:

  • Connect the P30_CS_SEL (fpga_0_FLASH_CE_inverter_Res_pin) to ground
  • Connect the FPGA_FCS_B (new signal in your design) to the memory controller's CEN pin
  • Add the Mem_ADV_LDN port to your memory controller
  • Connect the Mem_ADV_LDN_net (new signal in your design) to the PLATFORMFLASH_L_B pin
7) Add the following (your signal names might differ slightly) to the UCF:
  • Net fpga_0_FLASH_CE_inverter_Res_pin LOC=AJ12 | IOSTANDARD=LVCMOS25;
  • Net fpga_0_FLASH_Mem_ADV_LDN_pin LOC=AC23 | IOSTANDARD=LVCMOS25;
  • Net fpga_0_FLASH_Mem_FPGA_FCS_B_pin LOC=Y24 | IOSTANDARD=LVCMOS25;
8) Comment out the following in the UCF:
  • Net fpga_0_FLASH_Mem_A_pin<7> LOC=AA23  |  IOSTANDARD=LVCMOS25;
9) Click Project -> Export Hardware Design to SDK
  • Ensure the "Include bitstream and BMM file" checkbox is selected
10) Once SDK launches, create two new Xilinx C Projects (Under File -> New)
  • Hello World
  • SREC Bootloader
11) Ensure the linker scripts for each project point to the correct memory locations (right-click on the application -> Generate Linker Script):
  • SREC Bootloader = BRAM
  • Hello World = DDR
12) Open the blconfig.h file in the SREC bootloader project.
  • Set the address to match the FLASH BASEADDR in the system.xml + 0x00F0 0000 offset.
  • For example if the FLASH starts at 0x7600 0000, you set the address to 0x76F0 0000
13) Open the bootloader.c file in the SREC bootloader project.
  • Add the following lines to the include section:
    • #include "xio.h"
    • #include "xparameters.h"
  • Add the following lines to the main() function, under init_stdout();

14) Build both applications with Ctrl-B

15) Attempt to download the SREC Bootloader to the FPGA using Xilinx Tools -> Program FPGA and selecting that elf.

  • It will fail if the board is not connected. This just runs DATA2MEM to obtain a download.bit with the SREC bootloader in it.
16) Go to Xilinx Tools -> Program Flash
  • You need to have the FPGA configured with a bitstream. The one from Step 14 should work.

17) Select your Hello World ELF file (Generally under the workspace_dir/hello_world_0/Debug/hello_world_0.elf).

18) Place a check in the box that says "Convert to Bootable SREC format".

  • If the box is greyed out, close the flashwriter window.
  • Select Xilinx Tools -> Launch Shell.
  • Navigate to your hello_world_0/Debug directory.
  • Type the following command:
    • mb-objcopy O srec hello_world_0.elf hello_world_0.srec
  • Minimize the shell, and repeat steps 15 and 16, but with the SREC selected instead of the ELF.

19) Set the flash offset to 0x00F00000.

20) Program Flash.

21) Back in SDK, click on Xilinx Tools -> Launch Shell.

22) Type in:

  • promgen -p bin -c FF -o swapped.bin -data_file up 0 hello_world_0.srec -w
  • You need to point "hello_world_0.elf.srec" to wherever your srec is saved (generally under hw_platform_0/cache)

23) Open iMPACT.

24) Click "Create PROM file" on the left side.

25) Select BPI Flash -> Configure Single FPGA -> [Green Arrow]

26) Select Virtex-6 in Step 2.

27) Select XC128F [128M].

28) [Green Arrow]

29) Select a save location you will remember.

30) File Format MCS.

31) Data Width x16.

32) Add Non-Configuration files YES.

33) Click OK.

34) Click OK on Start adding device file to Revision 0.

35) Find your download.bit under the hw_platform_0/ folder.

36) Do not add another Device File.

37) Add the swapped.bin file you made in step (18) as the non-configuration/data file.

38) Add it to address location 0x0078 0000.

39) Click Generate on the Left Side.

40) Initialize the Boundary Scan.

41) Right-Click on your device, and Add SPI/BPI flash.

42) Assign the MCS you created in (25).

43) Right-click on the device's flash, and click Program.

44) This completes the steps you need to take.

AR# 50209
Date 11/23/2016
Status Active
Type General Article
People Also Viewed