Skip to content

Commit 8666278

Browse files
committed
Fix build script
1 parent 99a75ba commit 8666278

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

bootloaders/build.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
if [ $AVR_GCC_PATH == "" ]; then
1+
#!/bin/bash
2+
3+
if [ x$AVR_GCC_PATH == x"" ]; then
24
AVR_GCC_PATH=/bin/
35
fi
46

7+
echo Compiling
58
${AVR_GCC_PATH}/avr-gcc -c -g -Os -w -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -Wl,--gc-sections -w -mmcu=atmega4809 -DF_CPU=16000000L boot.c -o boot.o
69
${AVR_GCC_PATH}/avr-gcc -g -Os -w -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -nostartfiles -Wl,--gc-sections -w -mmcu=atmega4809 -DF_CPU=16000000L boot.o -o boot.elf
710

8-
${AVR_GCC_PATH}/avr-objcopy -O binary -R .fuses boot.elf boot.bin
11+
echo Extracting bin
12+
${AVR_GCC_PATH}/avr-objcopy -O ihex -R .fuses boot.elf boot.hex
913
#${AVR_GCC_PATH}avr-objcopy -O binary -j .fuses --set-section-flags=.fuses=alloc,load --no-change-warnings --change-section-lma .fuses=0 boot.elf boot.fuses
1014

15+
echo Moving hex
16+
mv boot.hex atmega4809_uart_bl.hex
17+
1118
${AVR_GCC_PATH}/../avrdude/6.3.0-arduino14/bin/avrdude -C${AVR_GCC_PATH}/../avrdude/6.3.0-arduino14/etc/avrdude.conf -v -patmega4809 -cxplainedmini_updi -Pusb -Ufuses:w:boot.fuses:r -Uflash:w:boot.bin:r

0 commit comments

Comments
 (0)