phev-remote / phev-ttgo

13 stars 2 forks source link

Unable to flash Lily Go #9

Closed jampez77 closed 1 year ago

jampez77 commented 3 years ago

Hoping someone can point me in the right direction. I have the Lily Go and can observe in a serial monitor that it is working as I can enter download mode this method:

https://github.com/Xinyuan-LilyGO/LilyGo-T-Call-SIM800/issues/89#issuecomment-686185252

However I get the following error A fatal error occurred: Failed to write to target RAM (result was 01070000).

Here is the full terminal log.

jamiepezone@Jamies-iMac phev-ttgo % idf.py -p /dev/cu.usbmodem52780010701 flash
Executing action: flash
Running ninja in directory /Users/jamiepezone/esp/phev-ttgo/build
Executing "ninja flash"...
[1/4] Performing build step for 'bootloader'
ninja: no work to do.
[1/2] cd /Users/jamiepezone/esp/esp-idf/components/esptool_py && /usr/local/Cellar/cmake/3.20.4/bin/cmake -D IDF_PATH="/Us...ORY="/Users/jamiepezone/esp/phev-ttgo/build" -P /Users/jamiepezone/esp/esp-idf/components/esptool_py/run_serial_tool.cmake
esptool.py esp32 -p /dev/cu.usbmodem52780010701 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x8000 partition_table/partition-table.bin 0xd000 ota_data_initial.bin 0x1000 bootloader/bootloader.bin 0x10000 phev-ttgo.bin
esptool.py v3.1-dev
Serial port /dev/cu.usbmodem52780010701
Connecting....
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 24:6f:28:d1:3a:f8
Uploading stub...

A fatal error occurred: Failed to write to target RAM (result was 01070000)
CMake Error at run_serial_tool.cmake:50 (message):
  /Users/jamiepezone/.espressif/python_env/idf4.3_py3.8_env/bin/python
  /Users/jamiepezone/esp/esp-idf/components/esptool_py/esptool/esptool.py
  --chip esp32 failed

FAILED: CMakeFiles/flash 
cd /Users/jamiepezone/esp/esp-idf/components/esptool_py && /usr/local/Cellar/cmake/3.20.4/bin/cmake -D IDF_PATH="/Users/jamiepezone/esp/esp-idf" -D SERIAL_TOOL="/Users/jamiepezone/.espressif/python_env/idf4.3_py3.8_env/bin/python /Users/jamiepezone/esp/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32" -D SERIAL_TOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="/Users/jamiepezone/esp/phev-ttgo/build" -P /Users/jamiepezone/esp/esp-idf/components/esptool_py/run_serial_tool.cmake
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
papawattu commented 3 years ago

Looks like the memory address config is not correct, have a look in the ESP bootloader memory layout config and try out a few options. Try erasing the flash first as well.