diff --git a/components/esp32/ld/esp32_fragments.lf b/components/esp32/ld/esp32_fragments.lf index cfdc79ceaf..66f20ae7f0 100644 --- a/components/esp32/ld/esp32_fragments.lf +++ b/components/esp32/ld/esp32_fragments.lf @@ -60,6 +60,10 @@ entries: entries: .wifirxiram+ +[sections:phy_iram] +entries: + .phyiram+ + [scheme:default] entries: if APP_BUILD_USE_FLASH_SECTIONS = y: @@ -81,6 +85,7 @@ entries: rtc_bss -> rtc_bss wifi_iram -> flash_text wifi_rx_iram -> flash_text + phy_iram -> flash_text [scheme:rtc] entries: @@ -110,3 +115,7 @@ entries: [scheme:wifi_rx_iram] entries: wifi_rx_iram -> iram0_text + +[scheme:phy_iram] +entries: + phy_iram -> iram0_text diff --git a/components/esp_wifi/esp32/include/phy_init_data.h b/components/esp_wifi/esp32/include/phy_init_data.h index 3b9a71c45c..f227138f27 100644 --- a/components/esp_wifi/esp32/include/phy_init_data.h +++ b/components/esp_wifi/esp32/include/phy_init_data.h @@ -83,7 +83,7 @@ static const esp_phy_init_data_t phy_init_data= { { 0x18, 0x18, 0x18, - LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 78), + LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 84), LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 72), LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 66), LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 60), diff --git a/components/esp_wifi/include/esp_phy_init.h b/components/esp_wifi/include/esp_phy_init.h index 2e5953a081..1cf3c13d2a 100644 --- a/components/esp_wifi/include/esp_phy_init.h +++ b/components/esp_wifi/include/esp_phy_init.h @@ -283,6 +283,12 @@ esp_err_t esp_phy_update_country_info(const char *country); esp_err_t esp_phy_apply_phy_init_data(uint8_t *init_data); #endif +/* + * @brief Get PHY lib version + * @return PHY lib version. + */ +char * get_phy_version_str(void); + #ifdef __cplusplus } #endif diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index f649e2fde0..00d5bd8c8e 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -448,6 +448,8 @@ esp_err_t esp_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_re /** * @brief Get information of AP which the ESP32 station is associated with * + * @attention When the obtained country information is empty, it means that the AP does not carry country information + * * @param ap_info the wifi_ap_record_t to hold AP information * sta can get the connected ap's phy mode info through the struct member * phy_11b,phy_11g,phy_11n,phy_lr in the wifi_ap_record_t struct. @@ -887,9 +889,9 @@ esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx); * @attention 1. Maximum power before wifi startup is limited by PHY init data bin. * @attention 2. The value set by this API will be mapped to the max_tx_power of the structure wifi_country_t variable. * @attention 3. Mapping Table {Power, max_tx_power} = {{8, 2}, {20, 5}, {28, 7}, {34, 8}, {44, 11}, - * {52, 13}, {56, 14}, {60, 15}, {66, 16}, {72, 18}, {78, 20}}. - * @attention 4. Param power unit is 0.25dBm, range is [8, 78] corresponding to 2dBm - 20dBm. - * @attention 5. Relationship between set value and actual value. As follows: {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 77],72}, {78,78}} + * {52, 13}, {56, 14}, {60, 15}, {66, 16}, {72, 18}, {80, 20}}. + * @attention 4. Param power unit is 0.25dBm, range is [8, 84] corresponding to 2dBm - 20dBm. + * @attention 5. Relationship between set value and actual value. As follows: {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}. * * @param power Maximum WiFi transmitting power. * diff --git a/components/esp_wifi/include/esp_wifi_types.h b/components/esp_wifi/include/esp_wifi_types.h index a9aaf200f9..ae92443593 100644 --- a/components/esp_wifi/include/esp_wifi_types.h +++ b/components/esp_wifi/include/esp_wifi_types.h @@ -380,6 +380,7 @@ typedef enum { #define WIFI_PROMIS_FILTER_MASK_MISC (1<<3) /**< filter the packets with type of WIFI_PKT_MISC */ #define WIFI_PROMIS_FILTER_MASK_DATA_MPDU (1<<4) /**< filter the MPDU which is a kind of WIFI_PKT_DATA */ #define WIFI_PROMIS_FILTER_MASK_DATA_AMPDU (1<<5) /**< filter the AMPDU which is a kind of WIFI_PKT_DATA */ +#define WIFI_PROMIS_FILTER_MASK_FCSFAIL (1<<6) /**< filter the FCS failed packets, do not open it in general */ #define WIFI_PROMIS_CTRL_FILTER_MASK_ALL (0xFF800000) /**< filter all control packets */ #define WIFI_PROMIS_CTRL_FILTER_MASK_WRAPPER (1<<23) /**< filter the control packets with subtype of Control Wrapper */ diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index e2516f2894..dfe4c8ec6c 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit e2516f28942b3ae056eb38e996a0e91b62bcab78 +Subproject commit dfe4c8ec6c8edce255fd7f3c3716920b8e9dd9e9 diff --git a/components/esp_wifi/src/phy_init.c b/components/esp_wifi/src/phy_init.c index e50f21dae9..ae28036a1e 100644 --- a/components/esp_wifi/src/phy_init.c +++ b/components/esp_wifi/src/phy_init.c @@ -714,6 +714,9 @@ static void __attribute((unused)) esp_phy_reduce_tx_power(esp_phy_init_data_t* i void esp_phy_load_cal_and_init(phy_rf_module_t module) { + char * phy_version = get_phy_version_str(); + ESP_LOGI(TAG, "phy_version %s", phy_version); + esp_phy_calibration_data_t* cal_data = (esp_phy_calibration_data_t*) calloc(sizeof(esp_phy_calibration_data_t), 1); if (cal_data == NULL) {