Skip to content

Commit 1c620dc

Browse files
committed
Fix EEPROM being erased by upload
Need to issue "Burn bootloader" to make it effective
1 parent 2385473 commit 1c620dc

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

Diff for: boards.txt

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ uno2018.build.core=arduino
2020
uno2018.build.variant=uno2018
2121
#uno2018.build.extra_flags=-B{runtime.tools.atpack.path}/gcc/dev/{build.mcu}
2222

23+
uno2018.bootloader.tool=avrdude
24+
uno2018.bootloader.SYSCFG0=0xC9
25+
uno2018.fuses.file=fuses_4809.bin
26+
2327
menu.mode=Registers emulation
2428
uno2018.menu.mode.on=ATMEGA328
2529
uno2018.menu.mode.on.build.extra_flags=-DUNO_WIFI_REV2_328MODE

Diff for: fuses/fuses_4809.bin

9 Bytes
Binary file not shown.

Diff for: libraries/EEPROM/src/EEPROM.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct EEPROMClass{
124124
//STL and C++11 iteration capability.
125125
EEPtr begin() { return 0x00; }
126126
EEPtr end() { return length(); } //Standards requires this to be the item after the last valid entry. The returned pointer is invalid.
127-
uint16_t length() { return E2END + 1; }
127+
uint16_t length() { return EEPROM_SIZE; }
128128

129129
//Functionality to 'get' and 'put' objects to and from EEPROM.
130130
template< typename T > T &get( int idx, T &t ){

Diff for: platform.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {
113113

114114
tools.avrdude.erase.params.verbose=-v
115115
tools.avrdude.erase.params.quiet=-q -q
116-
tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m
116+
tools.avrdude.erase.pattern=
117117

118118
tools.avrdude.bootloader.params.verbose=-v
119119
tools.avrdude.bootloader.params.quiet=-q -q
120-
tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m
120+
tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Ufuses:w:{runtime.platform.path}/fuses/{fuses.file}:r"
121121

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

Diff for: programmers.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
medbg.name=Atmel mEDBG
1+
medbg.name=Onboard Atmel mEDBG (UNO WiFi Rev2)
22
medbg.communication=usb
3-
medbg.protocol=xplainedpro_updi
4-
medbg.program.protocol=xplainedpro_updi
3+
medbg.protocol=xplainedmini_updi
4+
medbg.program.protocol=xplainedmini_updi
55
medbg.program.tool=avrdude
66
medbg.program.extra_params=-Pusb

0 commit comments

Comments
 (0)