ESP32 S3 + DXL MKR Shield Mash-Up in ARDUINO


Continuing on my mash-up projects with the DXL MKR Shield, here are my current progress on using the ESP32 S3 controller with the Dynamixel2Arduino Library using the wire-wrap experimental carrier developed for my previous ESP32 mash-up project, see post below

ESP32 + DXL Shield MKR Mashup in ARDUINO - #6 by roboteer

I used the UM Feather S3 from Unexpected Maker and the test setup is shown below:

First, using this board with Windows 10 (at least on my current PC) requires me to manually set this board to LOAD mode in order to upload my sketch from the PC to this S3 board using a combination to the BOOT and RESET buttons, and then manually use RESET again to run the uploaded sketch (EVERY SINGLE TIME!). The Arduino IDE won’t be able to flip-flop automatically for the user between the loading and running USB Ports with the current version of ESP32 S3 (for example like for the Portenta H7 Lite).

Second, the usual Arduino Pin labeling “Ax” scheme no longer applies. For example to use the Pin “A5”, now one just specifies “5”.

Thirdly, Serial1 can still be used for the DXL Control Port, but one needs to begin Serial1 separately and before the beginning of the usual Dynamixel2Arduino instance/handle, see picture below:

Next, I checked to see if my Sync Read Write sketch still worked on a Single Core (Core 0 or Core 1, one at a time), and I am glad to report that it worked well with the ESP32 S3 also:

Then, I went on to check the Dual Core version that worked well previously for the ESP32 V2 (see YouTube video ESP32 and Dynamixel MKR Shield Mash-Up - YouTube

Unfortunately, at present, I have only partial success:

  1. This Dual Core sketch was compiled and uploaded fine.

  2. But after starting the two Independent Tasks, the S3 just hanged (see picture below):

My guess is that semaphores would have to be implemented next. So stay tuned!


Update 3/3/2023

I am making good progress on several issues (see picture below):

  1. The maker of the UM Feather S3 board told me that the Ax notation for I/O Pins is “outdated” and GPIO Pin Numbers are preferred nowadays. You can see the pinout of the UM board used here (Introducing the FeatherS3 by Unexpected Maker), Then you can use the IOx numbers to modify the Ax entries in the corresponding file pins_Arduino.h: for example A5 = 5 and A0 = 17 so that you don’t have to do much editing to your existing sketches which probably use the Ax notation.

  2. I found that the “task hanging” issue reported earlier for the Dual Core application was simply due to the SIZE of the STACK. I used 2048 or 3072 for my new tests, but I have not tried to pin down the optimal values yet as the UM Feather S3 has plenty of memory for my needs.

The picture below shows typical results displayed on Serial Monitor (physically, the 4 servos were performing as they were supposed to):

  • Looking at the Time Stamp values, you can see that several printouts have the same Time values, this is because the Time Stamp resolution is rather “coarse”, about 47 ms. So we had about 12 println per block of 47 ms! That pretty fast multi-tasking for robots, but may be needed for the more expensive DXLs that run at 4-5 Mbps?

  • Occasionally the Serial Monitor got “jumbled up”, i.e. lost a Next Line character so Output from one Task got mingled with Output from the other Task. So I wonder if the Present Velocity value of 2072 highlighted in yellow was a real Read error or it was just a matter of Serial Monitor being messed up by the ESP32 Task Scheduler? These issues will be need to be looked at more closely later.

In summary, this mash-up project is working out very well, and maybe ROBOTIS would be interested in making a PCB Carrier that only has 3 or 4 Stacking Headers? Two would be used to hold the MKR DXL Shield itself, then at least 1 Stacking Header to hold the header that contains the TX and RX pins of the considered 3.3V Arduino Variant board. That is the minimum to perform the Custom Wire Wrapping needed. This PCB Carrier would be handy for ROBOTIS users who do not have access or skills for soldering, but “everybody” should be able to do “wire-wrapping”!

1 Like

UPDATE: 3/9/2023

Just got in today an Adafruit Feather S3 4 MB Flash 2 MB PSRAM. It also got the same issues with needing to use the BOOT & RESET buttons to get into LOAD mode and into RUN mode as the UM board. I am beginning to think that THIS IS a FEATURE of the S3 :face_with_raised_eyebrow:

Don’t know when Espressif and/or Arduino are going to fix this issue as according to this Github post, this issue had been discussed since May 2022.

The ESP32 C3 seemed to have similar issues but supposedly the C3’s issue was fixed/closed in Feb 2023 with Update 2.0.7.

May be S3 will be fixed at the next round? Ones can always hope!

Otherwise, the Adafruit Feather S3 board is working well for me.

Also I mounted the Adafruit Feather S3 using only 1 Stacking Header and thus let the other header “float”, but the whole module is sturdy enough so far.