diff mbox series

[v2,2/2] package/picotool: new package

Message ID 20240228202414.719244-2-buildroot@bubu1.eu
State Accepted
Headers show
Series [v2,1/2] package/pico-sdk: new package | expand

Commit Message

Marcus Hoffmann Feb. 28, 2024, 8:24 p.m. UTC
Add the raspberry pi picotool for interacting with rp2040 binaries and
devices.

Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
---
Changes v1 -> v2:
  - fix check-package

 package/Config.in              |  1 +
 package/picotool/Config.in     | 16 ++++++++++++++++
 package/picotool/picotool.hash |  3 +++
 package/picotool/picotool.mk   | 15 +++++++++++++++
 4 files changed, 35 insertions(+)
 create mode 100644 package/picotool/Config.in
 create mode 100644 package/picotool/picotool.hash
 create mode 100644 package/picotool/picotool.mk

Comments

Thomas Petazzoni July 12, 2024, 1:28 p.m. UTC | #1
Hello Marcus,

On Wed, 28 Feb 2024 21:24:13 +0100
Marcus Hoffmann via buildroot <buildroot@buildroot.org> wrote:

> +config BR2_PACKAGE_PICOTOOL
> +	bool "picotool"
> +	depends on BR2_INSTALL_LIBSTDCPP
> +	depends on BR2_HOST_GCC_AT_LEAST_4_9 # libusb
> +	select BR2_PACKAGE_LIBUSB
> +	select BR2_PACKAGE_PICO_SDK
> +	help
> +	  picotool is a tool for inspecting rp2040 binaries and
> +	  interacting with rp2040 devices when they are in bootsel
> +	  mode or devices USBstdio support from the Raspberry Pi Pico
> +	  SDK.
> +
> +	  https://github.com/raspberrypi/picotool

Could you give some details on the use case for having picotool on your
target? In which context is your RP2040 connected to your target
system generated by Buildroot?

Thomas
Marcus Hoffmann July 15, 2024, 6:31 p.m. UTC | #2
Hi Thomas,

On 12.07.24 15:28, Thomas Petazzoni via buildroot wrote:
> Hello Marcus,
> 
> On Wed, 28 Feb 2024 21:24:13 +0100
> Marcus Hoffmann via buildroot <buildroot@buildroot.org> wrote:
> 
>> +config BR2_PACKAGE_PICOTOOL
>> +	bool "picotool"
>> +	depends on BR2_INSTALL_LIBSTDCPP
>> +	depends on BR2_HOST_GCC_AT_LEAST_4_9 # libusb
>> +	select BR2_PACKAGE_LIBUSB
>> +	select BR2_PACKAGE_PICO_SDK
>> +	help
>> +	  picotool is a tool for inspecting rp2040 binaries and
>> +	  interacting with rp2040 devices when they are in bootsel
>> +	  mode or devices USBstdio support from the Raspberry Pi Pico

Just noticed this is missing a "with" between devices and USBstdio.

>> +	  SDK.
>> +
>> +	  https://github.com/raspberrypi/picotool
> 
> Could you give some details on the use case for having picotool on your
> target? In which context is your RP2040 connected to your target
> system generated by Buildroot?

We use it to to reboot a usb-connected rp2040 devices into bootloader 
mode from where you can apply a firmware update. (This requires using 
the pico sdk for the rp2040 firmware and setting a specific flag when 
setting up the usb support)

Does that help?

> 
> Thomas

Best,
Marcus
Thomas Petazzoni July 15, 2024, 7:45 p.m. UTC | #3
Hello Marcus,

On Wed, 28 Feb 2024 21:24:13 +0100
Marcus Hoffmann via buildroot <buildroot@buildroot.org> wrote:

>  package/Config.in              |  1 +
>  package/picotool/Config.in     | 16 ++++++++++++++++
>  package/picotool/picotool.hash |  3 +++
>  package/picotool/picotool.mk   | 15 +++++++++++++++
>  4 files changed, 35 insertions(+)
>  create mode 100644 package/picotool/Config.in
>  create mode 100644 package/picotool/picotool.hash
>  create mode 100644 package/picotool/picotool.mk

Entry in the DEVELOPERS file was missing, so I added one.

> diff --git a/package/picotool/picotool.mk b/package/picotool/picotool.mk
> new file mode 100644
> index 0000000000..c98284c491
> --- /dev/null
> +++ b/package/picotool/picotool.mk
> @@ -0,0 +1,15 @@
> +################################################################################
> +#
> +# picotool
> +#
> +################################################################################
> +
> +PICOTOOL_VERSION = 1.1.2
> +PICOTOOL_SITE = https://github.com/raspberrypi/picotool/archive/refs/tags

This should have used the $(call github,...) macro since they don't
provide specific tarballs other than the auto-generated ones.

> +PICOTOOL_SOURCE = $(PICOTOOL_VERSION).tar.gz

This can therefore go.

> +PICOTOOL_CONF_OPTS = -DPICO_SDK_PATH=$(STAGING_DIR)/usr/include/pico-sdk

And this had to be adjusted to usr/share/pico-sdk.

Applied with those minor fixes. Thanks!

Thomas
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index b01024ae04..2d4559036b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -583,6 +583,7 @@  endmenu
 	source "package/pciutils/Config.in"
 	source "package/pdbg/Config.in"
 	source "package/picocom/Config.in"
+	source "package/picotool/Config.in"
 	source "package/pifmrds/Config.in"
 	source "package/pigpio/Config.in"
 	source "package/powertop/Config.in"
diff --git a/package/picotool/Config.in b/package/picotool/Config.in
new file mode 100644
index 0000000000..0046f8ad61
--- /dev/null
+++ b/package/picotool/Config.in
@@ -0,0 +1,16 @@ 
+comment "picotool needs a toolchain w/ C++ and gcc >= 4.9"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_HOST_GCC_AT_LEAST_4_9
+
+config BR2_PACKAGE_PICOTOOL
+	bool "picotool"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_HOST_GCC_AT_LEAST_4_9 # libusb
+	select BR2_PACKAGE_LIBUSB
+	select BR2_PACKAGE_PICO_SDK
+	help
+	  picotool is a tool for inspecting rp2040 binaries and
+	  interacting with rp2040 devices when they are in bootsel
+	  mode or devices USBstdio support from the Raspberry Pi Pico
+	  SDK.
+
+	  https://github.com/raspberrypi/picotool
diff --git a/package/picotool/picotool.hash b/package/picotool/picotool.hash
new file mode 100644
index 0000000000..b573ada09e
--- /dev/null
+++ b/package/picotool/picotool.hash
@@ -0,0 +1,3 @@ 
+# Locally calculated
+sha256  f1746ead7815c13be1152f0645db8ea3b277628eb0110d42a0a186db37d40a91  1.1.2.tar.gz
+sha256  483f865953435b66c443dee7558debe3cc3cf8fcbb6a112fd9fc6a795d53f1f6  LICENSE.TXT
diff --git a/package/picotool/picotool.mk b/package/picotool/picotool.mk
new file mode 100644
index 0000000000..c98284c491
--- /dev/null
+++ b/package/picotool/picotool.mk
@@ -0,0 +1,15 @@ 
+################################################################################
+#
+# picotool
+#
+################################################################################
+
+PICOTOOL_VERSION = 1.1.2
+PICOTOOL_SITE = https://github.com/raspberrypi/picotool/archive/refs/tags
+PICOTOOL_SOURCE = $(PICOTOOL_VERSION).tar.gz
+PICOTOOL_CONF_OPTS = -DPICO_SDK_PATH=$(STAGING_DIR)/usr/include/pico-sdk
+PICOTOOL_DEPENDENCIES = libusb pico-sdk
+PICOTOOL_LICENSE = BSD-3-Clause
+PICOTOOL_LICENSE_FILES = LICENSE.TXT
+
+$(eval $(cmake-package))