Closed Twilight-Logic closed 3 years ago
I suspect the board is not actually bricked, but the failed upload breaks the sketch and prevents an automatic restart into the bootloader (which is handled by the sketch when its serial port is opened at 1200bps). You can probably recover using a manual reset just before starting the upload (using the reset button, which should keep the bootloader active for a dozen or so seconds, indicated by the slowly pulsating led).
Having said that, the failed upload is still problematic of course. I'm not quite sure what would cause all these errors, haven't seen them before.
On a hunch: Could it be that modemmanager is interfering with the serial port? It is known to mess with serial ports by probing them and a recent change has inadvertedly made it more aggressive towards Arduino boards. The best way to test this is to (temporarily) remove modemmanager, since probing can (I think) be autostarted from udev even when not running.
My apologies if I have used the term 'bricked' incorrectly, and it may perhaps have been more accurate to say inaccessible via the serial port. No amount of playing with reset will allow it to be accessed. This has been tried ad nauseam with various timings but with no result.
I am not familiar with modemmanager but will investigate further and report back.
My apologies if I have used the term 'bricked' incorrectly,
No problem :-)
No amount of playing with reset will allow it to be accessed.
Did you check dmesg when pressing the reset button? If the bootloader still functions normally, I would expect that to at least create a serial port (for a dozen or so seconds, until the bootloader quits again).
Indeed it does come up as /dev/ttyACM0 for about 8 seconds after reset, then it disappears. Here is the dmesg output:
[ 413.384345] usb 2-1.6: Product: Arduino Micro
[ 413.384348] usb 2-1.6: Manufacturer: Arduino LLC
[ 413.384865] cdc_acm 2-1.6:1.0: ttyACM0: USB ACM device
[ 420.989299] usb 2-1.6: USB disconnect, device number 16
[ 421.221044] usb 2-1.6: new full-speed USB device number 17 using ehci-pci
[ 421.301003] usb 2-1.6: device descriptor read/64, error -32
[ 421.488971] usb 2-1.6: device descriptor read/64, error -32
[ 421.680942] usb 2-1.6: new full-speed USB device number 18 using ehci-pci
[ 421.760931] usb 2-1.6: device descriptor read/64, error -32
[ 421.948919] usb 2-1.6: device descriptor read/64, error -32
[ 422.057052] usb 2-1-port6: attempt power cycle
[ 422.660777] usb 2-1.6: new full-speed USB device number 19 using ehci-pci
[ 423.076714] usb 2-1.6: device not accepting address 19, error -32
[ 423.156712] usb 2-1.6: new full-speed USB device number 20 using ehci-pci
[ 423.572654] usb 2-1.6: device not accepting address 20, error -32
[ 423.572806] usb 2-1-port6: unable to enumerate USB device
However, I have now also investigated ModemManager. It was indeed running on my system, having been installed by default. I recovered by Micro board and then disabled ModemManager on my Linux Mint 19.2 machine with:
systemctl stop ModemManager
I then tried the upload again and this time it was successful. I tried it a couple of times more and it worked each time consistently, so evidently ModemManager was interfering with the process. Since I don't need it (there is no modem of any kind attached to this machine) I have now disabled it with:
systemctl disable ModemManager
Thank you for assistance with this issue.
When I try to upload a sketch a 32u4 Micro board on Linux, the board gets bricked each time and has to be recovered using an AVR programmer. Have tested with IDE version 1.8.8, 1.8.9 and 1.8.10. The problem does not seem to happen on Windows.
On Linux the board is assigned serial port /dev/ttyACM0. The problem happens with new boards with standard bootloader. I am currently using the IDE Export Compiled Binary and uploading the version with the bootlloader using an AVR programmer to get around the problem.
Status of USB and serial before the upload:
The test sketch that I am using:
Output during compile and upload (excessive duplication removed):
Status of USB/serial after the upload has failed:
After the board is bricked, plugging in the board does nothing and shows nothing in dmesg. Its as if it hasn't been connected. Different USB cables have been tried (all work in Windows) and the board is connected directly to the USB port and not indirectly via a USB hub. As mentioned above, the board can be recovered with an AVR programmer by using the Burn Bootloader feature in the Tools menu within the IDE.