Skip to content

Commit f2fa530

Browse files
committed
manifest: Update to ncs-3.2.0
Update to ncs-3.2.0. Signed-off-by: Jorgen Kvalvaag <jorgen.kvalvaag@nordicsemi.no>
1 parent 9d86c56 commit f2fa530

File tree

19 files changed

+260
-143
lines changed

19 files changed

+260
-143
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,16 @@ jobs:
316316
if: ${{ inputs.build_bl_update }}
317317
working-directory: thingy91x-oob
318318
run: |
319-
west twister -T . --test app/app.build.bootloader_update -v -p thingy91x/nrf9151/ns --inline-logs
320-
cp twister-out/thingy91x_nrf9151_ns/zephyr/app/app.build.bootloader_update/dfu_mcuboot.zip \
321-
hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf91-bootloader.zip
319+
west twister -T app --test app.build.bootloader_update -v -p thingy91x/nrf9151/ns --inline-logs
320+
MCUBOOT_ZIP=$(find twister-out -name dfu_mcuboot.zip)
321+
cp $MCUBOOT_ZIP hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf91-bootloader.zip
322322
rm -rf twister-out
323323
west build -b thingy91x/nrf5340/cpuapp -p --sysbuild \
324324
-d ../nrf/applications/connectivity_bridge/build-bl-update \
325325
../nrf/applications/connectivity_bridge -- \
326326
-Dmcuboot_CONFIG_FW_INFO_FIRMWARE_VERSION=4
327-
cp ../nrf/applications/connectivity_bridge/build-bl-update/dfu_mcuboot.zip \
328-
connectivity-bridge-${{ env.VERSION }}-thingy91x-nrf53-bootloader.zip
327+
MCUBOOT_ZIP=$(find ../nrf/applications/connectivity_bridge/build-bl-update -name dfu_mcuboot.zip)
328+
cp $MCUBOOT_ZIP connectivity-bridge-${{ env.VERSION }}-thingy91x-nrf53-bootloader.zip
329329
330330
- name: Upload artifact
331331
if: ${{ inputs.build_bl_update }}

.github/workflows/compliance.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ jobs:
1010
compliance_job:
1111
runs-on: ubuntu-24.04
1212
name: Run compliance checks on patch series (PR)
13-
container: ghcr.io/zephyrproject-rtos/ci:v0.27.4
13+
container: ghcr.io/nrfconnect/sdk-nrf-toolchain:v3.2.0
14+
defaults:
15+
run:
16+
shell: bash
1417

1518
# Skip job if it was triggered by Renovate Bot
1619
if: ${{ !contains(github.actor, 'renovate') }}
@@ -26,6 +29,8 @@ jobs:
2629
- name: Initialize
2730
working-directory: thingy91x-oob
2831
run: |
32+
apt update
33+
apt install -y libmagic-dev
2934
west init -l .
3035
west config manifest.group-filter +bsec
3136
west config build.sysbuild True
@@ -40,6 +45,11 @@ jobs:
4045
BASE_REF: ${{ github.base_ref }}
4146
working-directory: thingy91x-oob
4247
run: |
48+
# WARNING: Ugly workaround
49+
# git in toolchain doesn't work with check_compliance.py - missing USE_LIBPCRE
50+
51+
GIT_EXE=$(which git)
52+
cp /usr/bin/git $GIT_EXE
4353
export ZEPHYR_BASE="../zephyr"
4454
$ZEPHYR_BASE/scripts/ci/check_compliance.py -m Codeowners -m Devicetree -m Gitlint -m Identity -m Nits -m pylint -m checkpatch -m KconfigBasic -c origin/${BASE_REF}..
4555

.github/workflows/sonarcloud.yml

Lines changed: 52 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
jobs:
1818
build:
1919
name: Build and analyze
20-
runs-on: ubuntu-latest
20+
runs-on: self-hosted
2121
container: ghcr.io/zephyrproject-rtos/ci:v0.27.4
2222
env:
2323
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
@@ -39,63 +39,79 @@ jobs:
3939
- name: Initialize
4040
working-directory: thingy91x-oob
4141
run: |
42+
if [ ! -d "../.west" ]; then
4243
west init -l .
43-
west config manifest.group-filter +bsec
44-
west config build.sysbuild True
45-
west update -o=--depth=1 -n
46-
west blobs fetch hal_nordic
44+
else
45+
echo ".west folder already exists, skipping west init."
46+
fi
47+
west update -o=--depth=1 -n
48+
west blobs fetch hal_nordic
4749
4850
- name: Install dependencies
4951
run: |
50-
pip install -r nrf/scripts/requirements-build.txt
51-
apt-get update
52-
apt install -y curl ruby-full
52+
# The Matter IDL is part of requirements-build.txt, but it's not available
53+
# in pypi so we need to install it from the source code
54+
MATTER_IDL_PATH=modules/lib/matter/scripts/py_matter_idl
55+
if [ -d $MATTER_IDL_PATH ]; then
56+
pip install -e $MATTER_IDL_PATH
57+
fi
58+
pip install -r nrf/scripts/requirements-fixed.txt
59+
apt-get update
60+
apt install -y curl ruby-full
5361
54-
- name: Install sonar-scanner and build-wrapper
55-
uses: SonarSource/sonarcloud-github-c-cpp@v3
62+
- name: Install Build Wrapper
63+
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v6.0.0
5664

5765
- name: Build and test
5866
working-directory: thingy91x-oob
5967
run: |
60-
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} west twister -T . -C --coverage-platform=native_sim -v --inline-logs --integration
68+
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} \
69+
west twister -T tests/ \
70+
--enable-coverage \
71+
--coverage-platform=native_sim \
72+
-v \
73+
--inline-logs \
74+
--integration
6175
6276
- name: Extract coverage into sonarqube xml format
6377
working-directory: thingy91x-oob
6478
run: |
6579
gcovr twister-out -v --merge-mode-functions=separate --exclude='twister-out|drivers' --sonarqube coverage.xml
6680
67-
- name: Run sonar-scanner on main
68-
working-directory: thingy91x-oob
81+
- name: SonarQube Scan on main
6982
if: github.event_name != 'pull_request'
83+
uses: SonarSource/sonarqube-scan-action@v6.0.0
7084
env:
7185
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7286
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
73-
run: |
74-
sonar-scanner \
75-
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
76-
--define project.settings=sonar-project.properties \
77-
--define sonar.coverageReportPaths=coverage.xml \
78-
--define sonar.inclusions=**/*.c,**/*.h \
87+
with:
88+
args: |
89+
--define sonar.cfamily.build-wrapper-output=thingy91x-oob/${{ env.BUILD_WRAPPER_OUT_DIR }}
90+
--define sonar.projectKey=hello-nrfcloud_firmware
91+
--define sonar.organization=hello-nrfcloud-com-firmware
92+
--define sonar.host.url=https://sonarcloud.io
93+
--define sonar.coverageReportPaths=coverage.xml
94+
--define sonar.inclusions=**/*.c,**/*.h
7995
--define sonar.exclusions=tests/,drivers/sensor/*_dummy/
96+
projectBaseDir: thingy91x-oob
8097

81-
- name: Run sonar-scanner on PR
82-
working-directory: thingy91x-oob
98+
- name: SonarQube Scan on PR
8399
if: github.event_name == 'pull_request'
100+
uses: SonarSource/sonarqube-scan-action@v6.0.0
84101
env:
85102
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86103
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
87-
PR_NUMBER: ${{ github.event.pull_request.number }}
88-
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
89-
BASE_REF: ${{ github.event.pull_request.base.ref }}
90-
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
91-
run: |
92-
sonar-scanner \
93-
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
94-
--define project.settings=sonar-project.properties \
95-
--define sonar.coverageReportPaths=coverage.xml \
96-
--define sonar.inclusions=**/*.c,**/*.h \
97-
--define sonar.exclusions=tests/,drivers/sensor/*_dummy/ \
98-
--define sonar.scm.revision=${{ env.HEAD_SHA }} \
99-
--define sonar.pullrequest.key=${{ env.PR_NUMBER }} \
100-
--define sonar.pullrequest.branch=${{ env.PR_BRANCH }} \
101-
--define sonar.pullrequest.base=${{ env.BASE_REF }}
104+
with:
105+
args: |
106+
--define sonar.cfamily.build-wrapper-output=thingy91x-oob/${{ env.BUILD_WRAPPER_OUT_DIR }}
107+
--define sonar.projectKey=hello-nrfcloud_firmware
108+
--define sonar.organization=hello-nrfcloud-com-firmware
109+
--define sonar.host.url=https://sonarcloud.io
110+
--define sonar.coverageReportPaths=coverage.xml
111+
--define sonar.inclusions=**/*.c,**/*.h
112+
--define sonar.exclusions=tests/,drivers/sensor/*_dummy/
113+
--define sonar.scm.revision=${{ github.event.pull_request.head.sha }}
114+
--define sonar.pullrequest.key=${{ github.event.pull_request.number }}
115+
--define sonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
116+
--define sonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
117+
projectBaseDir: thingy91x-oob

app/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ add_subdirectory_ifdef(CONFIG_APP_SHELL src/modules/shell)
3030

3131
# Include Memfault configuration folder
3232
zephyr_include_directories(config)
33+
zephyr_include_directories(src/common)
3334

3435
if (CONFIG_NRF_CLOUD_COAP_SEC_TAG GREATER_EQUAL 2147483648 AND CONFIG_NRF_CLOUD_COAP_SEC_TAG LESS_EQUAL 2147483667)
3536
message(WARNING "CONFIG_NRF_CLOUD_COAP_SEC_TAG is set to a developer security tag. "

app/overlay-memfault.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CONFIG_MEMFAULT_NCS_LOCATION_METRICS=y
1414
CONFIG_MEMFAULT_HTTP_DEDICATED_WORKQUEUE_STACK_SIZE=1560
1515
CONFIG_MEMFAULT_COREDUMP_FULL_THREAD_STACKS=y
1616
CONFIG_MEMFAULT_EVENT_STORAGE_SIZE=2048
17+
CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX=y
1718

1819
# Memfault depends on POSIX, disable unneeded POSIX features
1920
CONFIG_POSIX_FILE_SYSTEM=n
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#ifndef __MEMFAULT_NRF_PLATFORM_BATTERY_MODEL_H__
8+
#define __MEMFAULT_NRF_PLATFORM_BATTERY_MODEL_H__
9+
10+
#include "lp803448_model.h"
11+
12+
#endif /* __MEMFAULT_NRF_PLATFORM_BATTERY_MODEL_H__ */

app/src/modules/battery/Kconfig.battery

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ menu "Sampler"
88

99
config APP_BATTERY_THREAD_STACK_SIZE
1010
int "Thread stack size"
11+
default 2048 if MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX
1112
default 1536
1213

1314
config APP_BATTERY_WATCHDOG_TIMEOUT_SECONDS

app/src/modules/battery/battery.c

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ struct s_object {
8686

8787
/* Forward declarations of state handlers */
8888
static void state_init_entry(void *o);
89-
static void state_init_run(void *o);
90-
static void state_sampling_run(void *o);
89+
static enum smf_state_result state_init_run(void *o);
90+
static enum smf_state_result state_sampling_run(void *o);
9191

9292
static struct s_object s_obj;
9393
static const struct smf_state states[] = {
@@ -143,7 +143,7 @@ static void state_init_entry(void *o)
143143
}
144144
}
145145

146-
static void state_init_run(void *o)
146+
static enum smf_state_result state_init_run(void *o)
147147
{
148148
struct s_object *state_object = o;
149149

@@ -154,11 +154,14 @@ static void state_init_run(void *o)
154154
LOG_DBG("Time available, sampling can start");
155155

156156
STATE_SET(STATE_SAMPLING);
157+
return SMF_EVENT_HANDLED;
157158
}
158159
}
160+
161+
return SMF_EVENT_PROPAGATE;
159162
}
160163

161-
static void state_sampling_run(void *o)
164+
static enum smf_state_result state_sampling_run(void *o)
162165
{
163166
struct s_object *state_object = o;
164167

@@ -170,6 +173,8 @@ static void state_sampling_run(void *o)
170173
sample(&state_object->fuel_gauge_ref_time);
171174
}
172175
}
176+
177+
return SMF_EVENT_PROPAGATE;
173178
}
174179

175180
/* End of state handling */
@@ -200,6 +205,10 @@ static int charger_read_sensors(float *voltage, float *current, float *temp, int
200205
return 0;
201206
}
202207

208+
#if defined(CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX)
209+
#include "memfault/metrics/platform/battery.h"
210+
#endif /* CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX */
211+
203212
static void sample(int64_t *ref_time)
204213
{
205214
int err;
@@ -213,6 +222,9 @@ static void sample(int64_t *ref_time)
213222
struct bat_object bat_object = { 0 };
214223
struct payload payload = { 0 };
215224
int64_t system_time;
225+
#if defined(CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX)
226+
sMfltPlatformBatterySoc soc;
227+
#endif /* CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX */
216228

217229
err = date_time_now(&system_time);
218230
if (err) {
@@ -227,14 +239,28 @@ static void sample(int64_t *ref_time)
227239
return;
228240
}
229241

242+
#if defined(CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX)
243+
err = memfault_platform_get_stateofcharge(&soc);
244+
if (err) {
245+
LOG_ERR("memfault_platform_get_stateofcharge, error: %d", err);
246+
SEND_FATAL_ERROR();
247+
return;
248+
}
249+
250+
state_of_charge = (float)soc.soc / (float)CONFIG_MEMFAULT_METRICS_BATTERY_SOC_PCT_SCALE_VALUE;
251+
charging = soc.discharging;
252+
253+
(void)delta;
254+
#else /* CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX */
255+
230256
delta = (float)k_uptime_delta(ref_time) / 1000.f;
231257

232258
charging = (chg_status & (NPM1300_CHG_STATUS_TC_MASK |
233259
NPM1300_CHG_STATUS_CC_MASK |
234260
NPM1300_CHG_STATUS_CV_MASK)) != 0;
235261

236262
state_of_charge = nrf_fuel_gauge_process(voltage, current, temp, delta, NULL);
237-
263+
#endif /* CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX */
238264
LOG_DBG("State of charge: %f", (double)roundf(state_of_charge));
239265
LOG_DBG("The battery is %s", charging ? "charging" : "not charging");
240266

app/src/modules/environmental/environmental.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ struct s_object {
6666
};
6767

6868
/* Forward declarations of state handlers */
69-
static void state_init_run(void *o);
70-
static void state_sampling_run(void *o);
69+
static enum smf_state_result state_init_run(void *o);
70+
static enum smf_state_result state_sampling_run(void *o);
7171

7272
static struct s_object s_obj;
7373
static const struct smf_state states[] = {
@@ -83,7 +83,7 @@ static const struct smf_state states[] = {
8383

8484
/* State handlers */
8585

86-
static void state_init_run(void *o)
86+
static enum smf_state_result state_init_run(void *o)
8787
{
8888
struct s_object *state_object = o;
8989

@@ -94,11 +94,14 @@ static void state_init_run(void *o)
9494
LOG_DBG("Time available, sampling can start");
9595

9696
STATE_SET(STATE_SAMPLING);
97+
return SMF_EVENT_HANDLED;
9798
}
9899
}
100+
101+
return SMF_EVENT_PROPAGATE;
99102
}
100103

101-
static void state_sampling_run(void *o)
104+
static enum smf_state_result state_sampling_run(void *o)
102105
{
103106
struct s_object *state_object = o;
104107

@@ -110,6 +113,8 @@ static void state_sampling_run(void *o)
110113
sample();
111114
}
112115
}
116+
117+
return SMF_EVENT_PROPAGATE;
113118
}
114119

115120
/* End of state handling */

0 commit comments

Comments
 (0)