Error "compiling for board Adafruit Feather M0"

485 views
Skip to first unread message

Renée Poelman

unread,
Dec 21, 2021, 9:35:35 AM12/21/21
to FEDforum
Hi everyone,
I am getting the FED3 device up and running but I'm stuck on an error.
After I flash the "SetClock" sketch, the display on the FED3 states "reflash device code". I followed Lex's instruction video so I:
1. double klicked the button again so the red light starts breathing and its in "boot loader" mode
2. I select File > example > FED3 > programs > Classic FED3
3. I re-select the port in the tools menu
4. I flash the code

then I get the following error: compiling for board Adafruit Feather M0. I have the same when I try and flash the FR1 sketch. I can successfully run the blink and the setclock sketches.

Is there anyone that knows what could be wrong? Am I missing a library, and if yes, which one? 
Best,
Renée

Lex Kravitz

unread,
Dec 21, 2021, 11:56:33 PM12/21/21
to FEDforum
Hi Renée!
It does sound like you're missing a library or have the wrong board selected.  Does it give you any more information in the error?  Often you can decode from the error report which library you are missing. 

At any rate, can you try:
1) Download the latest version of the FED3 library from the Arduino library manager.  It is currently version 1.11.0. 
2) When it prompts you, click the "Install All" button to get all the dependent libraries:
FED3dependencies.jpg
3) Make sure you have "Adafruit Feather M0" selected in the Arduino IDE before compiling
FED3board.jpg

4) Try again?

Let me know what happens, and if you get anything more in the error window paste the full error here!

Renée Poelman

unread,
Dec 22, 2021, 5:44:55 AM12/22/21
to FEDforum
Hi lex, 
Thank you for your quick answer! I reinstalled the 1.11.0 version of the FED3 library (again) and I am sure I selected the right board. I can also see all libraries listed in my documents > arduino > libraries folder. 
I ran everything again and I get the same error. It doesnt seem to miss a specific library, but it can't find a lot of 'members'
I attached the error in a word document, because the whole page keeps crashing when I try to copy paste it here.
Best,
Renée

Op woensdag 22 december 2021 om 05:56:33 UTC+1 schreef lex.k...@gmail.com:
ERROR221221.docx

Lex Kravitz

unread,
Dec 22, 2021, 9:16:57 AM12/22/21
to FEDforum
Wow that is a lot of errors!  The main clue I'm seeing here is that all of these errors are with your "SdFat " library, it's not finding a bunch of things in this directory, which holds that library:
c:\users\xpoere\documents\arduino\libraries\sdfat
This also explains why you are able to flash the Setclock script - that doesn't use the SD card. 

I'm wondering if you have a different version of the SdFat libary that's conflicting? Do you have multiple  SdFat or SD libraries in the directory "c:\users\xpoere\documents\arduino\libraries"?   Can you delete any library that has "SD" in the name and then reinstall the proper one to see if that solves the problem?  The proper one is SdFat version 2.1.2. 

Untitled.png

Let me know what happens!

Renée Poelman

unread,
Jan 3, 2022, 7:55:19 AM1/3/22
to FEDforum
Hi Lex,
Best wishes for the new year! I just got back from my holiday and managed to fix the problem with your description. I replaced the SdFat library with the 2.1.2 version and I could flash the FED3 library again. Thanks for your help!
Best,
Renée 

Op woensdag 22 december 2021 om 15:16:57 UTC+1 schreef lex.k...@gmail.com:

Nik Hayes

unread,
Feb 17, 2022, 3:19:05 PM2/17/22
to FEDforum
I also had an issue compiling and I was using Adafruit SAMD board version 1.5.5, FED3 version 1.11.0, and RTClib version 1.11.1. The compiling was failing at RTClib so I tried updating the newest version (which failed) and a random older version 1.4.0 ended up working. For some reason the lights are currently working but not seeing anything on the screen/clock so might have to post a question about that later...

Marie Le May

unread,
Jun 9, 2022, 12:22:24 PM6/9/22
to FEDforum
Hi!

I have a similar error using the FED3 device although with different details. 

Here starts the error:
C:\Users\marlem\Documents\Arduino\libraries\FED3\src\FED3.cpp: In member function 'void FED3::CreateFile()':
C:\Users\marlem\Documents\Arduino\libraries\FED3\src\FED3.cpp:877:9: warning: 'char* strcpy(char*, const char*)' writing 21 bytes into a region of size 15 overflows the destination [-Wstringop-overflow=]
  877 |   strcpy(filename, "FED_____________.CSV");  // placeholder filename
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\marlem\Documents\Arduino\libraries\RTClib\src\RTC_DS1307.cpp: In member function 'void RTC_DS1307::writenvram(uint8_t, const uint8_t*, uint8_t)':
C:\Users\marlem\Documents\Arduino\libraries\RTClib\src\RTC_DS1307.cpp:109:18: error: invalid conversion from 'const uint8_t*' {aka 'const unsigned char*'} to 'uint8_t*' {aka 'unsigned char*'} [-fpermissive]
  109 |   i2c_dev->write(buf, size, true, &addrByte, 1);
      |                  ^~~
      |                  |
      |                  const uint8_t* {aka const unsigned char*}
In file included from C:\Users\marlem\Documents\Arduino\libraries\RTClib\src\RTClib.h:25,
                 from C:\Users\marlem\Documents\Arduino\libraries\RTClib\src\RTC_DS1307.cpp:1:
C:\Users\marlem\Documents\Arduino\libraries\Adafruit_BusIO/Adafruit_I2CDevice.h:15:23: note:   initializing argument 1 of 'bool Adafruit_I2CDevice::write(uint8_t*, size_t, bool, uint8_t*, size_t)'
   15 |   bool write(uint8_t *buffer, size_t len, bool stop = true,
      |              ~~~~~~~~~^~~~~~
exit status 1
Error compiling for board Adafruit Feather M0 (SAMD21).

I tried all the tricks given above as well as to re-install the FED3 and the RTClib libraries but it did not help.

This comes up when I verify the code. Does someone have a idea how to solve this?

Thanks a lot in advance!

Best,
Marie


Lex Kravitz

unread,
Jun 9, 2022, 12:36:04 PM6/9/22
to FEDforum
Hi!  This looks like an library error, maybe from having the wrong version. Just to make sure you have the right version can you delete RTClib and RTCZero libraries from your Documents\Arduino\libraries\ folder, replace them with the libraries in the attached .zip file, and see if that fixes it?
RTClibraries.zip

Marie Le May

unread,
Jun 10, 2022, 4:35:45 AM6/10/22
to FEDforum
Hi Lex,

Thanks for your quick reply!

Unfortunately, deleting and replacing the RTClib and RTCZero from your file did not solve the error.
I will try to re-install everything according to your guide online, maybe this will help.
Do you notice anything else I could try?

Best,
Marie

Lex

unread,
Jun 10, 2022, 7:44:57 AM6/10/22
to Marie Le May, FEDforum
A fresh install would be the next thing I'd try. Try deleting everything in your Arduino libraries folder, then use the library manager to install the FED3 library. It will pop up and ask you whether to download all of the dependent libraries, click yes there.

Also do you have another computer you can try this from?   If you get it working on one computer it will be easier to figure out what's going on with the other one.

Please post back what happens!

--
You received this message because you are subscribed to the Google Groups "FEDforum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fedforum+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fedforum/874d6084-f0d0-4b86-8840-b7d575da5fcen%40googlegroups.com.

Marie Le May

unread,
Jun 10, 2022, 8:06:48 AM6/10/22
to FEDforum
I did as you instructed and the error text did get shorter!

C:\Users\marlem\Documents\Arduino\libraries\FED3\src\FED3.cpp: In member function 'void FED3::CreateFile()':
C:\Users\marlem\Documents\Arduino\libraries\FED3\src\FED3.cpp:877:9: warning: 'char* strcpy(char*, const char*)' writing 21 bytes into a region of size 15 overflows the destination [-Wstringop-overflow=]
  877 |   strcpy(filename, "FED_____________.CSV");  // placeholder filename
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\marlem\Documents\Arduino\libraries\Adafruit_SHARP_Memory_Display\Adafruit_SharpMem.cpp: In member function 'void Adafruit_SharpMem::clearDisplay()':
C:\Users\marlem\Documents\Arduino\libraries\Adafruit_SHARP_Memory_Display\Adafruit_SharpMem.cpp:223:43: warning: narrowing conversion of '(int)(((unsigned char)((int)((Adafruit_SharpMem*)this)->Adafruit_SharpMem::_sharpmem_vcom)) | 4)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
  223 |   uint8_t clear_data[2] = {_sharpmem_vcom | SHARPMEM_BIT_CLEAR, 0x00};
Sketch uses 86620 bytes (33%) of program storage space. Maximum is 262144 bytes.

My colleague Renée got it to work on her computer yes. What could I check to find the problem?

Thanks a lot!

Best,
Marie

Marie Le May

unread,
Jun 10, 2022, 9:40:37 AM6/10/22
to FEDforum
Now the error is gone! I did not do anything but verifying the code again went without error this time.
So I guess it is solved now. Thank you very much for your help Lex!

Have a nice weekend,
Marie

Lex

unread,
Jun 10, 2022, 10:29:58 AM6/10/22
to Marie Le May, FEDforum
Wonderful!  It was almost certainly a library issue with RTClib, sometimes it helps to exit and restart the Arduino IDE after updating libraries, maybe that did it? 

BTW the first error (pasted below) is just a "warning" not an "error".  Errors will stop the compile while warnings just warn you that something is not exactly right.  This warning is telling us that I didn't allocate enough space in the filename when I initialized it... it's a minor bug that doesn't affect anything but I will fix it in the next library update to make this warning go away!  So you still will likely see this warning, but as long as it uploads you can ignore it!

C:\Users\marlem\Documents\Arduino\libraries\FED3\src\FED3.cpp: In member function 'void FED3::CreateFile()':
C:\Users\marlem\Documents\Arduino\libraries\FED3\src\FED3.cpp:877:9: warning: 'char* strcpy(char*, const char*)' writing 21 bytes into a region of size 15 overflows the destination [-Wstringop-overflow=]
  877 |   strcpy(filename, "FED_____________.CSV");  // placeholder filename
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Users\marlem\Documents\Arduino\libraries\FED3\src\FED3.cpp: In member function 'void FED3::CreateFile()':

C:\Users\marlem\Documents\Arduino\libraries\FED3\src\FED3.cpp:877:9: warning: 'char* strcpy(char*, const char*)' writing 21 bytes into a region of size 15 overflows the destination [-Wstringop-overflow=]
  877 |   strcpy(filename, "FED_____________.CSV");  // placeholder filename
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reply all
Reply to author
Forward
0 new messages