WiFi: Add support for ESP32S2

1) Update WiFi and PHY libs for ESP32S2.
2) Remove KConfig options ESP32S2 PHY lib selection.
3) Change target macros from ESP32S2BETA to ESP32S2
This commit is contained in:
Sagar Bijwe
2020-02-05 18:34:05 +05:30
parent f515db1a3e
commit 4f93a707f8
7 changed files with 16 additions and 38 deletions

View File

@@ -4,27 +4,6 @@ menu "ESP32S2-specific"
# not working so we just hide all items here
visible if IDF_TARGET_ESP32S2
choice ESP32S2_CHIP_VERSION
# TODO: remove once final S2 chip is supported
prompt "ESP32-S2 chip version"
default ESP32S2_VERSION_A
help
There are three versions of ESP32-S2 chip with different Wi-Fi PHY: A, B and Marlin3.
This setting must match the chip for Wi-Fi to work correctly. You can determine
the chip version by reading the markings on top of the chip. It will be one of the
three options given here.
The Wi-Fi performance of Marlin3 is the best among the three versions of chip.
config ESP32S2_VERSION_A
bool "Chip7.2.2-A"
config ESP32S2_VERSION_B
bool "Chip7.2.2-B"
config ESP32S2_VERSION_MARLIN3
bool "Marlin3-B2 or Marlin3-B3"
endchoice
choice ESP32S2_DEFAULT_CPU_FREQ_MHZ
prompt "CPU frequency"
default ESP32S2_DEFAULT_CPU_FREQ_160 if !IDF_ENV_FPGA

View File

@@ -40,18 +40,7 @@ endif()
target_link_libraries(${COMPONENT_LIB} PUBLIC "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib/${target_name}")
if(link_binary_libs)
if(CONFIG_IDF_TARGET_ESP32)
set(phy phy)
elseif(CONFIG_IDF_TARGET_ESP32S2)
# TODO: remove once final S2 chip is supported
if(CONFIG_ESP32S2_VERSION_A)
set(phy phyA)
elseif(CONFIG_ESP32S2_VERSION_B)
set(phy phyB)
elseif(CONFIG_ESP32S2_VERSION_MARLIN3)
set(phy phy_marlin3)
endif()
endif()
set(blobs coexist core espnow mesh net80211 pp rtc smartconfig ${phy})
foreach(blob ${blobs})

View File

@@ -582,7 +582,7 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._get_random = os_get_random,
._get_time = get_time_wrapper,
._random = os_random,
#if CONFIG_IDF_TARGET_ESP32S2BETA
#if CONFIG_IDF_TARGET_ESP32S2
._slowclk_cal_get = esp_clk_slowclk_cal_get,
#endif
._log_write = esp_log_write,

View File

@@ -107,7 +107,7 @@ typedef struct {
int32_t (* _get_random)(uint8_t *buf, size_t len);
int32_t (* _get_time)(void *t);
unsigned long (* _random)(void);
#if CONFIG_IDF_TARGET_ESP32S2BETA
#if CONFIG_IDF_TARGET_ESP32S2
uint32_t (* _slowclk_cal_get)(void);
#endif
void (* _log_write)(uint32_t level, const char* tag, const char* format, ...);

View File

@@ -325,7 +325,7 @@ typedef struct {
unsigned sgi:1; /**< Short Guide Interval(SGI). 0: Long GI; 1: Short GI */
#if CONFIG_IDF_TARGET_ESP32
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: 0.25dBm*/
#elif CONFIG_IDF_TARGET_ESP32S2BETA
#elif CONFIG_IDF_TARGET_ESP32S2
unsigned :8;
#endif
unsigned ampdu_cnt:8; /**< ampdu cnt */
@@ -333,10 +333,15 @@ typedef struct {
unsigned secondary_channel:4; /**< secondary channel on which this packet is received. 0: none; 1: above; 2: below */
unsigned :8; /**< reserve */
unsigned timestamp:32; /**< timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */
#if CONFIG_IDF_TARGET_ESP32
unsigned :32; /**< reserve */
unsigned :31; /**< reserve */
unsigned ant:1; /**< antenna number from which this packet is received. 0: WiFi antenna 0; 1: WiFi antenna 1 */
#if CONFIG_IDF_TARGET_ESP32S2BETA
#elif CONFIG_IDF_TARGET_ESP32S2
unsigned :32;
unsigned :32;
#endif
#if CONFIG_IDF_TARGET_ESP32S2
signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: 0.25dBm*/
unsigned :24;
#endif

View File

@@ -765,3 +765,8 @@ void esp_phy_load_cal_and_init(phy_rf_module_t module)
free(cal_data); // PHY maintains a copy of calibration data, so we can free this
}
#if CONFIG_IDF_TARGET_ESP32S2
/* Just a stub to avoid SSC build failure. Need to update phylib */
void set_cca(bool en ,uint8_t cca_thr) {}
#endif