Skip to content
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
34 changes: 32 additions & 2 deletions .github/workflows/test-build-kontron-vx3060-s2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,40 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- name: Workaround for sources.list
run: |
set -euxo pipefail
apt-cache policy
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
shopt -s nullglob
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
/etc/apt/sources.list || true
for f in /etc/apt/sources.list.d/*.list; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
"$f"
done
for f in /etc/apt/sources.list.d/*.sources; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
"$f"
done
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
Comment on lines +25 to +42
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

This workflow rewrites Ubuntu apt sources from https://... to an http:// mirror. Even though apt verifies signed repositories, keeping HTTPS avoids unnecessary downgrade/MITM risk and aligns with the default secure transport. If the mirror supports it, prefer https://mirror.arizona.edu/... (or another HTTPS mirror) rather than HTTP.

Suggested change
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
/etc/apt/sources.list || true
for f in /etc/apt/sources.list.d/*.list; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
"$f"
done
for f in /etc/apt/sources.list.d/*.sources; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
"$f"
done
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|https://mirror.arizona.edu/ubuntu/|g" \
/etc/apt/sources.list || true
for f in /etc/apt/sources.list.d/*.list; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|https://mirror.arizona.edu/ubuntu/|g" \
"$f"
done
for f in /etc/apt/sources.list.d/*.sources; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|https://mirror.arizona.edu/ubuntu/|g" \
-e "s|https\?://azure\.archive\.ubuntu\.com|https://mirror.arizona.edu|g" \
"$f"
done
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|https://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt

Copilot uses AI. Check for mistakes.
fi
- name: install req
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y -q nasm gcc-multilib
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install --no-install-recommends -y -q -o Acquire::Retries=3 nasm gcc-multilib
- name: setup git
run: |
git config --global user.email "you@example.com"
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/test-renode-fastmath-smallstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ '*' ]

permissions:
contents: read
packages: read

jobs:
renode_automated_fastmath_smallstack:
runs-on: ubuntu-22.04
Expand All @@ -15,6 +19,13 @@ jobs:
with:
submodules: true

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Select config
run: |
cp config/examples/nrf52840.config .config && make include/target.h
Expand Down Expand Up @@ -55,4 +66,3 @@ jobs:
with:
name: Renode Test Results
path: test_results/

11 changes: 11 additions & 0 deletions .github/workflows/test-renode-fastmath.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ '*' ]

permissions:
contents: read
packages: read

jobs:
renode_automated_fastmath:
runs-on: ubuntu-22.04
Expand All @@ -16,6 +20,13 @@ jobs:
with:
submodules: true

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Select config
run: |
cp config/examples/nrf52840.config .config && make include/target.h
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/test-renode-noasm-smallstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ '*' ]

permissions:
contents: read
packages: read

jobs:
renode_automated_noasm_smallstack:
runs-on: ubuntu-22.04
Expand All @@ -16,6 +20,13 @@ jobs:
with:
submodules: true

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Select config
run: |
cp config/examples/nrf52840.config .config && make include/target.h
Expand Down Expand Up @@ -56,4 +67,3 @@ jobs:
with:
name: Renode Test Results
path: test_results/

12 changes: 11 additions & 1 deletion .github/workflows/test-renode-noasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ '*' ]

permissions:
contents: read
packages: read

jobs:
renode_automated_noasm:
runs-on: ubuntu-22.04
Expand All @@ -16,6 +20,13 @@ jobs:
with:
submodules: true

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Select config
run: |
cp config/examples/nrf52840.config .config && make include/target.h
Expand Down Expand Up @@ -65,4 +76,3 @@ jobs:
with:
name: Renode Test Results
path: test_results/

12 changes: 11 additions & 1 deletion .github/workflows/test-renode-nrf52.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ '*' ]

permissions:
contents: read
packages: read

jobs:
renode_automated_base:
runs-on: ubuntu-22.04
Expand All @@ -16,6 +20,13 @@ jobs:
with:
submodules: true

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Select config
run: |
cp config/examples/nrf52840.config .config && make include/target.h SIGN=NONE
Expand Down Expand Up @@ -84,4 +95,3 @@ jobs:
with:
name: Renode Test Results
path: test_results/

11 changes: 11 additions & 0 deletions .github/workflows/test-renode-sha3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ '*' ]

permissions:
contents: read
packages: read

jobs:
renode_automated_multi_sha:
runs-on: ubuntu-22.04
Expand All @@ -16,6 +20,13 @@ jobs:
with:
submodules: true

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Select config
run: |
cp config/examples/nrf52840.config .config && make include/target.h
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/test-renode-sha384.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ '*' ]

permissions:
contents: read
packages: read

jobs:
renode_automated_multi_sha:
runs-on: ubuntu-22.04
Expand All @@ -16,6 +20,13 @@ jobs:
with:
submodules: true

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Select config
run: |
cp config/examples/nrf52840.config .config && make include/target.h
Expand Down Expand Up @@ -68,4 +79,3 @@ jobs:
with:
name: Renode Test Results
path: test_results/

12 changes: 11 additions & 1 deletion .github/workflows/test-renode-smallstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ '*' ]

permissions:
contents: read
packages: read

jobs:
renode_automated_smallstack:
runs-on: ubuntu-22.04
Expand All @@ -16,6 +20,13 @@ jobs:
with:
submodules: true

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Select config
run: |
cp config/examples/nrf52840.config .config && make include/target.h
Expand Down Expand Up @@ -71,4 +82,3 @@ jobs:
with:
name: Renode Test Results
path: test_results/

34 changes: 32 additions & 2 deletions .github/workflows/test-x86-fsp-qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,40 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- name: Workaround for sources.list
run: |
set -euxo pipefail

apt-cache policy
grep -RInE '^(deb|Types|URIs)' /etc/apt || true

shopt -s nullglob

sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
/etc/apt/sources.list || true

for f in /etc/apt/sources.list.d/*.list; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
"$f"
done

for f in /etc/apt/sources.list.d/*.sources; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
"$f"
done

if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
Comment on lines +25 to +42
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

This workflow rewrites Ubuntu apt sources from https://... to an http:// mirror. Even though apt verifies signed repositories, keeping HTTPS avoids unnecessary downgrade/MITM risk and aligns with the default secure transport. If the mirror supports it, prefer https://mirror.arizona.edu/... (or another HTTPS mirror) rather than HTTP.

Suggested change
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
/etc/apt/sources.list || true
for f in /etc/apt/sources.list.d/*.list; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
"$f"
done
for f in /etc/apt/sources.list.d/*.sources; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
"$f"
done
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|https://mirror.arizona.edu/ubuntu/|g" \
/etc/apt/sources.list || true
for f in /etc/apt/sources.list.d/*.list; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|https://mirror.arizona.edu/ubuntu/|g" \
"$f"
done
for f in /etc/apt/sources.list.d/*.sources; do
sudo sed -i \
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|https://mirror.arizona.edu/ubuntu/|g" \
-e "s|https\?://azure\.archive\.ubuntu\.com|https://mirror.arizona.edu|g" \
"$f"
done
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|https://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt

Copilot uses AI. Check for mistakes.
fi
- name: install req
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y -q nasm gcc-multilib qemu-system-x86 swtpm uuid-dev
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install --no-install-recommends -y -q -o Acquire::Retries=3 nasm gcc-multilib qemu-system-x86 swtpm uuid-dev
- name: setup git
run: |
git config --global user.email "you@example.com"
Expand Down
8 changes: 5 additions & 3 deletions hal/nrf52.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@
void uart_init(void)
{
UART0_BAUDRATE = BAUD_115200;
UART0_ENABLE = 1;
UART0_ENABLE = 4;
}
Comment on lines 31 to 33
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

UART0_ENABLE is being set to 4 while this implementation is using EasyDMA-style UARTE registers (TXD_PTR/TXD_MAXCOUNT). In this repo the UARTE enable value is 8 (e.g., test-app/emu-test-apps/nrf5340/uart.c:60), and enabling the wrong peripheral mode can prevent TX from ever starting in Renode/hardware. Consider defining a named constant for UARTE enable and using the correct value here.

Copilot uses AI. Check for mistakes.

static volatile uint8_t uart_tx_buf;

static void uart_write_char(char c)
{
uart_tx_buf = c;
UART0_EVENT_ENDTX = 0;

UART0_TXD_PTR = (uint32_t)(&c);
UART0_TXD_PTR = (uint32_t)&uart_tx_buf;
UART0_TXD_MAXCOUNT = 1;
UART0_TASK_STARTTX = 1;
while(UART0_EVENT_ENDTX == 0)
Expand Down
9 changes: 3 additions & 6 deletions tools/renode/docker-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,22 @@ declare -r HOST_TEST_RESULTS_PATH=${HOST_ROOT_DIR}/test_results
declare -r HOST_LOG_PATH=${HOST_TEST_RESULTS_PATH}
declare -r HOST_LOG_FILENAME=${HOST_LOG_PATH}/logs.txt

declare -r DOCKER_TAG=renode_nrf52
declare -r DOCKER_IMAGE="${DOCKER_IMAGE:-ghcr.io/wolfssl/wolfboot-ci-renode:latest}"
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The default Renode image is :latest, which makes CI non-reproducible and can introduce breakages when the image updates. Consider pinning to a version tag or (preferably) an immutable digest, and bump it intentionally when needed.

Suggested change
declare -r DOCKER_IMAGE="${DOCKER_IMAGE:-ghcr.io/wolfssl/wolfboot-ci-renode:latest}"
declare -r DOCKER_IMAGE="${DOCKER_IMAGE:-ghcr.io/wolfssl/wolfboot-ci-renode:1.15.3}"

Copilot uses AI. Check for mistakes.
declare -r DOCKER_WORKSPACE=/workspace
declare -r DOCKER_TEST_RESULTS_PATH=/tmp/test_results

mkdir -p ${HOST_LOG_PATH}

docker build -t ${DOCKER_TAG} -f ${HOST_ROOT_DIR}/tools/renode/Dockerfile .

# running in `if` to avoid setting +e
docker pull ${DOCKER_IMAGE} >/dev/null 2>&1 || true

exit_code=0
if ! docker run \
--log-driver=none -a stdout -a stderr \
--volume ${HOST_ROOT_DIR}:${DOCKER_WORKSPACE} \
--volume ${HOST_TEST_RESULTS_PATH}:${DOCKER_TEST_RESULTS_PATH} \
--env SCRIPT=${DOCKER_WORKSPACE}/renode-config.resc \
--env RENODE_CHECKOUT=/home/developer/renode \
--workdir ${DOCKER_WORKSPACE} \
${DOCKER_TAG} \
${DOCKER_IMAGE} \
/bin/bash -c "tools/scripts/renode-test-update.sh $@ 2>&1 > ${DOCKER_TEST_RESULTS_PATH}/logs.txt"
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The docker run command redirects output as 2>&1 > ..., which sends stderr to the original stdout and only stdout to the file. If the intention is to capture both streams in logs.txt (as implied by later cat ${HOST_LOG_FILENAME}), swap the redirection order (or use &>), so stderr is also written to the log file.

Suggested change
/bin/bash -c "tools/scripts/renode-test-update.sh $@ 2>&1 > ${DOCKER_TEST_RESULTS_PATH}/logs.txt"
/bin/bash -c "tools/scripts/renode-test-update.sh $@ > ${DOCKER_TEST_RESULTS_PATH}/logs.txt 2>&1"

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

/bin/bash -c "tools/scripts/renode-test-update.sh $@ ..." interpolates the host script’s arguments directly into a shell command string without escaping. This allows accidental breakage (spaces/quotes) and also enables command injection if an argument contains shell metacharacters. Prefer passing arguments to docker run as real argv (avoid bash -c), or ensure each argument is safely shell-escaped before building the command string.

Suggested change
/bin/bash -c "tools/scripts/renode-test-update.sh $@ 2>&1 > ${DOCKER_TEST_RESULTS_PATH}/logs.txt"
/bin/bash -c 'tools/scripts/renode-test-update.sh "$@" > '"${DOCKER_TEST_RESULTS_PATH}"'/logs.txt 2>&1' -- "$@"

Copilot uses AI. Check for mistakes.
then
echo "FAILED"
Expand Down
Loading
Loading