MATLAB: External mode error with Arduino Mega 2560

2560arduinoch340externalmegamode

Why does shipping demo fail to connect to target in external mode, even though the code download to target is successful?
The error shown is as below:

Best Answer

The issue is seen in variants of Arduino boards that are manufactured by third party companies which may use a serial over USB chip of type 'CH340' instead of the traditional Atmega 16U2 chip
The CH340 chip does not support greater than 230400 Bauds which is less than our external mode default Baud Rate of 921600 Bauds
It is recommended to use official Arduino boards, however, if the customer chooses to use other boards and works in external mode, the below API may be used to explicitly set the external mode default Baud Rate to 230400
>>codertarget.arduinobase.registry.setBaudRate(mdl,230400)
It is recommended to use the same API as below to verify if the external mode default Baud Rate is now set to 230400 Bauds
>>codertarget.arduinobase.registry.setBaudRate(mdl)