arduino / uno-r4-wifi-usb-bridge

27 stars 9 forks source link

0.2.0 Firmware update has bricked my Arduino R4 Wifi #9

Closed princelundgren closed 1 year ago

princelundgren commented 1 year ago

Bug description: After flashing successfully to 0.2.0. I am no longer able to upload any code to the Arduino R4 Wifi. I am getting error message "No device found on cu.usbmodemDC5475C5165C2". I have tried to flash firmware and upload code from both my Macbook and my Windows PC but I am having the same issue on both. See below image to see error message I am receiveing when upload code from Arduino IDE.

CleanShot 2023-07-13 at 18 39 46@2x

Reproduce:

  1. Firmware updated using instructions from this forum post. The firmware update is successfully completed. EDIT: Would like to add, the last step where it says to physically reconnecting the board I am doing as well
  2. Try to Upload code from Arduino IDE but fails with error message "No device found on cu.usbmodemDC5475C5165C2".
facchinm commented 1 year ago

Hi @PrinceBalabis , Did you disconnect physically the board from the computer after updating the firmware? That's unfortunate but there's a bug in esp32 preventing the board to reboot without user intervention.

vshymanskyy commented 1 year ago

Yes, looks like this happens from time to time, not directly after the firmware upgrade. Reconnecting the board physically helps.

princelundgren commented 1 year ago

I have physically reconnected the board to the Macbook after flashing firmware, even tried to connect to my PC afterwards, getting same error message on both computers. To clarify, I can find the board on the list of devices in Arduino IDE on both my Macbook and PC, but it's only when uploading code that I get the error message.

EDIT: The board has been physically disconnected for 24h now. I just tried reconnected to my Mac and upload code, still getting the same error message

princelundgren commented 1 year ago

I've also been trying to flash to 0.1.0 in an effort to unbrick my board, I am trying to perform the flash but maybe I am not smart enough to figure this out.

  1. Download assets from https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/tag/0.1.0
  2. Set the board to ESP mode by shorting the pins as explained here
  3. Connect board to Macbook
  4. Run command from assets folder: esptool.py --chip esp32s3 --port "/dev/cu.usbmodemDC5475C5165C2" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x0 "CompostaUSBBridge.ino.bootloader.bin" 0x8000 "CompostaUSBBridge.ino.partitions.bin" 0xe000 "boot_app0.bin" 0x10000 "CompostaUSBBridge.ino.bin"
  5. Get error message A fatal error occurred: Failed to connect to ESP32-S3: No serial data received. (See attached image). CleanShot 2023-07-14 at 16 51 10@2x

UPDATE: Figured out the problem was due to ESP mode not working. I tried to connect and reconnect a couple of times until it finally went into ESP Mode(don't ask me how), however I get another error now. "A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption". I have tried different baud rates; 9600, 115200 and 921600.

CleanShot 2023-07-14 at 17 49 33@2x
LYB030 commented 1 year ago

i got same problem

princelundgren commented 1 year ago

I bought a 2nd Arduino Uno R4 and tried to flash using the guide on Arduino Cloud IoT when registering an Arduino. This broke my 2nd Arduino Uno R4 as well so I have two Arduino Uno R4 which are no longer working.

Can I get some help in reflashing to previous firmware to see if I can restore my Arduinos? I am not able to do this as mentioned in previous comment

RickorDD commented 1 year ago

i flashed with the Jumper on ESP Pin and flashed with MacOS and ./bin/espflash ... and it was successful With Windows has not running with error and the workaround with Mac Console was not running without jumper. After the flash i press the reset button, not USB unplugged

But now I also have the problem that the UNO R4 sometimes does not start immediately and hangs. But after reset button it works

pennam commented 1 year ago

@PrinceBalabis @RickorDD are your boards from the early access program?

@PrinceBalabis have you tried using a different PC and/or USB cable? What macOS version are you using?

RickorDD commented 1 year ago

no board from early access

pennam commented 1 year ago

After the flash i press the reset button, not USB unplugged

After flashing the wifi firmware you have to unplug the board, remove the jumper wire, and connect the board again to the PC. Only pressing the reset button the board will stay in ESP download mode.

princelundgren commented 1 year ago

@PrinceBalabis @RickorDD are your boards from the early access program?

Not that I know of, they are purchased from a local store

@PrinceBalabis have you tried using a different PC and/or USB cable? What macOS version are you using?

Yes, I have tried flashing firmware and uploading code from all of these devices:

  1. Macbook 1
  2. Macbook 2
  3. Windows PC

Both of my Arduino Uno R4 worked completely fine until I flashed them.

I follow these instructions (including physically disconnecting the USB cable and trying to upload code from all my Macbooks and PC's) Screenshot 2023-07-21 203656

See here that the flash is successful from my PC: Screenshot 2023-07-21 203623

See here how the upload fails (same with my PC, Mac 1 and Mac 2): Screenshot 2023-07-21 203748

LYB030 commented 1 year ago

same problem

RickorDD commented 1 year ago

do you unplugged the jumper? With Jumper is COM5 without COM4

RickorDD commented 1 year ago

Update to hang. UNO R4 starts ever, but sometimes is to long that connect to WiFi I will check this again.

princelundgren commented 1 year ago

do you unplugged the jumper? With Jumper is COM5 without COM4

I don't use a jumper when flashing 0.2.0. It flashes fine. When I replug the Arduino it is COM4, and when I try to flash it fails. see my previous comment with pictures showing that it is COM5 when flashing and COM4 when uploading code: https://github.com/arduino/uno-r4-wifi-usb-bridge/issues/9#issuecomment-1646102559

LYB030 commented 1 year ago
image

same problem!

RickorDD commented 1 year ago

when could be use a jumper or when not??? Whats say the Arduino Team? Can you check with jumper?

Bildschirmfoto 2023-07-22 um 20 01 48

RickorDD commented 1 year ago

Bildschirmfoto 2023-07-22 um 20 04 51

pennam commented 1 year ago

@PrinceBalabis i've prepaerd a package of the 0.1.0 firmware version you can upload using the update script:

can you please check if going back to firmware version 0.1.0 restores upload functionality of your boards?

pennam commented 1 year ago

@RickorDD The jumper wire is used to put the board in ESP downaload mode. The same job can be done using the unor4wifi-reboot-* binary that is included in the unor4wifi-update-* package.

You should not use the jumper wire if you are using the unor4wifi-update-* package.

If there are troubles using the unor4wifi-update-* package (board is not going in ESP download mode) You can manually put the board in in ESP download mode using the jumper wire following this istructions:

https://github.com/arduino/uno-r4-wifi-usb-bridge/tree/main/unor4wifi-updater#option-2

princelundgren commented 1 year ago

@PrinceBalabis i've prepaerd a package of the 0.1.0 firmware version you can upload using the update script:

can you please check if going back to firmware version 0.1.0 restores upload functionality of your boards?

Thank you for the help! Can confirm I flashed both my Arduinos R4's and I can now upload code just fine.

  1. Downloaded the macos 0.1.0 zip file you linked
  2. Ran chmod +x update.command
  3. Ran ./update.command.
  4. The flash was successful
  5. Unplug and replug Arduino R4
  6. Upload code from Arduino IDE
  7. Upload successful!
CleanShot 2023-07-25 at 01 53 36@2x CleanShot 2023-07-25 at 01 54 32@2x
princelundgren commented 1 year ago

Now this is interesting. After flashing to 0.1.0, I thought I'll try to flash 0.2.0 again. I did the same procedure and now uploading code to my 0.2.0 Arduino works fine. I tried the same with flashing my 2nd Arduino, and it works fine too.

I can only think of two theories why my Arduinos bricked:

  1. I had almost the exact same code on both my Arduino R4's when I flashed them (both Arduinos completely unattached from any components other than the USB cable so it wasn't hardware related). Perhaps the uploaded code somehow affected the flash and caused the brick. However, this doesn't exactly explain why the Arduinos started working again after flashing 0.1.0, after trying to reflash 0.2.0 multiple times and they remained bricked. So this theory is maybe less likely.
  2. Flashing 0.2.0 on a vanilla production Arduino R4 bricks it. Flashing with the 0.1.0 firmware first somehow allows for 0.2.0 to flash successfully.
pennam commented 1 year ago

@PrinceBalabis Thanks for the feedback 0.1.0 is the vanilla production firmware so i suspect the issue could be in the sketch loaded during the upgrade from 0.1.0 to 0.2.0. Do you remember what sketch was running when your board has bricked?

princelundgren commented 1 year ago

@PrinceBalabis Thanks for the feedback 0.1.0 is the vanilla production firmware so i suspect the issue could be in the sketch loaded during the upgrade from 0.1.0 to 0.2.0. Do you remember what sketch was running when your board has bricked?

I'm not completely sure of the exact code because I don't have a commits on the code before flashing, just approximately. I had my own code uploaded used for a quadcopter project, though because it was very early stage of development, it was not a lot of code involved when I was flashing the first Arduino, and looking back at the commit history, I believe it was quite a different code from when I flashed the 2nd Arduino.

I believe when I flashed the first Arduino, it was quite lightweight, it involved Serial, FreeRTOS & blinking built-in LED, I might've had some WiFi code then, not sure.

The code I had uploaded when I flashed the 2nd Arduino, No longer had FreeRTOS but included Wire.h and some code for communicating with MPU-9150 and MP-280.

princelundgren commented 1 year ago

Flashed with latest 0.2.1 firmware on both my Arduino Uno R4 and uploading sketch works fine! https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/tag/0.2.1