-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with some EEPROM libraries #155
Comments
Wow. The actual bug is in <avr/eeprom.h> - their definition of eeprom_is_ready() refers to registers and bits within the register that don't exist.... I can't do anything to my core to fix it, but I put in a PR to the library maintainer to fix it: thijse/Arduino-EEPROMEx#31 I also submitted a PR to the EEPROMWearLevel library, which I think you also reported... PRosenb/EEPROMWearLevel#9 |
I think other libraries should only use the standard EEPROM.h library, which works fine with the ATtiny3217 (see example). |
The problem is solved, I think, when we use the standard library EEPROM.h in instead of AVR Libc EEPROM.h here: |
The issue with Pete Rosen's EEPROMWearLevel library is unrelated to the eeprom.h library - the issue with that library is that he was manually manipulation the EEPROM registers for finer control over the write process, but he only wrote code to work with classic avrs not megaavrs. See the PR I submitted over on his library for the correction for that library - though he seems to have a problem with where I put the architecture-dependent code, so it's up to him to take the next steps there. I made the library work shrug And as I noted above, I also submitted a fix to this EEPROM library to work around this bug in the standard avr/eeprom.h library. EEPROM.h is an arduino library included with the core. It actually does use the avr/eeprom.h library, just not the one bad macro. eeprom.h is located in the avr-gcc package that gets installed using board manager - assuming you're on windows, it ends up in C:\Users(your username)\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr (note that AppData is a hidden folder) The files that are part of avr-libc are really supposed to work; they're distributed with the compiler, FFS! It's very surprising when we see stuff like this... THEY are the "standard" library - EEPROM.h is an arduino-specific one that's just a wrapper around eeprom.h |
Hi Spence
Thank you
you know a lot of the Arduino..
stay healthy
Albert
From: Spence Konde (aka Dr. Azzy)
Sent: Sunday, March 22, 2020 11:17 AM
To: SpenceKonde/megaTinyCore
Cc: Albert van Dalen ; Author
Subject: Re: [SpenceKonde/megaTinyCore] Problem with some EEPROM libraries (#155)
The issue with Pete Rosen's EEPROMWearLevel library is unrelated to the eeprom.h library - the issue with that library is that he was manually manipulation the EEPROM registers for finer control over the write process, but he only wrote code to work with classic avrs not megaavrs. See the PR I submitted over on his library for the correction for that library - though he seems to have a problem with where I put the architecture-dependent code, so it's up to him to take the next steps there. I made the library work shrug
And as I noted above, I also submitted a fix to this EEPROM library to work around this bug in the standard avr/eeprom.h library.
EEPROM.h is an arduino library included with the core. It actually does use the avr/eeprom.h library, just not the one bad macro. eeprom.h is located in the avr-gcc package that gets installed using board manager - assuming you're on windows, it ends up in C:\Users(your username)\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr (note that AppData is a hidden folder)
The files that are part of avr-libc are really supposed to work; they're distributed with the compiler, FFS! It's very surprising when we see stuff like this... THEY are the "standard" library - EEPROM.h is an arduino-specific one that's just a wrapper around eeprom.h
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi Spence,
I have troubles using some EEPROM libraries, such as the EEPROMex.h library:
https://github.com/thijse/Arduino-EEPROMEx
It doesn’t work for the ATtiny3217, the error is:
'NVM_STATUS' was not declared in this scope
Note that the standard Arduino library EEPROM.h still works fine, see this sketch:
So, I think it is not a big compatiblity issue.
I have looked for a solution, but I don’t have enough knowledge of the Arduino platform.
Maybe you can talk to Thijs Elenbaas what to do.
The text was updated successfully, but these errors were encountered: