stnolting / neorv32

:desktop_computer: A small, customizable and extensible MCU-class 32-bit RISC-V soft-core CPU and microcontroller-like SoC written in platform-independent VHDL.
https://neorv32.org
BSD 3-Clause "New" or "Revised" License
1.58k stars 223 forks source link

bootloader makefile #1070

Closed mahdi259 closed 4 hours ago

mahdi259 commented 5 hours ago

Hi I appreciate utilization of parameters in bootloader image generator. Unfortunately some parameters are not recognized and I'm not able to change them in make command. Any idea?

make USER_FLAGS+=-DUART_BAUD=115200 USER_FLAGS+=-SPI_FLASH_SECTOR_SIZE=4096 clean_all bootloader

And the result is:

/content/neorv32/sw/bootloader
riscv32-unknown-elf-gcc: error: unrecognized command-line option '-SPI_FLASH_SECTOR_SIZE=4096'
make: *** [../../sw/common/common.mk:172: bootloader.c.o] Error 1
stnolting commented 4 hours ago

You need to put a -D in front of each define that you want to alter. Just add this to your SPI flash definition and it should work:

make USER_FLAGS+=-DUART_BAUD=115200 USER_FLAGS+=-DSPI_FLASH_SECTOR_SIZE=4096 clean_all bootloader
mahdi259 commented 4 hours ago

Thanks a lot

mahdi259 commented 4 hours ago

May I ask what -D does?

stnolting commented 4 hours ago

It is just a GCC preprocessor flag: https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html

It basically (re-)defines a #define.

mahdi259 commented 3 hours ago

Thanks a lot