Está en la página 1de 7

Creating a working SREC bootloader SDK project for version 12 AUTHOR: Billy Huang DATE: 2010-12-13 This project

focuses on obtaining output on the UART. It assumes that the XPS UART used is of type uart16550. This is recommended as it is well supported on Linux, should you wish to run Linux (such as TokaLin) on your Microblaze. Assumes you have a working XPS setup. This should be the case if you used a reference design and in XPS you selected Export Hardware Design to SDK. In XPS

In SDK Create a new Xilinx C project

Choose the SREC bootloader project. Next we change the BSP settings to link up the UART, otherwise you wont see anything.

Click standalone and change the value in the dropdown to your UART.

Click OK. Next you may need to modify the C code. Note SDK recompiles every time you save. If you get linker errors dont worry about these, see linker generation

below. If you get C code errors try and fix these. Below are some fixes Ive had to do. Add to the top of platform_config.h
#define STDOUT_IS_16550 #define STDOUT_BASEADDR STDOUT_BASEADDRESS

Change blconfig.h
#define FLASH_IMAGE_BASEADDR 0x87120000

To your flash image base address, i.e. where your flash file will be loaded. It should be at the flash base, plus some offset. The offset is important because generally you will have a bitstream at offset zero. So my offset is 0x00120000. This is 1179648 in decimal, so 1152 Kilobytes, so about 1MB. This should be enough of an offset to miss overwriting the end of my bitstream. Change platform.c baud rate to what you desire (generally 9600 or 115200).
XUartNs550_SetBaud(STDOUT_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, 115200);

Next we need to generate a linker script, our program wont fit in microblaze cache, it needs to go into the BRAM memory. bram_block and xps_bram_if_cntlr need to be in your XPS design to have access to this. Without this you will not be able to use your microblaze for much at all, I think all reference designs should include this anyway. In the very unlikely event it your design does not, then download the SP601 reference design and compare your microblaze with the SP601 to see how BRAM is added, or refer to the documentation. If you dont know what a linker script is, it essentially defines for a static executable (which ours is) where in memory various parts of the code should be. This of course is completely system dependant, so needs to be regenerated on different systems. Thankfully the SDK makes this process very easy.

Put everything into the BRAM.

Then click generate. That should then recompile the program okay. Running the program on the Microblaze There are a few ways to do this, I am going to explain the way which initialises the bitstream BRAM with your srec bootloader elf, loads the updated bitstream onto the FPGA and runs it. In SDK

Select your complied bootloader.elf.

And Program. With any luck you should see output on the UART. If not check the stages in this document. Confirm that you have the Correct baud rate (an example of my settings are below). Check that you have the UART NTS 16550 in your XPS project.

A view of TokaLin (not the SREC bootloader!!) is shown below.

También podría gustarte