From aa24bfc1df5c4df20335bc9ef626f5dafad29e0c Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Wed, 19 Jul 2023 20:31:06 +0800 Subject: [PATCH 1/2] esp_phy:update comments in esp_phy_init.h --- components/esp_wifi/include/esp_phy_init.h | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/components/esp_wifi/include/esp_phy_init.h b/components/esp_wifi/include/esp_phy_init.h index 29905f4540..0c63a4bcc5 100644 --- a/components/esp_wifi/include/esp_phy_init.h +++ b/components/esp_wifi/include/esp_phy_init.h @@ -98,7 +98,7 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void); void esp_phy_release_init_data(const esp_phy_init_data_t* data); /** - * @brief Function called by esp_phy_init to load PHY calibration data + * @brief Function called by esp_phy_load_cal_and_init to load PHY calibration data * * This is a convenience function which can be used to load PHY calibration * data from NVS. Data can be stored to NVS using esp_phy_store_cal_data_to_nvs @@ -109,13 +109,6 @@ void esp_phy_release_init_data(const esp_phy_init_data_t* data); * or obtained for a different version of software), this function will * return an error. * - * If "Initialize PHY in startup code" option is set in menuconfig, this - * function will be used to load calibration data. To provide a different - * mechanism for loading calibration data, disable - * "Initialize PHY in startup code" option in menuconfig and call esp_phy_init - * function from the application. For an example usage of esp_phy_init and - * this function, see esp_phy_store_cal_data_to_nvs function in cpu_start.c - * * @param out_cal_data pointer to calibration data structure to be filled with * loaded data. * @return ESP_OK on success @@ -123,19 +116,13 @@ void esp_phy_release_init_data(const esp_phy_init_data_t* data); esp_err_t esp_phy_load_cal_data_from_nvs(esp_phy_calibration_data_t* out_cal_data); /** - * @brief Function called by esp_phy_init to store PHY calibration data + * @brief Function called by esp_phy_load_cal_and_init to store PHY calibration data * * This is a convenience function which can be used to store PHY calibration - * data to the NVS. Calibration data is returned by esp_phy_init function. + * data to the NVS. Calibration data is returned by esp_phy_load_cal_and_init function. * Data saved using this function to the NVS can later be loaded using * esp_phy_store_cal_data_to_nvs function. * - * If "Initialize PHY in startup code" option is set in menuconfig, this - * function will be used to store calibration data. To provide a different - * mechanism for storing calibration data, disable - * "Initialize PHY in startup code" option in menuconfig and call esp_phy_init - * function from the application. - * * @param cal_data pointer to calibration data which has to be saved. * @return ESP_OK on success */ From bb70fa6450cc41e50c729a3b724e616547df8f74 Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Wed, 19 Jul 2023 21:02:54 +0800 Subject: [PATCH 2/2] Backport some lwip bugs for 4.3 * Update submodule: git log --oneline 8290c3b8f2adaf82aa45ec992b87f16205f2689b..4f24c9baf9101634b7c690802f424b197b3bb685 Detailed description of the changes: - lower the dhcp discover and request retry backoff time (esp-lwip@4f24c9ba) - netdb:fixed bug for getaddrinfo returns null when IPV4 mapped address (esp-lwip@a4d70c7e) --- components/lwip/lwip | 2 +- components/lwip/port/esp32/include/lwipopts.h | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/components/lwip/lwip b/components/lwip/lwip index 8290c3b8f2..4f24c9baf9 160000 --- a/components/lwip/lwip +++ b/components/lwip/lwip @@ -1 +1 @@ -Subproject commit 8290c3b8f2adaf82aa45ec992b87f16205f2689b +Subproject commit 4f24c9baf9101634b7c690802f424b197b3bb685 diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index d0dd9ee0fc..13f6b69fd1 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -260,12 +260,10 @@ extern "C" #define ESP_DHCP_DISABLE_CLIENT_ID CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID #define DHCP_DEFINE_CUSTOM_TIMEOUTS 1 -/* Since for embedded devices it's not that hard to miss a discover packet, so lower - * the discover retry backoff time from (2,4,8,16,32,60,60)s to (500m,1,2,4,8,15,15)s. - */ - #define DHCP_REQUEST_TIMEOUT_SEQUENCE(state, tries) (state == DHCP_STATE_REQUESTING ? \ - (uint16_t)(1 * 1000) : \ - (uint16_t)(((tries) < 6 ? 1 << (tries) : 60) * 250)) + /* Since for embedded devices it's not that hard to miss a discover packet, so lower + * the discover and request retry backoff time from (2,4,8,16,32,60,60)s to (500m,1,2,4,4,4,4)s. + */ +#define DHCP_REQUEST_TIMEOUT_SEQUENCE(tries) ((uint16_t)(((tries) < 5 ? 1 << (tries) : 16) * 250)) #define DHCP_COARSE_TIMER_SECS CONFIG_LWIP_DHCP_COARSE_TIMER_SECS