07-09-2023, 12:50 PM
(This post was last modified: 07-09-2023, 12:54 PM by saint_code.)
Hi
I am try to flash my brand new KinKony A16 controller with empty sketch using Arduino 2.1.1
earn "A fatal error occurred: Invalid head of packet (0xA6)" error
also esptool shows some other errors
but erase successfully
some additional info from Arduino serial port monitor
looks like A16 is into continius loop reset ?
I am try to flash my brand new KinKony A16 controller with empty sketch using Arduino 2.1.1
earn "A fatal error occurred: Invalid head of packet (0xA6)" error
Code:
Linking everything together...
/Users/myuser/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-gcc -nostdlib -L/Users/myuser/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/lib -L/Users/myuser/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/ld -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u esp_app_desc -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception -Wl,--start-group /private/var/folders/42/swzk51zs3x93tjqmp7mlcmhm0000gn/T/arduino/sketches/F59284665596F1CC333E4934A94B676A/sketch/sketch_jul9a.ino.cpp.o /private/var/folders/42/swzk51zs3x93tjqmp7mlcmhm0000gn/T/arduino/sketches/F59284665596F1CC333E4934A94B676A/core/core.a -lgcc -lesp_websocket_client -lwpa2 -ldetection -lesp_https_server -lwps -lhal -lconsole -lpe -lsoc -lsdmmc -lpthread -llog -lesp_http_client -ljson -lmesh -lesp32-camera -lnet80211 -lwpa_supplicant -lc -lmqtt -lcxx -lesp_https_ota -lulp -lefuse -lpp -lmdns -lbt -lwpa -lspiffs -lheap -limage_util -lunity -lrtc -lmbedtls -lface_recognition -lnghttp -ljsmn -lopenssl -lcore -lfatfs -lm -lprotocomm -lsmartconfig -lxtensa-debug-module -ldl -lesp_event -lesp-tls -lfd -lespcoredump -lesp_http_server -lfr -lsmartconfig_ack -lwear_levelling -ltcp_transport -llwip -lphy -lvfs -lcoap -lesp32 -llibsodium -lbootloader_support -ldriver -lcoexist -lasio -lod -lmicro-ecc -lesp_ringbuf -ldetection_cat_face -lapp_update -lespnow -lface_detection -lapp_trace -lnewlib -lbtdm_app -lwifi_provisioning -lfreertos -lfreemodbus -lethernet -lnvs_flash -lspi_flash -lc_nano -lexpat -lfb_gfx -lprotobuf-c -lesp_adc_cal -ltcpip_adapter -lstdc++ -Wl,--end-group -Wl,-EL -o /private/var/folders/42/swzk51zs3x93tjqmp7mlcmhm0000gn/T/arduino/sketches/F59284665596F1CC333E4934A94B676A/sketch_jul9a.ino.elf
/Users/myuser/Library/Arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool --chip esp32 elf2image --flash_mode dio --flash_freq 80m --flash_size 4MB -o /private/var/folders/42/swzk51zs3x93tjqmp7mlcmhm0000gn/T/arduino/sketches/F59284665596F1CC333E4934A94B676A/sketch_jul9a.ino.bin /private/var/folders/42/swzk51zs3x93tjqmp7mlcmhm0000gn/T/arduino/sketches/F59284665596F1CC333E4934A94B676A/sketch_jul9a.ino.elf
esptool.py v3.0-dev
python /Users/myuser/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/tools/gen_esp32part.py -q /private/var/folders/42/swzk51zs3x93tjqmp7mlcmhm0000gn/T/arduino/sketches/F59284665596F1CC333E4934A94B676A/partitions.csv /private/var/folders/42/swzk51zs3x93tjqmp7mlcmhm0000gn/T/arduino/sketches/F59284665596F1CC333E4934A94B676A/sketch_jul9a.ino.partitions.bin
/Users/myuser/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-size -A /private/var/folders/42/swzk51zs3x93tjqmp7mlcmhm0000gn/T/arduino/sketches/F59284665596F1CC333E4934A94B676A/sketch_jul9a.ino.elf
Sketch uses 199324 bytes (15%) of program storage space. Maximum is 1310720 bytes.
Global variables use 13224 bytes (4%) of dynamic memory, leaving 314456 bytes for local variables. Maximum is 327680 bytes.
"/Users/myuser/Library/Arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool" --chip esp32 --port "/dev/cu.usbserial-210" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 "/Users/myuser/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/tools/partitions/boot_app0.bin" 0x1000 "/Users/myuser/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/bin/bootloader_dio_80m.bin" 0x10000 "/private/var/folders/42/swzk51zs3x93tjqmp7mlcmhm0000gn/T/arduino/sketches/F59284665596F1CC333E4934A94B676A/sketch_jul9a.ino.bin" 0x8000 "/private/var/folders/42/swzk51zs3x93tjqmp7mlcmhm0000gn/T/arduino/sketches/F59284665596F1CC333E4934A94B676A/sketch_jul9a.ino.partitions.bin"
esptool.py v3.0-dev
Serial port /dev/cu.usbserial-210
Connecting....
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: b0:a7:32:80:e4:a0
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
A fatal error occurred: Invalid head of packet (0xA6)
Failed uploading: uploading error: exit status 2
also esptool shows some other errors
Code:
esptool.py --baud 115200 write_flash 0x0 tasmota32.bin --flash_freq 80m --flash_mode dio --flash_size 4MB
esptool.py v4.6.2
Found 2 serial ports
Serial port /dev/cu.usbserial-210
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: b0:a7:32:80:e4:a0
Uploading stub...
Running stub...
Stub running...
WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x001d3fff...
Compressed 1915648 bytes to 1228182...
Writing at 0x0000e5d8... (4 %)Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/esptool/__init__.py", line 1073, in _main
main()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/esptool/__init__.py", line 868, in main
operation_func(esp, args)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/esptool/cmds.py", line 595, in write_flash
esp.flash_defl_block(block, seq, timeout=timeout)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/esptool/loader.py", line 131, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/esptool/loader.py", line 1037, in flash_defl_block
self.check_command(
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/esptool/loader.py", line 436, in check_command
val, data = self.command(op, data, chk, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/esptool/loader.py", line 405, in command
p = self.read()
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/esptool/loader.py", line 338, in read
return next(self._slip_reader)
^^^^^^^^^^^^^^^^^^^^^^^
StopIteration
A fatal error occurred: The chip stopped responding.
but erase successfully
Code:
esptool.py erase_flash
esptool.py v4.6.2
Found 2 serial ports
Serial port /dev/cu.usbserial-210
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: b0:a7:32:80:e4:a0
Uploading stub...
Running stub...
Stub running...
WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.
Erasing flash (this may take a while)...
Chip erase completed successfully in 0.1s
Hard resetting via RTS pin...
some additional info from Arduino serial port monitor
looks like A16 is into continius loop reset ?
Code:
[13:42:55]rst:0x3 (SW_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
[13:42:55]configsip: 0, SPIWP:0xee
[13:42:56]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[13:42:56]mode:DIO, clock div:2
[13:42:56]load:0x3fff0030,len:1184
[13:42:56]load:0x40078000,len:12784
[13:42:56]load:0x40080400,len:3032
[13:42:56]entry 0x400805e4
[13:42:56]ets Jul 29 2019 12:21:46
[13:42:56]
[13:42:56]rst:0x3 (SW_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
[13:42:56]configsip: 0, SPIWP:0xee
[13:42:56]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[13:42:56]mode:DIO, clock div:2
[13:42:56]load:0x3fff0030,len:1184
[13:42:56]load:0x40078000,len:12784
[13:42:56]load:0x40080400,len:3032
[13:42:56]entry 0x400805e4
[13:42:56]ets Jul 29 2019 12:21:46
[13:42:56]
[13:42:56]rst:0x3 (SW_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
[13:42:56]configsip: 0, SPIWP:0xee
[13:42:56]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[13:42:56]mode:DIO, clock div:2
[13:42:56]load:0x3fff0030,len:1184
[13:42:56]load:0x40078000,len:12784
[13:42:56]load:0x40080400,len:3032
[13:42:56]entry 0x400805e4
[13:42:57]ets Jul 29 2019 12:21:46
...