Having problems on a Mac with IDE 2.0 when detecting ports, I have gone back to IDE 1.8 assuming that there would not be such a problem with this IDE version (as I have read in several posts on this). I was wrong.
When starting my Mac and opening IDE 1.8, no ports are detected. If I push the reset button in the board, the port where the Arduino (Nano 33 IOT) is connected is suddenly detected. Then I can upload my programs, edit them, reupload them, test them, etc... till some point in which I don't know why the port stops being detected. No upload is possible, so, and the only solution I have found so far is:
1- Reboot the Mac
2- Open IDE
3- Load my program
4- Checking that no ports are detected
5- Push the reset button on the board
6- Port suddenly is detected
7- Then I can upload the program and work with the board till the port stops being detected.
8- Go to 1
All this is a pain in the ass. I spend more time rebooting my Mac than debugging my programs. Is there any way of overcoming all this ? Any IDE version with no port detection problems ?
I have read dozens posts on this but I have not been able to find so far any solution. I would appreciate very much if somebody could give a clue about how to overcome this problem.
The legacy IDE (1.8.19 and older) has no known port issues.
The Nano 33 IoT has native USB if not mistaken. In which case part of the code that you upload contains functionality to identify the board to the PC and react on software reset (opening/closing the serial port with a baud rate of 1200 baud).
If your sketch corrupts the variables used by those functionalities, one or both of those functionalities no longer function as expected.
You can simply test by using basic sketches like "blink" or "hello world"; does the problem also show its face with those? If not and it happened to me I would suspect my sketch.
I'm not sure how the Nano 33 IoT is supposed to behave on reset; would a single tap invoke the bootloader or not? The L-LED will (probably) fade in-and-out when the bootloader is active (this is the expected behaviour with e.g. Leonardos and Micros). You can try both single tap and double tap on the reset button and check if there is a difference in behaviour regarding the L-LED; I do not know how to check the behaviour on the Mac itself, in Windows there would be Windows device manager to check it.
The Nano 33 IoT has native USB if not mistaken. In which case part of the code that you upload contains functionality to identify the board to the PC and react on software reset (opening/closing the serial port with a baud rate of 1200 baud).
If your sketch corrupts the variables used by those functionalities, one or both of those functionalities no longer function as expected
If this is so, how can I go back to the original status of the board ?
You can simply test by using basic sketches like "blink" or "hello world"; does the problem also show its face with those? If not and it happened to me I would suspect my sketch.
If I cannot connect the board to the Mac, I cannot upload any program....
Following the reboot cycle mentioned in my original post, I have reached a situation in which I have not been able anymore to make the Nano IOT visible to the Mac.
Suspecting some hardware failure, I have removed the Nano from its board and tried to connect the Mac to it alone. No success. The port was not recognized.
Then, I have replaced the Nano IOT alone by another similar unit, and .... BINGO ! The port was discovered by the Mac
Then I have replaced the Nano on the board and once again it has been recognized by the Mac.
I have uploaded the program that I was testing and up to now everything seems to be ok.
Conclusion 1: the Nano IOT has suffered a process that has started making difficult the communication with the Mac and has ended making this communication impossible.
Conclusion 2: It is very convenient to have spare CPUs to be able to check this kind of things....