Skip to content

bootstrap.sh: limit Zephyr HALs by default #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025

Conversation

pillo79
Copy link

@pillo79 pillo79 commented May 21, 2025

This reworks the current west.yml and bootstrap.sh so that only the HALs used by the Arduino core are installed by default.

Since those not named in the allowlist are discarded during the Zephyr import, it is impossible to allow the option to install every HAL that way. Instead, allow all HALs by path, then filter them by group using the manifest.project-filter config that is automatically set by bootstrap.sh. This allows to enable all HALs, if needed, by simply removing the filter.

@pillo79 pillo79 force-pushed the pr-reduce-hals branch 4 times, most recently from 2b8337c to a3b2c39 Compare May 21, 2025 10:21
This reworks the current west.yml and bootstrap.sh so that only the HALs
used by the Arduino core are installed by default.  The list is directly
taken from boards.txt, where each board has a 'zephyr_hal' entry.

Since the HALs not named in the allowlist are discarded at Zephyr import
time, an explicit list makes it impossible to later install every HAL.
Instead, allow all HALs by path, then filter them by group using the
'manifest.project-filter' config that is automatically set by
bootstrap.sh. This allows to enable all HALs, if needed, by simply
removing the filter.
@pillo79 pillo79 merged commit f2300ea into arduino:arduino May 21, 2025
15 checks passed
@pillo79
Copy link
Author

pillo79 commented May 21, 2025

@KurtE @mjs513 this includes a change at boostrap.sh time, so your current workspaces do not have this filter enabled and have "many" hals (a lot more than were required). You have 2 options:

  • do a clean reinstall and enjoy the minimal set of HALs (less disk space, faster west update)

or, to convert an existing workspace:

  • remove everything from the modules/hal top-level folder in the workspace;
  • run from ArduinoCore-zephyr:
    . venv/bin/update
    west config manifest.project-filter -- "-hal_.*,+hal_nordic,+hal_nxp,+hal_stm32,+hal_renesas"
    west update
    west blobs fetch hal_nxp
    

@KurtE
Copy link

KurtE commented May 21, 2025

@pillo79 - On my windows machine (in WSL), I think I did your 2nd option and then did a ./extra/build_all.sh

And it failed on:

-- Found assembler: /home/kurte/Downloads/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Looking for device RW612 in /home/kurte/git/modules/hal/nxp/mcux/mcux-sdk-ng/devices/
-- Found device folder: /home/kurte/git/modules/hal/nxp/mcux/mcux-sdk-ng/devices/Wireless/RW/RW612
CMake Error at /home/kurte/git/modules/hal/nxp/zephyr/src/rw61x/CMakeLists.txt:39 (message):
  Couldn't find signed firmware !
  /home/kurte/git/modules/hal/nxp/zephyr/blobs/rw61x/rw61x_sb_wifi_a2.bin


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/home/kurte/git/ArduinoCore-zephyr/venv/bin/python3 -B/home/kurte/git/ArduinoCore-zephyr/build/frdm_rw612_rw612 -GNinja -DBOARD=frdm_rw612 -S/home/kurte/git/ArduinoCore-zephyr/loader

frdm_rw612_rw612 result: 1

@pillo79
Copy link
Author

pillo79 commented May 21, 2025

🤦‍♂️ my bad, sorry, forgot one bit on the above instructions - west blobs fetch hal_nxp. I've amended them now.
The change was really to avoid all these manual steps in the future 🙂

@mjs513
Copy link

mjs513 commented May 21, 2025

@pillo79

Just did a clean install (should include @facchinm latest changes). Interesting install process now with the modules fpr example:

=== updating tinycrypt (modules/crypto/tinycrypt):
--- tinycrypt: initializing
Initialized empty Git repository in /home/my_new_zephyr_folder/modules/crypto/tinycrypt/.git/
--- tinycrypt: fetching, need revision 1012a3ebee18c15ede5efc8332ee2fc37817670f
remote: Enumerating objects: 51, done.
remote: Counting objects: 100% (51/51), done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 51 (delta 15), reused 49 (delta 14), pack-reused 0 (from 0)
Unpacking objects: 100% (51/51), 67.28 KiB | 3.96 MiB/s, done.
From https://github.com/zephyrproject-rtos/tinycrypt
 * [new branch]      master     -> refs/west/master
HEAD is now at 1012a3e Fix warnings reported by UBSAN
HEAD is now at 1012a3e Fix warnings reported by UBSAN
Zephyr (/home/my_new_zephyr_folder/zephyr/share/zephyr-package/cmake)
has been added to the user package registry in:
~/.cmake/packages/Zephyr

ZephyrUnittest (/home/my_new_zephyr_folder/zephyr/share/zephyrunittest-package/cmake)
has been added to the user package registry in:
~/.cmake/packages/ZephyrUnittest

I am running WSL on a Win 11 machine and I tend to run into issues when building - like board failing to compile on first try but then builds on second - so probably an issue with WSL.

Anyways - build_all failed for the giga but when I built again using just build,sh giga built no issue.

doing a build_all again giga built but failed on building OPTA. This is really more of an FYI

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.

3 participants