Skip to content

Commit

Permalink
wifi: build with no blobs
Browse files Browse the repository at this point in the history
Add Wi-Fi stubs to allow CI build that does not
required binary blobs. It is useful to test
Wi-Fi driver and adapter.

Signed-off-by: Sylvio Alves <[email protected]>
  • Loading branch information
sylvioalves committed Nov 2, 2024
1 parent 0f18742 commit 2bc9c60
Show file tree
Hide file tree
Showing 7 changed files with 1,239 additions and 36 deletions.
30 changes: 0 additions & 30 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,5 @@
# SPDX-License-Identifier: Apache-2.0

# check for RF libraries in case ESP32 family is used and BT or WIFI are enabled
if(CONFIG_BT_ESP32 OR CONFIG_WIFI_ESP32)
list(APPEND LIBRARIES "core" "net80211" "phy" "pp" "espnow")

if(NOT CONFIG_SOC_SERIES_ESP32C2)
list(APPEND LIBRARIES "mesh" "wapi")
endif()

if(CONFIG_SOC_SERIES_ESP32)
list(APPEND LIBRARIES "btdm_app" "rtc")
endif()

if(CONFIG_SOC_SERIES_ESP32C3 OR CONFIG_SOC_SERIES_ESP32S3)
list(APPEND LIBRARIES "btbb" "btdm_app" "bttestmode" "rftest" "smartconfig")
endif()

foreach(lib ${LIBRARIES})
find_library(${lib}_FOUND ${lib} HINTS
"${ZEPHYR_HAL_ESPRESSIF_MODULE_DIR}/zephyr/blobs/lib/${CONFIG_SOC_SERIES}")

if(NOT ${lib}_FOUND)
message(FATAL_ERROR
"ESP32 RF library ${lib} not found.\n"
"Run the command below to download the necessary files:\n"
"> west blobs fetch hal_espressif")
break()
endif()
endforeach()
endif()

add_subdirectory_ifdef(CONFIG_SOC_SERIES_ESP32 esp32)
add_subdirectory_ifdef(CONFIG_SOC_SERIES_ESP32C2 esp32c2)
add_subdirectory_ifdef(CONFIG_SOC_SERIES_ESP32C3 esp32c3)
Expand Down
4 changes: 3 additions & 1 deletion zephyr/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ if(CONFIG_SOC_SERIES_ESP32)
../../components/esp_phy/src/phy_common.c
)

zephyr_link_libraries(
zephyr_sources_ifdef(CONFIG_WIFI_BUILD_ONLY_MODE ../port/wifi/wifi_stubs.c)

zephyr_link_libraries_ifndef(CONFIG_WIFI_BUILD_ONLY_MODE
net80211
core
pp
Expand Down
4 changes: 3 additions & 1 deletion zephyr/esp32c2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ if(CONFIG_SOC_SERIES_ESP32C2)
../../components/efuse/src/efuse_controller/keys/without_key_purposes/one_key_block/esp_efuse_api_key.c
)

zephyr_link_libraries(
zephyr_sources_ifdef(CONFIG_WIFI_BUILD_ONLY_MODE ../port/wifi/wifi_stubs.c)

zephyr_link_libraries_ifndef(CONFIG_WIFI_BUILD_ONLY_MODE
net80211
core
pp
Expand Down
4 changes: 3 additions & 1 deletion zephyr/esp32c3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ if(CONFIG_SOC_SERIES_ESP32C3)
../../components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c
)

zephyr_link_libraries(
zephyr_sources_ifdef(CONFIG_WIFI_BUILD_ONLY_MODE ../port/wifi/wifi_stubs.c)

zephyr_link_libraries_ifndef(CONFIG_WIFI_BUILD_ONLY_MODE
net80211
core
pp
Expand Down
7 changes: 5 additions & 2 deletions zephyr/esp32s2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,15 @@ if(CONFIG_SOC_SERIES_ESP32S2)
zephyr_compile_definitions_ifdef(CONFIG_ESP32_WIFI_ENABLE_SAE_PK CONFIG_SAE_PK)
zephyr_compile_definitions_ifdef(CONFIG_ESP32_WIFI_SOFTAP_SAE_SUPPORT CONFIG_SAE)

zephyr_link_libraries(
zephyr_link_libraries(mbedTLS)

zephyr_sources_ifdef(CONFIG_WIFI_BUILD_ONLY_MODE ../port/wifi/wifi_stubs.c)

zephyr_link_libraries_ifndef(CONFIG_WIFI_BUILD_ONLY_MODE
net80211
core
pp
phy
mbedTLS
## esp-idf wifi libs refer gcc libs symbols, so linked in libgcc
gcc
-L${CMAKE_CURRENT_SOURCE_DIR}/../blobs/lib/esp32s2
Expand Down
4 changes: 3 additions & 1 deletion zephyr/esp32s3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,9 @@ if(CONFIG_SOC_SERIES_ESP32S3)
../../components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c
)

zephyr_link_libraries(
zephyr_sources_ifdef(CONFIG_WIFI_BUILD_ONLY_MODE ../port/wifi/wifi_stubs.c)

zephyr_link_libraries_ifndef(CONFIG_WIFI_BUILD_ONLY_MODE
net80211
core
pp
Expand Down
Loading

0 comments on commit 2bc9c60

Please sign in to comment.