General Project Setup
One of the most important points here is that if you’re attempting to create an embedded system is that your linker script is setup properly. When using LWIP, I had to increase the heap and stack size of my main application to 0x0A00 as seen below.
From the SDK, create a default bootloader (srec_bootloader)
Here’s it’s linker script…
Ensure that in your blconfig.h file you have the following line
#define FLASH_IMAGE_BASEADDR 0x87200000
This tells the bootloader where to begin pulling the SREC data (your actual executable application)
Program the FPGA w/ the system bit file and the srec bootloader.
Take the download.bit file from the hardware platform
Run the following commands
impact -batch make_bpi_up.impact
xmcsutil -accept_notice -18 pi outfile.hex -o bootloader.bin
(The last command above creates a bootable image w/ your FPGA bit file and the bootloader)
Program your application @ the offset specified by your bootloader using XSDK…
Next, program the bootloader @ 0x0 using XSDK
Note, when you’re selecting “Program Flash” from XSDK, you’ll need to browse to the bootloader.bin and select * as opposed to “.bin;.elf;*.srec” in the file type filter in the browser window so you’ll be able to select the bootloader.bin file itself.
Let me know if you need me to clarify any of the steps in the comments below
The make_bpi_up.impact file consists of the following
setPreference -pref StartupClock:Auto_Correction
addPromDevice -p 1 -size 32768
addDesign -version 0 -startaddress 000000
addDeviceChain -index 0
addDevice -p 1 -file download.bit
generate -format hex -fillvalue FF -output outfile