Skip to content

Commit 220de8e

Browse files
committed
fix(p4): Init SDIO host properly on Network boot
esp-hosted has one function marked as "constructor" that did not run in the boot phase of the chip. This calls the function when network is started
1 parent 98db66f commit 220de8e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

idf_component.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ dependencies:
8585
version: "^1.4.2"
8686
rules:
8787
- if: "target in [esp32s3]"
88+
espressif/esp_hosted:
89+
version: "^0.0.22"
90+
rules:
91+
- if: "target == esp32p4"
8892
espressif/esp_wifi_remote:
89-
version: "*"
93+
version: "^0.4.1"
9094
rules:
9195
- if: "target == esp32p4"
9296
espressif/libsodium:

libraries/Network/src/NetworkManager.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "esp_mac.h"
1111
#include "netdb.h"
1212

13+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
14+
extern "C" esp_err_t esp_hosted_init(void *);
15+
#endif
16+
1317
NetworkManager::NetworkManager() {}
1418

1519
NetworkInterface *getNetifByID(Network_Interface_ID id);
@@ -18,6 +22,9 @@ bool NetworkManager::begin() {
1822
static bool initialized = false;
1923
if (!initialized) {
2024
initialized = true;
25+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
26+
esp_hosted_init(NULL);
27+
#endif
2128
#if CONFIG_IDF_TARGET_ESP32
2229
uint8_t mac[8];
2330
if (esp_efuse_mac_get_default(mac) == ESP_OK) {

0 commit comments

Comments
 (0)