Skip to content

Commit

Permalink
Document the bug in <avr/eeprom.h> that prompted #155
Browse files Browse the repository at this point in the history
  • Loading branch information
SpenceKonde authored Mar 22, 2020
1 parent 3c26842 commit f5972ce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@ Note that, if you have UPDI programming enabled, and desire the convenience of a

# Known Compiler Bugs
* Sometimes a sketch which is too big to fit will, instead of generating a message saying that, result in the error: 'relocation truncated to fit: R_AVR_13_PCREL against symbol tablejump2'.
* At least as of the avr-gcc package 7.3.0-atmel3.6.1-arduino5 there is a bug in the `<avr/eeprom.h>` library's eeprom_is_ready() macro - it refers to registers that don't exist on the parts (this impacts the 4809 and it's ilk as used in Nano Every/Uno WiFi Rev. 2 as well). Attempting to use that macro will generate a error stating that `'NVM_STATUS' was not declared in this scope`. When a newer version of that package that corrects this issue is available, megaTinyCore will use it. In the meantime, replace eeprom_is_ready() with this:

```
bit_is_clear(NVMCTRL.STATUS,NVMCTRL_EEBUSY_bp);
```
If writing a library or sketch that is intended to work on both megaavr and classic avr parts, you can test for effected parts using `#if defined(ARDUINO_ARCH_MEGAAVR)`


# Buying ATtiny megaAVR breakout boards
I sell breakout boards with regulator, UPDI header, and Serial header in my tindie shop, as well as the bare boards. Buying from my store helps support further development on the core, and is a great way to get started using these exciting new parts with Arduino.
Expand Down

0 comments on commit f5972ce

Please sign in to comment.