Arduino Leonardo Not Staying Connected

Hello,
I am having a lot of difficulty with my Leonardo board. It is an official Arduino one I bought. Below I've listed exactly what I'm seeing and what I've tried to alleviate the issue based on other forum posts:

System:

  • Mac OS Apple Silicone M1 13.0.1
  • Arduino IDE Version 2.1.0

Arduino IDE Settings:

  • Board: Leonardo
  • Port: No port showing up with Leonardo naming convention
  • Programmer: ArduinoISP

Issue:

  • Connecting Arduino Leonardo with AND without using Motor Shield V2 does not appear in the 'Port' section of the IDE. Reports 'Not Connected' on the bottom right hand side of the IDE.
    Sketch uses 3956 bytes (13%) of program storage space. Maximum is 28672 bytes.
    Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
    Failed uploading: no upload port provided

Things I did to Resolve without success:

  • Rebooted the computer.
  • Removed and re-installed the Arduino IDE with the latest version. (not sure whether I was on an older version prior to re-install.
  • Tested removing Motor shield completely. Nothing plugged into the board except the USB to the computer on below steps.
  • Tested several USB cables. Made sure they are data + power.
  • Tested a USB hub powered to a wall socket.
  • Pressed the 'reset' button on the Leonardo board. This allowed the port to show up momentarily.
  • As soon as I try to upload a sketch it reports uploading... and then it fails because the port disappears again.
  • The sketch I'm trying to upload is the 'blink' from the examples.

Questions:

The only other thing I can think, is I had configured the Arduino IDE to work with the ATTiny recently. Not sure how this would have effected it or what could parameters could even be checked to see if this was an issue. Does anyone have any knowledge of the 'programmers.txt' I've seen on other forums sometimes something within here needs to change, but honestly not sure what to even look for with the leonardo specifically?

programmers.txt (4.3 KB)

picture of board pls

Here it is, it's an Arduino Leonardo board with nothing plugged in except the usb cable:

is it blink some LED if USB been plugged?

No, just the steady green light for power. If I press the 'reset' button then the yellow light next to 'L' blinks until it is reset.

so, try to hold reset button or short reset pin and GND with wire, then select port and upload

Which version of the IDE?

That will be approximately 8 seconds.

Following @kolaha's approach

  1. Reset the board.
  2. Start an upload.
  3. Reset the board again when the IDE reports the memory usage.

This can work because the compiling might take more than 8 seconds and the board is no longer in bootloader mode and hence the second reset.

The same can be achieved with the below.

If you use IDE 1.x, start the upload. When the IDE reports the memory usage, press and release the reset on the Leonardo; you have approximately the 8 seconds to do that.

I have not been succesfull using this approach in IDE 2.x because the board detection is relatively slow.

I'm not familiar enough with the ATtiny to know how it is programmed. If you have an Uno/Mega/Nano or if you have a TTL-to-USB converter, the following approach should work in both IDE versions; this approach might also work with the ATtiny but I don't know.

  1. Connect both the Leonardo and the other board (or adapter).
  2. Select the Leonardo as the board.
  3. Select the other board's / adapter's port.
  4. Stort the upload.
  5. When the IDE reports the memory usage, press and release the reset on the Leonardo; you have approximately the 8 seconds to do that.

I'm not a Mac user so can't tell you what exactly will happen on your system.

Notes:
1 }
You can actually use any port that the IDE reports; in Windows I use COM1 in this scenario which is a system port.

2 )

From memory, that would indicate that no sketch is loaded; the board should have come with the blink sketch preloaded. Part of sketches that you upload to a board with native USB provide functionality for the board detection and the software reset while sketch is running. No sketch loaded would mean that your board can't be detected and can not be reset by the IDE.

Thanks, yup I've tried all of the above with no success. @sterretje I'm on * Arduino IDE Version 2.1.0 as I mentioned above.

I should have also mentioned in my original comment that after pressing 'reset' the device:

  1. 'L' blink a few times
  2. I see the port name appear
  3. I start upload of 'blink' sketch
  4. the upload fails: Sketch uses 3956 bytes (13%) of program storage space. Maximum is 28672 bytes.
    Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
    avrdude: ser_open(): can't open device "/dev/cu.usbmodem11201": No such file or directory
    Failed uploading: uploading error: exit status 1
  5. THEN the RX light is just steadily on.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.