Description
Describe the problem
When uploading to the M4 core of the Arduino Portenta H7 board, the port selection is lost.
🐛 It is inconvenient for the user to have to reselect the port after every upload, and may cause confusion if they didn't notice this happened.
To reproduce
Equipment
Steps
- Use Boards Manager to install version 3.5.4 of the "Arduino Mbed OS Portenta Boards" platform.
ⓘ Versions 4.0.2 and newer do not provide the required conditions to reproduce the fault due to arduino/ArduinoCore-mbed@29184e9 - Select File > New from the Arduino IDE menus.
- Connect a "Portenta H7" board to your computer.
- Select Tools > Board > Arduino Portenta H7 (M4 Core) from the Arduino IDE menus.
- Select the port of the board from the Tools > Port menu.
- Select Sketch > Upload from the Arduino IDE menus.
- Wait for the upload to finish.
- Open the Tools > Port menu.
🐛 The port is no longer selected. You must select the port from the menu again after every single upload to this board.
Expected behavior
The port selected by the user remains selected after uploading.
Arduino IDE version
Original report
2.0.0-beta.2-snapshot.f9730ab
Last verified with
2.0.0-rc9.2.snapshot-ca47e8a
Operating system
Windows
Operating system version
10
Additional context
I suspect this is related to the behavior of the port of the native USB boards, where the USB CDC serial port disappears and reappears during the switch from the bootloader to the sketch application.
The Portenta H7 is unique in that it has two different board definitions, but only one of these ("Arduino Portenta H7 (M7 Core)") is associated with the USB VID/PID of the port:
https://github.com/arduino/ArduinoCore-mbed/blob/3.2.0/boards.txt#L104-L111
envie_m7.upload_port.0.vid=0x2341
envie_m7.upload_port.0.pid=0x025b
envie_m7.upload_port.1.vid=0x2341
envie_m7.upload_port.1.pid=0x035b
envie_m7.upload_port.2.vid=0x2341
envie_m7.upload_port.2.pid=0x045b
envie_m7.upload_port.3.vid=0x2341
envie_m7.upload_port.3.pid=0x055b
This causes the Arduino IDE's automatic board selection to lose the port selection when the selected board doesn't match the VID/PID of the port that appears at the end of the upload process.
Originally reported at: https://forum.arduino.cc/t/0-1-0-portenta-wonders-ide-released/671634/7
I am able to build these and get them both onto the board and run, but it seems in this arrangement, the IDE windows commonly wind up reporting "not connected" in the lower right status bar.
I'm completely new to this IDE so I am curious if I should have the expectation that the connection status should be live whether the target sketch is running or not..
I also noticed that the second session I opened for the M4 sketch, I had to tell it over and over which board and port to target. I got the impression that having both sketches open might be causing a fight for the link.
Another variant of this bug was reported at #82
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details