Skip to content

Commit e124ee1

Browse files
committed
fix #569
1 parent 7212afb commit e124ee1

2 files changed

Lines changed: 87 additions & 45 deletions

File tree

ChangeLog.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ These items are in addition to what was listed under changes already in release.
1010
* Enhancement: Implement sleep library
1111
* Re-add SPI attach and detach.
1212
* Ensure libraries in sync with megaTinyCore.
13+
* Add support for DU-series to tools menus, permitting compile tests once I get the toolchain ready.
1314

1415
## 1.6.0
1516
These are typically planned for release in a future version (usually the next one) as noted.
17+
* OSCCFG is now written for Dx-series parts. We have never supported any option other that 0x00 on those parts, and the hardware only supports one other value, which starts the chip on the 32 kHz oscillator.
1618
* Support for the PTC peripheral on DA parts
1719
* Correct bug with EA-series parts having the SYSCFG0 fuse set during normal uploads, which is inappropriate, because if the UPDIPINCFG bit is not 1, the chip can only be reprogrammed with an exotic HV programmer.
1820
* Corrected a bug with EA-series parts incorrectly calculating the UPDIPINCFG bit as 0 in all cases. In combination with the above, unlucky users who were able to get an upload to attempt would promptly brick the chip, since nobody has HV programmers. Sorry bout that \o/ I'm not even certain there is a programming problem, or if I'd just attempted to program every chip I had mounted on a board....
1921
* Correct bug with EA-series parts failing to correctly configure clock speed.
20-
* Add support for EB-series to tools menus, permitting compile tests.
22+
* Add support for EB-series to tools menus, permitting compile tests once I get the toolchain ready.
23+
* Not yet expected to work.
2124
* Brutal restructuring of Arduino.h.
2225
* keywords.txt for DxCore contained numerous deficiencies of varying severities. It was rebuilt de novo. Slightly less disorganized this time.
2326
* device_timer_pins.h design deemed hopelessly defective. Functionally identical file regenerated de novo,
24-
27+
* Fix issue with 0ms SUT.
2528

2629
### 1.5.11 (Emergency fix)
2730
* At some point in the recent past, I must have angered the gods of C, and suddenly millis disabled stopped working - the system would hang (actually, with in-depth investigation, it was shown to be bootlooping - before it called init(), it was calling 0x0000 (a dirty reset) instead of eliding a weakly defined function with nothing in the body except a return, or with an empty body. Why was it doing this? And why only when millis was disabled?). millis disabled is a key piece of core functionality, necessitating an urgent fix. Moving the definitions into main.cpp resolved this issue. (#485)

megaavr/boards.txt

Lines changed: 82 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,19 @@ azduinoboard.name=Azduino Boards (Optiboot)
152152
#________________________________________#
153153
avrda.upload.tool=avrdude
154154
avrda.upload.prog_interlock=
155-
avrda.build.board=avrda
156-
avrda.build.core=dxcore
157155
avrda.upload.maximum_size=0
158156
avrda.upload.maximum_data_size=0
159157
# The maximum size and data size attributes are overridden by the selected chip. If you are avoiding specifying that somehow, there is no hope of anything working, so don't do that.
160158
# Each top-level entry supports at least a dozen parts with varying memory constraints.
159+
avrda.build.board=avrda
160+
avrda.build.core=dxcore
161161
avrda.build.f_cpu={build.speed}000000L
162162
avrda.build.text_section_start=.text=0x0
163-
avrda.build.extra_flags= {bootloader.appspm}
163+
avrda.build.extra_flags={bootloader.appspm}
164164
avrda.build.export_merged_output=false
165165
avrda.build.printf=
166166
avrda.build.flmapopts=
167167
avrda.build.attachmode=-DCORE_ATTACH_ALL
168-
169168
#----------------------------------------#
170169
# Bootloading parameters and fuses #
171170
#________________________________________#
@@ -182,9 +181,19 @@ avrda.bootloader.BOOTSIZE=0x01
182181
# Note that BOOTSIZE is overridden by App SPM menu's default option - this way is just less verbose.
183182
avrda.bootloader.avrdudestring=
184183
avrda.bootloader.pymcuprogstring=-aerase
185-
avrda.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
186184
avrda.bootloader.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
187-
185+
avrda.bootloader.supdidudefuse5=5:{bootloader.SYSCFG0}
186+
#----------------------------------------#
187+
# Upload and programming #
188+
#________________________________________#
189+
avrda.upload.tool=avrdude
190+
avrda.upload.prog_interlock=
191+
avrda.upload.maximum_size=0
192+
avrda.upload.maximum_data_size=0
193+
# The maximum size and data size attributes are overridden by the selected chip. If you are avoiding specifying that somehow, there is no hope of anything working, so don't do that.
194+
# Each top-level entry supports at least a dozen parts with varying memory constraints.
195+
avrda.program.supdidudefuse5=5:{bootloader.SYSCFG0}
196+
avrda.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
188197
#----------------------------------------#
189198
# Exported hex/lst/map names will #
190199
# indicate selected options. These #
@@ -466,7 +475,7 @@ avrda.menu.attach.oldversion.build.attachabr=.aOld
466475
# Startup time options #
467476
#________________________________________#
468477
avrda.menu.startuptime.8=8ms
469-
avrda.menu.startuptime.1=0ms
478+
avrda.menu.startuptime.0=0ms
470479
avrda.menu.startuptime.1=1ms
471480
avrda.menu.startuptime.2=2ms
472481
avrda.menu.startuptime.4=4ms
@@ -614,24 +623,16 @@ avrda.menu.WDTwindow.63msec.bootloader.wdtwindowbits=0100
614623
# #
615624
# Parameters and defaults for DB parts #
616625
#________________________________________#
617-
avrdb.upload.tool=avrdude
618-
avrdb.upload.prog_interlock=
619-
avrdb.build.board=avrdb
620626
avrdb.build.mvioenable=-DMVIO_ENABLED
627+
avrdb.build.board=avrdb
621628
avrdb.build.core=dxcore
622-
avrdb.upload.maximum_size=0
623-
avrdb.upload.maximum_data_size=0
624-
# The maximum size and data size attributes are overridden by the selected chip. If you are avoiding specifying that somehow, there is no hope of anything working, so don't do that.
625-
# Each top-level entry supports at least a dozen parts with varying memory constraints.
626629
avrdb.build.f_cpu={build.speed}000000L
627630
avrdb.build.text_section_start=.text=0x0
628631
avrdb.build.extra_flags= {bootloader.appspm} {build.mvioenable}
629632
avrdb.build.export_merged_output=false
630-
avrdb.build.mcupostfix=
631633
avrdb.build.printf=
632634
avrdb.build.flmapopts=
633635
avrdb.build.attachmode=-DCORE_ATTACH_ALL
634-
635636
#----------------------------------------#
636637
# Bootloading parameters and fuses #
637638
#________________________________________#
@@ -646,11 +647,22 @@ avrdb.bootloader.SYSCFG0=0b1100{bootloader.resetpinbit}0{bootloader.eesavebit}
646647
avrdb.bootloader.SYSCFG1=0b000{bootloader.mviobits}{bootloader.sutbits}
647648
avrdb.bootloader.CODESIZE=0x00
648649
avrdb.bootloader.BOOTSIZE=0x01
650+
# Note that BOOTSIZE is overridden by App SPM menu's default option - this way is just less verbose.
649651
avrdb.bootloader.avrdudestring=
650652
avrdb.bootloader.pymcuprogstring=-aerase
651-
avrdb.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
652653
avrdb.bootloader.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
653-
654+
avrdb.bootloader.supdidudefuse5=5:{bootloader.SYSCFG0}
655+
#----------------------------------------#
656+
# Upload and programming #
657+
#________________________________________#
658+
avrdb.upload.tool=avrdude
659+
avrdb.upload.prog_interlock=
660+
avrdb.upload.maximum_size=0
661+
avrdb.upload.maximum_data_size=0
662+
# The maximum size and data size attributes are overridden by the selected chip. If you are avoiding specifying that somehow, there is no hope of anything working, so don't do that.
663+
# Each top-level entry supports at least a dozen parts with varying memory constraints.
664+
avrdb.program.supdidudefuse5=5:{bootloader.SYSCFG0}
665+
avrdb.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
654666
#----------------------------------------#
655667
# Exported hex/lst/map names will #
656668
# indicate selected options. These #
@@ -1109,43 +1121,48 @@ avrdb.menu.flmap.locksection0.build.flmapabr=.fl0
11091121
# #
11101122
# Parameters and defaults for DD parts #
11111123
#________________________________________#
1112-
avrdd.upload.tool=avrdude
1113-
avrdd.upload.prog_interlock=
1114-
avrdd.build.board=avrdd
11151124
avrdd.build.mvioenable=-DMVIO_ENABLED
1125+
avrdd.build.board=avrdd
11161126
avrdd.build.core=dxcore
1117-
avrdd.upload.maximum_size=0
1118-
avrdd.upload.maximum_data_size=0
1119-
# The maximum size and data size attributes are overridden by the selected chip. If you are avoiding specifying that somehow, there is no hope of anything working, so don't do that.
1120-
# Each top-level entry supports at least a dozen parts with varying memory constraints.
11211127
avrdd.build.f_cpu={build.speed}000000L
11221128
avrdd.build.text_section_start=.text=0x0
11231129
avrdd.build.defaultswaps=
11241130
avrdd.build.extra_flags= {bootloader.appspm} {build.mvioenable} {build.defaultswaps}
11251131
avrdd.build.export_merged_output=false
1126-
avrdd.build.highestcb=B2
11271132
avrdd.build.printf=
11281133
avrdd.build.flmapopts=
11291134
avrdd.build.attachmode=-DCORE_ATTACH_ALL
1130-
11311135
#----------------------------------------#
11321136
# Bootloading parameters and fuses #
11331137
#________________________________________#
11341138
avrdd.bootloader.tool=avrdude
11351139
avrdd.bootloader.WDTCFG=0b{bootloader.wdtwindowbits}{bootloader.wdttimeoutbits}
11361140
# AVR Dx-series can only take either 1 (unsupported, 32 kHz, too slow for serial, and 1/30th of the minimum speed we support) or 0 (normal operation)
1137-
avrda.bootloader.OSCCFG=0b00000000
1141+
avrdd.bootloader.OSCCFG=0b00000000
11381142
avrdd.bootloader.wdtwindowbits=0000
11391143
avrdd.bootloader.wdttimeotbits=0000
11401144
avrdd.bootloader.BODCFG=0b{bootloader.bodlevbits}{bootloader.bodmodebits}
1141-
avrdd.bootloader.SYSCFG0=0b110{bootloader.updipinbit}{bootloader.resetpinbit}00{bootloader.eesavebit}
1145+
avrdd.bootloader.SYSCFG0=0b1101{bootloader.resetpinbit}0{bootloader.eesavebit}
11421146
avrdd.bootloader.SYSCFG1=0b000{bootloader.mviobits}{bootloader.sutbits}
11431147
avrdd.bootloader.CODESIZE=0x00
11441148
avrdd.bootloader.BOOTSIZE=0x01
1149+
# Note that BOOTSIZE is overridden by App SPM menu's default option - this way is just less verbose.
11451150
avrdd.bootloader.avrdudestring=
11461151
avrdd.bootloader.pymcuprogstring=-aerase
1147-
avrdd.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
11481152
avrdd.bootloader.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
1153+
avrdd.bootloader.supdidudefuse5=5:{bootloader.SYSCFG0}
1154+
#----------------------------------------#
1155+
# Upload and programming #
1156+
#________________________________________#
1157+
avrdd.upload.tool=avrdude
1158+
avrdd.upload.prog_interlock=
1159+
avrdd.upload.maximum_size=0
1160+
avrdd.upload.maximum_data_size=0
1161+
# The maximum size and data size attributes are overridden by the selected chip. If you are avoiding specifying that somehow, there is no hope of anything working, so don't do that.
1162+
# Each top-level entry supports at least a dozen parts with varying memory constraints.
1163+
avrdd.program.supdidudefuse5=
1164+
avrdd.program.avrdudefuse5=
1165+
11491166

11501167
#----------------------------------------#
11511168
# Exported hex/lst/map names will #
@@ -1617,12 +1634,8 @@ avrdd.menu.flmap.locksection0.build.flmapabr=.fl0
16171634
# #
16181635
# Parameters and defaults for EA parts #
16191636
#________________________________________#
1620-
avrea.upload.tool=avrdude
1621-
avrea.upload.prog_interlock=
16221637
avrea.build.board=avrea
16231638
avrea.build.core=dxcore
1624-
avrea.upload.maximum_size=0
1625-
avrea.upload.maximum_data_size=0
16261639
# The maximum size and data size attributes are overridden by the selected chip. If you are avoiding specifying that somehow, there is no hope of anything working, so don't do that.
16271640
# Each top-level entry supports at least a dozen parts with varying memory constraints.
16281641
avrea.build.f_cpu={build.speed}000000L
@@ -1648,9 +1661,17 @@ avrea.bootloader.CODESIZE=0x00
16481661
avrea.bootloader.BOOTSIZE=0x01
16491662
avrea.bootloader.avrdudestring=
16501663
avrea.bootloader.pymcuprogstring=-aerase
1651-
avrea.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
16521664
avrea.bootloader.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
1653-
1665+
avrea.bootloader.supdidudefuse5=5:{bootloader.SYSCFG0}
1666+
#----------------------------------------#
1667+
# Upload and programming #
1668+
#________________________________________#
1669+
avrea.program.avrdudefuse5=
1670+
avrea.program.supdidudefuse5=
1671+
avrea.upload.tool=avrdude
1672+
avrea.upload.prog_interlock=
1673+
avrea.upload.maximum_size=0
1674+
avrea.upload.maximum_data_size=0
16541675
#----------------------------------------#
16551676
# Exported hex/lst/map names will #
16561677
# indicate selected options. These #
@@ -1953,7 +1974,7 @@ avrea.menu.attach.oldversion.build.attachabr=.aOld
19531974
# Startup time options #
19541975
#________________________________________#
19551976
avrea.menu.startuptime.8=8ms
1956-
avrea.menu.startuptime.1=0ms
1977+
avrea.menu.startuptime.0=0ms
19571978
avrea.menu.startuptime.1=1ms
19581979
avrea.menu.startuptime.2=2ms
19591980
avrea.menu.startuptime.4=4ms
@@ -2116,8 +2137,17 @@ avreb.bootloader.CODESIZE=0x00
21162137
avreb.bootloader.BOOTSIZE=0x01
21172138
avreb.bootloader.avrdudestring=
21182139
avreb.bootloader.pymcuprogstring=-aerase
2119-
avreb.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
21202140
avreb.bootloader.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
2141+
avreb.bootloader.supdidudefuse5=5:{bootloader.SYSCFG0}
2142+
#----------------------------------------#
2143+
# Upload and programming #
2144+
#________________________________________#
2145+
avreb.program.avrdudefuse5=
2146+
avreb.program.supdidudefuse5=
2147+
avreb.upload.tool=avrdude
2148+
avreb.upload.prog_interlock=
2149+
avreb.upload.maximum_size=0
2150+
avreb.upload.maximum_data_size=0
21212151

21222152
#----------------------------------------#
21232153
# Exported hex/lst/map names will #
@@ -2401,7 +2431,7 @@ avreb.menu.attach.oldversion.build.attachabr=.aOld
24012431
# Startup time options #
24022432
#________________________________________#
24032433
avreb.menu.startuptime.8=8ms
2404-
avreb.menu.startuptime.1=0ms
2434+
avreb.menu.startuptime.0=0ms
24052435
avreb.menu.startuptime.1=1ms
24062436
avreb.menu.startuptime.2=2ms
24072437
avreb.menu.startuptime.4=4ms
@@ -2537,7 +2567,10 @@ avrdaopti.build.export_merged_output=true
25372567
avrdaopti.build.printf=
25382568
avrdaopti.build.flmapopts=
25392569
avrdaopti.build.attachmode=-DCORE_ATTACH_ALL
2540-
2570+
avrdaopti.bootloader.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
2571+
avrdaopti.bootloader.supdidudefuse5=5:{bootloader.SYSCFG0}
2572+
avrdaopti.program.supdidudefuse5=5:{bootloader.SYSCFG0}
2573+
avrdaopti.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
25412574
#----------------------------------------#
25422575
# Bootloading parameters and fuses #
25432576
#________________________________________#
@@ -2824,7 +2857,7 @@ avrdaopti.menu.attach.oldversion.build.attachabr=.aOld
28242857
# Startup time options #
28252858
#________________________________________#
28262859
avrdaopti.menu.startuptime.8=8ms
2827-
avrdaopti.menu.startuptime.1=0ms
2860+
avrdaopti.menu.startuptime.0=0ms
28282861
avrdaopti.menu.startuptime.1=1ms
28292862
avrdaopti.menu.startuptime.2=2ms
28302863
avrdaopti.menu.startuptime.4=4ms
@@ -3047,7 +3080,10 @@ avrdbopti.bootloader.CODESIZE=0x00
30473080
avrdbopti.bootloader.BOOTSIZE=0x01
30483081
avrdbopti.bootloader.avrdudestring=-Uflash:w:{bootloader.file}:i
30493082
avrdbopti.bootloader.pymcuprogstring=-f "{bootloader.file}" -a write
3050-
3083+
avrdbopti.bootloader.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
3084+
avrdbopti.bootloader.supdidudefuse5=5:{bootloader.SYSCFG0}
3085+
avrdbopti.program.supdidudefuse5=5:{bootloader.SYSCFG0}
3086+
avrdbopti.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
30513087
#----------------------------------------#
30523088
# Upload parameters for Optiboot #
30533089
#________________________________________#
@@ -3591,7 +3627,10 @@ avrddopti.bootloader.CODESIZE=0x00
35913627
avrddopti.bootloader.BOOTSIZE=0x01
35923628
avrddopti.bootloader.avrdudestring=-Uflash:w:{bootloader.file}:i
35933629
avrddopti.bootloader.pymcuprogstring=-f "{bootloader.file}" -a write
3594-
3630+
avrddopti.bootloader.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
3631+
avrddopti.bootloader.supdidudefuse5=5:{bootloader.SYSCFG0}
3632+
avrddopti.program.supdidudefuse5=5:{bootloader.SYSCFG0}
3633+
avrddopti.program.avrdudefuse5="-Ufuse5:w:{bootloader.SYSCFG0}:m"
35953634
#----------------------------------------#
35963635
# Upload parameters for Optiboot #
35973636
#________________________________________#

0 commit comments

Comments
 (0)