mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
feat(openthread): support 154 debug features on RCP
This commit is contained in:
@@ -64,3 +64,43 @@ Please refer to [ot_br](../ot_br) example for the setup steps.
|
||||
#### Thread Sniffer
|
||||
|
||||
Please refer to [Thread Sniffer](https://openthread.io/guides/pyspinel/sniffer) for the detailed instructions.
|
||||
|
||||
### Debug Feature: Turn on RCP console
|
||||
|
||||
The RCP console feature allows you to send console commands to the RCP firmware via the Spinel protocol. This is useful for debugging IEEE 802.15.4 PHY register issues and accessing debug statistics.
|
||||
|
||||
To enable the RCP console, you can either:
|
||||
|
||||
**Option 1: Use the debug configuration file**
|
||||
|
||||
Use the debug configuration file and rebuild:
|
||||
|
||||
```
|
||||
idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.debug" set-target esp32h2
|
||||
idf.py -p <PORT> build flash
|
||||
```
|
||||
|
||||
This enables the following commands:
|
||||
|
||||
- `phyreg -g` - Get IEEE 802.15.4 PHY register debug information, including PBUS registers, PHY calibration data, I2C checks, and register validation
|
||||
- `help` - List all available console commands
|
||||
|
||||
**Option 2: Configure manually via menuconfig**
|
||||
|
||||
To enable other IEEE 802.15.4 debug commands (detailed in `examples/ieee802154/components/cmd_ieee802154_debug/README.md`), run `idf.py menuconfig` and enable the following options:
|
||||
|
||||
```
|
||||
Component config → OpenThread → Thread Core Features → Thread Radio Co-Processor Feature → Enable RCP console via Spinel
|
||||
Component config → IEEE 802.15.4 → Enable IEEE802154 Debug
|
||||
Component config → IEEE 802.15.4 → IEEE 802.15.4 Debug Parameters → **Select relevant debug features as required**
|
||||
Component config → Log → Log Level → Default log verbosity → Info
|
||||
Component config → ESP System Settings → Task watchdog timeout period (seconds) → 10
|
||||
```
|
||||
|
||||
**Note:** It's recommended to increase the watchdog timer timeout to 10 seconds when enabling debug features, as large debug prints may take longer to complete.
|
||||
|
||||
Then rebuild and flash:
|
||||
|
||||
```
|
||||
idf.py -p <PORT> build flash
|
||||
```
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
|
||||
#if CONFIG_OPENTHREAD_RCP_SPINEL_CONSOLE
|
||||
#include "esp_console.h"
|
||||
#if CONFIG_IEEE802154_DEBUG
|
||||
#include "ieee802154_debug.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define TAG "ot_esp_rcp"
|
||||
@@ -67,6 +70,9 @@ void app_main(void)
|
||||
esp_console_config_t console_config = ESP_CONSOLE_CONFIG_DEFAULT();
|
||||
esp_console_init(&console_config);
|
||||
esp_console_register_help_command();
|
||||
#if CONFIG_IEEE802154_DEBUG
|
||||
register_ieee802154_debug_cmd();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ESP_ERROR_CHECK(esp_openthread_start(&config));
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
dependencies:
|
||||
ot_examples_common:
|
||||
path: ${IDF_PATH}/examples/openthread/ot_common_components/ot_examples_common
|
||||
cmd_ieee802154_debug:
|
||||
path: ${IDF_PATH}/examples/ieee802154/components/cmd_ieee802154_debug
|
||||
|
||||
@@ -52,9 +52,3 @@ CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n
|
||||
CONFIG_OPENTHREAD_LOG_LEVEL_NONE=y
|
||||
CONFIG_OPENTHREAD_TIMING_OPTIMIZATION=y
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
|
||||
#
|
||||
# Turn on RCP console by default, overriding default log level from above
|
||||
#
|
||||
CONFIG_OPENTHREAD_RCP_SPINEL_CONSOLE=y
|
||||
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Turn on RCP console, overriding default log level from sdkconfig.defaults
|
||||
# We also increase the timeout for watchdog timer to account for large prints.
|
||||
#
|
||||
CONFIG_OPENTHREAD_RCP_SPINEL_CONSOLE=y
|
||||
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
||||
CONFIG_ESP_TASK_WDT_TIMEOUT_S=10
|
||||
CONFIG_IEEE802154_DEBUG=y
|
||||
CONFIG_IEEE802154_PRINT_PHY_REG=y
|
||||
Reference in New Issue
Block a user