Skip to content

Commit

Permalink
assorted changes and fices
Browse files Browse the repository at this point in the history
  • Loading branch information
SpenceKonde committed Oct 10, 2024
1 parent ad01c83 commit a2a3331
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 55 deletions.
94 changes: 58 additions & 36 deletions megaavr/boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ menu.bootloader-class=Bootloader type (installed by burn + must match 2 upload)
avrda.name=AVR DA-series (no bootloader)
avrdb.name=AVR DB-series (no bootloader)
avrdd.name=AVR DD-series (no bootloader)
#avrdu.name=AVR DU-series (no bootloader)
avrdu.name=AVR DU-series (no bootloader)
avrea.name=AVR EA-series (no bootloader)
#avreb.name=AVR EB-series (no bootloader)
avreb.name=AVR EB-series (no bootloader)
avrdaopti.name=AVR DA-series (Optiboot)
avrdbopti.name=AVR DB-series (Optiboot)
avrddopti.name=AVR DD-series (Optiboot)
Expand Down Expand Up @@ -254,6 +254,27 @@ avrda.menu.chip.avr32da48.upload.maximum_size=32768
avrda.menu.chip.avr32da48.upload.maximum_data_size=4096
avrda.menu.chip.avr32da48.build.variant=48pin-standard

avrda.menu.chip.avr128da28s=AVR128DA28S
avrda.menu.chip.avr128da28s.build.mcu=avr128da28
avrda.menu.chip.avr128da28s.upload.maximum_size=131072
avrda.menu.chip.avr128da28s.upload.maximum_data_size=16384
avrda.menu.chip.avr128da28s.build.variant=28pin-standard
avrda.menu.chip.avr128da32s=AVR128DA32S
avrda.menu.chip.avr128da32s.build.mcu=avr128da32
avrda.menu.chip.avr128da32s.upload.maximum_size=131072
avrda.menu.chip.avr128da32s.upload.maximum_data_size=16384
avrda.menu.chip.avr128da32s.build.variant=32pin-standard
avrda.menu.chip.avr128da48s=AVR128DA48S
avrda.menu.chip.avr128da48s.build.mcu=avr128da48
avrda.menu.chip.avr128da48s.upload.maximum_size=131072
avrda.menu.chip.avr128da48s.upload.maximum_data_size=16384
avrda.menu.chip.avr128da48s.build.variant=48pin-standard
avrda.menu.chip.avr128da64s=AVR128DA64S
avrda.menu.chip.avr128da64s.build.mcu=avr128da64
avrda.menu.chip.avr128da64s.upload.maximum_size=131072
avrda.menu.chip.avr128da64s.upload.maximum_data_size=16384
avrda.menu.chip.avr128da64s.build.variant=64pin-standard

#----------------------------------------#
# Clock speed and source options #
#________________________________________#
Expand Down Expand Up @@ -1937,43 +1958,43 @@ avrea.menu.wiremode.mands.build.wireabr=.wA
# SPM from app mode #
# To enable writing flash from app #
#_____________________________________#
avrea.menu.appspm.no=Disabled (Always use this - Other options UNSUPPORTED on EA!)
avrea.menu.appspm.no=Disabled (SPM write from app is not yet supported)
avrea.menu.appspm.no.bootloader.appspm=
avrea.menu.appspm.no.bootloader.BOOTSIZE=0x00
avrea.menu.appspm.no.build.appspmabr=
avrea.menu.appspm.full=Anywhere after 0x0200 (warning: App allowed to overwrite itself)
avrea.menu.appspm.full.bootloader.appspm=-DSPM_FROM_APP=-1
avrea.menu.appspm.full.build.appspmabr=.spmALL
avrea.menu.appspm.8plus=Above 8k (meant for 16k parts)
avrea.menu.appspm.8plus.bootloader.appspm=-DSPM_FROM_APP=32
avrea.menu.appspm.8plus.bootloader.CODESIZE=32
avrea.menu.appspm.12plus=Above 12k (meant for 16k parts)
avrea.menu.appspm.12plus.bootloader.appspm=-DSPM_FROM_APP=48
avrea.menu.appspm.12plus.bootloader.CODESIZE=48
avrea.menu.appspm.14plus=Above 14k (meant for 16k parts)
avrea.menu.appspm.14plus.bootloader.appspm=-DSPM_FROM_APP=56
avrea.menu.appspm.14plus.bootloader.CODESIZE=56
avrea.menu.appspm.16plus=Above 16k (AVR64/32 only, meant for 32k parts)
avrea.menu.appspm.16plus.bootloader.appspm=-DSPM_FROM_APP=64
avrea.menu.appspm.16plus.bootloader.CODESIZE=64
avrea.menu.appspm.24plus=Above 24k (AVR64/32 only, meant for 32k parts)
avrea.menu.appspm.24plus.bootloader.appspm=-DSPM_FROM_APP=96
avrea.menu.appspm.24plus.bootloader.CODESIZE=96
avrea.menu.appspm.28plus=Above 28k (AVR64/32 only, meant for 32k parts)
avrea.menu.appspm.28plus.bootloader.appspm=-DSPM_FROM_APP=112
avrea.menu.appspm.28plus.bootloader.CODESIZE=112
avrea.menu.appspm.32plus=Above 32k (AVR64 only)
avrea.menu.appspm.32plus.bootloader.appspm=-DSPM_FROM_APP=128
avrea.menu.appspm.32plus.bootloader.CODESIZE=128
avrea.menu.appspm.48plus=Above 48k (AVR64 only)
avrea.menu.appspm.48plus.bootloader.appspm=-DSPM_FROM_APP=192
avrea.menu.appspm.48plus.bootloader.CODESIZE=192
avrea.menu.appspm.56plus=Above 56k (AVR64 only)
avrea.menu.appspm.56plus.bootloader.appspm=-DSPM_FROM_APP=224
avrea.menu.appspm.56plus.bootloader.CODESIZE=224
avrea.menu.appspm.60plus=Above 60k (AVR64 only)
avrea.menu.appspm.60plus.bootloader.appspm=-DSPM_FROM_APP=240
avrea.menu.appspm.60plus.bootloader.CODESIZE=240
#avrea.menu.appspm.full=Anywhere after 0x0200 (warning: App allowed to overwrite itself)
#avrea.menu.appspm.full.bootloader.appspm=-DSPM_FROM_APP=-1
#avrea.menu.appspm.full.build.appspmabr=.spmALL
#avrea.menu.appspm.8plus=Above 8k (meant for 16k parts)
#avrea.menu.appspm.8plus.bootloader.appspm=-DSPM_FROM_APP=32
#avrea.menu.appspm.8plus.bootloader.CODESIZE=32
#avrea.menu.appspm.12plus=Above 12k (meant for 16k parts)
#avrea.menu.appspm.12plus.bootloader.appspm=-DSPM_FROM_APP=48
#avrea.menu.appspm.12plus.bootloader.CODESIZE=48
#avrea.menu.appspm.14plus=Above 14k (meant for 16k parts)
#avrea.menu.appspm.14plus.bootloader.appspm=-DSPM_FROM_APP=56
#avrea.menu.appspm.14plus.bootloader.CODESIZE=56
#avrea.menu.appspm.16plus=Above 16k (AVR64/32 only, meant for 32k parts)
#avrea.menu.appspm.16plus.bootloader.appspm=-DSPM_FROM_APP=64
#avrea.menu.appspm.16plus.bootloader.CODESIZE=64
#avrea.menu.appspm.24plus=Above 24k (AVR64/32 only, meant for 32k parts)
#avrea.menu.appspm.24plus.bootloader.appspm=-DSPM_FROM_APP=96
#avrea.menu.appspm.24plus.bootloader.CODESIZE=96
#avrea.menu.appspm.28plus=Above 28k (AVR64/32 only, meant for 32k parts)
#avrea.menu.appspm.28plus.bootloader.appspm=-DSPM_FROM_APP=112
#avrea.menu.appspm.28plus.bootloader.CODESIZE=112
#avrea.menu.appspm.32plus=Above 32k (AVR64 only)
#avrea.menu.appspm.32plus.bootloader.appspm=-DSPM_FROM_APP=128
#avrea.menu.appspm.32plus.bootloader.CODESIZE=128
#avrea.menu.appspm.48plus=Above 48k (AVR64 only)
#avrea.menu.appspm.48plus.bootloader.appspm=-DSPM_FROM_APP=192
#avrea.menu.appspm.48plus.bootloader.CODESIZE=192
#avrea.menu.appspm.56plus=Above 56k (AVR64 only)
#avrea.menu.appspm.56plus.bootloader.appspm=-DSPM_FROM_APP=224
#avrea.menu.appspm.56plus.bootloader.CODESIZE=224
#avrea.menu.appspm.60plus=Above 60k (AVR64 only)
#avrea.menu.appspm.60plus.bootloader.appspm=-DSPM_FROM_APP=240
#avrea.menu.appspm.60plus.bootloader.CODESIZE=240

#----------------------------------------#
# WDT MODE #
Expand Down Expand Up @@ -3594,6 +3615,7 @@ avrddopti.menu.flmap.lockdefault.build.flmapabr=.fld
avrddopti.menu.flmap.unlocked.build.flmapabr=.ful
avrddopti.menu.flmap.locksection0.build.flmapabr=.fl0


##########################################################################
# #
# ### # # #### ##### ### ### # #
Expand Down
4 changes: 2 additions & 2 deletions megaavr/cores/dxcore/UART_swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
// This is a MUCH simpler case - swap is trivial on those.
#define HWSERIAL_MUX_TINY
#else
#error "This part is unsupported, or there is a bug in the core or a problem with your toolchain."
#error "This part is unsupported, or there is a bug in the core or a problem with your toolchain. A USART struct exists, but cannot find registers that should be there. This can't happen - something is wrong"
#endif

/* Okay, now we know what the mux register is, and whether it's a tiny-like mux or a Dx-like one. */
Expand All @@ -92,7 +92,7 @@
#error "Only one USART, but this is a core for modern AVRs, and it's NOT a tinyAVR 0/1 or EB-series. Something is wrong!"
// #warning "Only one USART, but this is not a tinyAVR. Something is wrong!"
#else
#error "No USARTs detected, all supported parts have at least 2, something is wrong!"
#error "No USARTs detected, all supported parts have one or more - and this is a cant-happen anywauy. Something is wrong!"
#endif
#endif
#endif
Expand Down
22 changes: 5 additions & 17 deletions megaavr/cores/dxcore/core_devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -809,22 +809,10 @@
#define ERRATA_DOES_NOT_APPLY (0)

#define checkErrata(errata) (errata == ERRATA_DOES_NOT_APPLY ? ERRATA_DOES_NOT_APPLY : (errata==ERRATA_IRREL ? ERRATA_DOES_NOT_APPLY : (errata > SYSCFG_REVID ? ERRATA_DOES_APPLY : ERRATA_DOES_NOT_APPLY)))
/* YARGH! **NOT** **A** **COMPILETIME** **TEST** */
/* You can't control #defines with it.

/* When they're fixed, we'll replace these with a macro to check REVID and return 1 or 0 appropriately. */
/* aaahahahah! Sorry...
... I meant, *if* they're ever fixed.
Highly unlikely events come in groups, so if they get fixed, maybe put on a jacket or something as a precaution....
just in case a pig coming in for a landing collides with you on your way to claim your lottery jackpot, killing you...
And if in that unlikely event, contrary to your expectations, you end up in hell, yet find, instead of fire and brimstone there's just ice as far as you
can see, the jacket will make etenal damnation to a frozen-over hell a bit less miserable.
That's how pessimistic I am left feeling about the prospects for errata fixes by this point
*/

/* Okay, so what is all of this relevant errata?
* Uhm, okay, why don't you take a seat, we're gonna be here a while */
DB silicon with die rev 0x11 is available.
/* See Ref_Errata.md in the documentation, and the official errata document for more information.
// The 128DA had a few unique and nasty ones. */
Expand Down Expand Up @@ -863,8 +851,8 @@ That's how pessimistic I am left feeling about the prospects for errata fixes by

// And both DA and DB had a whole slew of issues
#if defined(__AVR_DA__) || defined(__AVR_DB__)
#define ERRATA_TCD_PORTMUX (1) // *thud* *thud* *thud* - the sound of an embedded developer banging his head on the desk leaving a dent.
#define ERRATA_DAC_DRIFT (1) // How much drift? I dunno - enough for Microchip to feel a need to add an erratum about it, but too much for them to be comfortable sharing any numbers.
#define ERRATA_TCD_PORTMUX (1) // One of the most irritating erratums
#define ERRATA_DAC_DRIFT (1) // How much drift? I dunno - enough for Microchip to feel a need to add an erratum about it.
#define ERRATA_TCA_RESTART (1) // Is resets the direction, like the datasheet said. Appaently both the documentation and the silicon were wrong, it's not supposed to.
#define ERRATA_CCL_PROTECTION (1) // Busted on all pre-DD parts
#define ERRATA_TCD_ASYNC_COUNTPSC (1) // Busted on all pre-DD parts
Expand Down

0 comments on commit a2a3331

Please sign in to comment.