|
1 | | -if [$AVR_GCC_PATH=="" ];then |
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +if [ x$AVR_GCC_PATH== x"" ];then |
2 | 4 | AVR_GCC_PATH=/bin/ |
3 | 5 | fi |
4 | 6 |
|
| 7 | +echo Compiling |
5 | 8 | ${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 |
6 | 9 | ${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 |
7 | 10 |
|
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 |
9 | 13 | #${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 |
10 | 14 |
|
| 15 | +echo Moving hex |
| 16 | +mv boot.hex atmega4809_uart_bl.hex |
| 17 | + |
11 | 18 | ${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 |