Skip to content
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

SDFat library doesn't work #5

Closed
facchinm opened this issue Dec 9, 2024 · 4 comments
Closed

SDFat library doesn't work #5

facchinm opened this issue Dec 9, 2024 · 4 comments

Comments

@facchinm
Copy link
Member

facchinm commented Dec 9, 2024

Describe the bug
SDFat examples (like QuickStart) compile but don't run

Target board + cli verbose compilation output
Full verbose compilation output, ideally with arduino-cli invocation or from IDE 2.3.3+

/ssd/Arduino15/packages/zephyr/tools/arm-zephyr-eabi/0.16.8/bin/arm-zephyr-eabi-ar rcs /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/core/core.a /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/core/zephyrSerial.cpp.o
Archiving built core (caching) in: /home/martino/.cache/arduino/cores/arduino-git_zephyr_giga_debug_false_93083b39c8a8797990fb6c9f3bb1e864/core.a
Linking everything together...
/ssd/Arduino15/packages/zephyr/tools/arm-zephyr-eabi/0.16.8/bin/arm-zephyr-eabi-g++ -L/home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07 -r -Wl,--gc-sections -e main -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-unwind-tables -fno-use-cxa-atexit -T/ssd/products-Eslov/FW/MainPrograms/hardware/arduino-git/zephyr/variants/llext/linker_script.ld -Wl,-Map,/home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.map --specs=nosys.specs -o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.elf /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/sketch/QuickStart.ino.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SPI/SPI.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/ExFatLib/ExFatDbg.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/ExFatLib/ExFatFile.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/ExFatLib/ExFatFilePrint.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/ExFatLib/ExFatFileWrite.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/ExFatLib/ExFatFormatter.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/ExFatLib/ExFatName.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/ExFatLib/ExFatPartition.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/ExFatLib/ExFatVolume.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FatLib/FatDbg.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FatLib/FatFile.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FatLib/FatFileLFN.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FatLib/FatFilePrint.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FatLib/FatFileSFN.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FatLib/FatFormatter.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FatLib/FatName.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FatLib/FatPartition.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FatLib/FatVolume.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FreeStack.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FsLib/FsFile.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FsLib/FsNew.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/FsLib/FsVolume.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/MinimumSerial.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SdCard/SdCardInfo.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SdCard/SdSpiCard.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SdCard/SdioTeensy.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SpiDriver/SdSpiArtemis.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SpiDriver/SdSpiChipSelect.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SpiDriver/SdSpiDue.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SpiDriver/SdSpiESP.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SpiDriver/SdSpiParticle.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SpiDriver/SdSpiSTM32.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SpiDriver/SdSpiSTM32Core.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/SpiDriver/SdSpiTeensy3.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/common/FmtNumber.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/common/FsCache.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/common/FsDateTime.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/common/FsName.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/common/FsStructs.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/common/FsUtf.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/common/upcase.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/iostream/StdioStream.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/iostream/StreamBaseClass.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/iostream/istream.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/libraries/SdFat/iostream/ostream.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/core/variant.cpp.o /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/core/core.a -lstdc++ -lsupc++ -lnosys -nostdlib
/ssd/Arduino15/packages/zephyr/tools/arm-zephyr-eabi/0.16.8/bin/arm-zephyr-eabi-objcopy -O binary /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.elf /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.bin
Bootloader file specified but missing: /ssd/products-Eslov/FW/MainPrograms/hardware/arduino-git/zephyr/bootloaders/zephyr-arduino_giga_r1_m7.bin
/ssd/Arduino15/packages/zephyr/tools/arm-zephyr-eabi/0.16.8/bin/arm-zephyr-eabi-objcopy -O ihex -R .eeprom /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.elf /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.hex
/ssd/Arduino15/packages/zephyr/tools/arm-zephyr-eabi/0.16.8/bin/arm-zephyr-eabi-strip --strip-debug /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.elf -o/home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.llext
/ssd/Arduino15/packages/arduino/tools/zephyr-post-build-tool/0.0.2/post_build /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.llext
File copied and saved as /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.llext.dfu

Using library SPI in folder: /nvme/test_zephyr_standalone/zephyr-gsoc-core/libraries/SPI (legacy)
Using library SdFat at version 2.2.3 in folder: /ssd/products-Eslov/FW/MainPrograms/libraries/SdFat 
/ssd/Arduino15/packages/zephyr/tools/arm-zephyr-eabi/0.16.8/bin/arm-zephyr-eabi-size -A /home/martino/.cache/arduino/sketches/01FE4B8BBF53266D49226B5CB56CBE07/QuickStart.ino.elf
Sketch uses 18987 bytes (2%) of program storage space. Maximum is 786432 bytes.
Global variables use 4265 bytes (0%) of dynamic memory, leaving 519359 bytes for local variables. Maximum is 523624 bytes.

Output of Serial Monitor

[00:00:01.528,000] <err> llext: Failed to copy regions, ret -12                                             
Failed to load sketch, rc -12                                                                               

Using QuickStart example sketch and SDCARD shield on Giga

@mjs513
Copy link

mjs513 commented Dec 9, 2024

just posted this as well where I am seeing no output on the serial monitor but the error you are seeing sounds reasonble.

@facchinm
Copy link
Member Author

facchinm commented Dec 9, 2024

How to debug this issue:

  • with UART connected -> we see the shell, type sketch, get
    [00:00:01.528,000] <err> llext: Failed to copy regions, ret -12 Failed to load sketch, rc -12
    • Reason: the sketch is too big to fit in LLEXT HEAP (the one that will be used when interacted via shell)
    • Solution: temporarily reduce CONFIG_HEAP_MEM_POOL_SIZE to 2048, increase CONFIG_LLEXT_HEAP_SIZE to 64
  • next error:
    [00:00:03.332,000] <err> llext: Undefined symbol with no entry in symbol table isalpha, offset 13200, link 0 [00:00:03.343,000] <err> llext: Failed to link, ret -61 Failed to load sketch, rc -61
    • Reason: symbol not yet exported in llext_exports.c
    • Solution: add isaplha and isupper to that file

@facchinm
Copy link
Member Author

facchinm commented Dec 9, 2024

@mjs513 ouch, too fast 😄 Closing this one in favour of #4

@facchinm facchinm closed this as completed Dec 9, 2024
@mjs513
Copy link

mjs513 commented Dec 9, 2024

Sorry - been at this for the last week or so :) But looks like you got the fix - thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants