Problem compiling fed3.cpp using Arduino 1.8.19

30 views
Skip to first unread message

Eric Zorrilla

unread,
Jul 6, 2023, 8:29:15 PMJul 6
to FEDforum
Hi FED3ers,

We are trying to change the max retrieval latency to 180 sec from 60 sec and edited the 3 places in the fed3.cpp file (as an .ino file) to 180000.

However, when we try to compile it, we receive the following error.  We also receive this if we are using Arduino 2.1.00. Can anyone advise how to fix?

Error compiling for board Adafruit Feather M0 (SAMD21)

C:\Users\Zorrilla Lab\Documents\Arduino\libraries\SdFat\src\FatLib\FatFileLFN.cpp: In member function 'bool FatFile::open(FatFile*, fname_t*, oflag_t)':
C:\Users\Zorrilla Lab\Documents\Arduino\libraries\SdFat\src\FatLib\FatFileLFN.cpp:478:16: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
  478 |     m_dateTime(&dir->creationDate, &dir->creationTime);
      |                ^~~~~~~~~~~~~~~~~~
C:\Users\Zorrilla Lab\Documents\Arduino\libraries\SdFat\src\FatLib\FatFileLFN.cpp:478:16: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
C:\Users\Zorrilla Lab\Documents\Arduino\libraries\SdFat\src\FatLib\FatFileLFN.cpp:478:36: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
  478 |     m_dateTime(&dir->creationDate, &dir->creationTime);
      |                                    ^~~~~~~~~~~~~~~~~~
C:\Users\Zorrilla Lab\Documents\Arduino\libraries\SdFat\src\FatLib\FatFileLFN.cpp:478:36: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
C:\Users\Zorrilla Lab\Documents\Arduino\libraries\SdFat\src\FatLib\FatFile.cpp: In member function 'bool FatFile::sync()':
C:\Users\Zorrilla Lab\Documents\Arduino\libraries\SdFat\src\FatLib\FatFile.cpp:1219:18: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
 1219 |       m_dateTime(&dir->lastWriteDate, &dir->lastWriteTime);
      |                  ^~~~~~~~~~~~~~~~~~~
C:\Users\Zorrilla Lab\Documents\Arduino\libraries\SdFat\src\FatLib\FatFile.cpp:1219:18: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
C:\Users\Zorrilla Lab\Documents\Arduino\libraries\SdFat\src\FatLib\FatFile.cpp:1219:39: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
 1219 |       m_dateTime(&dir->lastWriteDate, &dir->lastWriteTime);
      |                                       ^~~~~~~~~~~~~~~~~~~
C:\Users\Zorrilla Lab\Documents\Arduino\libraries\SdFat\src\FatLib\FatFile.cpp:1219:39: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
C:\Users\Zorrilla Lab\Documents\Arduino\libraries\Adafruit_SHARP_Memory_Display\Adafruit_SharpMem.cpp: In member function 'void Adafruit_SharpMem::clearDisplay()':

Eric Zorrilla

unread,
Jul 6, 2023, 8:41:43 PMJul 6
to FEDforum
fwiw, we checked, and we have v.1.1.4 of the SDFat library installed.  Is that the appropriate one?

Thank you!
Eric

Lex

unread,
Jul 7, 2023, 2:24:17 PMJul 7
to Eric Zorrilla, FEDforum
Hi Eric,
Can you post the .cpp and screenshots or copy/paste which lines you changed?  Was it compiling before you made these changes?

It does seem like you're getting a lot of errors from the SDFat library.  I would use the "SdFat - Adafruit Fork" (you can find this in the Arduino library manager), and the most recent version which is 2.2.1.

image.png



--
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/015f17e0-079a-487f-be41-54b5efc1e8c7n%40googlegroups.com.

Eric Zorrilla

unread,
Jul 7, 2023, 3:28:02 PMJul 7
to FEDforum
Thanks, Lex!  We will update our SDFat to the SDFat - Adafruit Fork 2.2.1 as recommended!

We also figured out something we were doing wrong that was messing everything up -- we didnt need to edit the .cpp file as an .ino file using Arduino at all like we were doing.  Instead, we now edited the .cpp directly with a text editor.  And, that way our edits were happily used/incorporated when we compiled the actual fed3 ino files rather than renaming the .cpp as an .ino file and trying to compile that file.

Best wishes,
Eric
Reply all
Reply to author
Forward
0 new messages