The encountered error is related to the installed ESP32 package. To resolve this issue, you need to update the board.txt present inside the arduino ide package and add the following line at the end of this file:
esp32wrover.upload.speed=921600
This command sets the upload speed to 921600, which is a recommended value for the ESP32-WROOM and WROVER boards. After adding this line to the end of board.txt file, save the changes and run the hardware setup again. This time, it should successfully verify the setup and establish a connection with your ESP32-WROOM board.
To open the board.txt file, run the following command in matlab command window:
Windows:
edit(fullfile(arduino.supportpkg.getIDERoot,'portable','packages','esp32','hardware','esp32','1.0.6','boards.txt'))
Linux:
edit(fullfile(arduino.supportpkg.getIDERoot,'portable','packages','esp32','hardware','esp32','1.0.6','boards.txt'))
Mac:
edit(fullfile(arduino.supportpkg.getIDERoot,'idepkgs','packages','esp32','hardware','esp32','1.0.6','boards.txt'))
Note: This workaround will work only in MATLAB R2023b and earlier versions.