Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright 2026 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 🏗️ Build pioasm, picosdk, picotool

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
matrix:
os: [ubuntu-24.04, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: pipx install conan>=2.23.0
- run: conan config install https://github.com/libhal/conan-config2.git
- run: conan hal setup

# Build picosdk 2.2.0

- run: conan create pioasm --version=2.2.0 -pr:a hal/tc/llvm -b missing
- run: conan create pico-sdk --version=2.2.0

- if: ${{ startsWith(matrix.os, 'macos') }}
run: conan create picotool -b missing --version=2.2.0 -pr:a hal/tc/llvm -pr:a profiles/macos-build

- if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: sudo -E $(which conan) create picotool -b missing --version=2.2.0 -pr:a hal/tc/llvm -c tools.system.package_manager:mode=install

- if: ${{ startsWith(matrix.os, 'windows') }}
run: conan create picotool -b missing --version=2.2.0 -pr:a hal/tc/llvm

- name: 📡 Sign into JFrog Artifactory
env:
PASSWORD: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN }}
JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN_USER }}
run: conan remote login -p $PASSWORD libhal $JFROG_USER

# Upload Packages

- if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: conan upload "libusb/*" --confirm -r=libhal

- if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: conan upload "mbedlts/*" --confirm -r=libhal

- if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: conan upload "pioasm/*" --confirm -r=libhal

- if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: conan upload "pico-sdk/*" --confirm -r=libhal

- if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: conan upload "picotool/*" --confirm -r=libhal
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Pico Packages

These are conan packages for the Pico SDK for the Raspberry Pi Pico family of
microcontrollers.

## CI Deployed Packages

### Tool Packages

### OS Tools

For Mac and Linux

- libusb:
- 1.0.26

> [!WARNING]
> Windows development is currently not supported

### PicoSDK Packages

Versions:

- 2.1.1
- 2.2.0

Packages contained:

- pioasm
- picotool/pioasm/pico-sdk:

## Building the Packages

First build the tool packages needed for picosdk to build PIO assembly code

```bash
conan create pioasm --version=2.2.0 -pr:a hal/tc/llvm -b missing
conan create piosdk --version=2.2.0
conan create picotool --version=2.2.0 -pr:a hal/tc/llvm -b missing
```

For macOS add `-pr:a profiles/macos-build` in order to ensure that the LLVM
toolchain gets its sysroot set.
32 changes: 27 additions & 5 deletions board-headers/micromod/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
# MIT License
#
# Copyright (c) 2025 Shin Umeda
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from conan import ConanFile
from conan.tools.files import copy


class MicromodHeader(ConanFile):
name = "rp-board-header-rp2350-micromod"
package_type = "header-library"
Expand All @@ -16,16 +39,15 @@ class MicromodHeader(ConanFile):
default_options = {}

exports_sources = "*.h"


def package(self):
copy(self, "*", self.export_sources_folder, self.package_folder)

def package_info(self):
self.buildenv_info.append("PICO_BOARD_HEADER_DIRS", self.package_folder, separator=";")
self.buildenv_info.append("PICO_BOARD_HEADER_DIRS",
self.package_folder, separator=";")
self.cpp_info.includedirs = [] # no actual include directories
self.cpp_info.libdirs = [] # nothing is being built
self.cpp_info.libdirs = [] # nothing is being built

def package_id(self):
self.info.settings.clear()

32 changes: 24 additions & 8 deletions board-headers/micromod/libhal_rp2350_micromod.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
/*
/**
* MIT License
*
* Copyright (c) 2025 Shin Umeda
*
*
*
* */
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

#ifndef _rp2350_micromod_h
#define _rp2350_micromod_h
Expand Down Expand Up @@ -57,15 +74,14 @@ pico_board_cmake_set(PICO_PLATFORM, rp2350)
#define PICO_FLASH_SPI_CLKDIV 2
#endif

pico_board_cmake_set_default(PICO_FLASH_SIZE_BYTES, (16 * 1024 * 1024))
pico_board_cmake_set_default(PICO_FLASH_SIZE_BYTES, (16 * 1024 * 1024))
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif

pico_board_cmake_set_default(PICO_RP2350_A2_SUPPORTED, 1)
pico_board_cmake_set_default(PICO_RP2350_A2_SUPPORTED, 1)
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif


#endif
49 changes: 35 additions & 14 deletions pico-sdk/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,61 @@
# MIT License
#
# Copyright (c) 2025 Shin Umeda
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from conan import ConanFile
from conan.tools.files import get, patch, copy, chdir
from os.path import join
from pathlib import Path


class PicoSDK(ConanFile):
name = "picosdk"
package_type = "static-library"

# Optional metadata
license = "BSD-3"
author = "<Shin Umeda> <umeda.shin@gmail.com>"
url = "https://github.com/DolphinGui/pico-sdk-libhal"
url = "https://github.com/libhal/pico-packages"
description = "The Raspberry Pi Pico C/C++ SDK repackaged for conan"
topics = ("Embedded", "Raspberry Pi Pico", "ARM")

settings = "os", "compiler", "build_type", "arch"
options = {}
default_options = {}

exports_sources = "patches/*"

def source(self):
strip = not self.version.startswith('2.1')
get(self, **self.conan_data["sources"][self.version]["sdk"], strip_root = strip)
patch_file = join(self.export_sources_folder, f"patches/{self.version}-psdk.patch")
patch(self, patch_file=patch_file)
get(self, **self.conan_data["sources"]
[self.version]["sdk"], strip_root=strip)
EXPORT_SOURCE = Path(self.export_sources_folder)
PATCH_FILE = EXPORT_SOURCE / "patches" / f"{self.version}-psdk.patch"
patch(self, patch_file=str(PATCH_FILE))
with chdir(self, "lib"):
get(self, **self.conan_data["sources"][self.version]["tinyusb"], destination = "tinyusb", strip_root = strip)
get(self, **self.conan_data["sources"][self.version]
["tinyusb"], destination="tinyusb", strip_root=strip)

def package(self):
copy(self, "*", self.export_sources_folder, self.package_folder)

def package_info(self):
self.buildenv_info.define("PICO_SDK_PATH", self.package_folder)
self.cpp_info.includedirs = [] # no actual include directories
self.cpp_info.libdirs = [] # nothing is being built
self.cpp_info.libdirs = [] # nothing is being built

def package_id(self):
self.info.settings.clear()

58 changes: 34 additions & 24 deletions picotool/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
# MIT License
#
# Copyright (c) 2025 Shin Umeda
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from conan.tools.files import get, patch, chdir
from os.path import join
from pathlib import Path


class Picotool(ConanFile):
name = "picotool"
package_type = "application"

license = "BSD-3"
author = "<Shin Umeda> <umeda.shin@gmail.com>"
url = "https://github.com/DolphinGui/pico-sdk-libhal"
url = "https://github.com/libhal/pico-packages"
description = "The Raspberry Pi Picotool repackaged for conan"
topics = ("Embedded", "Raspberry Pi Pico", "ARM")

settings = "os", "compiler", "build_type", "arch"

exports_sources = "patches/*"

def config_options(self):
pass

def configure(self):
pass

def requirements(self):
# The version of mbedtls pico uses is so
# ancient it CMake removed support for it.
self.output.error(f"{ self.conan_data["dependencies"][self.version]}")
for dep, version in self.conan_data["dependencies"][self.version].items():
DEPENDENCIES_VERSION = self.conan_data["dependencies"][self.version]
self.output.error(f"{DEPENDENCIES_VERSION}")
for dep, version in DEPENDENCIES_VERSION.items():
self.requires(f"{dep}/{version}")
self.requires("libusb/1.0.26")

self.requires("libusb/1.0.29")
self.requires(f"picosdk/{self.version}")

def layout(self):
Expand All @@ -48,13 +61,13 @@ def source(self):
destination="picotool",
strip_root=strip,
)
patch_file = join(
self.export_sources_folder, f"patches/{self.version}-ptool.patch"
)
EXPORT_SOURCE = Path(self.export_sources_folder)
PATCH_NAME = f"{self.version}-ptool.patch"
PATCH_FILE = EXPORT_SOURCE / "patches" / PATCH_NAME
patch(
self,
patch_file=patch_file,
base_path=join(self.export_sources_folder, "picotool"),
patch_file=str(PATCH_FILE),
base_path=EXPORT_SOURCE / "picotool",
)

def generate(self):
Expand All @@ -71,6 +84,3 @@ def build(self):
def package(self):
cmake = CMake(self)
cmake.install()

def package_info(self):
pass
Loading
Loading