XIAO Round Display Not Detecting SD Card

After blowing away my libraries, and starting over, I was able to get the display to function again.

Still no luck getting it to see the SD card, though.

Using the “Hardware Test” example as-is, I have no issues aside from not detecting the SD card. the “tf-card” switch is on initially, and then 7 seconds pass and it switches off. (The 7 seconds is the hard-coded timeout in the example).

Switching to the “TFT_eSPI_GifPlayer.ino”, I get a boatload of errors if I do not include :

In file included from /tmp/.arduinoIDE-unsaved2024010-32782-bwx43m.kpdac/TFT_eSPI_GifPlayer/TFT_eSPI_GifPlayer.ino:2:
/home/ognalysis/Arduino/libraries/TFT_eSPI/TFT_eSPI.h:970:8: warning: #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available! [-Wcpp]
  970 |       #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available!
      |        ^~~~~~~
/tmp/.arduinoIDE-unsaved2024010-32782-bwx43m.kpdac/TFT_eSPI_GifPlayer/TFT_eSPI_GifPlayer.ino: In function 'int getGifInventory(const char*)':
/tmp/.arduinoIDE-unsaved2024010-32782-bwx43m.kpdac/TFT_eSPI_GifPlayer/TFT_eSPI_GifPlayer.ino:218:25: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(const char*)'
  218 |       GifFiles.push_back( file.name() );
      |       ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/vector:64,
                 from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/queue:61,
                 from /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/cores/rp2040/SerialUART.h:26,
                 from /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/cores/rp2040/Arduino.h:120,
                 from /tmp/arduino/sketches/43A547574F88DDBCDC2FDD65C7FB41E2/sketch/TFT_eSPI_GifPlayer.ino.cpp:1:
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:1276:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1276 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:1276:35: note:   no known conversion for argument 1 from 'const char*' to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1276 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:1293:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1293 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:1293:30: note:   no known conversion for argument 1 from 'const char*' to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1293 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
/tmp/.arduinoIDE-unsaved2024010-32782-bwx43m.kpdac/TFT_eSPI_GifPlayer/TFT_eSPI_GifPlayer.ino: In function 'void loop()':
/tmp/.arduinoIDE-unsaved2024010-32782-bwx43m.kpdac/TFT_eSPI_GifPlayer/TFT_eSPI_GifPlayer.ino:278:61: error: invalid use of incomplete type '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'class std::__cxx11::basic_string<char>'}
  278 |   const char * fileName = GifFiles[currentFile++%totalFiles].c_str();
      |                                                             ^
In file included from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/iosfwd:39,
                 from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/shared_ptr.h:52,
                 from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/memory:76,
                 from /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/cores/rp2040/FS.h:23,
                 from /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/libraries/LittleFS/src/LittleFS.h:29,
                 from /home/ognalysis/Arduino/libraries/TFT_eSPI/Processors/TFT_eSPI_RP2040.h:12,
                 from /home/ognalysis/Arduino/libraries/TFT_eSPI/TFT_eSPI.h:106:
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stringfwd.h:72:11: note: declaration of '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'class std::__cxx11::basic_string<char>'}
   72 |     class basic_string;
      |           ^~~~~~~~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]':
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:526:7:   required from here
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:367:49: error: invalid use of incomplete type 'class std::__cxx11::basic_string<char>'
  367 |                       _M_impl._M_end_of_storage - _M_impl._M_start);
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stringfwd.h:72:11: note: declaration of 'class std::__cxx11::basic_string<char>'
   72 |     class basic_string;
      |           ^~~~~~~~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h: In instantiation of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = unsigned int]':
/tmp/.arduinoIDE-unsaved2024010-32782-bwx43m.kpdac/TFT_eSPI_GifPlayer/TFT_eSPI_GifPlayer.ino:278:60:   required from here
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:1124:41: error: invalid use of incomplete type 'class std::__cxx11::basic_string<char>'
 1124 |         return *(this->_M_impl._M_start + __n);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stringfwd.h:72:11: note: declaration of 'class std::__cxx11::basic_string<char>'
   72 |     class basic_string;
      |           ^~~~~~~~~~~~
In file included from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/arm-none-eabi/thumb/bits/c++allocator.h:33,
                 from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/allocator.h:46,
                 from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/deque:61,
                 from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/queue:60:
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/new_allocator.h: In instantiation of 'void std::__new_allocator<_Tp>::deallocate(_Tp*, size_type) [with _Tp = std::__cxx11::basic_string<char>; size_type = unsigned int]':
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/alloc_traits.h:496:23:   required from 'static void std::allocator_traits<std::allocator<_Tp1> >::deallocate(allocator_type&, pointer, size_type) [with _Tp = std::__cxx11::basic_string<char>; allocator_type = std::allocator<std::__cxx11::basic_string<char> >; pointer = std::__cxx11::basic_string<char>*; size_type = unsigned int]'
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:387:19:   required from 'void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; pointer = std::__cxx11::basic_string<char>*; std::size_t = unsigned int]'
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:366:2:   required from 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]'
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:526:7:   required from here
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/new_allocator.h:151:13: error: invalid application of '__alignof__' to incomplete type 'std::__cxx11::basic_string<char>'
  151 |         if (alignof(_Tp) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
      |             ^~~~~~~~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/new_allocator.h:153:38: error: invalid application of 'sizeof' to incomplete type 'std::__cxx11::basic_string<char>'
  153 |             _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n),
      |                                      ^~~~~~~~~~~~~~~~~~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/new_allocator.h:154:55: error: invalid application of '__alignof__' to incomplete type 'std::__cxx11::basic_string<char>'
  154 |                                      std::align_val_t(alignof(_Tp)));
      |                                                       ^~~~~~~~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/new_allocator.h:158:34: error: invalid application of 'sizeof' to incomplete type 'std::__cxx11::basic_string<char>'
  158 |         _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
      |                                  ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_pair.h:60,
                 from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_algobase.h:64,
                 from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/specfun.h:45,
                 from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/cmath:1935,
                 from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/math.h:36,
                 from /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/cores/rp2040/api/../../../ArduinoCore-API/api/ArduinoAPI.h:47,
                 from /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/cores/rp2040/api/ArduinoAPI.h:2,
                 from /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/cores/rp2040/Arduino.h:28:
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/type_traits: In instantiation of 'struct std::is_destructible<std::__cxx11::basic_string<char> >':
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_construct.h:188:51:   required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = __cxx11::basic_string<char>*]'
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/alloc_traits.h:850:15:   required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator, allocator<_T2>&) [with _ForwardIterator = __cxx11::basic_string<char>*; _Tp = __cxx11::basic_string<char>]'
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:730:15:   required from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]'
/tmp/.arduinoIDE-unsaved2024010-32782-bwx43m.kpdac/TFT_eSPI_GifPlayer/TFT_eSPI_GifPlayer.ino:28:26:   required from here
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/type_traits:910:52: error: static assertion failed: template argument must be a complete class or an unbounded array
  910 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/type_traits:910:52: note: 'std::__is_complete_or_unbounded<__type_identity<__cxx11::basic_string<char> > >((std::__type_identity<std::__cxx11::basic_string<char> >(), std::__type_identity<std::__cxx11::basic_string<char> >()))' evaluates to false
In file included from /home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/deque:62:
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_construct.h: In instantiation of 'void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = __cxx11::basic_string<char>*]':
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/alloc_traits.h:850:15:   required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator, allocator<_T2>&) [with _ForwardIterator = __cxx11::basic_string<char>*; _Tp = __cxx11::basic_string<char>]'
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_vector.h:730:15:   required from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]'
/tmp/.arduinoIDE-unsaved2024010-32782-bwx43m.kpdac/TFT_eSPI_GifPlayer/TFT_eSPI_GifPlayer.ino:28:26:   required from here
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_construct.h:188:51: error: static assertion failed: value type is destructible
  188 |       static_assert(is_destructible<_Value_type>::value,
      |                                                   ^~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_construct.h:188:51: note: 'std::integral_constant<bool, false>::value' evaluates to false
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stl_construct.h:195:25: error: invalid use of incomplete type 'std::iterator_traits<std::__cxx11::basic_string<char>*>::value_type' {aka 'class std::__cxx11::basic_string<char>'}
  195 |       std::_Destroy_aux<__has_trivial_destructor(_Value_type)>::
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ognalysis/.arduino15/packages/rp2040/tools/pqt-gcc/2.1.0-a-d3d2e6b/arm-none-eabi/include/c++/12.3.0/bits/stringfwd.h:72:11: note: declaration of 'std::iterator_traits<std::__cxx11::basic_string<char>*>::value_type' {aka 'class std::__cxx11::basic_string<char>'}
   72 |     class basic_string;
      |           ^~~~~~~~~~~~
Multiple libraries were found for "SD.h"
  Used: /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/libraries/SD
  Not used: /home/ognalysis/Arduino/libraries/SD
exit status 1

Compilation error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(const char*)'

If I include , I only get the usual “TOUCH_CS pin not defined” warnings.

The SD Card is formatted FAT32, has a single directory named “gif” on it, and the gif file inside is 1.5MB in size.
32GB SanDisk Ultra, Class 10, MicroSD HC

Using library TFT_eSPI at version 2.5.23 in folder: /home/ognalysis/Arduino/libraries/TFT_eSPI 
Using library SPI at version 1.0 in folder: /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/libraries/SPI 
Using library LittleFS at version 0.1.0 in folder: /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/libraries/LittleFS 
Using library SD at version 2.0.0 in folder: /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/libraries/SD 
Using library SDFS at version 0.1.0 in folder: /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/libraries/SDFS 
Using library ESP8266SdFat at version 2.1.1 in folder: /home/ognalysis/.arduino15/packages/rp2040/hardware/rp2040/3.6.3/libraries/ESP8266SdFat 
Using library AnimatedGIF at version 1.4.7 in folder: /home/ognalysis/Arduino/libraries/AnimatedGIF

I’m at a loss as to what to try next to see why the SD card isn’t being read.

Hi there,
I see it has multiple SD lib’s , ANYTIME I have had that the SD fails in some way. Fix that.
does the RP2040 have enough RAM, etc to doit?
HTH
GL :slight_smile: PJ

I’m sure you have seen this anything there different besides the obvious?

I removed one of the SD libraries, it didn’t like that, so I put that back and uninstalled the SD library from the Library manager (1.2.4 by Arduino and SparkFun). It compiles again, but still can’t detect the SD card.

I imagine if it didn’t have enough RAM, but the SD card could be detected, I would be getting different behavior.

As I said before, the HW test, the “tf-card” toggle turns off, which I understand means no card was detected.
The TFT_eSPI_GifPlayer example just has flashing text showing “INSERT SD”.

Hi there,
Hmmm , For sure? I would look at the names of the pin defined for SD card Chip enable.
Use the port number instead , or the physical pin number, try those… Your close.
HTH
GL :slight_smile: PJ

The RP2040 has 264KB of SRAM, and I’m using a 24Kb gif, if it can’t handle that, this may be all for naught.

I changed the PIN that SD uses (Seeed documents the SD card slot uses D2, D8, D9, D10). Hardware Usage | Seeed Studio Wiki

I don’t get the “INSERT SD” error using other pins, but the board also ceases to function after the SD timeout happens.

I REALLY think there is a manufacturing defect with the batch that i have i got three round displays in the same shipment and only opened one and kept the other two for safe keeping… i just opened the second box and got the same effect. I can run the sketch on XIAOSAMD and Expansion board and sd card and no problems but put the same in the round and no go… so i dont think their can be any software reason… it has to be hardware… only thing i can think to do is try to test probe from the sd card back to the XIAO header pins, but i dont have good enough eyesight for that

Hi there,
OK , so then that makes sense plenty of sram, I find this from the wiki
microSD card slot on Round Display, the chip select pin should be D2
D8,D9,D10 are the SPI port portion Can you check the D2 line with meter or If you have a PPK2 use the logic analyzer probes.


Have you tried and earlier version of the BSP instead of 3.6.3 ?
HTH
GL :slight_smile: PJ

.

I don’t get this schematic of the RP2040


Pins don’t match up?
So, I just compiled the code you posted Above , Cut and Paste,
compile gave me D2 not defined , Hmm There is NO D2 on the RP2040 , It’s A2
put that in and it compiled first stroke, complained about the touch screen stuff. but completed
That’s first thing so do that , and say what happens. (if it doesn’t work then ,
Then look at the schematic and change the SPI defines to match the PIN numbers.)
It should work NO problem.
HTH
GL :slight_smile: PJ :v:

#include <vector>
#include <TFT_eSPI.h>
#include <SPI.h>
#include <SD.h>
#include "AnimatedGIF.h"
#include <string>

AnimatedGIF gif;
TFT_eSPI tft = TFT_eSPI();

// rule: loop GIF at least during 3s, maximum 5 times, and don't loop/animate longer than 30s per GIF
const int maxLoopIterations =     1; // stop after this amount of loops
const int maxLoopsDuration  =  3000; // ms, max cumulated time after the GIF will break loop
const int maxGifDuration    =240000; // ms, max GIF duration

// used to center image based on GIF dimensions
static int xOffset = 0;
static int yOffset = 0;

static int totalFiles = 0; // GIF files count
static int currentFile = 0;
static int lastFile = -1;

char GifComment[256];

static File FSGifFile; // temp gif file holder
static File GifRootFolder; // directory listing
std::vector<std::string> GifFiles; // GIF files path
#define DISPLAY_WIDTH 240

static void MyCustomDelay( unsigned long ms ) {
  delay( ms );
  // log_d("delay %d\n", ms);
}

static void * GIFOpenFile(const char *fname, int32_t *pSize)
{
  // log_d("GIFOpenFile( %s )\n", fname );
  FSGifFile = SD.open(fname);
  if (FSGifFile) {
    *pSize = FSGifFile.size();
    return (void *)&FSGifFile;
  }
  return NULL;
}

static void GIFCloseFile(void *pHandle)
{
  File *f = static_cast<File *>(pHandle);
  if (f != NULL)
     f->close();
}

static int32_t GIFReadFile(GIFFILE *pFile, uint8_t *pBuf, int32_t iLen)
{
  int32_t iBytesRead;
  iBytesRead = iLen;
  File *f = static_cast<File *>(pFile->fHandle);
  // Note: If you read a file all the way to the last byte, seek() stops working
  if ((pFile->iSize - pFile->iPos) < iLen)
      iBytesRead = pFile->iSize - pFile->iPos - 1; // <-- ugly work-around
  if (iBytesRead <= 0)
      return 0;
  iBytesRead = (int32_t)f->read(pBuf, iBytesRead);
  pFile->iPos = f->position();
  return iBytesRead;
}

static int32_t GIFSeekFile(GIFFILE *pFile, int32_t iPosition)
{
  int i = micros();
  File *f = static_cast<File *>(pFile->fHandle);
  f->seek(iPosition);
  pFile->iPos = (int32_t)f->position();
  i = micros() - i;
  // log_d("Seek time = %d us\n", i);
  return pFile->iPos;
}

static void TFTDraw(int x, int y, int w, int h, uint16_t* lBuf )
{
  tft.pushRect( x+xOffset, y+yOffset, w, h, lBuf );
}

// Draw a line of image directly on the LCD
void GIFDraw(GIFDRAW *pDraw)
{
  uint8_t *s;
  uint16_t *d, *usPalette, usTemp[320];
  int x, y, iWidth;

  iWidth = pDraw->iWidth;
  if (iWidth > DISPLAY_WIDTH)
      iWidth = DISPLAY_WIDTH;
  usPalette = pDraw->pPalette;
  y = pDraw->iY + pDraw->y; // current line

  s = pDraw->pPixels;
  if (pDraw->ucDisposalMethod == 2) {// restore to background color
    for (x=0; x<iWidth; x++) {
      if (s[x] == pDraw->ucTransparent)
          s[x] = pDraw->ucBackground;
    }
    pDraw->ucHasTransparency = 0;
  }
  // Apply the new pixels to the main image
  if (pDraw->ucHasTransparency) { // if transparency used
    uint8_t *pEnd, c, ucTransparent = pDraw->ucTransparent;
    int x, iCount;
    pEnd = s + iWidth;
    x = 0;
    iCount = 0; // count non-transparent pixels
    while(x < iWidth) {
      c = ucTransparent-1;
      d = usTemp;
      while (c != ucTransparent && s < pEnd) {
        c = *s++;
        if (c == ucTransparent) { // done, stop
          s--; // back up to treat it like transparent
        } else { // opaque
            *d++ = usPalette[c];
            iCount++;
        }
      } // while looking for opaque pixels
      if (iCount) { // any opaque pixels?
        TFTDraw( pDraw->iX+x, y, iCount, 1, (uint16_t*)usTemp );
        x += iCount;
        iCount = 0;
      }
      // no, look for a run of transparent pixels
      c = ucTransparent;
      while (c == ucTransparent && s < pEnd) {
        c = *s++;
        if (c == ucTransparent)
            iCount++;
        else
            s--;
      }
      if (iCount) {
        x += iCount; // skip these
        iCount = 0;
      }
    }
  } else {
    s = pDraw->pPixels;
    // Translate the 8-bit pixels through the RGB565 palette (already byte reversed)
    for (x=0; x<iWidth; x++)
      usTemp[x] = usPalette[*s++];
    TFTDraw( pDraw->iX, y, iWidth, 1, (uint16_t*)usTemp );
  }
} /* GIFDraw() */

int gifPlay( char* gifPath )
{ // 0=infinite
  gif.begin(BIG_ENDIAN_PIXELS);
  if( ! gif.open( gifPath, GIFOpenFile, GIFCloseFile, GIFReadFile, GIFSeekFile, GIFDraw ) ) {
    // log_n("Could not open gif %s", gifPath );
    return maxLoopsDuration;
  }

  int frameDelay = 0; // store delay for the last frame
  int then = 0; // store overall delay
  bool showcomment = false;

  // center the GIF !!
  int w = gif.getCanvasWidth();
  int h = gif.getCanvasHeight();
  xOffset = ( tft.width()  - w )  /2;
  yOffset = ( tft.height() - h ) /2;

  if( lastFile != currentFile ) {
    // log_n("Playing %s [%d,%d] with offset [%d,%d]", gifPath, w, h, xOffset, yOffset );
    lastFile = currentFile;
    showcomment = true;
  }

  while (gif.playFrame(true, &frameDelay)) {
    if( showcomment )
      if (gif.getComment(GifComment))
        // log_n("GIF Comment: %s", GifComment);
    then += frameDelay;
    if( then > maxGifDuration ) { // avoid being trapped in infinite GIF's
      // log_w("Broke the GIF loop, max duration exceeded");
      break;
    }
  }

  gif.close();
  return then;
}

int getGifInventory( const char* basePath )
{
  int amount = 0;
  GifRootFolder = SD.open(basePath);
  if(!GifRootFolder){
    // log_n("Failed to open directory");
    return 0;
  }

  if(!GifRootFolder.isDirectory()){
    // log_n("Not a directory");
    return 0;
  }

  File file = GifRootFolder.openNextFile();

  tft.setTextColor( TFT_WHITE, TFT_BLACK );
  tft.setTextSize( 2 );

  int textPosX = tft.width()/2 - 16;
  int textPosY = tft.height()/2 - 10;

  tft.drawString("GIF Files:", textPosX-40, textPosY-20 );

  while( file ) {
    if(!file.isDirectory()) {
      GifFiles.push_back( file.name() );
      amount++;
      tft.drawString(String(amount), textPosX, textPosY );
      file.close();
    }
    file = GifRootFolder.openNextFile();
  }
  GifRootFolder.close();
  // log_n("Found %d GIF files", amount);
  return amount;
}

void setup()
{
  // Serial.begin(115200);
  // while (!Serial) ;
  // pinMode(D6, OUTPUT);
  // digitalWrite(D6, HIGH);
  tft.begin();
  tft.setRotation(2);

  int attempts = 0;
  int maxAttempts = 50;
  int delayBetweenAttempts = 300;
  bool isblinked = false;

  pinMode(A2, OUTPUT);
  while(! SD.begin(A2) ) {
    // log_n("SD Card mount failed! (attempt %d of %d)", attempts, maxAttempts );
    isblinked = !isblinked;
    attempts++;
    if( isblinked ) {
      tft.setTextColor( TFT_WHITE, TFT_BLACK );
    } else {
      tft.setTextColor( TFT_BLACK, TFT_WHITE );
    }
    tft.drawString( "INSERT SD", tft.width()/2, tft.height()/2 );

    if( attempts > maxAttempts ) {
      // log_n("Giving up");
    }
    delay( delayBetweenAttempts );
  }

  // log_n("SD Card mounted!");
  // Serial.print("SD Card mounted!");

  tft.begin();
  tft.fillScreen(TFT_BLACK);

  totalFiles = getGifInventory( "/gif" ); // scan the SD card GIF folder

}



void loop()
{
  tft.fillScreen(TFT_BLACK);

  const char * fileName = GifFiles[currentFile++%totalFiles].c_str();
  const char * fileDir = "/gif/";
  char * filePath = (char*)malloc(strlen(fileName)+strlen(fileDir)+1);
  strcpy(filePath, fileDir);
  strcat(filePath, fileName);

  int loops = maxLoopIterations; // max loops
  int durationControl = maxLoopsDuration; // force break loop after xxx ms

  while(loops-->0 && durationControl > 0 ) {
    durationControl -= gifPlay( (char*)filePath );
    gif.reset();
  }
  free(filePath);

}
FQBN: arduino:mbed:nanorp2040connect
Using board 'nanorp2040connect' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0
Using core 'arduino' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0

Detecting libraries used...
C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/defines.txt @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/cxxflags.txt -DARDUINO_ARCH_RP2040 -mcpu=cortex-m0plus -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_NANO_RP2040_CONNECT -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino/api/deprecated -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino/api/deprecated-avr-comp -iprefixC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/includes.txt C:\Users\Dude\AppData\Local\Temp\arduino\sketches\BFDAA0B353ED6E250B238DE2E79103DF\sketch\sketch_jan10a.ino.cpp -o nul
Alternatives for TFT_eSPI.h: [[email protected]]
ResolveLibrary(TFT_eSPI.h)
  -> candidates: [[email protected]]
C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/defines.txt @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/cxxflags.txt -DARDUINO_ARCH_RP2040 -mcpu=cortex-m0plus -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_NANO_RP2040_CONNECT -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT -Id:\Arduino_projects\libraries\TFT_eSPI -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino/api/deprecated -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino/api/deprecated-avr-comp -iprefixC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/includes.txt C:\Users\Dude\AppData\Local\Temp\arduino\sketches\BFDAA0B353ED6E250B238DE2E79103DF\sketch\sketch_jan10a.ino.cpp -o nul
Alternatives for SPI.h: [SPI]
ResolveLibrary(SPI.h)
  -> candidates: [SPI]
C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/defines.txt @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/cxxflags.txt -DARDUINO_ARCH_RP2040 -mcpu=cortex-m0plus -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_NANO_RP2040_CONNECT -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT -Id:\Arduino_projects\libraries\TFT_eSPI -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\libraries\SPI -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino/api/deprecated -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino/api/deprecated-avr-comp -iprefixC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/includes.txt C:\Users\Dude\AppData\Local\Temp\arduino\sketches\BFDAA0B353ED6E250B238DE2E79103DF\sketch\sketch_jan10a.ino.cpp -o nul
Alternatives for SD.h: [[email protected]]
ResolveLibrary(SD.h)
  -> candidates: [[email protected]]
C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/defines.txt @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/cxxflags.txt -DARDUINO_ARCH_RP2040 -mcpu=cortex-m0plus -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_NANO_RP2040_CONNECT -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT -Id:\Arduino_projects\libraries\TFT_eSPI -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\libraries\SPI -IC:\Users\Dude\AppData\Local\Arduino15\libraries\SD\src -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino/api/deprecated -IC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino/api/deprecated-avr-comp -iprefixC:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\cores\arduino @C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\variants\NANO_RP2040_CONNECT/includes.txt C:\Users\Dude\AppData\Local\Temp\arduino\sketches\BFDAA0B353ED6E250B238DE2E79103DF\sketch\sketch_jan10a.ino.cpp -o nul
Alternatives for AnimatedGIF.h: [[email protected]]
ResolveLibrary(AnimatedGIF.h)
  -> candidates: [[email protected]]
Edit ----
Linking everything together...
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -E -P -x c "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed\\3.3.0\\variants\\NANO_RP2040_CONNECT/linker_script.ld" -o "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/linker_script.ld"
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" "-LC:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF" -Wl,--gc-sections -Wl,--as-needed "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed\\3.3.0\\variants\\NANO_RP2040_CONNECT/ldflags.txt" "-TC:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/linker_script.ld" "-Wl,-Map,C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/sketch_jan10a.ino.map" --specs=nosys.specs -o "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/sketch_jan10a.ino.elf" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\sketch\\sketch_jan10a.ino.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\libraries\\TFT_eSPI\\TFT_eSPI.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\libraries\\SD\\File.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\libraries\\SD\\SD.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\libraries\\SD\\utility\\Sd2Card.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\libraries\\SD\\utility\\SdFile.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\libraries\\SD\\utility\\SdVolume.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\libraries\\AnimatedGIF\\AnimatedGIF.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\core\\double_tap_usb_boot.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\core\\nina_pins.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF\\core\\variant.cpp.o" -Wl,--whole-archive "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/core\\core.a" "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed\\3.3.0\\variants\\NANO_RP2040_CONNECT/libs/libmbed.a" -Wl,--no-whole-archive -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-objcopy" -O binary "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/sketch_jan10a.ino.elf" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/sketch_jan10a.ino.bin"
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/sketch_jan10a.ino.elf" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/sketch_jan10a.ino.hex"
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\rp2040tools\\1.0.6/elf2uf2" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/sketch_jan10a.ino.elf" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/sketch_jan10a.ino.uf2"

Using library TFT_eSPI at version 2.5.34 in folder: D:\Arduino_projects\libraries\TFT_eSPI 
Using library SPI in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\arduino\hardware\mbed\3.3.0\libraries\SPI (legacy)
Using library SD at version 1.2.4 in folder: C:\Users\Dude\AppData\Local\Arduino15\libraries\SD 
Using library AnimatedGIF at version 1.4.7 in folder: D:\Arduino_projects\libraries\AnimatedGIF 
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-size" -A "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\BFDAA0B353ED6E250B238DE2E79103DF/sketch_jan10a.ino.elf"
Sketch uses 140932 bytes (0%) of program storage space. Maximum is 16777216 bytes.
Global variables use 68992 bytes (25%) of dynamic memory, leaving 201344 bytes for local variables. Maximum is 270336 bytes.


:person_fencing: even the schematic calls it “A2”


Seems to be the analog vs digital pin.

I did try A2 instead, and while it compiled, it still doesn’t see the SD card.
I know the SD card is good, but I’m starting to wonder if it has something to do with the specific type I’m using.

can you say the production date on the sticker on the back of the box it came in. round display

05/23/23 is what is printed.

Hi there,
Yep , eliminate the basics first. I’ll assume you tried the port number as well p"28"
Here’s what I used for both demo’s Nrf52840 & ESP32C3

5/5/23 here too!

I would take a stab at setting the SPI pins MOSI , MISO, Sclk. and print them to the serial port first to see what they are currently set to.

Serial.println("--------------");
  Serial.println(SS);
  Serial.println(MOSI); // master out, slave in
  Serial.println(MISO); // master in, slave out
  Serial.println(SCK);  // clock
  Serial.println("--------------");

Post the results.

HTH
GL :slight_smile: PJ :v:

interesting my are 4/24/23

do you know of any way to see all the #define in a code at compile?

Unfortunately I’ve not had any luck getting my serial monitor to print anything yet.

Figured it out. I wasn’t monitoring the serial port…

SS(31)
MOSI(3)
MISO(4)
SCK(2)

1 Like

Hi there,
Ok so, Then…
Those are almost correct, for an Xiao RP2040

I would do something like this.* #define SS 28
first then go all in.
Try that?

// Map SPI port to 'new' pins
#define PIN_SPI_SS    (28)
#define PIN_SPI_MOSI  (3)
#define PIN_SPI_MISO  (4)
#define PIN_SPI_SCK   (2)

static const uint8_t SS   = PIN_SPI_SS;
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK  = PIN_SPI_SCK;

For grins , Try the Name of pin as well, i.e. A2,D10,D9, D7
HTH
GL :slight_smile: PJ

I tried that, and got compiler errors, indicating the pins are already defined.
Tried going to the pin definition file, changed the pin number, but unfortunately no dice.

I also tried just copy/paste the pinout you provided, and while it still compiled, I get zero output now.

I tried just changing the SS pins to 28, but also no luck.

It seems it has two different SPI_SS pins defined, but it’s labeled as not pinned out:
#define PIN_SPI0_SS (31u) // not pinned out

// Not pinned out
#define PIN_SPI1_MISO  (31u)
#define PIN_SPI1_MOSI  (31u)
#define PIN_SPI1_SCK   (31u)
#define PIN_SPI1_SS    (28u)

I’m very new to all this, so I appreciate your help with figuring this out.

Hi there,
No Problem, I don’t have that MCU or I could help better , But you are close.
My example wasn’t the correct syntax for your scenario,
So
Here is what it should be:

// Map SPI port to 'new' pins
#define SS 28
#define MOSI 3
#define MISO 4
#define SCK 2
Serial.println("--------------");
  Serial.println(SS);
  Serial.println(MOSI); // master out, slave in
  Serial.println(MISO); // master in, slave out
  Serial.println(SCK);  // clock
  Serial.println("--------------");

Try that and LMK
GL :slight_smile: PJ

can you post the whole code your using (with these edits)and also the last 20 or so lines of compiler output?

At least you confirm it’s using the PORT numbers for pins. that’s progress, LOL
the NOT pinned out info is when they are NOT defined in the pins file.