Espressif ESP32-C6 ESP-IDF Support ESP32C6

Sysprogs forums Forums VisualGDB Espressif ESP32-C6 ESP-IDF Support ESP32C6

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33946
    gojimmypi
    Participant

    Feature request: ESP32-C6 Support in VisualGDB

    See https://github.com/espressif/esp-idf/issues/10423

    I have the ESP-IDF master branch (V5.1) installed and successfully compiling and flashing for the ESP32-C6 from my local C:\SysGCC\esp32\esp-idf\master from commandline.

    I suspect it would work in VisualGDB if I only had the ESP32C6 Device option available under Configuration Settings. (see attached)

    Are there any (unsupported) ways of getting the ESP32C6 device listed in VisualGDB at this time?

    I see there’s a “ESP32 debug methods” package dated just today. What’s that?

    Thank you.

    Attachments:
    You must be logged in to view attached files.
    #33958
    support
    Keymaster

    Hi,

    VisualGDB takes the list of ESP32 devices from the <SysGCC>\esp32\esp32-bsp\BSP.xml file, so you can try editing it, although it may take a few attempts to get working correctly.

    That said, ESP32C6 looks interesting, so we will try to get one within the next month, and will consider adding out-of-the-box support for it, if the new ESP-IDF branch works out-of-the-box.

    The ESP32 debug methods package you mentioned was from last year (the latest update was still being tested). We have just released another one (20230309) based on the latest OpenOCD release from Espressif. Feel free to check the Espressif’s release logs for the exact list of changes.

    #33959
    gojimmypi
    Participant

    Hi,

    Thanks for the reply. Yes, the ESP32-C6 is pretty cool. I got myESP32-C6-DevKitC-1-N8 Development Board off Amazon for just $9, although it now says “unavailable”:  https://www.amazon.com/dp/B0BRMSDR4R

    Looks like Adafruit has some in stock:  https://www.adafruit.com/product/5672

    Thanks for the tips on the BSP file, I’ll give that a try. Things are working great from commandline. I have all the wolfSSL encryption tests passing. See https://github.com/wolfSSL/wolfssl/issues/6163

    There was a little bit of wonkiness on my V0.0 board with the [hold boot, tap reset, release boot] to actually program.

    Note in particular there’s a --preview option:
    idf.py -p /dev/ttyS8 --preview set-target esp32c6 build flash

    I’ve attached a couple of pics from the insert that came with my board. See also: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c6/api-guides/jtag-debugging/tips-and-quirks.html

     

    • This reply was modified 1 year, 8 months ago by gojimmypi.
    Attachments:
    You must be logged in to view attached files.
    #33976
    gojimmypi
    Participant

    Heads up for anyone else looking to manually enabled ESP32-C6 support before officially supported:

    In addition to copy/paste (mentioned above) of a  ESP32C3 section in [SysGCC]\esp32\esp32-bsp\BSP.xml

    Need to also edit C:\SysGCC\esp32\toolchain.xml

    The esp-2022r1-11.2.0\riscv32-esp-elf\bin does not support the RISC-V zifencei extension, resulting in an error like:

    Running CMake: C:\Users\gojimmypi\AppData\Local\VisualGDB\CMake\bin\cmake.exe ../../.. -G "Ninja" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_MAKE_PROGRAM=C:/SysGCC/esp32/tools/ninja/1.10.2/ninja.exe -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 -DIDF_TARGET=esp32c6
    -- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.39.1.windows.1")
    -- Component directory C:/SysGCC/esp32/esp-idf/master/components/tinyusb does not contain a CMakeLists.txt file. No component will be added
    -- The C compiler identification is GNU 11.2.0
    -- The CXX compiler identification is GNU 11.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/SysGCC/esp32/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - failed
    -- Check for working C compiler: C:/SysGCC/esp32/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe
    -- Check for working C compiler: C:/SysGCC/esp32/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe - broken
    -- Configuring incomplete, errors occurred!
    CMake Error at C:/Users/gojimmypi/AppData/Local/VisualGDB/CMake/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):
    The C compiler

    "C:/SysGCC/esp32/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe"

    is not able to compile a simple test program.

    It fails with the following output:

    Change Dir: C:/workspace/wolfssl-gojimmypi/IDE/Espressif/ESP-IDF/examples/wolfssl_test/build/VisualGDB/Debug/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/SysGCC/esp32/tools/ninja/1.10.2/ninja.exe cmTC_30b2a && [1/2] Building C object CMakeFiles/cmTC_30b2a.dir/testCCompiler.c.obj
    FAILED: CMakeFiles/cmTC_30b2a.dir/testCCompiler.c.obj
    C:\SysGCC\esp32\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin\riscv32-esp-elf-gcc.exe -march=rv32imc_zicsr_zifencei -o CMakeFiles/cmTC_30b2a.dir/testCCompiler.c.obj -c testCCompiler.c
    Assembler messages:
    Fatal error: -march=rv32imc_zicsr_zifencei: Invalid or unknown z ISA extension: 'zifencei'
    ninja: build stopped: subcommand failed.

    To fix this, I copied the esp-12.2.0_20230208toolchain from the Espressif-installed (latest master branch) toolchain:

    C:\Users\gojimmypi\.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208

    to:

    C:\SysGCC\esp32\tools\riscv32-esp-elf\esp-12.2.0_20230208

    and changed the C:\SysGCC\esp32\toolchain.xmlsetting:


    tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin

    (the old toolchain value was esp-2022r1-11.2.0)

    I also copied the ESP32c3.xml to ESP32C6.xml in

    C:\SysGCC\esp32\esp32-bsp\peripherals

    and edited the ESP32C6 contents.

    The GDB executable file was missing, so added

    riscv32-esp-elf-gdb.exe
    riscv32-esp-elf-gdb-add-index

    from

    C:\SysGCC\esp32\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin

    I copied the esp32c3.cfg to esp32c6.cfg in this directory:

    C:\Users\gojimmypi\AppData\Local\VisualGDB\EmbeddedDebugPackages\com.sysprogs.esp32.core\share\openocd\scripts\target

    and edited all of the “C3” to “C6” values in the new esp32c6.cfg file.

    I’m very close to having JTAG working, with this Error: Unknown target type esp32c6

    C:\Users\gojimmypi\AppData\Local\VisualGDB\EmbeddedDebugPackages\com.sysprogs.esp32.core\bin\openocd.exe -c "gdb_port 59108" -c "telnet_port 59106" -f interface/esp_usb_jtag_c6.cfg -c "adapter_khz 40000" -f target/esp32c6.cfg -c "echo VisualGDB_OpenOCD_Ready"
    Open On-Chip Debugger 0.10.0 (2022-05-03)
    Licensed under GNU GPL v2
    libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    Info : only one transport option; autoselect 'jtag'
    Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
    Info : esp_usb_jtag: capabilities descriptor set to 0x2000
    adapter speed: 40000 kHz

    DEPRECATED! use 'adapter speed' not 'adapter_khz'
    adapter speed: 40000 kHz

    Warn : Transport "jtag" was already selected
    target/esp32c6.cfg:96: Error: Unknown target type esp32c6, try one of arm7tdmi, arm9tdmi, arm920t, arm720t, arm966e, arm946e, arm926ejs, fa526, feroceon, dragonite, xscale, cortex_m, cortex_a, cortex_r4, arm11, ls1_sap, mips_m4k, avr, dsp563xx, dsp5680xx, testee, avr32_ap7k, hla_target, nds32_v2, nds32_v3, nds32_v3m, esp32, esp32s2, esp32s3, esp32c3, or1k, quark_x10xx, quark_d20xx, stm8, riscv, mem_ap, esirisc, arcv2, aarch64, or mips_mips64
    in procedure 'script'
    at file "embedded:startup.tcl", line 26
    at file "target/esp32c6.cfg", line 96

    Line 96 is the “else” here:

    if { $_RTOS == "none" } {
    target create $_TARGETNAME esp32c6 -chain-position $_TAPNAME
    } else {
    target create $_TARGETNAME esp32c6 -chain-position $_TAPNAME -rtos $_RTOS
    }

    So I’m able to compile and program via COM port in Visual Studio, but I don’t yet have GDB/JTAG working.

    Any tips on resolving the Error: Unknown target type esp32c6 at target create $_TARGETNAME esp32c6?

    My ESP32-C6 vgdbproj project file is here.

    • This reply was modified 1 year, 8 months ago by gojimmypi.
    • This reply was modified 1 year, 8 months ago by gojimmypi.
    • This reply was modified 1 year, 8 months ago by gojimmypi.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.