linux kernel 5.4.3上使用ESP32-WROOM-32UE的hosted模式做网卡
Posted: Thu Mar 09, 2023 1:55 am
我使用esp-hosted-release-v0.3及esp_hosted_firmware_esp32_sdio_uart_v0.3,使用sdio2
设备树配置&usdhc2 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
max-frequency = <50000000>;
pinctrl-0 = <&pinctrl_usdhc2_alt &pinctrl_wifi>;// &pinctrl_wifi
bus-width = <4>;
// no-1-8-v; /* force 3.3V VIO */
non-removable;
pm-ignore-notify;
cap-power-off-card;
// /delete-property/ wakeup-source;
status = "okay";
esp32: esp32@1 {
reg = <1>;
compatible = "alinx-led-my";
gpios = <&gpio3 4 GPIO_ACTIVE_LOW>;
};
};
将驱动编译成ko文件,加载驱动后,模组log为
I (647) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (757) phy: phy_version: 4390, 6b3c1f2, Sep 10 2020, 15:09:07, 0, 0
I (1227) SDIO_SLAVE: Using SDIO interface
I (1247) wifi:wifi driver task: 3ffde798, prio:23, stack:6656, core=0
I (1247) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1247) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1257) wifi:wifi firmware version: 6e1f9e4
I (1257) wifi:config NVS flash: disabled
I (1267) wifi:config nano formating: disabled
I (1267) wifi:Init data frame dynamic rx buffer num: 32
I (1277) wifi:Init management frame dynamic rx buffer num: 32
I (1277) wifi:Init management short buffer num: 32
I (1287) wifi:Init dynamic tx buffer num: 32
I (1287) wifi:Init static rx buffer size: 1600
I (1287) wifi:Init static rx buffer num: 10
I (1297) wifi:Init dynamic rx buffer num: 32
I (1307) wifi:mode : null
I (1307) NETWORK_ADAPTER: Initial set up done
这个设备id一直匹配不到
static const struct sdio_device_id esp_devices[] = {
{ SDIO_DEVICE(ESP_VENDOR_ID, ESP_DEVICE_ID_1) },
{ SDIO_DEVICE(ESP_VENDOR_ID, ESP_DEVICE_ID_2) },
{}
};
但linux端始终识别不到ESP32-WROOM-32UE的设备id进不到probe函数内,/sys/bus/sdio/devices下看不到设备节点,请指点下,是什么原因,该怎么查,能否提供一个linux上使用设备树驱动这个模组的例子,或者开发包。谢谢。
设备树配置&usdhc2 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
max-frequency = <50000000>;
pinctrl-0 = <&pinctrl_usdhc2_alt &pinctrl_wifi>;// &pinctrl_wifi
bus-width = <4>;
// no-1-8-v; /* force 3.3V VIO */
non-removable;
pm-ignore-notify;
cap-power-off-card;
// /delete-property/ wakeup-source;
status = "okay";
esp32: esp32@1 {
reg = <1>;
compatible = "alinx-led-my";
gpios = <&gpio3 4 GPIO_ACTIVE_LOW>;
};
};
将驱动编译成ko文件,加载驱动后,模组log为
I (647) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (757) phy: phy_version: 4390, 6b3c1f2, Sep 10 2020, 15:09:07, 0, 0
I (1227) SDIO_SLAVE: Using SDIO interface
I (1247) wifi:wifi driver task: 3ffde798, prio:23, stack:6656, core=0
I (1247) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1247) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1257) wifi:wifi firmware version: 6e1f9e4
I (1257) wifi:config NVS flash: disabled
I (1267) wifi:config nano formating: disabled
I (1267) wifi:Init data frame dynamic rx buffer num: 32
I (1277) wifi:Init management frame dynamic rx buffer num: 32
I (1277) wifi:Init management short buffer num: 32
I (1287) wifi:Init dynamic tx buffer num: 32
I (1287) wifi:Init static rx buffer size: 1600
I (1287) wifi:Init static rx buffer num: 10
I (1297) wifi:Init dynamic rx buffer num: 32
I (1307) wifi:mode : null
I (1307) NETWORK_ADAPTER: Initial set up done
这个设备id一直匹配不到
static const struct sdio_device_id esp_devices[] = {
{ SDIO_DEVICE(ESP_VENDOR_ID, ESP_DEVICE_ID_1) },
{ SDIO_DEVICE(ESP_VENDOR_ID, ESP_DEVICE_ID_2) },
{}
};
但linux端始终识别不到ESP32-WROOM-32UE的设备id进不到probe函数内,/sys/bus/sdio/devices下看不到设备节点,请指点下,是什么原因,该怎么查,能否提供一个linux上使用设备树驱动这个模组的例子,或者开发包。谢谢。