Trouble Portenta+MKR SHield Dynamixel

@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.

2 Likes