Skip to content

AVR folder removal appears to have caused issues with libraries #587

Closed

Description

Hello,

Firstly, thanks for providing this core module! It works really well and has enabled me to get the MKR WiFi 1010 board working quickly!

In the 1.8.10 release, it appears the "avr" directory, which includes a number of basic files such as pgmspace.h, was moved:

$ git checkout 1.8.10
Previous HEAD position was b9b84b6 Release 1.8.9
HEAD is now at d5d336c Merge pull request #574 from giulcioffi/APIintegration
$ find . -name "pgmspace.h"
$ git checkout 1.8.9
Previous HEAD position was d5d336c Merge pull request #574 from giulcioffi/APIintegration
HEAD is now at b9b84b6 Release 1.8.9
$ find . -name "pgmspace.h"
./cores/arduino/avr/pgmspace.h

This has caused an issue in my project where I am using Arduino libraries which make the assumption that these files will exist.

For example, I have a simple program which uses the AceTime library:

$ arduino-cli core install arduino:samd@1.8.9
Tool arduino:arm-none-eabi-gcc@7-2017q4 already installed
Tool arduino:bossac@1.7.0-arduino3 already installed
Tool arduino:openocd@0.10.0-arduino7 already installed
Tool arduino:CMSIS@4.5.0 already installed
Tool arduino:CMSIS-Atmel@1.2.0 already installed
Tool arduino:arduinoOTA@1.2.1 already installed
Downloading packages...
arduino:samd@1.8.9 already downloaded
Updating arduino:samd@1.8.10 with arduino:samd@1.8.9...
arduino:samd@1.8.9 installed
$ arduino-cli compile rtc_example -b arduino:samd:mkrwifi1010
Sketch uses 29812 bytes (11%) of program storage space. Maximum is 262144 bytes.
Global variables use 4552 bytes (13%) of dynamic memory, leaving 28216 bytes for local variables. Maximum is 32768 bytes.
$ arduino-cli core install arduino:samd@1.8.10
Tool arduino:arm-none-eabi-gcc@7-2017q4 already installed
Tool arduino:bossac@1.7.0-arduino3 already installed
Tool arduino:openocd@0.10.0-arduino7 already installed
Tool arduino:CMSIS@4.5.0 already installed
Tool arduino:CMSIS-Atmel@1.2.0 already installed
Tool arduino:arduinoOTA@1.2.1 already installed
Downloading packages...
arduino:samd@1.8.10 already downloaded
Updating arduino:samd@1.8.9 with arduino:samd@1.8.10...
arduino:samd@1.8.10 installed
$ arduino-cli compile rtc_example -b arduino:samd:mkrwifi1010
In file included from /Documents/Arduino/libraries/AceTime/src/AceTime.h:20:0,
                 from /Documents/arduino/rtc_example/rtc_example.ino:16:
/Documents/Arduino/libraries/AceTime/src/ace_time/common/compat.h:38:12: fatal error: avr/pgmspace.h: No such file or directory
   #include <avr/pgmspace.h>
            ^~~~~~~~~~~~~~~~
compilation terminated.
Error during build: exit status 1

The offending lines in that library are:

#elif defined(ARDUINO_ARCH_SAMD)
  #include <avr/pgmspace.h>

which makes it very clear that this path is expected to exist. I have similar issues with other libraries and have seen this mentioned on forums as a reasonable workaround for Arduino libraries which need to work over a wide range of boards/platforms.

So my questions are:

  • why was this removed?
  • can it be reinstated as it appears to break numerous libraries?
  • if not, what is the recommended upgrade path?

I hope that the information I have provided makes sense, please let me know if further diagnostics or information would be of use to you. I have obscured some of the file paths slightly for privacy purposes.

Thanks,

Tim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions