From 4758622331bb753b7e5de82c14156cc883f232cb Mon Sep 17 00:00:00 2001 From: "wangtao@espressif.com" Date: Fri, 20 Sep 2024 20:32:42 +0800 Subject: [PATCH 1/3] feat(wifi): support esp32c2 eco4 wifi bringup --- components/esp_wifi/include/esp_wifi_types.h | 1 + components/esp_wifi/src/wifi_init.c | 16 ++++++++++++++++ .../esp_supplicant/src/esp_wifi_driver.h | 2 ++ 3 files changed, 19 insertions(+) diff --git a/components/esp_wifi/include/esp_wifi_types.h b/components/esp_wifi/include/esp_wifi_types.h index dc67efd68f..b497c3e61c 100644 --- a/components/esp_wifi/include/esp_wifi_types.h +++ b/components/esp_wifi/include/esp_wifi_types.h @@ -884,6 +884,7 @@ typedef enum { WIFI_EVENT_STA_BEACON_TIMEOUT, /**< Station beacon timeout */ WIFI_EVENT_CONNECTIONLESS_MODULE_WAKE_INTERVAL_START, /**< Connectionless module wake interval start */ + /* Add next events after this only */ WIFI_EVENT_AP_WPS_RG_SUCCESS, /**< Soft-AP wps succeeds in registrar mode */ WIFI_EVENT_AP_WPS_RG_FAILED, /**< Soft-AP wps fails in registrar mode */ diff --git a/components/esp_wifi/src/wifi_init.c b/components/esp_wifi/src/wifi_init.c index 7361f366fd..0619a4bc23 100644 --- a/components/esp_wifi/src/wifi_init.c +++ b/components/esp_wifi/src/wifi_init.c @@ -579,3 +579,19 @@ void nan_sm_handle_event(void *p1, int p2) } #endif + +#if CONFIG_IDF_TARGET_ESP32C2 +#if CONFIG_ESP32C2_REV_MIN_FULL < 200 +void esp32c2_eco4_rom_ptr_init(void) +{ + /* Do not remove, stub to overwrite weak link in Wi-Fi Lib */ +} +#endif +#endif + +#ifndef CONFIG_ESP_WIFI_SLP_SAMPLE_BEACON_FEATURE +void pm_beacon_offset_funcs_init(void) +{ + /* Do not remove, stub to overwrite weak link in Wi-Fi Lib */ +} +#endif diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h b/components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h index 6be0bb3358..1556c1d991 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h @@ -57,6 +57,7 @@ typedef enum { } wifi_appie_ram_t; enum { + /* this enum is in C2 ROM, do not change before WPA3_AUTH_OWE */ NONE_AUTH = 0x01, WPA_AUTH_UNSPEC = 0x02, WPA_AUTH_PSK = 0x03, @@ -72,6 +73,7 @@ enum { WPA2_AUTH_ENT_SHA384_SUITE_B = 0x0d, WPA2_AUTH_FT_PSK = 0x0e, WPA3_AUTH_OWE = 0x0f, + /* this enum is in C2 ROM, do not change before WPA3_AUTH_OWE */ WPA2_AUTH_INVALID }; From 7caee46b7783eae9876f9761e16a7f8bcf069812 Mon Sep 17 00:00:00 2001 From: "wangtao@espressif.com" Date: Tue, 6 Aug 2024 19:48:20 +0800 Subject: [PATCH 2/3] fix(wifi): fix esp32c2 eco4 ld --- .../esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld index 8671e7f1bb..1528dd405a 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld @@ -1129,16 +1129,16 @@ lmacAdjustTimestamp = 0x40001b10; lmacDiscardMSDU = 0x40001b18; lmacEndFrameExchangeSequence = 0x40001b1c; lmacMSDUAged = 0x40001b28; -lmacSetTxFrame = 0x40001b4c; +//lmacSetTxFrame = 0x40001b4c; pm_check_state = 0x40001b6c; pm_dream = 0x40001b78; pm_on_beacon_rx = 0x40001ba0; -pm_parse_beacon = 0x40001bac; +//pm_parse_beacon = 0x40001bac; pm_process_tim = 0x40001bb0; pm_rx_beacon_process = 0x40001bb4; pm_rx_data_process = 0x40001bb8; pm_sleep = 0x40001bbc; -pm_tbtt_process = 0x40001bc4; +//pm_tbtt_process = 0x40001bc4; ppAssembleAMPDU = 0x40001bcc; ppCalTxAMPDULength = 0x40001bd8; ppRxFragmentProc = 0x40001c28; @@ -1148,7 +1148,7 @@ rcGetSched = 0x40001c88; rcTxUpdatePer = 0x40001c94; rcUpdateRate = 0x40001c9c; wDev_AppendRxBlocks = 0x40001cdc; -wDev_IndicateFrame = 0x40001cec; +//wDev_IndicateFrame = 0x40001cec; wDev_ProcessFiq = 0x40001d08; wDev_ProcessRxSucData = 0x40001d0c; ppProcTxDone = 0x40001d1c; @@ -1170,10 +1170,10 @@ hal_crypto_set_key_entry = 0x40001e18; pm_start = 0x40001e34; pm_stop = 0x40001e38; hal_set_sta_tbtt = 0x40001e4c; -pm_update_next_tbtt = 0x40001e50; +//pm_update_next_tbtt = 0x40001e50; pm_set_sleep_type = 0x40001e54; pm_tx_null_data_done_process = 0x40001eb0; -pm_tx_data_process = 0x40001eb4; +//pm_tx_data_process = 0x40001eb4; pm_attach = 0x40001eb8; pm_coex_schm_process = 0x40001ebc; pm_on_probe_resp_rx = 0x40001ecc; @@ -1196,31 +1196,31 @@ ieee80211_classify = 0x40001fe0; ieee80211_crypto_decap = 0x40001ff8; ieee80211_ccmp_decrypt = 0x4000200c; ieee80211_ccmp_encrypt = 0x40002010; -ieee80211_send_action_vendor_spec = 0x40002034; +//ieee80211_send_action_vendor_spec = 0x40002034; ieee80211_send_mgmt = 0x40002038; -ieee80211_auth_construct = 0x4000203c; +//ieee80211_auth_construct = 0x4000203c; ieee80211_deauth_construct = 0x40002040; ieee80211_disassoc_construct = 0x40002044; ieee80211_add_xrates = 0x40002058; -ieee80211_assoc_req_construct = 0x40002060; +//ieee80211_assoc_req_construct = 0x40002060; ieee80211_assoc_resp_construct = 0x40002064; ieee80211_timer_process = 0x4000208c; cnx_coexist_timeout = 0x40002090; -sta_recv_mgmt = 0x40002094; +//sta_recv_mgmt = 0x40002094; ieee80211_send_probereq = 0x4000209c; -sta_auth_open = 0x400020a0; -sta_auth_sae = 0x400020a8; +//sta_auth_open = 0x400020a0; +//sta_auth_sae = 0x400020a8; cnx_coexist_timeout_process = 0x400020ac; ieee80211_add_extcap = 0x400020cc; -ieee80211_alloc_proberesp = 0x400020d8; +//ieee80211_alloc_proberesp = 0x400020d8; esp_wifi_80211_tx = 0x400020f8; ieee80211_crypto_aes_128_cmac_decrypt = 0x40002104; ieee80211_output_do = 0x4000210c; ieee80211_send_nulldata = 0x40002110; -ieee80211_setup_robust_mgmtframe = 0x40002114; -ieee80211_mgmt_output = 0x40002118; +//ieee80211_setup_robust_mgmtframe = 0x40002114; +//ieee80211_mgmt_output = 0x40002118; ieee80211_send_deauth = 0x40002120; -ieee80211_tx_mgt_cb = 0x4000212c; +//ieee80211_tx_mgt_cb = 0x4000212c; sta_rx_csa = 0x40002134; sta_send_sa_query_req = 0x40002138; sta_send_sa_query_resp = 0x4000213c; @@ -1228,7 +1228,7 @@ sta_recv_sa_query_req = 0x40002140; sta_recv_sa_query_resp = 0x40002144; ieee80211_parse_beacon = 0x40002148; ieee80211_match_security = 0x40002154; -ieee80211_parse_rsn = 0x4000215c; +//ieee80211_parse_rsn = 0x4000215c; /* Data (.data, .bss, .rodata) */ s_sa_query_retries = 0x3fcdfad8; s_sa_query_success = 0x3fcdfad5; From 70b29ec9cfbae0506d495fb49317c7e4d685b558 Mon Sep 17 00:00:00 2001 From: "wangtao@espressif.com" Date: Fri, 20 Sep 2024 21:13:28 +0800 Subject: [PATCH 3/3] feat(wifi): update support esp32c2eco4 wifi lib --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 83eb70737e..b6a8a3e02f 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 83eb70737e9874a822d93132e1015cfa0157814b +Subproject commit b6a8a3e02f0b6386916a82d97a3b7bece68d301a