Merge branch 'bugfix/fix_cert_test_block_issue' into 'master'

cert_test: example: Fix cert_test blocking issue

See merge request espressif/esp-idf!22847
This commit is contained in:
Jiang Jiang Jian
2023-04-03 19:38:45 +08:00
3 changed files with 49 additions and 38 deletions

View File

@@ -60,49 +60,58 @@ Press TAB when typing command name to auto-complete.
I (598) main_task: Returned from app_main() I (598) main_task: Returned from app_main()
phy> phy>
phy> tx_contin_en 1 phy> tx_contin_en 1
I (4788) phy: Tx continuous test! I (11870) phy: Tx continuous test!
phy> phy>
phy> tx_contin_en 0 phy> tx_contin_en 0
I (7518) phy: Tx packet test! I (19860) phy: Tx packet test!
phy> phy>
phy> cbw40m_en 1 phy> cbw40m_en 1
I (10668) phy: cbw40m_en: 1 I (25660) phy: cbw40m_en: 1
phy> phy>
phy> cbw40m_en 0 phy> cbw40m_en 0
I (13238) phy: cbw40m_en: 0 I (33490) phy: cbw40m_en: 0
phy>
phy> esp_tx -n 1 -r 0x0 -p 0 -l 1000 -d 1000 -c 0
I (39640) phy: Wifi tx out: chan=1, rate=0x0, BK=0, len=1000, delay=1000, tx_num=0
phy> phy>
phy> cmdstop phy> cmdstop
I (8828) phy: Tx Over 0x0 I (45460) phy: Tx Over 0x0
phy> phy>
phy> esp_rx -n 1 -r 0 phy> esp_rx -n 1 -r 0
I (19348) phy: wifi rx start: channel is 1, rate is 0x0 I (51130) phy: wifi rx start: channel is 1, rate is 0x0
phy> phy>
phy> cmdstop phy> cmdstop
I (142881) phy: Total: 535 Correct: 474 RSSI: -650 noise: -960 gain: 531 para1: 5759 para2: 3 I (58800) phy: rx_num: 166 rx_rssi: -527
phy> phy>
phy> get_rx_result phy> get_rx_result
I (145991) cmd_phy: Total: 535, Correct: 474, RSSI: -650, flag: 1 I (66350) cmd_phy: Desired: 167, Correct: 166, RSSI: -527, flag: 1
phy> phy>
phy> wifiscwout -e 1 -c 1 -p 0 phy> wifiscwout -e 1 -c 1 -p 0
I (98308) phy: wifi single carrier tx out, single carrier is in 1 channel, power is about (2 I (80310) phy: wifi single carrier tx start: chan=1, pwr=20-0.0
phy>
phy> wifiscwout -e 0 -c 1 -p 0
I (88260) phy: wifi single carrier tx stop
phy> phy>
phy> esp_ble_tx -p 8 -n 1 -l 37 -t 2 -s 0x71764129 -r 0 -m 0 phy> esp_ble_tx -p 8 -n 1 -l 37 -t 2 -s 0x71764129 -r 0 -m 0
I (319138) phy: fcc_le_tx_syncw: txpwr=8,chan=1,len=37,data_type=2,syncw=0x71764129,rate=0,tx_ I (91470) phy: ble_tx:pwr=8,chan=1,len=37,type=2,syncw=0x71764129,rate=0,txnum=0
phy> phy>
phy> cmdstop phy> cmdstop
I (321208) phy: rw done! ce9 I (98650) phy: rw done! e22e
phy> phy>
phy> esp_ble_rx -n 1 -s 0x71764129 -r 0 phy> esp_ble_rx -n 1 -s 0x71764129 -r 0
I (2898) phy: RW LE V9 RX PER I (104990) phy: RW LE V9 RX PER
phy> phy>
phy> cmdstop phy> cmdstop
I (381241) phy: 3 0 0 0 3 0 0 0 0 0 p -263 -86 -279 a8 -100 -77 I (130260) phy: rx_num: 0 rx_rssi: 0
phy> phy>
phy> get_rx_result phy> get_rx_result
I (383871) cmd_phy: Total: 3, Correct: 0, RSSI: 0, flag: 2 I (139550) cmd_phy: Desired: 0, Correct: 0, RSSI: 0, flag: 2
phy> phy>
phy> bt_tx_tone -e 1 -n 1 -p 0 phy> bt_tx_tone -e 1 -n 1 -p 0
I (56008) phy: BT TX TONE START! I (151900) phy: BT TX TONE START!
phy>
phy> bt_tx_tone -e 0 -n 1 -p 0
I (191970) phy: BT TX TONE STOP!
phy> phy>
``` ```

View File

@@ -13,6 +13,8 @@
#define TAG "cmd_phy" #define TAG "cmd_phy"
#define CERT_TASK_PRIO 2
#if CONFIG_ESP_PHY_ENABLE_CERT_TEST #if CONFIG_ESP_PHY_ENABLE_CERT_TEST
static phy_args_t phy_args; static phy_args_t phy_args;
@@ -67,7 +69,7 @@ static int esp_phy_get_rx_result_func(int argc, char **argv)
esp_phy_get_rx_result(&rx_result); esp_phy_get_rx_result(&rx_result);
ESP_LOGI(TAG, "Total: %lu, Correct: %lu, RSSI: %d, flag: %lu", rx_result.phy_rx_total_count, ESP_LOGI(TAG, "Desired: %lu, Correct: %lu, RSSI: %d, flag: %lu", rx_result.phy_rx_total_count,
rx_result.phy_rx_correct_count, rx_result.phy_rx_rssi, rx_result.phy_rx_result_flag); rx_result.phy_rx_correct_count, rx_result.phy_rx_rssi, rx_result.phy_rx_result_flag);
return 0; return 0;
@@ -111,7 +113,7 @@ static int esp_phy_cbw40m_en_func(int argc, char **argv)
static int esp_phy_wifi_tx_func(int argc, char **argv) static int esp_phy_wifi_tx_func(int argc, char **argv)
{ {
phy_wifi_tx_s cmd; static phy_wifi_tx_s cmd;
int nerrors = arg_parse(argc, argv, (void **) &phy_wifi_tx_args); int nerrors = arg_parse(argc, argv, (void **) &phy_wifi_tx_args);
if (nerrors != 0) { if (nerrors != 0) {
arg_print_errors(stderr, phy_wifi_tx_args.end, argv[0]); arg_print_errors(stderr, phy_wifi_tx_args.end, argv[0]);
@@ -160,14 +162,14 @@ static int esp_phy_wifi_tx_func(int argc, char **argv)
ESP_LOGW(TAG, "Default packet_num is 0"); ESP_LOGW(TAG, "Default packet_num is 0");
} }
xTaskCreate(cert_wifi_tx, "cert_wifi_tx", 1024 * 10, (void *)&cmd, 10, NULL); xTaskCreate(cert_wifi_tx, "cert_wifi_tx", 1024 * 10, (void *)&cmd, CERT_TASK_PRIO, NULL);
return 0; return 0;
} }
static int esp_phy_wifi_rx_func(int argc, char **argv) static int esp_phy_wifi_rx_func(int argc, char **argv)
{ {
phy_wifi_tx_s cmd; static phy_wifi_rx_s cmd;
int nerrors = arg_parse(argc, argv, (void **) &phy_wifi_rx_args); int nerrors = arg_parse(argc, argv, (void **) &phy_wifi_rx_args);
if (nerrors != 0) { if (nerrors != 0) {
arg_print_errors(stderr, phy_wifi_rx_args.end, argv[0]); arg_print_errors(stderr, phy_wifi_rx_args.end, argv[0]);
@@ -188,7 +190,7 @@ static int esp_phy_wifi_rx_func(int argc, char **argv)
ESP_LOGW(TAG, "Default rate is PHY_RATE_1M"); ESP_LOGW(TAG, "Default rate is PHY_RATE_1M");
} }
xTaskCreate(cert_wifi_rx, "cert_wifi_rx", 1024 * 20, (void *)&cmd, 10, NULL); xTaskCreate(cert_wifi_rx, "cert_wifi_rx", 1024 * 20, (void *)&cmd, CERT_TASK_PRIO, NULL);
return 0; return 0;
} }
@@ -253,7 +255,7 @@ void cert_ble_rx(void *arg)
static int esp_phy_ble_tx_func(int argc, char **argv) static int esp_phy_ble_tx_func(int argc, char **argv)
{ {
phy_ble_tx_s cmd; static phy_ble_tx_s cmd;
int nerrors = arg_parse(argc, argv, (void **) &phy_ble_tx_args); int nerrors = arg_parse(argc, argv, (void **) &phy_ble_tx_args);
if (nerrors != 0) { if (nerrors != 0) {
arg_print_errors(stderr, phy_ble_tx_args.end, argv[0]); arg_print_errors(stderr, phy_ble_tx_args.end, argv[0]);
@@ -309,14 +311,14 @@ static int esp_phy_ble_tx_func(int argc, char **argv)
ESP_LOGW(TAG, "Default tx_num_in is 0"); ESP_LOGW(TAG, "Default tx_num_in is 0");
} }
xTaskCreate(cert_ble_tx, "cert_ble_tx", 4096, (void *)&cmd, 10, NULL); xTaskCreate(cert_ble_tx, "cert_ble_tx", 4096, (void *)&cmd, CERT_TASK_PRIO, NULL);
return 0; return 0;
} }
static int esp_phy_ble_rx_func(int argc, char **argv) static int esp_phy_ble_rx_func(int argc, char **argv)
{ {
phy_ble_rx_s cmd; static phy_ble_rx_s cmd;
int nerrors = arg_parse(argc, argv, (void **) &phy_ble_rx_args); int nerrors = arg_parse(argc, argv, (void **) &phy_ble_rx_args);
if (nerrors != 0) { if (nerrors != 0) {
arg_print_errors(stderr, phy_ble_rx_args.end, argv[0]); arg_print_errors(stderr, phy_ble_rx_args.end, argv[0]);
@@ -324,7 +326,7 @@ static int esp_phy_ble_rx_func(int argc, char **argv)
} }
if (phy_ble_rx_args.channel->count == 1) { if (phy_ble_rx_args.channel->count == 1) {
cmd.channel = phy_ble_tx_args.channel->ival[0]; cmd.channel = phy_ble_rx_args.channel->ival[0];
} else { } else {
cmd.channel = 1; cmd.channel = 1;
ESP_LOGW(TAG, "Default channel is 1"); ESP_LOGW(TAG, "Default channel is 1");
@@ -344,7 +346,7 @@ static int esp_phy_ble_rx_func(int argc, char **argv)
ESP_LOGW(TAG, "Default rate is PHY_BLE_RATE_1M"); ESP_LOGW(TAG, "Default rate is PHY_BLE_RATE_1M");
} }
xTaskCreate(cert_ble_rx, "cert_ble_rx", 4096, (void *)&cmd, 10, NULL); xTaskCreate(cert_ble_rx, "cert_ble_rx", 4096, (void *)&cmd, CERT_TASK_PRIO, NULL);
return 0; return 0;
} }