2021-06-14 00:09:38 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf build
|
|
|
|
mkdir -p build
|
|
|
|
|
2021-06-27 18:45:36 +02:00
|
|
|
hex2bin()
|
|
|
|
{
|
|
|
|
local name="$1"
|
|
|
|
|
|
|
|
makebin build/$name.ihx build/$name.bin
|
|
|
|
dd if=bootloader.bin of=build/$name.bin conv=notrunc &>/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
# build stock FW
|
|
|
|
|
|
|
|
cpp -P -nostdinc -I. -D__ASM_ONLY__ stock-ivt.asm build/stock-ivt.asm
|
|
|
|
sdas8051 -plosgff build/stock-ivt.rel build/stock-ivt.asm
|
|
|
|
|
2021-08-31 19:00:18 +02:00
|
|
|
echo "Stock FW"
|
2021-06-27 18:45:36 +02:00
|
|
|
sdcc \
|
|
|
|
-mmcs51 --iram-size 256 --xram-size 2048 \
|
|
|
|
--code-size 0x2000 --code-loc 0x2130 \
|
|
|
|
-Wl-bIVECT=0x2000 \
|
|
|
|
-I. \
|
|
|
|
-DFW_REVISION_STR="\"$(git describe) $(git log -1 --format=%cd --date=iso)\"" \
|
|
|
|
-DCONFIG_STOCK_FW=1 \
|
2023-02-17 17:30:55 +01:00
|
|
|
-DCONFIG_USB_STACK=0 \
|
|
|
|
-DCONFIG_SELFTEST=0 \
|
2021-06-27 18:45:36 +02:00
|
|
|
build/stock-ivt.rel main.c \
|
|
|
|
-o build/fw-stock.ihx
|
|
|
|
|
|
|
|
hex2bin fw-stock
|
|
|
|
|
|
|
|
# build user FW
|
|
|
|
|
|
|
|
echo User FW
|
|
|
|
sdcc \
|
|
|
|
-mmcs51 --iram-size 255 --xram-size 2048 \
|
|
|
|
--code-size 0x4000 --code-loc 0x4000 \
|
|
|
|
-I. \
|
|
|
|
-DFW_REVISION_STR="\"$(git describe) $(git log -1 --format=%cd --date=iso)\"" \
|
|
|
|
-DCONFIG_STOCK_FW=0 \
|
|
|
|
-DCONFIG_USB_STACK=0 \
|
|
|
|
-DCONFIG_DEBUG_LOG=1 \
|
|
|
|
-DCONFIG_SELFTEST=0 \
|
|
|
|
main.c \
|
|
|
|
-o build/fw-user.ihx
|
|
|
|
|
|
|
|
hex2bin fw-user
|