Arduino stuck in an endless loop

My Arduino was stuck in an endless loop trying to read from a pin and print it on a serial console. Now I can’t download any other programs. What can I do to get the chip out of the loop?

+6
arduino
source share
7 answers

If you are using Arduino Uno, you can check the Atmega8U2 Upgrade to Uno or Mega2560 using DFU . Apparently, an error occurred in the interface firmware.

+7
source share

Remove the USB connection, close the IDE, open the IDE, open BareMinimum, hold the reset button, connect the USB connection, press the download button 1/2 second after removing the finger from the reset button.

+5
source share

Reprogramming the interface firmware (see ViennaMike answer) did not work for me, so I bought another Arduino and turned it into an ISP programmer and rewrote the abusive application:

fooobar.com/questions/269839 / ...

Although this approach had a certain cost, I now have another tool and a way to keep Arduino in the future.

+1
source share

This may sound silly, but how to disconnect it from the power source to reset the MCU?

Edit:

I see that it is connected via USB; then make sure you disconnect the device, remove / discharge all batteries / capacitors. If nothing works, close the Arduino IDE, change the USB port that you are using (sometimes they get stuck ..), restart the computer. Good luck

0
source share

Download the bootloader with the Avr Pocket Programmer. This solves your MCU reset. Use the Watchdog timer instruction when coding an infinite loop if you are dealing with a critical parameter that must be written when restarting.

0
source share

If you run into the same problem with Arduino Yun, try loading a blank sketch using WIFI as the port. It worked for me when I could not upload a new sketch via USB.

0
source share

Arduino will wait a short time when trying to load. That way, you can press reset and hold it until Ide tries to load. then release it.

The problem may be that when you click on the download Ide, it first compiles, and at the end of the process tries to download. Therefore, pressing reset, clicking the compile button, and immediately disabling reset does not always work, because you release reset too quickly.

0
source share

All Articles