Skip to content

Commit ecae4a9

Browse files
committed
Make boards configuration more flexible
1 parent 99caee4 commit ecae4a9

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

boards.txt

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,23 @@ uno2018.upload.protocol=xplainedmini_updi
1212
uno2018.upload.maximum_size=49152
1313
uno2018.upload.maximum_data_size=6144
1414
uno2018.upload.speed=115200
15+
uno2018.upload.extra_params=-Pusb
16+
uno2018.upload.extra_files="-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i"
1517

1618
uno2018.build.mcu=atmega4809
1719
uno2018.build.f_cpu=16000000L
1820
uno2018.build.board=AVR_UNO_WIFI_REV2
1921
uno2018.build.core=arduino
2022
uno2018.build.variant=uno2018
23+
uno2018.build.text_section_start=.text=0x200
2124
uno2018.build.extra_flags={build.328emulation} -DMILLIS_USE_TIMERB3
2225
#uno2018.build.extra_flags=-B{runtime.tools.atpack.path}/gcc/dev/{build.mcu}
2326

2427
uno2018.bootloader.tool=avrdude
2528
uno2018.bootloader.file=atmega4809_uart_bl.hex
2629
uno2018.bootloader.SYSCFG0=0xC9
2730
uno2018.bootloader.BOOTEND=0x02
31+
uno2018.bootloader.OSCCFG=0x01
2832
uno2018.fuses.file=fuses_4809.bin
2933

3034
menu.mode=Registers emulation
@@ -38,26 +42,30 @@ uno2018.menu.mode.off.build.328emulation=
3842
nona4809.name=Arduino NONA 4809
3943

4044
nona4809.vid.0=0x2341
41-
nona4809.pid.0=0x0058
45+
nona4809.pid.0=0x0557
4246

4347
nona4809.upload.tool=avrdude
4448
nona4809.upload.protocol=jtag2updi
4549
nona4809.upload.maximum_size=49152
4650
nona4809.upload.maximum_data_size=6144
4751
nona4809.upload.speed=115200
52+
nona4809.upload.use_1200bps_touch=true
53+
nona4809.upload.extra_params=-P{serial.port}
4854

4955
nona4809.build.mcu=atmega4809
5056
nona4809.build.f_cpu=16000000L
51-
nona4809.build.board=AVR_UNO_WIFI_REV2
57+
nona4809.build.board=AVR_UNO_NONA_4809
5258
nona4809.build.core=arduino
5359
nona4809.build.variant=nona4809
60+
nona4809.build.text_section_start=.text=0x0
5461
nona4809.build.extra_flags={build.328emulation} -DMILLIS_USE_TIMERB3
5562
#nona4809.build.extra_flags=-B{runtime.tools.atpack.path}/gcc/dev/{build.mcu}
5663

5764
nona4809.bootloader.tool=avrdude
5865
nona4809.bootloader.file=atmega4809_uart_bl.hex
5966
nona4809.bootloader.SYSCFG0=0xC9
6067
nona4809.bootloader.BOOTEND=0x00
68+
nona4809.bootloader.OSCCFG=0x01
6169
nona4809.fuses.file=fuses_4809.bin
6270

6371
menu.mode=Registers emulation

platform.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ compiler.warning_flags.all=-Wall -Wextra
2121
compiler.path={runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path}/bin/
2222
compiler.c.cmd=avr-gcc
2323
compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects
24-
compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -Wl,--section-start=.text=0x200
24+
compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -Wl,--section-start={build.text_section_start}
2525
compiler.c.elf.cmd=avr-gcc
2626
compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD
2727
compiler.cpp.cmd=avr-g++
@@ -104,22 +104,22 @@ tools.avrdude.upload.params.quiet=-q -q
104104
# tools.avrdude.upload.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value
105105
tools.avrdude.upload.verify=
106106
tools.avrdude.upload.params.noverify=-V
107-
tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} -Pusb -b{upload.speed} -e -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" "-Ufuse5:w:{bootloader.SYSCFG0}:m" "-Ufuse8:w:{bootloader.BOOTEND}:m" "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i"
107+
tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} {upload.extra_params} -b{upload.speed} -e -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" "-Ufuse2:w:{bootloader.OSCCFG}:m" "-Ufuse5:w:{bootloader.SYSCFG0}:m" "-Ufuse8:w:{bootloader.BOOTEND}:m" {upload.extra_files}
108108

109109
tools.avrdude.program.params.verbose=-v
110110
tools.avrdude.program.params.quiet=-q -q
111111
# tools.avrdude.program.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value
112112
tools.avrdude.program.verify=
113113
tools.avrdude.program.params.noverify=-V
114-
tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" "-Ufuse5:w:{bootloader.SYSCFG0}:m" "-Ufuse8:w:{bootloader.BOOTEND}:m" "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i"
114+
tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" "-Ufuse2:w:{bootloader.OSCCFG}:m" "-Ufuse5:w:{bootloader.SYSCFG0}:m" "-Ufuse8:w:{bootloader.BOOTEND}:m" {upload.extra_files}
115115

116116
tools.avrdude.erase.params.verbose=-v
117117
tools.avrdude.erase.params.quiet=-q -q
118118
tools.avrdude.erase.pattern=
119119

120120
tools.avrdude.bootloader.params.verbose=-v
121121
tools.avrdude.bootloader.params.quiet=-q -q
122-
tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Ufuse5:w:{bootloader.SYSCFG0}:m" "-Ufuse8:w:{bootloader.BOOTEND}:m" "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i"
122+
tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Ufuse2:w:{bootloader.OSCCFG}:m" "-Ufuse5:w:{bootloader.SYSCFG0}:m" "-Ufuse8:w:{bootloader.BOOTEND}:m" "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i"
123123

124124
tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload.verbose} -p{build.mcu}
125125

0 commit comments

Comments
 (0)