XIAO Seeeduino SAMD vs XIAO ESP32-C3

My program works great on the SAMD (Seeeduino). It doesn’t seem to work at all on the XIAO ESP32-C3. Not even the initial serial printout of it starting up. I am not using any WiFi / BT. Just looking to use a faster cpu. I had migrated it (with only pin changes) from a Mega2560 and with a couple of #def changes (mostly for pins and EEPROM) the program will run on the 2560 or SAMD.

AFAIK, both board pinouts are the same. Here is the usage:

D0 - DIN used
D1 - DIN + interrupt used
D2 - DIN + interrupt used
D3 - DOUT as an SPI select
D4 - SCA used for 3 devices
D5 - SCL used ditto
D6 - serial Tx (may be used depending on hardware used)
D7 - serial Rx ditto
D8 - SCK used for SPI to one device
D9 - MISO - used ditto
D10 - MOSI - used ditto
3V3 - used to power 3.3v devices - about 50ma
GND - yup
5V - main power in (when not connected to USB-C)

I have select the correct Board type and compile / download do fine.
I cannot post my code as it is about 5,000 lines long.

Any basic differences between the two boards that I am overlooking?

In my experience, it was necessary to do the following to get the serial monitor working.

  Serial.setTxTimeoutMs(0); // for Serial Monitor

Thanks for the info. Upon further debugging it turned out to be the SPI Chip Select (CS) output that is defined differently depending on which board is selected. “3” for the XIAO and “D3” for the ESP32. Not using the right pin results in the SPI device never getting data / returning data.

Since the Wire lib does not seem to implement a proper timeout, waiting for a reply to ID which LCD display is being used was hanging it up.

All was for naught as the speed of my program actually was slower with the ESP32. Took twice as long to read sensors, process and display the results. I do quite a lot of floating point math and trig functions along with quite a lot of SPI transactions updating the LCD display.