espressif/esp-thread-br

Build fail for C6 (TZ-619)

orenc75 opened this issue · 23 comments

Building on ESP32-C6 fails for both esp-idf-v5.1.2 and esp-idf-v5.2-beta2.

For example, on esp-idf-v5.2-beta2, using ESP32-C6, I get the following error:

In file included from C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_br.c:17:
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_br.c: In function 'app_main':
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_config.h:54:36: error: 'CONFIG_PIN_TO_RCP_MOSI' undeclared (first use in this function); did you mean 'CONFIG_PIN_TO_RCP_BOOT'?
54 | .mosi_io_num = CONFIG_PIN_TO_RCP_MOSI,
| ^~~~~~~~~~~~~~~~~~~~~~
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_br.c:77:25: note: in expansion of macro 'ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG'
77 | .radio_config = ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG(),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_config.h:54:36: note: each undeclared identifier is reported only once for each function it appears in
54 | .mosi_io_num = CONFIG_PIN_TO_RCP_MOSI,
| ^~~~~~~~~~~~~~~~~~~~~~
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_br.c:77:25: note: in expansion of macro 'ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG'
77 | .radio_config = ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG(),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_config.h:55:36: error: 'CONFIG_PIN_TO_RCP_MISO' undeclared (first use in this function); did you mean 'CONFIG_PIN_TO_RCP_RX'?
55 | .miso_io_num = CONFIG_PIN_TO_RCP_MISO,
| ^~~~~~~~~~~~~~~~~~~~~~
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_br.c:77:25: note: in expansion of macro 'ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG'
77 | .radio_config = ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG(),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_config.h:56:36: error: 'CONFIG_PIN_TO_RCP_SCLK' undeclared (first use in this function); did you mean 'CONFIG_PIN_TO_RCP_RX'?
56 | .sclk_io_num = CONFIG_PIN_TO_RCP_SCLK,
| ^~~~~~~~~~~~~~~~~~~~~~
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_br.c:77:25: note: in expansion of macro 'ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG'
77 | .radio_config = ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG(),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_config.h:66:37: error: 'CONFIG_PIN_TO_RCP_CS' undeclared (first use in this function); did you mean 'CONFIG_PIN_TO_RCP_RX'?
66 | .spics_io_num = CONFIG_PIN_TO_RCP_CS,
| ^~~~~~~~~~~~~~~~~~~~
C:/Users/ORENC/Private/Thread/esp-thread-br/examples/basic_thread_border_router/main/esp_ot_br.c:77:25: note: in expansion of macro 'ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG'
77 | .radio_config = ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG(),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the C:\Users\ORENC\Private\Thread\esp-thread-br\examples\basic_thread_border_router\build\log\idf_py_stderr_output_48496 and C:\Users\ORENC\Private\Thread\esp-thread-br\examples\basic_thread_border_router\build\log\idf_py_stdout_output_48496

The basic_thread_border_router example in esp-thread-br repo works as is on ESP Thread BR Board, which is ESP32-S3 + ESP32+H2.

Please use ot_br example in esp-idf on ESP32-C6, but the single SoC solution is not recommended for production.

In order to setup the Thread BR with C6 + H2, here are the steps for your reference:

  • build and flash ot_rcp to ESP32-H2 devkit
  • use ot_br example in esp-idf
    • idf.py set-target esp32c6
    • configure OPENTHREAD_RADIO_TYPE to "Connect via UART" (note: C6 has 802.15.4, so the default is "Native 15.4 radio")
    • update the correct C6 pin numbers connected to H2's TX and RX
    • build and flash the example to ESP32-C6 devkit
  • connect C6 and H2 with three wires (TX, RX, GND), be sure to close the H2 console monitor, since the UART0 is used for RCP UART

Then there should be some output as below:

I (611M�I (621) OPENTHREAD: spinel UART interface initialization completed
I (621) main_task: Returned from app_main()
I(621) OPENTHREAD:[I] P-RadioSpinel-: RCP reset: RESET_POWER_ON
I(631) OPENTHREAD:[I] P-RadioSpinel-: Software reset RCP successfully
I(671) OPENTHREAD:[I] ChildSupervsn-: Timeout: 0 -> 190
I (671) OPENTHREAD: OpenThread attached to netif
> scan

| PAN  | MAC Address      | Ch | dBm | LQI |
+------+------------------+----+-----+-----+
| b335 | 92eacce0b84594c1 | 11 | -63 |   9 |
| 1a65 | e6bd350d91e0c183 | 13 | -45 |   9 |
| 1a65 | 9eed1d95cf1004b3 | 13 | -44 |   8 |
| 35e9 | 8122334455667705 | 15 | -55 |  10 |
| e2b2 | 0e5ba4c40bf0b6be | 16 | -49 |  10 |
| e2b2 | 360d34996a2c9e34 | 16 | -43 |  10 |
| 4d83 | ba9741cd44273f44 | 18 | -45 |   9 |
| 472f | da75c0910ffbb2a7 | 24 | -53 |  10 |
| 8df9 | c60e461cbc93936c | 25 | -58 |   7 |
| 45f7 | 7e062787e985c640 | 25 | -57 |   9 |
Done
>

Thanks, I was actually trying to setup it as C6+H2, so I will follow the ot_br example.

Maybe the README.md for this project should be updated since it might be a bit confusion since it state that the project support any ESP32-S & ESP32-C systems:

"Hardware Platforms
Wi-Fi based Thread Border Router
The Wi-Fi based ESP Thread Border Router consists of two SoCs:

  • An ESP32 series Wi-Fi SoC (ESP32, ESP32-C, ESP32-S, etc) loaded with ESP Thread Border Router and OpenThread Stack.
  • An ESP32-H 802.15.4 SoC loaded with OpenThread RCP."

ot_br example is much easier to get start with on standalone modules. While it's still doable to run the basic_thread_border_router example on C6+H2, just need to connect more GPIO pins as described here: https://github.com/espressif/esp-thread-br?tab=readme-ov-file#standalone-modules.

Your previous compile issue could be resolved by enabling OPENTHREAD_RADIO_SPINEL_UART config option.

Thanks you.
Enabling the config option did solved the compile error as you said. I had to move to esp-idf-v5.2-rc1 in order to fix another "BAUDRATE" error but now it was compiled fine.

However, once I connect the H2 to the C6 using all the 9 pins and start idf.py monitor, I get the following endless loop of messages:
Executing action: monitor
Serial port COM6
Connecting....
Detecting chip type... ESP32-C6
Running idf_monitor in directory C:\Users\ORENC\Private\Thread\esp-thread-br\examples\basic_thread_border_router
Executing "C:\Users\ORENC.espressif\python_env\idf5.1_py3.8_env\Scripts\python.exe C:\Users\ORENC\Private\Thread\esp-idf-v5.2-rc1\tools/idf_monitor.py -p COM6 -b 115200 --toolchain-prefix riscv32-esp-elf- --target esp32c6 --revision 0 --decode-panic backtrace C:\Users\ORENC\Private\Thread\esp-thread-br\examples\basic_thread_border_router\build\esp_ot_br.elf --force-color -m 'C:\Users\ORENC.espressif\python_env\idf5.1_py3.8_env\Scripts\python.exe' 'C:\Users\ORENC\Private\Thread\esp-idf-v5.2-rc1\tools\idf.py'"...
--- WARNING: GDB cannot open serial ports accessed as COMx
--- Using \.\COM6 instead...
--- esp-idf-monitor 1.4.0 on \.\COM6 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x40875720,len:0x1804
load:0x4086c410,len:0xd08
load:0x4086e610,len:0x2e14
entry 0x4086c41a
I (23) boot: ESP-IDF v5.2-rc1 2nd stage bootloader
I (24) boot: compile time Feb 5 2024 14:30:37
I (24) boot: chip revision: v0.0
I (27) boot.esp32c6: SPI Speed : 80MHz
I (31) boot.esp32c6: SPI Mode : DIO
I (36) boot.esp32c6: SPI Flash Size : 4MB
I (41) boot: Enabling RNG early entropy source...
I (46) boot: Partition Table:
I (50) boot: ## Label Usage Type ST Offset Length
I (57) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (65) boot: 1 otadata OTA data 01 00 0000f000 00002000
I (72) boot: 2 phy_init RF data 01 01 00011000 00001000
I (79) boot: 3 ota_0 OTA app 00 10 00020000 00190000
I (87) boot: 4 ota_1 OTA app 00 11 001b0000 00190000
I (94) boot: 5 web_storage Unknown data 01 82 00340000 00019000
I (102) boot: 6 rcp_fw Unknown data 01 82 00359000 000a0000
I (110) boot: End of partition table
I (114) esp_image: segment 0: paddr=00020020 vaddr=42120020 size=51610h (333328) map
I (190) esp_image: segment 1: paddr=00071638 vaddr=40800000 size=0e9e0h ( 59872) load
I (204) esp_image: segment 2: paddr=00080020 vaddr=42000020 size=11a050h (1155152) map
I (440) esp_image: segment 3: paddr=0019a078 vaddr=4080e9e0 size=06874h ( 26740) load
I (446) esp_image: segment 4: paddr=001a08f4 vaddr=40815260 size=03b4ch ( 15180) load
I (456) boot: Loaded app from partition at offset 0x20000
I (456) boot: Disabling RNG early entropy source...
I (458) cpu_start: Unicore app
W (469) clk: esp_perip_clk_init() has not been implemented yet
I (470) cpu_start: Pro cpu start user code
I (472) cpu_start: cpu freq: 160000000 Hz
I (477) cpu_start: Application information:
I (481) cpu_start: Project name: esp_ot_br
I (487) cpu_start: App version: v1.0-18-gec65dc8
I (492) cpu_start: Compile time: Feb 5 2024 14:30:13
I (498) cpu_start: ELF file SHA256: 2c1a73e22...
I (504) cpu_start: ESP-IDF: v5.2-rc1
I (509) cpu_start: Min chip rev: v0.0
I (514) cpu_start: Max chip rev: v0.99
I (518) cpu_start: Chip rev: v0.0
I (523) heap_init: Initializing. RAM available for dynamic allocation:
I (530) heap_init: At 4082AEB0 len 00051760 (325 KiB): RAM
I (536) heap_init: At 4087C610 len 00002F54 (11 KiB): RAM
I (543) heap_init: At 50000000 len 00003FE8 (15 KiB): RTCRAM
I (550) spi_flash: detected chip: generic
I (554) spi_flash: flash io: dio
W (557) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (571) sleep: Configure to isolate all GPIO pins in sleep state
I (577) sleep: Enable automatic switching of GPIO sleep configuration
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001975a
0x4001975a: software_reset_cpu in ROM

SPIWP:0xee
mode:DIO, clock div:2
load:0x40875720,len:0x1804
load:0x4086c410,len:0xd08
load:0x4086e610,len:0x2e14
entry 0x4086c41a
I (26) boot: ESP-IDF v5.2-rc1 2nd stage bootloader
I (27) boot: compile time Feb 5 2024 14:30:37
I (28) boot: chip revision: v0.0
I (30) boot.esp32c6: SPI Speed : 80MHz
I (35) boot.esp32c6: SPI Mode : DIO
I (39) boot.esp32c6: SPI Flash Size : 4MB
I (44) boot: Enabling RNG early entropy source...

@orenc75 Hi, could you please show us how did you connect the C6 with H2? You said you connect 9 pins, which pins did you use?

Hi, I set the following pins:

C6 side -> H2 Side
GND -> G
19 -> TX
18 -> RX
7 -> RST
8 -> 9
10 -> 2
11 -> 3
12 -> 0
13 -> 1

I also set in menuconfig the following pins:
ESP Thread Border Router Example -> Board Configuration -> (19) Pin to RCP TX
(18) Pin to RCP RX
I did not changed the RCP Reset (7) and RCP Boot (8) pins in menuconfig

@orenc75 Hi I tried to use the uart 0 for C6 to communicate with H2, and also used the GPIO19 and GPIO18 on c6, all things work fine. And what is the GPIO 10~13 used for in your apps? Did you enable RCP SPI in your project? If you use uart, please check both BR and RCP side, you should enable OPENTHREAD_RADIO_SPINEL_UART for BR and OPENTHREAD_RCP_UART for RCP.

If you want to use SPI for communication between BR and RCP. You should enable OPENTHREAD_RADIO_SPINEL_SPI for BR and OPENTHREAD_RCP_SPI for RCP. But notice, for the chapter 7.1 of the esp32c6 TRM, it said that GPIO10 ~ GPIO11 are not led out to any chip pins, thus not available to users. So GPIO 10 and GPIO 11 should not be used for the user. Since different chips may have some difference, this repo is designed for the ESP Thread Border Router Board, if you want to use C6 for your project, we recommend reading the TRM first before choosing the GPIO you used.

BTY, did you try this example?

The basic_thread_border_router example in esp-thread-br repo works as is on ESP Thread BR Board, which is ESP32-S3 + ESP32+H2.

Please use ot_br example in esp-idf on ESP32-C6, but the single SoC solution is not recommended for production.

In order to setup the Thread BR with C6 + H2, here are the steps for your reference:

* build and flash [ot_rcp](https://github.com/espressif/esp-idf/tree/master/examples/openthread/ot_rcp) to ESP32-H2 devkit

* use [ot_br](https://github.com/espressif/esp-idf/tree/master/examples/openthread/ot_br) example in esp-idf
  
  * idf.py set-target esp32c6
  * configure OPENTHREAD_RADIO_TYPE to "Connect via UART" (note: C6 has 802.15.4, so the default is "Native 15.4 radio")
  * update the correct [C6 pin numbers](https://github.com/espressif/esp-idf/blob/master/examples/openthread/ot_br/main/esp_ot_config.h#L40) connected to H2's TX and RX
  * build and flash the example to ESP32-C6 devkit

* connect C6 and H2 with three wires (TX, RX, GND), be sure to close the H2 console monitor, since the UART0 is used for RCP UART

@zwx1995esp
Thank you very much for reproducing my setup. I followed your guidelines and it still not working for me. I got the same error as I got before. I wonder if there is something wrong with my HW or am I missing something in the setup.

Regarding the setup using ot_br as @chshu wrote. It is not working for me either. I connect the three pins and followed the steps and this is the error I got:
Wrote 1710368 bytes (974093 compressed) at 0x00010000 in 22.5 seconds (effective 609.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 106...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (106 compressed) at 0x00008000 in 0.0 seconds (effective 907.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
3.8_env/Scripts/python.exe;;C:/Users/ORENC/Private/Thread/esp-idf-v5.2-rc1/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=C:/Users/ORENC/Private/Thread/esp-idf-v5.2-rc1/examples/openthread/ot_br/build -P C:/Users/ORENC/Private/Thread/esp-idf-v5.2-rc1/components/esptool_py/run_serial_tool.cmake"
Executing action: monitor
Running idf_monitor in directory C:\Users\ORENC\Private\Thread\esp-idf-v5.2-rc1\examples\openthread\ot_br
Executing "C:\Users\ORENC.espressif\python_env\idf5.1_py3.8_env\Scripts\python.exe C:\Users\ORENC\Private\Thread\esp-idf-v5.2-rc1\tools/idf_monitor.py -p com6 -b 115200 --toolchain-prefix riscv32-esp-elf- --target esp32c6 --revision 0 --decode-panic backtrace C:\Users\ORENC\Private\Thread\esp-idf-v5.2-rc1\examples\openthread\ot_br\build\esp_ot_br.elf --force-color -m 'C:\Users\ORENC.espressif\python_env\idf5.1_py3.8_env\Scripts\python.exe' 'C:\Users\ORENC\Private\Thread\esp-idf-v5.2-rc1\tools\idf.py' '-p' 'com6'"...
--- esp-idf-monitor 1.4.0 on com6 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
�ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x40875720,len:0x1804
load:0x4086c410,len:0xde0
load:0x4086e610,len:0x2e04
entry 0x4086c41a
I (23) boot: ESP-IDF v5.2-rc1-dirty 2nd stage bootloader
I (24) boot: compile time Feb 7 2024 19:11:33
I (24) boot: chip revision: v0.0
I (27) boot.esp32c6: SPI Speed : 80MHz
I (32) boot.esp32c6: SPI Mode : DIO
I (37) boot.esp32c6: SPI Flash Size : 2MB
I (41) boot: Enabling RNG early entropy source...
I (47) boot: Partition Table:
I (50) boot: ## Label Usage Type ST Offset Length
I (58) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (65) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (73) boot: 2 factory factory app 00 00 00010000 001a9000
I (80) boot: End of partition table
I (84) esp_image: segment 0: paddr=00010020 vaddr=42138020 size=4fb08h (326408) map
I (159) esp_image: segment 1: paddr=0005fb30 vaddr=40800000 size=004e8h ( 1256) load
I (160) esp_image: segment 2: paddr=00060020 vaddr=42000020 size=13729ch (1274524) map
I (424) esp_image: segment 3: paddr=001972c4 vaddr=408004e8 size=169e0h ( 92640) load
I (445) esp_image: segment 4: paddr=001adcac vaddr=40816ed0 size=03c50h ( 15440) load
I (455) boot: Loaded app from partition at offset 0x10000
I (455) boot: Disabling RNG early entropy source...
I (467) cpu_start: Unicore app
W (476) clk: esp_perip_clk_init() has not been implemented yet
I (482) cpu_start: Pro cpu start user code
I (483) cpu_start: cpu freq: 160000000 Hz
I (483) cpu_start: Application information:
I (486) cpu_start: Project name: esp_ot_br
I (491) cpu_start: App version: v5.2-rc1-dirty
I (496) cpu_start: Compile time: Feb 7 2024 19:11:07
I (502) cpu_start: ELF file SHA256: c76836d87...
I (508) cpu_start: ESP-IDF: v5.2-rc1-dirty
I (513) cpu_start: Min chip rev: v0.0
I (518) cpu_start: Max chip rev: v0.99
I (523) cpu_start: Chip rev: v0.0
I (528) heap_init: Initializing. RAM available for dynamic allocation:
I (535) heap_init: At 4082C260 len 000503B0 (320 KiB): RAM
I (541) heap_init: At 4087C610 len 00002F54 (11 KiB): RAM
I (547) heap_init: At 50000000 len 00003FE8 (15 KiB): RTCRAM
I (554) spi_flash: detected chip: generic
I (558) spi_flash: flash io: dio
W (562) spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (575) sleep: Configure to isolate all GPIO pins in sleep state
I (582) sleep: Enable automatic switching of GPIO sleep configuration
I (589) coexist: coex firmware version: 77cd7f8
I (594) coexist: coexist rom version 5b8dcfa
�I (609) OPENTHREAD: spinel UART interface initialization completed
I (609) main_task: Returned from app_main()
W(2619) OPENTHREAD:[W] P-RadioSpinel-: Wait for response timeout
W(4629) OPENTHREAD:[W] P-RadioSpinel-: Wait for response timeout
E(4629) OPENTHREAD:[C] P-RadioSpinel-: Failed to reset RCP!
E(4639) OPENTHREAD:[C] Platform------: ResetRcp() at radio_spinel.cpp:229: Failure

abort() was called at PC 0x42006b1b on core 0
0x42006b1b: syscall_not_implemented_aborts at C:/Users/ORENC/Private/Thread/esp-idf-v5.2-rc1/components/newlib/syscalls.c:27

Stack dump detected
Core 0 register dump:
MEPC : 0x408004ec RA : 0x408082b8 SP : 0x40839330 GP : 0x408176d0
0x408004ec: panic_abort at C:/Users/ORENC/Private/Thread/esp-idf-v5.2-rc1/components/esp_system/panic.c:472
0x408082b8: __ubsan_include at C:/Users/ORENC/Private/Thread/esp-idf-v5.2-rc1/components/esp_system/ubsan.c:313

TP : 0x407ea590 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000004 S1 : 0x40839394 A0 : 0x4083935c A1 : 0x40839392
A2 : 0x00000000 A3 : 0x40839389 A4 : 0x00000001 A5 : 0x4082c000
A6 : 0x00000000 A7 : 0x76757473 S2 : 0x00000001 S3 : 0x00000001
S4 : 0x00000000 S5 : 0x4081fb8c S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000007 MTVAL : 0x00000000
0x40800001: _vector_table at ??:?

MHARTID : 0x00000000

None
Waiting for the device to reconnect.............Failed to run gdb_panic_server.py script: Command '['riscv32-esp-elf-gdb', '--batch', '-n', 'C:\Users\ORENC\Private\Thread\esp-idf-v5.2-rc1\examples\openthread\ot_br\build\esp_ot_br.elf', '-ex', 'target remote | "C:\Users\ORENC\.espressif\python_env\idf5.1_py3.8_env\Scripts\python.exe" -m esp_idf_panic_decoder --target esp32c6 "C:\Users\ORENC\AppData\Local\Temp\tmpt7_52irm"', '-ex', 'bt']' returned non-zero exit status 1.
b"error starting child process '| C:\Users\ORENC\.espressif\python_env\idf5.1_py3.8_env\Scripts\python.exe -m esp_idf_panic_decoder --target esp32c6 C:\Users\ORENC\AppData\Local\Temp\tmpt7_52irm': CreateProcess: No such file or directory\r\nNo stack.\r\n"

Stack memory:
40839330: 0x00000000 0x408193c8 0x40839390 0x4080e9fe 0x00000000 0x408193c8 0x4082ce10 0x40819d84
40839350: 0x40839394 0x40819da0 0x40839390 0x726f6261 0x20292874 0x20736177 0x6c6c6163 0x61206465
40839370: 0x43502074 0x34783020 0x36303032 0x20623162 0x63206e6f 0x2065726f 0x00000030 0x42120000
40839390: 0x00000030 0x30303234 0x62316236 0x00000000 0x00000000 0x00000000 0x00000001 0x42006b1e
408393b0: 0x00000001 0x00000000 0x00000001 0x4212ba90 0x42153a2c 0x00000001 0x4081fb88 0x42082952
408393d0: 0x00000025 0x4083942c 0x4081fb88 0x420835cc 0x7665642f 0x7261752f 0x00312f74 0x00000261
408393f0: 0x421498c8 0x00000000 0x00000000 0x00000000 0x00000000 0x40839470 0x00000000 0x420530f6
40839410: 0x4205e850 0x4205e8a8 0x4205e8e0 0x4205e880 0x00000000 0x4205e908 0x4205e92c 0x42052d00
40839430: 0xa5a5a5a5 0xa5a5a5a5 0x00000000 0x4205299c 0xa5a5a5a5 0x00000000 0x408396e4 0x420512ae
40839450: 0xa5a5a5a5 0xa5a5a5a5 0x408396e4 0x4200a6a0 0xa5a5a5a5 0x42173af8 0x00000000 0x42173a94
40839470: 0x00000001 0x00000001 0x00070800 0x00000003 0x00000000 0x00000001 0x00000000 0x00000000
40839490: 0x00000004 0x00000013 0x00000012 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408394b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408394d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000001 0x00000000 0x0001c200 0x00000003
408394f0: 0x00000000 0x00000001 0x00000000 0x00000000 0x00000004 0xffffffff 0xffffffff 0x00000000
40839510: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40839530: 0x00000000 0x00000000 0x4213ad2c 0x00000a0a 0x00000000 0x00000000 0x00000000 0x40809366
40839550: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40839570: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x00000150
40839590: 0x40838bb0 0x00000193 0x4081ad40 0x4081ad40 0x40839590 0x4081ad38 0x00000014 0x40839f98
408395b0: 0x40839f98 0x40839590 0x00000000 0x00000005 0x4083458c 0x625f746f 0x616d5f72 0x00006e69
408395d0: 0x00000000 0x40839580 0x00000005 0x00000000 0x00000000 0x00000000 0x00000000 0x4082cd40
408395f0: 0x4082cda8 0x4082ce10 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000
40839610: 0x4200699e 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40839630: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40839650: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40839670: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40839690: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0000 0x00000000
408396d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000060 0x00000000 0x00000000 0x40839748
408396f0: 0x40839758 0x40839768 0x42051920 0x420518ae 0x40839768 0x00000000 0x00000000 0x00000000
40839710: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000

ELF file SHA256: c76836d87

Rebooting...

I see, so could you please try these steps again on the v5.2-rc1 commit bd18b8ba6a?

0.let's checkout the ESP-IDF to this commit

$ git checkout bd18b8ba6a
$ git submodule update --init --recursive

(Notice, please use git status to double check no files were modified.)

1.compile the RCP after removing all previous build files.

> cd $IDP_PATH/examples/openthread/ot_rcp
> rm -rf ./build sdkconfig
> idf.py set-target esp32h2
> idf.py -p <your-h2-port> build flash
  1. compile the BR after removing all previous build files.
> cd $IDP_PATH/examples/openthread/ot_br
> rm -rf ./build sdkconfig
> idf.py set-target esp32c6
> idf.py menuconfig

Only enable this config, please do not modify any others:

(Top) → Component config → OpenThread → Config the Thread radio type (Connect via UART) 

image
Then flash to board

> idf.py -p <your-c6-port> build flash
  1. Connect C6 with BR:
C6      <----->   H2
GPIO4   <----->   TX
GPIO5   <----->   RX
GND     <----->   GND

4.Open the C6 monitor

idf.py -p <your-c6-port> monitor

If all things go as expected, you will see
image

@zwx1995esp
Thank you very much for the detailed instructions.
I followed your instructions and got the same problem I got same error I got before.
This is the error:
I (612) main_task: Returned from app_main()
W(2622) OPENTHREAD:[W] P-RadioSpinel-: Wait for response timeout
W(4632) OPENTHREAD:[W] P-RadioSpinel-: Wait for response timeout
E(4632) OPENTHREAD:[C] P-RadioSpinel-: Failed to reset RCP!
E(4642) OPENTHREAD:[C] Platform------: ResetRcp() at radio_spinel.cpp:229: Failure

abort() was called at PC 0x42006b1b on core 0
0x42006b1b: syscall_not_implemented_aborts at C:/Users/ORENC/Private/Thread/esp-idf/components/newlib/syscalls.c:27

Stack dump detected
Core 0 register dump:
MEPC : 0x408004e8 RA : 0x40808286 SP : 0x40839380 GP : 0x408176a0
0x408004e8: panic_abort at C:/Users/ORENC/Private/Thread/esp-idf/components/esp_system/panic.c:472
0x40808286: __ubsan_include at C:/Users/ORENC/Private/Thread/esp-idf/components/esp_system/ubsan.c:313

TP : 0x407ea714 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000004 S1 : 0x408393e4 A0 : 0x408393ac A1 : 0x408393e2
A2 : 0x00000000 A3 : 0x408393d9 A4 : 0x00000001 A5 : 0x4082c000
A6 : 0x00000000 A7 : 0x76757473 S2 : 0x00000001 S3 : 0x00000001
S4 : 0x00000000 S5 : 0x4081fb5c S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000007 MTVAL : 0x00000000
0x40800001: _vector_table at ??:?

MHARTID : 0x00000000

Thinking that my C6 is defective, I flashed the "blink" example to both C6 and H2, and both worked flawlessly.

@zwx1995esp Thank you very much for the detailed instructions. I followed your instructions and got the same problem I got same error I got before. This is the error: I (612) main_task: Returned from app_main() W(2622) OPENTHREAD:[W] P-RadioSpinel-: Wait for response timeout W(4632) OPENTHREAD:[W] P-RadioSpinel-: Wait for response timeout E(4632) OPENTHREAD:[C] P-RadioSpinel-: Failed to reset RCP! E(4642) OPENTHREAD:[C] Platform------: ResetRcp() at radio_spinel.cpp:229: Failure

abort() was called at PC 0x42006b1b on core 0 0x42006b1b: syscall_not_implemented_aborts at C:/Users/ORENC/Private/Thread/esp-idf/components/newlib/syscalls.c:27

Stack dump detected Core 0 register dump: MEPC : 0x408004e8 RA : 0x40808286 SP : 0x40839380 GP : 0x408176a0 0x408004e8: panic_abort at C:/Users/ORENC/Private/Thread/esp-idf/components/esp_system/panic.c:472 0x40808286: __ubsan_include at C:/Users/ORENC/Private/Thread/esp-idf/components/esp_system/ubsan.c:313

TP : 0x407ea714 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130 S0/FP : 0x00000004 S1 : 0x408393e4 A0 : 0x408393ac A1 : 0x408393e2 A2 : 0x00000000 A3 : 0x408393d9 A4 : 0x00000001 A5 : 0x4082c000 A6 : 0x00000000 A7 : 0x76757473 S2 : 0x00000001 S3 : 0x00000001 S4 : 0x00000000 S5 : 0x4081fb5c S6 : 0x00000000 S7 : 0x00000000 S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000 T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938 MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000007 MTVAL : 0x00000000 0x40800001: _vector_table at ??:?

MHARTID : 0x00000000

Thinking that my C6 is defective, I flashed the "blink" example to both C6 and H2, and both worked flawlessly.

So, could you please take a photo showing that how do you connect the C6 with H2?

Thank you

PXL_20240209_050926191

could you please try to add this code after this line?

        if (config->tx_pin != -1) {
            gpio_set_drive_capability(config->tx_pin, GPIO_DRIVE_CAP_3);
        }
        if (config->rx_pin != -1) {
            gpio_set_drive_capability(config->rx_pin, GPIO_DRIVE_CAP_3);
        }

(before calling the function uart_set_pin)
It seems your jump line is a little long, let's set the gpio driver level to the max and then have a try, notice, both RCP and BR need to re-flash with this change.

I added the lines (Your marked line is at line #65 in my active code), and flashed both sides.
I still get the same error:
I (965) main_task: Returned from app_main()
W(2975) OPENTHREAD:[W] P-RadioSpinel-: Wait for response timeout
W(4985) OPENTHREAD:[W] P-RadioSpinel-: Wait for response timeout
E(4985) OPENTHREAD:[C] P-RadioSpinel-: Failed to reset RCP!
E(4995) OPENTHREAD:[C] Platform------: ResetRcp() at radio_spinel.cpp:229: Failure

abort() was called at PC 0x42006b1b on core 0
0x42006b1b: syscall_not_implemented_aborts at C:/Users/ORENC/Private/Thread/esp-idf/components/newlib/syscalls.c:27

Stack dump detected
Core 0 register dump:
MEPC : 0x408004e8 RA : 0x40808286 SP : 0x40839380 GP : 0x408176a0
0x408004e8: panic_abort at C:/Users/ORENC/Private/Thread/esp-idf/components/esp_system/panic.c:472
0x40808286: __ubsan_include at C:/Users/ORENC/Private/Thread/esp-idf/components/esp_system/ubsan.c:313

TP : 0x407ea6e4 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000004 S1 : 0x408393e4 A0 : 0x408393ac A1 : 0x408393e2
A2 : 0x00000000 A3 : 0x408393d9 A4 : 0x00000001 A5 : 0x4082c000
A6 : 0x00000000 A7 : 0x76757473 S2 : 0x00000001 S3 : 0x00000001
S4 : 0x00000000 S5 : 0x4081fb5c S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000007 MTVAL : 0x00000000

Do you want me to find a shorter jump lines?

I added the lines (Your marked line is at line #65 in my active code), and flashed both sides. I still get the same error: I (965) main_task: Returned from app_main() W(2975) OPENTHREAD:[W] P-RadioSpinel-: Wait for response timeout W(4985) OPENTHREAD:[W] P-RadioSpinel-: Wait for response timeout E(4985) OPENTHREAD:[C] P-RadioSpinel-: Failed to reset RCP! E(4995) OPENTHREAD:[C] Platform------: ResetRcp() at radio_spinel.cpp:229: Failure

abort() was called at PC 0x42006b1b on core 0 0x42006b1b: syscall_not_implemented_aborts at C:/Users/ORENC/Private/Thread/esp-idf/components/newlib/syscalls.c:27

Stack dump detected Core 0 register dump: MEPC : 0x408004e8 RA : 0x40808286 SP : 0x40839380 GP : 0x408176a0 0x408004e8: panic_abort at C:/Users/ORENC/Private/Thread/esp-idf/components/esp_system/panic.c:472 0x40808286: __ubsan_include at C:/Users/ORENC/Private/Thread/esp-idf/components/esp_system/ubsan.c:313

TP : 0x407ea6e4 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130 S0/FP : 0x00000004 S1 : 0x408393e4 A0 : 0x408393ac A1 : 0x408393e2 A2 : 0x00000000 A3 : 0x408393d9 A4 : 0x00000001 A5 : 0x4082c000 A6 : 0x00000000 A7 : 0x76757473 S2 : 0x00000001 S3 : 0x00000001 S4 : 0x00000000 S5 : 0x4081fb5c S6 : 0x00000000 S7 : 0x00000000 S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000 T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938 MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000007 MTVAL : 0x00000000

Do you want me to find a shorter jump lines?

Oh, too bad, it does not make sense... You can have a try with a shorter jump line.

I compile the .bin file to you, and could you please try with this bin file building from my side? Let's try if the file built from my side can work or not. If it also did not work, it might be some HW issue related to your board.
test.zip
Please download this .zip file and unzip to your local directory, for example, my folder is ~/playground/github_issue

  1. Flash to C6 using this command:
python -m esptool --chip esp32c6 -b 2000000 -p /dev/ttyUSB0 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x0 C6_BR/bootloader.bin 0x8000 C6_BR/partition-table.bin 0x10000 C6_BR/esp_ot_br.bin

image
then flash H2.

python -m esptool --chip esp32h2 -b 2000000 -p /dev/ttyUSB2 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 2MB --flash_freq 48m 0x0 RCP_H2/bootloader.bin 0x8000 RCP_H2/partition-table.bin 0x10000 RCP_H2/esp_ot_rcp.bin

image
Then connect the C6 with H2, also using this map:

C6      <----->   H2
GPIO4   <----->   TX
GPIO5   <----->   RX
GND     <----->   GND

1212

Tips: if you see an error "no module named esptool", You can install it via command python -m pip install esptool

ok, now it is working!

The message seems different from what you posted here:
#56 (comment)

Is it ok? So I got a problem with my build process?

ok, now it is working!

image

The message seems different from what you posted here: #56 (comment)

Is it ok? So I got a problem with my build process?

Yes, could you please double check with these steps again?
#56(comment)

@zwx1995esp , I started a fresh installation on a different computer.
First, I built and compiled ot_rcp, then I used the monitor command to check (my ot_rcp, yours ot_br) and it worked.
Second, I build and compiled ot_br, then I used the monitor command to check (my ot_rcp, my ot_br) and it failed...

I documented the steps I did so maybe you can find what am I doing wrong. I am using windows environment.

  1. Install ESP-IDF using windows installer from here

  2. Update branch

git checkout bd18b8ba6a
git submodule update --init --recursive

git status results:
image

  1. Build, flash and check ot_rcp
cd %IDF_PATH%/examples/openthread/ot_rcp
del sdkconfig
rmdir build /s/q
idf.py set-target esp32h2
idf.py -p com5 build flash
idf.py -p com6 monitor

Result: Success

  1. Build, flash and check ot_br
cd %IDF_PATH%/examples/openthread/ot_br
del sdkconfig
rmdir build /s/q
idf.py set-target esp32c6
idf.py menuconfig : (Top) → Component config → OpenThread → Config the Thread radio type (Connect via UART) 
idf.py -p com6 build flash
idf.py -p com6 monitor

Result: Failed

I did not touch the HW in between the tests.

I have an update.

I installed a fresh Linux installation and repeated the steps in #56 (comment) .
Amazingly, but I still get the same error... I am not sure what am i doing wrong.

I compared the bin files I got from @zwx1995esp and the file sizes are different:

For ot_rcp:
my <---> zwx1995esp
bootloader.bin : 19120 <---> 19280
partition-table.bin : 3072 <---> 3072
esp_ot_br.bin : 193312 <---> 195024

For ot_br:
my <---> zwx1995esp
bootloader.bin : 21568 <---> 21584
partition-table.bin : 3072 <---> 3072
esp_ot_br.bin : 1709280 <---> 1696656

So I definitely missing something in the complication since it happen in both Windows and Linux and on fresh installations of es-idf for both.
Any idea?

An update:
I managed to make the full esp-thread-br to work on C6+H2.
I think the trick was to switch to non-stable version of esp-idf v5.3 and to follow this guide.

So now it is working. Thank you all.

It is working now