Skip to content

Conversation

@RyanDraves
Copy link

Replace the toolchain setup with a hermetic toolchain from https://github.com/hexdae/bazel-arm-none-eabi. This addresses issue #10

NOTE: The output files differ; I paid minimal attention to what changed and simply tested by flashing the hello_usb.c program with each toolchain onto my Pico.

-r-xr-xr-x 1 dravesr dravesr 178688 Jan 13 17:34 hello-apt-toolchain.uf2
-r-xr-xr-x 1 dravesr dravesr 168960 Jan 13 17:51 hello-hermetic.uf2


def rules_pico_toolchains():
native.register_toolchains("//toolchain:gcc-pico")
native.register_toolchains("//toolchain:gcc-pico_linux_x86_64")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bazel query "@rules_pico//toolchain:*"

@rules_pico//toolchain:BUILD
@rules_pico//toolchain:cc_toolchain_darwin_x86_64_gcc-pico
@rules_pico//toolchain:cc_toolchain_linux_aarch64_gcc-pico
@rules_pico//toolchain:cc_toolchain_linux_x86_64_gcc-pico
@rules_pico//toolchain:cc_toolchain_windows_x86_64_gcc-pico
@rules_pico//toolchain:config_darwin_x86_64_gcc-pico
@rules_pico//toolchain:config_linux_aarch64_gcc-pico
@rules_pico//toolchain:config_linux_x86_64_gcc-pico
@rules_pico//toolchain:config_windows_x86_64_gcc-pico
@rules_pico//toolchain:empty
@rules_pico//toolchain:gcc-pico_darwin_x86_64
@rules_pico//toolchain:gcc-pico_linux_aarch64
@rules_pico//toolchain:gcc-pico_linux_x86_64
@rules_pico//toolchain:gcc-pico_windows_x86_64

Lots of generated targets. I just picked the one I wanted; I imagine something fancier is needed here.

"@platforms//cpu:armv6-m",
"@koro-platforms//cxx:14",
],
target_platform = True,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using latest Bazel 7.0.0 and this option wasn't recognized; seemed safe to remove?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its been a while since I worked on this and it looks like things have changed in the meantime. I'm currently using bazel 5.4.1. I'll try to figure out if this is needed.

@dfr
Copy link
Owner

dfr commented Jan 16, 2024

I love the idea but I don't see FreeBSD in the list of platforms. Since FreeBSD is the only platform I use for pico development, thats a blocker. If we could get FreeBSD added to https://github.com/hexdae/bazel-arm-none-eabi, then I would be happy to merge this.

@RyanDraves
Copy link
Author

Do you know where FreeBSD distributions of the toolchain can be found? Setting it up doesn't look too bad, but I'm not sure where do find the package.

@dfr
Copy link
Owner

dfr commented Feb 6, 2024

I use the gcc-arm-embedded package and I typically install it on the host manually:

# pkg install gcc-arm-embedded

@RyanDraves
Copy link
Author

I found https://www.freshports.org/devel/gcc-arm-embedded/ but am struggling to find a way to download it. Is there something I'm missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants