Trouble Portenta+MKR SHield Dynamixel


my servos are Dynamixel MX64AT 2.0 and MX106T 1.0

My system is Portenta H7 connected to them through MKR shield. All is charged with 12V.

If I use an arduino uno or an openCM904 the dynamixel works properly. With portenta and dynamixel shield I have problems. I linked the dynamixel to the DXL_T3 port as your manual said because I have MX series dynamixel but no one sketch works. Any idea, please?
Thank you

1 Like

It could be some bug in Portenta. I heard some of user has faced the same issue when using the shield. I have my own portenta shield. Later I will test it too.

Hi @Yogurt_Man I was searching for a solution but I didn’t find it yet. It seems like portenta h7 not works with mkr shield dynamixel. I found only this post AX-12A cannot be pinged - ROBOTIS-GIT/DynamixelShield.
IS there some updates from you?
Thank you

Hmm I would like to test, but I am in trouble while uploading an example of Dynamixel2Arduino (D2A)

I search the google and nothing has not given me insight yet. Did you also encounter that issue? I am on Linux Ubuntu 16.04. Portenta H7 only upload. (Arduino 1.8.13)

Never seen this error before with other board. Portenta has some given somewhat trouble everyone compared to other casual arduino boards.

Hi @Yogurt_Man I never had your problem using portenta h7.
I am working with Windows 10 and Arduino 1.8.19.
If I run scan and id sketches coming from examples of Dynamixel2Arduino, that is the suggestion from the manual, they don’t find the servo. It is settled on id=1,BR=57600, Protocol 2.0
I have no idea even more because from the documentation the mkrshield for dynamixel is made considering the compatibility with portenta.

1 Like

Hi @Yogurt_Man is there some update about the communication between portenta h7 and MKR dynamixel shield?

Thank You

It seems that this issue is resolved very recently by @willson with the latest version 0.6.0 of Dynamixel2Arduino.


Thank You but it seems still not to work with my environment. Communication Problem between Portenta H7 and MKR Dynamixel Shield · Issue #96 · ROBOTIS-GIT/Dynamixel2Arduino · GitHub

@willson @Yogurt_Man
I just got my Portenta H7 in today. So I hooked up 2 XL-320s to the DXL MKR Shield and just had a simple sketch to get them into Wheel Mode and rotate/stop them for short intervals and everything seemed to work OK for me. See screen shot below:

There were some warnings during compiling (malloc) and downloading, but the code downloaded and ran OK for me.


Hi @DjangoTango

Make sure that you’ve uploaded the Dynamixel Shield example, but not Dynamixel2Arduino example. And also check that you’ve chosen the proper board for your Portenta board either M4 / M7 core.

I’ve simply tested my own Portenta H7 + DYNAMIXEL Shield for Arduino MKR board.
I have successfully ran the position_mode.ino and ping.ino in DynamixelShield library (v0.2.6, The latest) with Dynamixel2Arduino libaray (v0.6.0, The latest)

Position Mode

Ping (ID: 5)

The tested setup is as follows,

  • XL330-M288 (Factory Released State: 57600 bps, Position Mode)
  • DYNAMIXEL Shield for Arduino MKR Board.
    - H/W Setup
    • Jumper Cab positioned at5V for USB power delivery.

    • Board Configuration: Tested all flashes option and it works all fine.

Note: When you are having trouble with Portenta 7 at recognizing port, do Recovery Mode by holding down the Reset budtton for few Secs on the Arduino Portenta board and it will bring you back to the port recognition.

@DjangoTango is running the MX-64AT(2.0) so the jumper should be set to the VIN(DXL) side.

I have no problem with recognition. My Portenta H7 works correctly. The problem is the communication with the Arduino MKR shield. Anyway, following the documentation I set the jumper on the VIN side. Till now I have not solved it. It was suggested to add a delay. It seems to solve the problem but not in my case (Communication Problem between Portenta H7 and MKR Dynamixel Shield · Issue #96 · ROBOTIS-GIT/Dynamixel2Arduino · GitHub) Thank you for your interest!

Could you double check if you are running the example from the DYNAMIXEL Shield library?
DYNAMIXEL2Arduino examples will not work with Portenta + DYNAMIXEL MKR Shield.

1 Like

@DjangoTango @Yogurt_Man

Actually, ones can use the Dynamixel2Arduino library directly with the combo Portenta H7 + DXL MKR shield, if ones can make sure that the DXL_DIR_PIN parameter is set to “A6” instead of “2”.

In the picture below, I have fixed this issue by commenting out the original line 52 and added line 53 (in the “scan_dynamixel.ino” sketch inside the Dynamixel2Arduino example folder).

This modified sketch compiled with 3 warnings (see code insert below), but seemed to upload OK and ran fine for me, as it could identify my 2XL-430s with ID 11 and 12.

C:\Users\xxx\Documents\Arduino\libraries\Dynamixel2Arduino\src\dxl_c\protocol.c:704:37: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   uint8_t* param_array = (uint8_t *)malloc(sizeof(uint8_t) * size);
C:\Users\xxx\Documents\Arduino\libraries\Dynamixel2Arduino\src\dxl_c\protocol.c:702:12: warning: unused variable 'byte_stuffing_cnt' [-Wunused-variable]
   uint16_t byte_stuffing_cnt = 0;
C:\Users\xxx\Documents\Arduino\libraries\Dynamixel2Arduino\src\utility\master.cpp:1144:38: warning: variable length array 'p_recv_buf_array' is used [-Wvla]
   uint8_t* p_recv_buf_array[xel_count];
Opening DFU capable USB device...
Device ID 2341:035b
Device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading element to address = 0x08040000, size = 141568
Erase   	[=========================] 100%       141568 bytes
Erase    done.
Download	[=========================] 100%       141568 bytes
Download done.
File downloaded successfully
Warning: Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release
Transitioning to dfuMANIFEST state

So these are the items that ROBOTIS folks could fix up at their next maintenance round for the Dynamixel2Arduino library and example codes.


Thank You both so much.

This can work as solution. I confirm it.

This posting thing is new to me but is pretty cool that folks like you teach others. Many thanks, I will change pin# and run it.