Skip to contentSkip to conversation

esp-hosted: new package

PATCH In review Jens Kleintje 3 participants 4 messages Mar 20, 2023 – Jul 31, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 esp-hosted: new package

The package provides a kernel driver for esp32 as wifi module. The project https://github.com/espressif/esp-hosted/tree/release/ng-v1.0.2.
configures the esp32 as a wifi module. The host and the esp32 can be
connected via sd bus or spi. This package supports only the host sd connection.
On the esp the firmware from
https://github.com/espressif/esp-hosted/releases/download/release%2Fng-v1.0.2/ESP-Hosted-NG_release_v1.0.2.tgz
needs to be flashed.

---
 DEVELOPERS                         |  1 +
 package/Config.in                  |  1 +
 package/esp-hosted/Config.in       |  8 ++++++++
 package/esp-hosted/esp-hosted.hash |  2 ++
 package/esp-hosted/esp-hosted.mk   | 17 +++++++++++++++++
 5 files changed, 29 insertions(+)
 create mode 100644 package/esp-hosted/Config.in
 create mode 100644 package/esp-hosted/esp-hosted.hash
 create mode 100644 package/esp-hosted/esp-hosted.mk
DEVELOPERS +1 -0
index b6d288c54f..2d2559242c 100644
@@ -1483,6 +1483,7 @@ F:	package/openfpgaloader/
 
 N:	Jens Kleintje <[email protected]>
 F:	package/gcnano-binaries/
+F:	package/esp-hosted/
 
 N:	Jens Rosenboom <[email protected]>
 F:	package/sl/
package/Config.in +1 -0
index 0f8dab3e71..89a6dacbc1 100644
@@ -494,6 +494,7 @@ endmenu
 	source "package/edid-decode/Config.in"
 	source "package/edk2-non-osi/Config.in"
 	source "package/edk2-platforms/Config.in"
+	source "package/esp-hosted/Config.in"
 	source "package/eudev/Config.in"
 	source "package/ev3dev-linux-drivers/Config.in"
 	source "package/evemu/Config.in"
package/esp-hosted/Config.in new file +8 -0
new file mode 100644
index 0000000000..b1f44aa956
@@ -0,0 +1,8 @@
+comment "esp-hosted needs a Linux kernel to be built"
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_ESP_HOSTED
+	bool "esp-hosted"
+	depends on BR2_LINUX_KERNEL
+	help
+	  Wireless driver for esp32
package/esp-hosted/esp-hosted.hash new file +2 -0
new file mode 100644
index 0000000000..6be9337159
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 5538d6aa0f322801ddd8428d131f485e7e490be871d9cdf650afb894bb485905 esp-hosted-ng-v1.0.2.tar.gz
package/esp-hosted/esp-hosted.mk new file +17 -0
new file mode 100644
index 0000000000..53e5d3bcc0
@@ -0,0 +1,17 @@
+################################################################################
+#
+# esp-hosted
+#
+################################################################################
+
+ESP_HOSTED_VERSION = ng-v1.0.2
+ESP_HOSTED_SITE = $(call github,espressif,esp-hosted,refs/tags/release/$(ESP_HOSTED_VERSION))
+ESP_HOSTED_DEPENDENCIES = linux
+ESP_HOSTED_MODULE_SUBDIRS = esp_hosted_ng/host
+
+ESP_HOSTED_MODULE_MAKE_OPTS = KERNEL=$(LINUX_DIR) \
+			      CROSS_COMPILE=$(TARGET_CROSS) \
+			      MODULE_NAME=esp32_sdio
+
+$(eval $(kernel-module))
+$(eval $(generic-package))

--
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw

Hi Jens,

Quoted 8 lines · Jens Kleintje

The package provides a kernel driver for esp32 as wifi module. The project https://github.com/espressif/esp-hosted/tree/release/ng-v1.0.2.
configures the esp32 as a wifi module. The host and the esp32 can be
connected via sd bus or spi. This package supports only the host sd connection.
On the esp the firmware from
https://github.com/espressif/esp-hosted/releases/download/release%2Fng-v1.0.2/ESP-Hosted-NG_release_v1.0.2.tgz
needs to be flashed.

me and Jesse in Cc were working on this too. Have you checked that it builds correctly with latest Linux versions? There are several PRs open upstream for months(they are not reactive):
https://github.com/espressif/esp-hosted/pull/147
https://github.com/espressif/esp-hosted/pull/176
https://github.com/espressif/esp-hosted/pull/209

and those fix building on Linux 5.17, 5.18, 6.0.

So I suspect you need to add those PRs as local patches and check for Linux 6.1 and 6.2

Best regards
--
Giulio Benetti
CTO/CEO@Benetti Engineering sas

Quoted 84 lines
---
  DEVELOPERS                         |  1 +
  package/Config.in                  |  1 +
  package/esp-hosted/Config.in       |  8 ++++++++
  package/esp-hosted/esp-hosted.hash |  2 ++
  package/esp-hosted/esp-hosted.mk   | 17 +++++++++++++++++
  5 files changed, 29 insertions(+)

create mode 100644 package/esp-hosted/Config.in create mode 100644 package/esp-hosted/esp-hosted.hash create mode 100644 package/esp-hosted/esp-hosted.mk

DEVELOPERS +1 -0
index b6d288c54f..2d2559242c 100644
@@ -1483,6 +1483,7 @@ F:	package/openfpgaloader/
 
  N:	Jens Kleintje <[email protected]>
  F:	package/gcnano-binaries/
+F:	package/esp-hosted/
 
  N:	Jens Rosenboom <[email protected]>
  F:	package/sl/
package/Config.in +1 -0
index 0f8dab3e71..89a6dacbc1 100644
@@ -494,6 +494,7 @@ endmenu
  	source "package/edid-decode/Config.in"
  	source "package/edk2-non-osi/Config.in"
  	source "package/edk2-platforms/Config.in"
+	source "package/esp-hosted/Config.in"
  	source "package/eudev/Config.in"
  	source "package/ev3dev-linux-drivers/Config.in"
  	source "package/evemu/Config.in"
package/esp-hosted/Config.in new file +8 -0
new file mode 100644
index 0000000000..b1f44aa956
@@ -0,0 +1,8 @@
+comment "esp-hosted needs a Linux kernel to be built"
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_ESP_HOSTED
+	bool "esp-hosted"
+	depends on BR2_LINUX_KERNEL
+	help
+	  Wireless driver for esp32
package/esp-hosted/esp-hosted.hash new file +2 -0
new file mode 100644
index 0000000000..6be9337159
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 5538d6aa0f322801ddd8428d131f485e7e490be871d9cdf650afb894bb485905 esp-hosted-ng-v1.0.2.tar.gz
package/esp-hosted/esp-hosted.mk new file +17 -1
new file mode 100644
index 0000000000..53e5d3bcc0
@@ -0,0 +1,17 @@
+################################################################################
+#
+# esp-hosted
+#
+################################################################################
+
+ESP_HOSTED_VERSION = ng-v1.0.2
+ESP_HOSTED_SITE = $(call github,espressif,esp-hosted,refs/tags/release/$(ESP_HOSTED_VERSION))
+ESP_HOSTED_DEPENDENCIES = linux
+ESP_HOSTED_MODULE_SUBDIRS = esp_hosted_ng/host
+
+ESP_HOSTED_MODULE_MAKE_OPTS = KERNEL=$(LINUX_DIR) \
+			      CROSS_COMPILE=$(TARGET_CROSS) \
+			      MODULE_NAME=esp32_sdio
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
--

2.25.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hi Jens,

here[0] is there is a patch that deals with all the points below and support both SDIO and SPI busses. All patches I and Jesse contributed have been upstream.

[0]: https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
Quoted 19 lines · Giulio Benetti

Hi Jens,

Quoted 8 lines · Jens Kleintje

The package provides a kernel driver for esp32 as wifi module. The project https://github.com/espressif/esp-hosted/tree/release/ng-v1.0.2.
  configures the esp32 as a wifi module. The host and the esp32 can be connected via sd bus or spi. This package supports only the host sd connection.
On the esp the firmware from
https://github.com/espressif/esp-hosted/releases/download/release%2Fng-v1.0.2/ESP-Hosted-NG_release_v1.0.2.tgz
needs to be flashed.

me and Jesse in Cc were working on this too. Have you checked that it builds correctly with latest Linux versions? There are several PRs open upstream for months(they are not reactive):
https://github.com/espressif/esp-hosted/pull/147
https://github.com/espressif/esp-hosted/pull/176
https://github.com/espressif/esp-hosted/pull/209

Quoted 105 lines

and those fix building on Linux 5.17, 5.18, 6.0.

So I suspect you need to add those PRs as local patches and check for Linux 6.1 and 6.2

Best regards

Signature · 2 lines
Giulio Benetti
CTO/CEO@Benetti Engineering sas
Quoted 90 lines

---
  DEVELOPERS                         |  1 + package/Config.in                  |  1 + package/esp-hosted/Config.in       |  8 ++++++++ package/esp-hosted/esp-hosted.hash |  2 ++ package/esp-hosted/esp-hosted.mk   | 17 +++++++++++++++++

  5 files changed, 29 insertions(+)

  create mode 100644 package/esp-hosted/Config.in create mode 100644 package/esp-hosted/esp-hosted.hash create mode 100644 package/esp-hosted/esp-hosted.mk

DEVELOPERS +0 -0
index b6d288c54f..2d2559242c 100644
@@ -1483,6 +1483,7 @@ F:    package/openfpgaloader/
 

  N:    Jens Kleintje <[email protected]>
  F:    package/gcnano-binaries/
+F:    package/esp-hosted/

  N:    Jens Rosenboom <[email protected]>
  F:    package/sl/

package/Config.in +0 -0
index 0f8dab3e71..89a6dacbc1 100644
@@ -494,6 +494,7 @@ endmenu

      source "package/edid-decode/Config.in" source "package/edk2-non-osi/Config.in" source "package/edk2-platforms/Config.in" +    source "package/esp-hosted/Config.in" source "package/eudev/Config.in"
      source "package/ev3dev-linux-drivers/Config.in" source "package/evemu/Config.in"

package/esp-hosted/Config.in new file +8 -0
new file mode 100644
index 0000000000..b1f44aa956
@@ -0,0 +1,8 @@
+comment "esp-hosted needs a Linux kernel to be built"
+    depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_ESP_HOSTED
+    bool "esp-hosted"
+    depends on BR2_LINUX_KERNEL
+    help
+      Wireless driver for esp32
package/esp-hosted/esp-hosted.hash new file +2 -0
new file mode 100644
index 0000000000..6be9337159
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 

5538d6aa0f322801ddd8428d131f485e7e490be871d9cdf650afb894bb485905 esp-hosted-ng-v1.0.2.tar.gz

package/esp-hosted/esp-hosted.mk new file +8 -0
new file mode 100644
index 0000000000..53e5d3bcc0
@@ -0,0 +1,17 @@
+################################################################################
+#
+# esp-hosted
+#
+################################################################################
+
+ESP_HOSTED_VERSION = ng-v1.0.2
+ESP_HOSTED_SITE = $(call 

github,espressif,esp-hosted,refs/tags/release/$(ESP_HOSTED_VERSION))

package/esp-hosted/esp-hosted.mk new file +9 -0
+ESP_HOSTED_DEPENDENCIES = linux
+ESP_HOSTED_MODULE_SUBDIRS = esp_hosted_ng/host
+
+ESP_HOSTED_MODULE_MAKE_OPTS = KERNEL=$(LINUX_DIR) \
+                  CROSS_COMPILE=$(TARGET_CROSS) \
+                  MODULE_NAME=esp32_sdio
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Jens Kleintje

Hello Jens,

Quoted 10 lines · On Mon, 20 Mar 2023 12:55:09 +0100 Jens Kleintje <[email protected]> wrote:

The package provides a kernel driver for esp32 as wifi module. The project https://github.com/espressif/esp-hosted/tree/release/ng-v1.0.2.
configures the esp32 as a wifi module. The host and the esp32 can be
connected via sd bus or spi. This package supports only the host sd connection.
On the esp the firmware from
https://github.com/espressif/esp-hosted/releases/download/release%2Fng-v1.0.2/ESP-Hosted-NG_release_v1.0.2.tgz
needs to be flashed.

Quoted 10 lines
---
 DEVELOPERS                         |  1 +
 package/Config.in                  |  1 +
 package/esp-hosted/Config.in       |  8 ++++++++
 package/esp-hosted/esp-hosted.hash |  2 ++
 package/esp-hosted/esp-hosted.mk   | 17 +++++++++++++++++
 5 files changed, 29 insertions(+)
 create mode 100644 package/esp-hosted/Config.in
 create mode 100644 package/esp-hosted/esp-hosted.hash
 create mode 100644 package/esp-hosted/esp-hosted.mk

Sorry for the super long delay in getting back to you, and thanks for your contribution. As Giulio replied, he had been working on a similar package, and posted on July 11, 2023 a new iteration that was more up-to-date and more complete, so I merged his proposal.

Do not hesitate to give it a test now that it is merged in our master branch, and report back if you encounter any issue.

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot