After a wrong sketch, Arduino R4 does not accept new sketch

A wrong sketch was recorded on the Arduino R4 which is sending too much data via the serial. After that, the Arduino IDE can no longer send sketch to the Arduino R4 via USB.
I tried to use a second R4 with the ISCP interface to clear the sketch out of its memory, but the IDE version 2.3.2 did not support R4 to work as a recorder. Is there any other way to delete this wrong sketch and let R4 to receive new sketches?

Compiling messages:

Sketch uses 38740 bytes (14%) of program storage space. Maximum is 262144 bytes.
Global variables use 3940 bytes (12%) of dynamic memory, leaving 28828 bytes for local variables. Maximum is 32768 bytes.
dfu-util 0.11-arduino4

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
Device ID 2341:0069
Run-Time device DFU version 0101
Claiming USB DFU (Run-Time) Interface...
Setting Alternate Interface zero...
Determining device status...
Failed to retrieve language identifiers
Failed to retrieve language identifiers
error get_status: LIBUSB_ERROR_TIMEOUT
Failed uploading: uploading error: exit status 74

I do not use this board but I always put a few second delay in setup, reason is if I get a serial flood like you did I have a few seconds for the programer to get control.

1 Like

Great solution! It worked well and I was able to save the new sketch!

I will consider your words, because the solution from Delta_G, did not work on Arduino Nano. Only Arduino R4. Thanks!

1 Like

Well, in this case, it's better to implement the suggestion of using a delay in the setup.

1 Like

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