Skip to content
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

feat(zephyr): port to zephyr 4.1.0 #115

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: ./.github/workflows/zephyr_build.yml
with:
board: pearl_main
app_path: orb/public/main_board
app_path: orb/main_board
secrets:
gh_token: ${{ secrets.GIT_HUB_TOKEN }}

Expand All @@ -21,6 +21,6 @@ jobs:
uses: ./.github/workflows/zephyr_build.yml
with:
board: diamond_main
app_path: orb/public/main_board
app_path: orb/main_board
secrets:
gh_token: ${{ secrets.GIT_HUB_TOKEN }}
18 changes: 4 additions & 14 deletions .github/workflows/twister_native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,25 @@ jobs:
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
with:
path: "${{ github.job }}/orb/public"
path: "${{ github.job }}/orb"
- name: Initialize West repo
run: |
cd ${{ github.job }}
git config --global --add url."https://wc-cicd:${{ secrets.GIT_HUB_TOKEN }}@github.com/worldcoin/".insteadOf "[email protected]:worldcoin/"
cd orb && west init -l --mf public/west.yml . || echo "Ignoring west init error $?" # might be already initialized
cd orb && west init -l --mf west.yml . || echo "Ignoring west init error $?" # might be already initialized
west update --narrow --fetch-opt=--depth=1
- name: Twister native POSIX 64
run: |
cd ${{ github.job }}
if ! ./zephyr/scripts/twister -T orb/public/main_board -vv -c -p native_posix_64; then
find twister-out/ \( -name 'build.log' -o -name 'handler.log' -o -name 'device.log' \) -exec cat {} \;
false
fi
# keep a copy to be merged with next test
cp twister-out/twister_report.xml twister_report_local.xml
- name: Twister unit tests
run: |
cd ${{ github.job }}
if ! ./zephyr/scripts/twister -T orb/public/main_board -vv -c -p unit_testing; then
if ! ./zephyr/scripts/twister -T orb/main_board -A orb/main_board -vv -c -p unit_testing; then
find twister-out/ \( -name 'build.log' -o -name 'handler.log' -o -name 'device.log' \) -exec cat {} \;
false
fi
junitparser merge twister-out/twister_report.xml twister_report_local.xml junit.xml
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@ca89ad036b5fcd524c1017287fb01b5139908408 # pin@v2
if: always()
with:
junit_files: "${{ github.job }}/junit.xml"
junit_files: "${{ github.job }}/twister-out/twister_report.xml"
comment_mode: off
- name: Clean
if: always()
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/zephyr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,31 @@ jobs:
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
with:
path: "${{ github.job }}/orb/public"
path: "${{ github.job }}/orb"
- name: Initialize West repo
run: |
cd ${{ github.job }}
git config --global --add url."https://wc-cicd:${{ secrets.gh_token }}@github.com/worldcoin/".insteadOf "[email protected]:worldcoin/"
cd orb && west init -l --mf public/west.yml . || echo "Ignoring west init error $?" # might be already initialized
cd orb && west init -l --mf west.yml . || echo "Ignoring west init error $?" # might be already initialized
west update --narrow --fetch-opt=--depth=1
- name: Generate temporary signing keys locally
run: cd ${{ github.job }}/orb/public/utils/ota/ && ./generate_dev_keys
run: cd ${{ github.job }}/orb/utils/ota/ && ./generate_dev_keys
- name: Build app
run: cd ${{ github.job }} && west build ${APP_PATH} -d ${APP_PATH}/build -b ${BOARD} -p -- -DCMAKE_BUILD_TYPE="Release" -DEXTRA_COMPILE_FLAGS=-Werror -DBUILD_FROM_CI=1
run: |
cd ${{ github.job }}
PROJ_DIR=$(dirname $(west manifest --path))
west build ${APP_PATH} -d ${APP_PATH}/build -b ${BOARD} -p -- \
-DCMAKE_BUILD_TYPE="Release" \
-DEXTRA_COMPILE_FLAGS=-Werror \
-DBUILD_FROM_CI=1 \
-DCONFIG_MCUBOOT_SIGNATURE_KEY_FILE=\"${PROJ_DIR}/utils/ota/root-ec-p256.pem\" \
-DCONFIG_MCUBOOT_ENCRYPTION_KEY_FILE=\"${PROJ_DIR}/utils/ota/enc-ec256-pub.pem\"
- name: Build bootloader
run: cd ${{ github.job }} && west build orb/public/bootloader -d orb/public/bootloader/build -b ${BOARD} -p -- -DCMAKE_BUILD_TYPE="Release" -DBUILD_FROM_CI=1
run: |
cd ${{ github.job }}
PROJ_DIR=$(dirname $(west manifest --path))
west build orb/bootloader -d orb/bootloader/build -b ${BOARD} -p -- \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_FROM_CI=1 \
-DCONFIG_BOOT_SIGNATURE_KEY_FILE=\"${PROJ_DIR}/utils/ota/root-ec-p256.pem\" \
-DCONFIG_BOOT_ENCRYPTION_KEY_FILE=\"${PROJ_DIR}/utils/ota/enc-ec256-priv.pem\"
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ the [conda environment](utils/env/environment.yml).
Configure `pre-commit` using the config in the repo:

```shell
cd "$REPO_DIR"/orb/public
cd "$WEST_TOPDIR"/orb
pre-commit install -c utils/format/pre-commit-config.yaml --hook-type commit-msg
```

Expand All @@ -24,13 +24,13 @@ pre-commit install -c utils/format/pre-commit-config.yaml --hook-type commit-msg
Manually:

```shell
cd "$REPO_DIR"/orb/public && pre-commit run --all-files --config utils/format/pre-commit-config.yaml
cd "$WEST_TOPDIR"/orb && pre-commit run --all-files --config utils/format/pre-commit-config.yaml
```

Using Docker:

```shell
cd "$REPO_DIR"/orb/public/utils/docker
cd utils/docker
make format
```

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ enumerated in the [west.yml](west.yml) file.
2. Create an empty directory where the projects and dependencies will be located.

```shell
export REPO_DIR=$HOME/firmware # or any other directory
mkdir "$REPO_DIR"
export WEST_TOPDIR=$HOME/firmware # or any other directory
mkdir "$WEST_TOPDIR"
```

3. Clone the manifest repository using west.

```shell
cd "$REPO_DIR"
cd "$WEST_TOPDIR"
west init -m <repo-url.git> --mr main
```

Expand All @@ -65,7 +65,7 @@ enumerated in the [west.yml](west.yml) file.

5. If you prefer to use Docker, you can use the provided [Dockerfile](utils/docker/Dockerfile).
```shell
cd "$REPO_DIR"/orb/public/utils/docker
cd utils/docker
make build
make shell
```
Expand All @@ -81,11 +81,11 @@ the [Zephyr getting started guide](https://docs.zephyrproject.org/latest/getting
for [installing dependencies](https://docs.zephyrproject.org/latest/getting_started/index.html#install-dependencies).
- Then:
```shell
pip3 install -r "$REPO_DIR"/zephyr/scripts/requirements.txt
pip3 install -r "$WEST_TOPDIR"/zephyr/scripts/requirements.txt
```
- Or install the Conda environment provided [here](utils/env/environment.yml).
```shell
conda env create -f orb/public/utils/env/environment.yml
conda env create -f orb/utils/env/environment.yml
conda activate worldcoin
```

Expand Down Expand Up @@ -171,7 +171,7 @@ the [Zephyr getting started guide](https://docs.zephyrproject.org/latest/getting
10. Export CMake packages.

```shell
cd "$REPO_DIR"
cd "$WEST_TOPDIR"
west zephyr-export
```

Expand Down Expand Up @@ -207,7 +207,7 @@ Print out the bootloader and main MCU application logs using:

```shell
# replace /dev/ttyxxx with your UART device
python "$REPO_DIR"/orb/public/utils/debug/uart_dump.py -p /dev/ttyxxx -b 115200
python "$WEST_TOPDIR"/orb/utils/debug/uart_dump.py -p /dev/ttyxxx -b 115200
```

## Contributing
Expand Down
3 changes: 0 additions & 3 deletions boards/arm/diamond_main/Kconfig.board

This file was deleted.

22 changes: 0 additions & 22 deletions boards/arm/diamond_main/Kconfig.defconfig

This file was deleted.

3 changes: 0 additions & 3 deletions boards/arm/pearl_main/Kconfig.board

This file was deleted.

7 changes: 0 additions & 7 deletions boards/arm/pearl_main/Kconfig.defconfig

This file was deleted.

2 changes: 2 additions & 0 deletions boards/tfh/diamond_main/Kconfig.diamond_main
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config BOARD_DIAMOND_MAIN
select SOC_STM32G474XX
5 changes: 5 additions & 0 deletions boards/tfh/diamond_main/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
board:
name: diamond_main
vendor: tfh
socs:
- name: stm32g474xx
Loading
Loading