The NEORV32 default bootloader has various configuration options. Here’s how to modify and recompile it.
If you want to modify the bootloader, edit the bootloader.c file first.
Then recompile the bootloader into a .vhd
file representing the ROM:
cd lib/neorv32/sw/bootloader
make clean_all
make make bl_image
Memory utilization:
text data bss dec hex filename
4092 0 8 4100 1004 main.elf
Compiling image generator...
Generating neorv32_bootloader_image.vhd
Finally, install this file somewhere along our modified NEORV32 sources:
mv neorv32_bootloader_image.vhd ../../../../src/hdl/neorv32/neorv32_bootloader_image.vhd
In our top-level Makefile, make sure you use this file instead of the original neorv32_bootloader_image.vhd
.
Then simply re-synthesize and re-flash the FPGA firmware.
If you’re making modifications and just want to test the bootloader, you can use make exe
instead of make bl_image
and run the bootloader like a normal application.