0

Serial comms issues with M0 and M4
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Serial comms issues with M0 and M4

by Matty on Fri Sep 24, 2021 7:24 pm

I am having trouble establishing serial communication with an M0 or M4 express card to a serial monitoring program (written in Xojo) running on my mac.

the code running on the M0 (or M4) will output to the IDE serial monitor just fine. however it will not output to this other monitoring program running on the mac.

As a debug step, I tried running the same Arduino code (example: ASCIItable) and it WILL communicate to the monitoring program IF I use a Metro Express board. It will also communicate with the Serial monitor in the Arduino IDE of course. However running the code on the M0/M4 only works with the Arduino serial monitor, not the external Serial monitor program.

I even tried adding the following suggested code when running the M0 or M4 without luck:

#if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL)
// Required for Serial on Zero based boards
#define Serial SERIAL_PORT_USBVIRTUAL
#endif

My external serial monitor program can see the M0/M4 serial port, and I think it connects, because once connected, the IDE serial monitor cannot connect to the board.

Any thoughts? I am stuck at this point...

Thanks,
Matt
Matty
 
Posts: 7
Joined: Fri Aug 17, 2012 8:26 pm

Re: Serial comms issues with M0 and M4

by User_UMjT7KxnxP8YN8 on Sat Sep 25, 2021 12:49 am

Apologies in advance if I'm telling you something you already know, but the other programs may not come configured for the same serial data format. In KiTTY, for instance (the PuTTY fork I prefer), you have to set the baud rate, data bits, stop bits and parity correctly to get it to work.

Set the baud rate to whatever you have in your Serial.begin(baudRate) call, and the other settings as shown in this image.

Hope that helps.

KiTTYSerialConfigPage.jpg
KiTTYSerialConfigPage.jpg (60.1 KiB) Viewed 914 times

User_UMjT7KxnxP8YN8
 
Posts: 255
Joined: Tue Jul 17, 2018 1:28 pm

Re: Serial comms issues with M0 and M4

by Matty on Sat Sep 25, 2021 6:09 pm

Yes, I have checked baud rate, parity bits, etc. The smoking gun is that the metro express works fine for this, but the SAMD51 based boards (M0, and M4) do not. The M0 and M4 do communicate fine with the IDE Serial Monitor, but fail with my serial monitor program. Adafruit docs do point out some differences in the documentation here: https://learn.adafruit.com/adafruit-gra ... ches-to-m0

The reason I need to use the M0 or M4 is that I need to store a large amount of data to the flash chip on those boards( see https://learn.adafruit.com/adafruit-met ... -spi-flash ) for my application. I am lighting up 120 NeoPixels from a matrix of about 24,000 pixels

Matt
Matty
 
Posts: 7
Joined: Fri Aug 17, 2012 8:26 pm

Re: Serial comms issues with M0 and M4

by User_UMjT7KxnxP8YN8 on Sun Sep 26, 2021 1:25 pm

I'm not sure what product you mean by "Metro Express". Adafruit's Metro M0 Express boards use the ATSAMD21 chip, while the Metro M4 Express boards use the ATSAMD51 chip.

Do you mean the Metro ESP32-S2 Express?

User_UMjT7KxnxP8YN8
 
Posts: 255
Joined: Tue Jul 17, 2018 1:28 pm

Re: Serial comms issues with M0 and M4

by Matty on Sun Sep 26, 2021 1:31 pm

sorry, I meant Metro 328 https://www.adafruit.com/product/2488
Matty
 
Posts: 7
Joined: Fri Aug 17, 2012 8:26 pm

Re: Serial comms issues with M0 and M4

by User_UMjT7KxnxP8YN8 on Tue Sep 28, 2021 12:32 am

No problem, except that I've never used that board and don't know how to help. Hopefully one of the Adafruit folks will be able to.

User_UMjT7KxnxP8YN8
 
Posts: 255
Joined: Tue Jul 17, 2018 1:28 pm

Please be positive and constructive with your questions and comments.