Errors while running the flasher: Fatal error when writing to target

While running the flasher on MacOS M1, at step one i received the below error, where a fatal error occurs with failure to write to target RAM. Any tips?

Step 1/4 esp32 full

ESPTOOL Using command:--port /dev/cu.usbmodem53230050451 erase_flash

esptool.py v3.3

Serial port /dev/cu.usbmodem53230050451

Connecting...

.

Detecting chip type...

Unsupported detection protocol, switching and trying again...

Connecting...

.

Detecting chip type...

ESP32

Chip is ESP32-D0WDQ6-V3 (revision 3)

Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None

Crystal is 40MHz

MAC: [REDACTED]

Uploading stub...

Traceback (most recent call last):

File "/Users/[REDACTED]/meshtastic-flasher/venv/lib/python3.8/site-packages/meshtastic_flasher/esptool_form.py", line 70, in run

esptool.main(command)

File "/Users/[REDACTED]/meshtastic-flasher/venv/bin/esptool.py", line 4710, in main

esp = esp.run_stub()

File "/Users/[REDACTED/meshtastic-flasher/venv/bin/esptool.py", line 891, in run_stub

self.mem_block(stub[field][from_offs:to_offs], seq)

File "/Users/[REDACTED]/meshtastic-flasher/venv/bin/esptool.py", line 755, in mem_block

return self.check_command("write to target RAM", self.ESP_MEM_DATA,

File "/Users/[REDACTED]/meshtastic-flasher/venv/bin/esptool.py", line 505, in check_command

raise FatalError.WithResult('Failed to %s' % op_description, status_bytes)

esptool

.

FatalError

:

Failed to write to target RAM (result was 01070000: Operation timed out)

Does the device have meshtastic on it?

It shouldn’t as it’s a fresh device. Checked by selecting that it does and received the following, so assuming it doesn’t:
ezgif.com-gif-maker

You probably need to use the install script then, we have not managed to wrangle all devices with other firmware yet.

You can add your details to the issue here

1 Like

Understood. To clarify, while the device is listed as an option under the devices tab, not all firmware is actually present in the latest flasher?

Fixed!!

Solution might be as follows:

Attach the antenna before flashing. Yeah that’s all lolol

Although this solution doesn’t work consistently. Unknown what the fix was, but unable to install on a second device just yet.

Only recent versions are available.

What firmware is on the second device?

No firmware preinstalled, managed to install via GUI on one. On an identical device, did not manage, ran into the same error.

For a few additional devices, 1.0 was installed; however, the GUI didn’t detect them. I updated the firmware via Android OTA, and now have ~75% of devices working

I have never gotten a lilygo device without something running on it. May be an arduino sketch clogging up the serial port, but there is likely code running.

It’s running SoftRF.

Probably going to have to use the install script, we have been working on this but it is a weird combo of drivers and serial port.

1 Like

I just got a few devices (ttgo Lora32 V1 and Heltec v2.0). I had the same issues where the installer wasn’t cooperating. I think it had to do with what ever came on the devices (not meshtastic for sure). Though, for my ttgo Lora32 devices I had to install a usb driver.

I also did the manual install of the flasher, pulled down the versions with the gui, then went back to the terminal and ran device-install.sh manually. The reason I do this has much more to do with understanding what’s going on under the hood.

$ mkdir meshroot
$ cd meshroot/
$ python3 -m venv venv
$ . venv/bin/activate
$ pip install --upgrade pip
$ pip install meshtastic-flasher
$ meshtastic-flasher
<get versions and quit>
$ cd <firmware folder>
$ chmod +x device-install.sh
$ ./device-install.sh

You should be able to use the flasher to do upgrades and device configuration once you have a usb serial driver and meshtastic on the boards.

In my case I found the solution thanks to the animation above.
The real issue is that the selected port by Meshtastic Flasher is “MODEM”.
You want serial port.
As displayed in the video, just say that the firmware is already installed (even if it’s not), then serial will be available.
Then choose the “Device” (aka related firmware) and flash it.
If you have a doubt on the matching firmware just say that nothing is flashed, checked what’s recommended and do the procedure again.
In short, there’s a bug which doesn’t display all the available USB options.
They are displayed under visual code, and workaround made possible to select serial and flash my device (PaxCounter). It ain’t a driver issue.