Skip to content

Releases: SpenceKonde/DxCore

1.5.0 - the big one! (treat as beta for now)

21 Dec 08:55
034a694
Compare
Choose a tag to compare

This release brings in more changes than any other DxCore or megaTinyCore release ever has.

1.5.0

  • Major Enhancement: Support the AVR DD-series parts!!
  • Major Enhancement: Update to latest version of Wire
  • Related to other libraries
    • Bugfix: Fix issue with SSD bit being cleared when using beginTransaction().
    • Bugfix: Fix bug in Logic with pin inputs being handled improperly.
    • Bugfix: Remove multiple signatures for Wire.requestFrom to fix issues with Wire with certain libraries.
    • Bugfix: long_soft_event method did not work correctly.
    • Bugfix: Correct bug(s) when waking from sleep mode via TWI (aka I2C/Wire) address match (Thanks @MX682X. You are one of our MVPs). TWI slaves should now reliably wake on address match and other wake sources from all sleep modes.
    • The big improvement is that if you don't attach an interrupt using the attachInterrupt() method, you can make your own interrupt, or just save the flash.
    • Bugfix: Logic, Event, Comparator and ZCD no longer fight if multiple are used at the same time.
  • boards.txt menu related
    • Enhancement: Improvements for menu options for all boards.
    • Enhancement: Add flash spm options for DD-series parts.
    • Bugfix: Remove notice in that MVIO requires bootloader burn to apply for non-optiboot parts (where it is not required), and add it to optiboot parts (where it is - yes, these were backwards)
    • Bugfix: Correct issue with the menu options for AVR DD-series parts, which resulting in burn bootloader bricking these chips to all who don't have an NV UPDI programmer, of which I believe only one is currently available, from Microchip, for an arm and a leg. (Special thanks to the folks who reported this before I had a chance to brick any of my own hardware)
    • Enhancement: Add WDT menu options to set the WDT fuse to forcibly enable the watchdog timer on start.
  • PWM related
    • Enhancement: Largely reimplemented the first half of analogWrite(). On parts with a TCA1, all PORTMUX options should now work, even those with only 3 pins.
    • Enhancement: Enable PORTMUX detection for TCD0 on the DD's (and it can be enabled easily for DA and DB parts if they ever fix the errata)
    • Bugfix: Correct bad pwm-related macros on 28, 32, and 20 pin DD-series parts.
  • SerialUPDI related
    • Bugfix: Fix issue with SerialUPDI uploads on updated versions of linux
    • Bugfix: Correct issue with SerialUPDI and PROGMEM_SECTIONn directives (it was tripping over the hole in the binary).
  • Serial related
    • Major Enhancement: Change class hierarchy for hardware serial ports. This results in some flash size reduction since unused virtual functions now don't have to exist. (The same thing was done for Two_Wire (Wire.h) on a very early version of megaTinyCore due to complaints about the fact that stock version of Wire wouldn't fit onto a 4k part. The Wire library has since seen a near total rewrite which further reduced flash usage). Thus, rather than pulling in api/HardwareSerial.h, and subclassing that definition of HardwareSerial (itself a subclass of Stream) to derive UartClass, we instead subclass Stream directly. This has been accompanied by changing the name of the class to HardwareSerial to ensure code compatibility (so a library could ask for a pointer to a HardwareSerial port, using that name like it would on classic AVRs) and it still works (it always did, but only because UARTclass was a subclass of HardwareSerial, which was a subclass of Stream). This saves yet more flash on top of the reduction from the 1.4.x series of versions where the ISRs were merged and rewritten in asm.
    • Enhancement: Improvement to stream timed read to make it work when millis is disabled, and to save 4 bytes of RAM.
    • Bugfix: Correct issue introduced in 1.4.x which could cause problems when receiving data over Serial.
    • Enhancement: Implement generic autobaud for Serial and some associated functionality.
  • Bootloader related
    • Enhancement: Implement a greater variety of entry conditions for the bootloader. This combined with DD increases the number of binaries I distribute to 325 for this core from 65 to 330 (the entry conditions alone would have brought it to 198. The new parts added 132 more).
    • Enhancement: Add new entry condition menu for optiboot boards.
    • Bugfix: Correct issue with spurious verification error on 128k parts using the bootloader when uploading a sketch of 64513-64024 bytes.
    • Bugfix: Correct internal flaw in the bootloader that meant the compiler could legally output a bootloader binary which would only write 314 bytes per 512 byte page, leaving the rest blank. This happened to not manifest for the previous bootloader binaries. This was purely dumb luck though, and the new ones didn't work.
    • Bugfix: Correct issue with serial on alt pins in Optiboot that never should have worked.
    • Bugfix: Account for the fact that there is no acceptable LED pin on a 14-pin DD that is viable for all serial port and mux options. We pick PD6, unless using USART1, in which case we assume the LED is on PD4.
  • Related to errors that may occur at hidden locations when using LTO (".text+0")
    • Enhancement: Add Ref_LTO to explain what LTO is, and how to disable it when you receive an error pointing .text+0 (often specifying a function that isn't even defined in the file it mentioned) so that you can get the actual location of the error. This is a pain in the ass to do, and usually you can figure it out without doing this, but uh, well sometimes you can't. That was the case for me which led to me writing this up and providing a mechanism by which the core can be made to compile (we still disable uploading if LTO is disabled - in some cases the things done to make it compile with LTO disabled do not preserve functionality).
    • Enhancement: Add clean copies of platform.txt and platform.txt without LTO/uploading, for both manual and board manager installations to extras.
  • Other
    • Enhancement: Add more part information macros (See the define list)
    • Enhancement: New Toolchain version: Azduino5 Azduino6 for DD support. Added about 4000 lines of code to core_devices.h to ensure compatibility with people who manually install on instance with the old ATPACK
    • Bugfix: Undesired quote stripping bug workaround for windows cmd /C
    • Bugfix: Correct bug with MVIO enable/disable behavior always being treated as disabled by the application code (this had little impact on actual behavior)
    • Actually make it impossible to disable warnings.
    • Enhancement: Add the MCUDude version of pinConfigure, arguments can now be separated by commas not bitwise OR's (though the old way will work).
    • Bugfix: Add the missing #defines for peripheral count and reorganize core_devices to make porting easier
    • Enhancement: Port asm millis from mTC.
    • Documentation: Document what we know about the newly announced AVR EB-series, pencil in variants for the EA and EB-series.
    • Enhancement: Rearrange Arduino.h for readability

1.4.10 - CRITICAL BUGFIX - hopefully the last

25 Mar 03:38
Compare
Choose a tag to compare

This is - hopefully - the final critical bugfix for the 1.4.0 bugs in the new attachInterrupt implementation. Now a function that happens to use the X pointer register will correctly clear the interrupt flag, instead of (attempting to) write (1<<bit) to a near random location in the first 256 bytes of the data space (consisting of the most critical of system registers, naturally), which would generally simply fail since most of those addresses are read only - in any event it would then call the interrupt continually with only 1 instruction between calls until the user reset it. So for all but te simplest attached interrupts it would slow the sketch to a crawl and optionally do something wacky. Now, instead of writing over the address of VPORT.INTFLAGS with the low byte of the X pointer, we correctly copy the address of VPORT.INTFLAGS to the low byte of the X pointer.
That's the true joy of assembly programming!
This release also:
Fixes timing problems at 1 MHz (it was off by a factor of 2), and corrects a bug in compatibility defines for CLKSEL macros for the RTC, so code written for megaTinyCore will now interoperate
People who feel a need to compile to the C++ 20 standard won't get warnings from the core over combinations of enumerated types. This makes uart_constants.h ugly, but does not change the generated code. Based on unanimous feedback, removed emulation of classicAVR pinMode() calls as regards the state of the PORTx.OUT register. Update tinyNeoPixel, should now work down to 4 MHz, and correct the assembly such that it would work even if the compiler was able to optimize calls to show() (which it can't do because it's the method of a class member - if it could, that would result in undefined behavior because the constraints are specified incorrectly).
Work around compatibility problems with libraries that assume a HardwareSerial.h file can be included if they need to subclass the hardware serial class (which is generally a very bad sign for overhead, but this isn't megaTinyCore)

Improved docs:

  • Significant additions to to information on the DD and EA-series (since the EA-series headers are now available for download - as DD headers have been for quite some time now.
  • Add list of particularly useful appnotes.
  • Clarify Ref_Optiboot. Update Errata page.
  • Fix documentation for DxCore library, which was inaccurate.

1.4.7 - CRITICAL BUGFIX for 28-pin parts

30 Jan 15:45
Compare
Choose a tag to compare

Pins 0 and 1 of PORTC, PORTD, and PORTF did not work correctly. tje pins on PORTC woi;ld actially control PA0 and PA1, trying to control PD0 and PD1 would configure PC0/PC1, and the PORTF ones would control PORTD. Impacted all parts. and was due to a simple copy-paste error in the digital_pin_to_port_PGM table.

The ADC_ACCn constants were missing.

Some error reporting improvements for serialUPDI, and some improvements to Wire documentation around setClock in the hopes of making it clear that it is at best a ballpark, because the actua; speed depends on the electrical conditions on the bus.

1.4.6 Wire buffer fix and SerialUPDI update

17 Jan 13:43
Compare
Choose a tag to compare

Prior to 1.4.6, there was a bug in wire where the address of the slave device occupied 1 byte in the fixed size buffer. So the buffer was actually 1 byte smaller than specified. Though this was rarely relevant on DxCore since everything has enough RAM that the buffer got enlarged anyway, it caused major problems for megaTinyCore, and would cause problems here in the future (ex, adafruit oled display driver displayed garbage, because 1/32nd of the bytes were lost.

SerialUPDI updated to 1.2.3 - this fixes the bug present in 1.2.0 that prevented read operations from working (I don't think it impacted the 1.1.0 that DxCore had). Added a fix that should prevent the failures writing fuses with some combinations of OS and programmer (it's not clear if that was only relevant for tinyAVR) Additionally, we have adjusted the tools -> programmer menu options to be clearer.
Also, verbose mode now works - I adjusted the priority of logging messages so -v is reasonable and shows the useful output, while -v -v is the one with too much information for almost anyone. Verbose mode uses -v
The write delay functionality (not used by DxCore) is much more accurate now.

1.4.5 - Critical bugfix for upload issues and 1.4.x bugs

10 Jan 17:00
Compare
Choose a tag to compare

1.4.x introduced a number of critical upload issues that only came to light in the past week. This should fix those issues, and the breaking changes reported with attachInterrupt and the Wire library.

1.4.4 - Fix critical upload issue

26 Dec 09:16
8130221
Compare
Choose a tag to compare

This corrects a critical bug in the 1.4.x release that prevented upload from working on non-bootloader board defs, caused by an incomplete port of a change from megaTinyCore aimed at blocking upload using programmer on bootloader boards (where it would upload a non-functional binary and trash the bootloader)

1.4.3 - Actually fix critical bug

23 Dec 03:43
Compare
Choose a tag to compare

The first emergency fix didn't actually correct the issue due to a typo.

1.4.2 - Another CRITICAL bugfx

22 Dec 05:26
Compare
Choose a tag to compare

This corrects a cryptic PCREL relocation truncated to fit error that could occur whenever a sketch larger than 8k is compiled amd serial is used in the sketch, introduced by 1.4.0 due to a bug in the assembly implementation of the Data Register Empty ISR and the polling mode used when the buffer is full.and interrupts are disabled; when it manifested it would prevent all compilation; (1.4.1 and 1.4.2 correct the same issue at different parts of the code.)

This is another MASSIVE set of updates, including some much awaited changes and fixes:

Totally Rewritten Wire library

Among other things, it supports DualMode (and master/slave without dual mode), which has been an oft-requested issue.

  • Completely new Wire.h library with exciting features - Thanks to @MX682X!
    • See the Wire library readme for more details.
    • Master + Slave on the same TWI - either using the same pins or in dual mode
    • Support for TWI1 assuming your device has it.
    • Enhanced slave functionality:
      • When set to match multiple addresses, method provided to find which address was used most recently.
      • After the master has read data from the slave, method provided to find out how many bytes were actually read.
      • Slave now has a way to test whether there is currently an ongoing transaction.
        All that, and it uses less flash too!

Serial is better now too!

That's not the only thing that's seen major rewrites: So has Serial - also thanks to @MX682X! These changes aren't as comprehensive, and I did more work here than on Wire.h (where I did virtually nothing other than the documentation). Check out the Serial Reference for more details, but in short

  • When the DD-series comes out, we will be able to support all the new pin mappings.
  • Added support for loopback, rs485, open drain mode!!
  • Added support for using event input instead of the RX pin (Untested)
  • Even added support for MSPI and synch (clocked) mode
  • Reimplemented ISRs in assembly, saving up to 1k of flash, and improving execution time such that you could receive bursts of characters at the maximum baud rate and not miss characters.

Other new features:

  • Expanded Event library. Greatly Improved functionality for portable code/libraries
  • New pinout charts. Yes, they are indeed more cluttered with text now. But I felt that information needed to be right in front of you when youare looking at the pin mapping, and I hope you all agree.
  • New USERSIG library for Dx-series parts. Has a few extra complications, but that's Microchip's fault for taking away our byte-granularity erases.
  • Major cleanup of variants, removing unnecessary garbage defines left and right.
  • Most keywords should now be highlighted as you would expect.
  • Calling millis or micros when those are disabled will result in more useful error messages. Libraries and user code can test whether millis and micros are available with #if defined(micros) and #if defined(millis)
  • Add 27 MHz external clock/crystal... Math is amazingly simple, one of the cleanest so far!
  • init_reset_flags() will automatically clear reset flags if not overridden, stashing them in GPIOR0 (chosen because has lower overhead than a variable)
  • Boards.txt and platform.txt improvements
  • Ensure that upload with programmer is not used on bootloader board definitions.
  • Include recent version of the io headers for practical reference, and the original versions for historical reference (mostly so you can view them in your web browser).

Bug Fixes

  • Correct verification bug in SerialUPDI where it would fail on a last page of the minimum size (thanks @dbuchwald!). The 1-word read takes a different codepath because it doesn't need the REP.
  • Fixed bugs in new attachInterrupt implementation
  • Correct problem with many macros and more generally with the typeof keyword (a GCC-specific extension) by switching to std=gnu++17.
  • Fix a recent regression in delayMicroseconds at 8 and 4 MHz when the delay was not a compile-time known constant
  • Somewhere along the line I realized MAPPED_PROGMEM isn't a good name because the symbol is used by the headers too, and switched to PROGMEM_MAPPED. Docs and even some libraries were never updated and were silently not using this...
  • Actually made the TCD PWM on external clock sources behave as documented.

1.4.1 - CRITICAL bugfix for 1.4.0

19 Dec 17:33
Compare
Choose a tag to compare

This corrects a cryptic PCREL relocation truncated to fit error that could occur whenever a sketch larger than 8k is compiled amd serial is used in the sketch, introduced by 1.4.0 due to a bug in the assembly implementation of the Data Register Empty ISR and the polling mode used when the buffer is full.and interrupts are disabled; when it manifsted it would prevent all compilation;

This is another MASSIVE set of updates, including some much awaited changes and fixes:

Totally Rewritten Wire library

Among other things, it supports DualMode (and master/slave without dual mode), which has been an oft-requested issue.

  • Completely new Wire.h library with exciting features - Thanks to @MX682X!
    • See the Wire library readme for more details.
    • Master + Slave on the same TWI - either using the same pins or in dual mode
    • Support for TWI1 assuming your device has it.
    • Enhanced slave functionality:
      • When set to match multiple addresses, method provided to find which address was used most recently.
      • After the master has read data from the slave, method provided to find out how many bytes were actually read.
      • Slave now has a way to test whether there is currently an ongoing transaction.
        All that, and it uses less flash too!

Serial is better now too!

That's not the only thing that's seen major rewrites: So has Serial - also thanks to @MX682X! These changes aren't as comprehensive, and I did more work here than on Wire.h (where I did virtually nothing other than the documentation). Check out the Serial Reference for more details, but in short

  • When the DD-series comes out, we will be able to support all the new pin mappings.
  • Added support for loopback, rs485, open drain mode!!
  • Added support for using event input instead of the RX pin (Untested)
  • Even added support for MSPI and synch (clocked) mode
  • Reimplemented ISRs in assembly, saving up to 1k of flash, and improving execution time such that you could receive bursts of characters at the maximum baud rate and not miss characters.

Other new features:

  • Expanded Event library. Greatly Improved functionality for portable code/libraries
  • New pinout charts. Yes, they are indeed more cluttered with text now. But I felt that information needed to be right in front of you when youare looking at the pin mapping, and I hope you all agree.
  • New USERSIG library for Dx-series parts. Has a few extra complications, but that's Microchip's fault for taking away our byte-granularity erases.
  • Major cleanup of variants, removing unnecessary garbage defines left and right.
  • Most keywords should now be highlighted as you would expect.
  • Calling millis or micros when those are disabled will result in more useful error messages. Libraries and user code can test whether millis and micros are available with #if defined(micros) and #if defined(millis)
  • Add 27 MHz external clock/crystal... Math is amazingly simple, one of the cleanest so far!
  • init_reset_flags() will automatically clear reset flags if not overridden, stashing them in GPIOR0 (chosen because has lower overhead than a variable)
  • Boards.txt and platform.txt improvements
  • Ensure that upload with programmer is not used on bootloader board definitions.
  • Include recent version of the io headers for practical reference, and the original versions for historical reference (mostly so you can view them in your web browser).

Bug Fixes

  • Correct verification bug in SerialUPDI where it would fail on a last page of the minimum size (thanks @dbuchwald!). The 1-word read takes a different codepath because it doesn't need the REP.
  • Fixed bugs in new attachInterrupt implementation
  • Correct problem with many macros and more generally with the typeof keyword (a GCC-specific extension) by switching to std=gnu++17.
  • Fix a recent regression in delayMicroseconds at 8 and 4 MHz when the delay was not a compile-time known constant
  • Somewhere along the line I realized MAPPED_PROGMEM isn't a good name because the symbol is used by the headers too, and switched to PROGMEM_MAPPED. Docs and even some libraries were never updated and were silently not using this...
  • Actually made the TCD PWM on external clock sources behave as documented.

1.3.10 - A few more critical bug fixed.

12 Nov 11:05
Compare
Choose a tag to compare

Burn bootloader was broken when BOD was enabled.
Wire.h had a bug in Wire.swap() that prevented it from compiling for most parts. Oops.
Comparator didn't compile - now it does, and there's a single codebase for this + megaTinyCore.

We also have CI running now, which didn't catch any major problems, but flagged a number of issues, now resolved, impacting library examples. Documentation and examples for EEPROM are improved, and code shared with megaTinyCore now. tinyNeoPixel works with millis disabled and comparator documentation is improved.