Moddable-OpenSource / moddable

Tools for developers to create truly open IoT products using standard JavaScript on low cost microcontrollers.

Home Page:http://www.moddable.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xsbug not works with esp32c6

stc1988 opened this issue · comments

Now I'm trying to add new device M5nanoC6 that equipped with an ESP32-C6 in my branch.

release build with mcconfig -i shows console log on my terminal and application works fine, so I think flashing firmware is going well.
On the other hand, debug build with mcconfig -d shows no output on xsbug.Below is part of the log.

Project build complete. To flash, run this command:
/Users/satoshi/.espressif/python_env/idf5.1_py3.8_env/bin/python ../../../../../../../../../.local/share/esp32/esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32c6  write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/xs_esp32.bin
or run 'idf.py -p (PORT) flash'
Executing action: flash
Running ninja in directory /Users/satoshi/Projects/moddable/build/tmp/esp32/m5nanoc6/debug/sht3x/xsProj-esp32c6/build
Executing "ninja flash"...
[1/5] cd /Users/satoshi/Projects/moddable/build/tmp/esp32/m5nanoc6/debug/sht3x/xsProj-esp32c6/build/esp-idf/esptool_py && /Users/satoshi/.espressif/python_env/idf5.1_py3.8_env/bin/python /Users/satoshi/.local/share/esp32/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /Users/satoshi/Projects/moddable/build/tmp/esp32/m5nanoc6/debug/sht3x/xsProj-esp32c6/build/partition_table/partition-table.bin /Users/satoshi/Projects/moddable/build/tmp/esp32/m5nanoc6/debug/sht3x/xsProj-esp32c6/build/xs_esp32.bin
xs_esp32.bin binary size 0x100a30 bytes. Smallest app partition is 0x3f0000 bytes. 0x2ef5d0 bytes (75%) free.
[2/5] Performing build step for 'bootloader'
[1/1] cd /Users/satoshi/Projects/moddable/build/tmp/esp32/m5nanoc6/debug/sht3x/xsProj-esp32c6/build/bootloader/esp-idf/esptool_py && /Users/satoshi/.espressif/python_env/idf5.1_py3.8_env/bin/python /Users/satoshi/.local/share/esp32/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 /Users/satoshi/Projects/moddable/build/tmp/esp32/m5nanoc6/debug/sht3x/xsProj-esp32c6/build/bootloader/bootloader.bin
Bootloader binary size 0x3170 bytes. 0x4e90 bytes (61%) free.
[3/5] No install step for 'bootloader'
[4/5] Completed 'bootloader'
[4/5] cd /Users/satoshi/.local/share/esp32/esp-idf/components/esptool_py && /opt/homebrew/Cellar/cmake/3.26.1/bin/cmake -D IDF_PATH=/Users/satoshi/.local/share/esp32/esp-idf -D "SERIAL_TOOL=/Users/satoshi/.espressif/python_env/idf5.1_py3.8_env/bin/python;;/Users/satoshi/.local/share/esp32/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32c6" -D "SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args" -D WORKING_DIRECTORY=/Users/satoshi/Projects/moddable/build/tmp/esp32/m5nanoc6/debug/sht3x/xsProj-esp32c6/build -P /Users/satoshi/.local/share/esp32/esp-idf/components/esptool_py/run_serial_tool.cmake
esptool.py --chip esp32c6 -p /dev/cu.usbmodem2101 -b 921600 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 4MB 0x0 bootloader/bootloader.bin 0x10000 xs_esp32.bin 0x8000 partition_table/partition-table.bin
esptool.py v4.7.0
Serial port /dev/cu.usbmodem2101
Connecting...
Chip is ESP32-C6FH4 (QFN32) (revision v0.1)
Features: WiFi 6, BT 5, IEEE802.15.4
Crystal is 40MHz
MAC: 40:4c:ca:ff:fe:5b:24:04
BASE MAC: 40:4c:ca:5b:24:04
MAC_EXT: ff:fe
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00010000 to 0x00110fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 12656 bytes to 9239...
Writing at 0x00000000... (100 %)
Wrote 12656 bytes (9239 compressed) at 0x00000000 in 0.2 seconds (effective 479.8 kbit/s)...
Hash of data verified.
Compressed 1051184 bytes to 645558...
Writing at 0x00010000... (2 %)
Writing at 0x0001a4ec... (5 %)
Writing at 0x00023c79... (7 %)
Writing at 0x0002d6fd... (10 %)
Writing at 0x000330ee... (12 %)
Writing at 0x00038902... (15 %)
Writing at 0x0003f036... (17 %)
Writing at 0x0004557f... (20 %)
Writing at 0x0004bbfe... (22 %)
Writing at 0x00052ccc... (25 %)
Writing at 0x00059f6c... (27 %)
Writing at 0x00060b3d... (30 %)
Writing at 0x00066f8c... (32 %)
Writing at 0x0006de66... (35 %)
Writing at 0x0007852e... (37 %)
Writing at 0x0007e2b3... (40 %)
Writing at 0x00084ac7... (42 %)
Writing at 0x0008aa68... (45 %)
Writing at 0x00090818... (47 %)
Writing at 0x00096354... (50 %)
Writing at 0x0009c0f0... (52 %)
Writing at 0x000a1f96... (55 %)
Writing at 0x000a7bbe... (57 %)
Writing at 0x000ada95... (60 %)
Writing at 0x000b3ba7... (62 %)
Writing at 0x000b990c... (65 %)
Writing at 0x000bf801... (67 %)
Writing at 0x000c5938... (70 %)
Writing at 0x000cbc96... (72 %)
Writing at 0x000d1b63... (75 %)
Writing at 0x000d7dcd... (77 %)
Writing at 0x000ddfaf... (80 %)
Writing at 0x000e3ba8... (82 %)
Writing at 0x000e9259... (85 %)
Writing at 0x000eed26... (87 %)
Writing at 0x000f4a11... (90 %)
Writing at 0x000fa91e... (92 %)
Writing at 0x001001c6... (95 %)
Writing at 0x001064c2... (97 %)
Writing at 0x0010c7d4... (100 %)
Wrote 1051184 bytes (645558 compressed) at 0x00010000 in 7.9 seconds (effective 1060.5 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 83...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (83 compressed) at 0x00008000 in 0.1 seconds (effective 431.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
Done
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x15 (USB_UART_HPSYS),boot:0x2d (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001a36a
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xbf4
load:0x4086e610,len:0x2428
load:0x40875728,len:0xf8
entry 0x4086c410

I don't know if it's a device issue or an esp32c6 issue. Is there any way I can investigate?

Hello @stc1988, the target esp32/esp32c6 uses UART for debugging.

Please try to add "USE_USB": "2" to the build section of your device manifest.
Like:

    "build":{
        "ESP32_SUBCLASS": "esp32c6",
        "USE_USB": "2"
    },

This section in the documentation describes it: https://www.moddable.com/documentation/devices/esp32#using_usb

@mkellner
Thank you for confirming.

Please try to add "USE_USB": "2" to the build section of your device manifest.

I got it working this way! I will make PR for esp32/m5nanoc6 later.