Skip to content
Open

CI #8

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
26 changes: 9 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: 🏗️ Build pioasm, picosdk, picotool
name: 🏗️ Build all packages

on:
workflow_dispatch:
Expand All @@ -31,7 +31,7 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-24.04, macos-latest]
os: [ubuntu-24.04, macos-latest, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -41,17 +41,17 @@ jobs:

# 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
- run: conan create pioasm --version=2.2.0 -pr:a hal/tc/llvm -b missing

- 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
run: conan create picotool -b missing --version=2.2.0 -pr:a hal/tc/llvm -c tools.build:sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

- 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
run: conan create picotool -b missing --version=2.2.0 -c tools.cmake.cmaketoolchain:generator="NMake Makefiles"

- name: 📡 Sign into JFrog Artifactory
env:
Expand All @@ -61,19 +61,11 @@ jobs:

# TODO(#5): Check that demo builds correctly

# Upload Packages: disabled for now as we fix

# - 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 "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 "pico-sdk/*" --confirm -r=libhal

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


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

Expand All @@ -23,21 +24,46 @@ Versions:

- 2.1.1
- 2.2.0
- 2.2.1-alpha

Packages contained:

- pioasm
- picotool/pioasm/pico-sdk:

## Building the Packages
## Building

`pico-sdk` is a pure source package and does not require any profile to build.
Use `conan create pico-sdk --version <version>` and it should just work. The current
version that is supported is `2.2.1-alpha` since it has hard-floating point ABI support.
`2.2.0` is also supported for soft-fp ABI, and is required to build picotool and pioasm.

```sh
conan create pico-sdk --version 2.2.1-alpha
```

`picotool` is a host software used to generate uf2 files and upload firmware. Use either
the default conan profile, or whatever conan profile you use to build host software. `picotool`
is currently tested to work on `2.2.0`, which depends on `pico-sdk/2.2.0`.

```sh
conan create picotool --version 2.2.0
```

`pioasm` is a host software used to assemble pio programs. It is not necessary unless you are
developing programs using the pio peripheral. `pioasm` is currently known to build on `2.2.0`, which
depends on `pico-sdk/2.2.0`.

```sh
conan create pioasm --version 2.2.0
```

First build the tool packages needed for picosdk to build PIO assembly code
`test_package` is a small program demonstrating the usage of `pico-sdk` and `picotool`. It is intended
as a guide on configuring dependents on how to use `pico-sdk`.

```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
```sh
conan build test_package -pr:h hal/tc/arm-gcc-14.2 -pr:h feather-rp2350 -of build
```

For macOS add `-pr:a profiles/macos-build` in order to ensure that the LLVM
toolchain gets its sysroot set.
Using `pico-sdk/2.2.1-alpha` with `picotool/2.2.0` is perfectly acceptable and the expected way to build
projects until `pico-sdk/2.2.1` becomes formally released.
53 changes: 0 additions & 53 deletions board-headers/micromod/conanfile.py

This file was deleted.

87 changes: 0 additions & 87 deletions board-headers/micromod/libhal_rp2350_micromod.h

This file was deleted.

1 change: 1 addition & 0 deletions picotool/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.preprocessor_definitions["NOMINMAX"] = "1"
tc.generate()

def build(self):
Expand Down
5 changes: 5 additions & 0 deletions profiles/feather-rp2350
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include(rp2350a)

[options]
*:board=adafruit_feather_rp2350

2 changes: 0 additions & 2 deletions profiles/macos-build

This file was deleted.

7 changes: 7 additions & 0 deletions profiles/micromod-rp2350
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include(rp2350b)

[options]
*:flash_size=(8 * 1024 * 1024)
*:flash_clkdiv=2
*:rp_revision=a2
*:use_w25q_flash=True
15 changes: 12 additions & 3 deletions profiles/rp2350
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
[settings]
build_type=MinSizeRel
build_type=Release
os=baremetal
arch=cortex-m33
build_type=RelWithDebInfo
arch=cortex-m33f

[options]
*:platform=rp2350-arm-s
prebuilt-picolibc/*:oslib=semihost
prebuilt-picolibc/*:crt0=none

[buildenv]
CC=arm-none-eabi-gcc
CXX=arm-none-eabi-g++
LD=arm-none-eabi-ld

[conf]
tools.cmake.cmaketoolchain:generator=Ninja
5 changes: 5 additions & 0 deletions profiles/rp2350a
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include(rp2350)

[options]
*:variant=rp2350a

5 changes: 5 additions & 0 deletions profiles/rp2350b
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include(rp2350)

[options]
*:variant=rp2350b

2 changes: 2 additions & 0 deletions test_package/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
.cache
29 changes: 29 additions & 0 deletions test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.15)
set(CMAKE_EXECUTABLE_SUFFIX_ASM .elf)
set(CMAKE_EXECUTABLE_SUFFIX_C .elf)
set(CMAKE_EXECUTABLE_SUFFIX_CXX .elf)
set(PICO_CXX_ENABLE_EXCEPTIONS On)

set(CMAKE_VERBOSE_MAKEFILE ON)

include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)

project(raspberry_pico_test C CXX ASM)

pico_sdk_init()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_executable(main main.cpp)

target_compile_options(main PRIVATE -Wall -Werror)
target_link_libraries(main pico_stdlib hardware_gpio pico_stdio)
# This is necessary to get LTO to work, but for some reason it doesn't build when
# it's off. TODO investigate further
target_compile_definitions(main PUBLIC PICO_STDIO_SHORT_CIRCUIT_CLIB_FUNCS=0)

include(CheckIPOSupported)
check_ipo_supported()
set_property(TARGET main PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)

pico_add_extra_outputs(main)
pico_enable_stdio_usb(main 1)
pico_enable_stdio_uart(main 0)
9 changes: 9 additions & 0 deletions test_package/CMakeUserPresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": 4,
"vendor": {
"conan": {}
},
"include": [
"build/CMakePresets.json"
]
}
6 changes: 6 additions & 0 deletions test_package/activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file should be sourced

if [ -e build/conanbuild.sh ]
then
source build/conanbuild.sh
fi
Loading
Loading