Skip to content

Commit 59c845a

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 59c845a

17 files changed

Lines changed: 237 additions & 138 deletions

File tree

.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: 46 additions & 32 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
@@ -47,55 +47,69 @@ jobs:
4747
4848
- name: Install dependencies
4949
run: |
50-
pip install -r nrf/scripts/requirements-build.txt
51-
apt-get update
52-
apt install -y curl ruby-full
50+
# The Matter IDL is part of requirements-build.txt, but it's not available
51+
# in pypi so we need to install it from the source code
52+
MATTER_IDL_PATH=modules/lib/matter/scripts/py_matter_idl
53+
if [ -d $MATTER_IDL_PATH ]; then
54+
pip install -e $MATTER_IDL_PATH
55+
fi
56+
pip install -r nrf/scripts/requirements-fixed.txt
57+
apt-get update
58+
apt install -y curl ruby-full
5359
54-
- name: Install sonar-scanner and build-wrapper
55-
uses: SonarSource/sonarcloud-github-c-cpp@v3
60+
- name: Install Build Wrapper
61+
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v6.0.0
5662

5763
- name: Build and test
5864
working-directory: thingy91x-oob
5965
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
66+
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} \
67+
west twister -T tests/ \
68+
--enable-coverage \
69+
--coverage-platform=native_sim \
70+
-v \
71+
--inline-logs \
72+
--integration
6173
6274
- name: Extract coverage into sonarqube xml format
6375
working-directory: thingy91x-oob
6476
run: |
6577
gcovr twister-out -v --merge-mode-functions=separate --exclude='twister-out|drivers' --sonarqube coverage.xml
6678
67-
- name: Run sonar-scanner on main
68-
working-directory: thingy91x-oob
79+
- name: SonarQube Scan on main
6980
if: github.event_name != 'pull_request'
81+
uses: SonarSource/sonarqube-scan-action@v6.0.0
7082
env:
7183
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7284
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 \
85+
with:
86+
args: |
87+
--define sonar.cfamily.build-wrapper-output=thingy91x-oob/${{ env.BUILD_WRAPPER_OUT_DIR }}
88+
--define sonar.projectKey=hello-nrfcloud_firmware
89+
--define sonar.organization=hello-nrfcloud-com-firmware
90+
--define sonar.host.url=https://sonarcloud.io
91+
--define sonar.coverageReportPaths=coverage.xml
92+
--define sonar.inclusions=**/*.c,**/*.h
7993
--define sonar.exclusions=tests/,drivers/sensor/*_dummy/
94+
projectBaseDir: thingy91x-oob
8095

81-
- name: Run sonar-scanner on PR
82-
working-directory: thingy91x-oob
96+
- name: SonarQube Scan on PR
8397
if: github.event_name == 'pull_request'
98+
uses: SonarSource/sonarqube-scan-action@v6.0.0
8499
env:
85100
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86101
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 }}
102+
with:
103+
args: |
104+
--define sonar.cfamily.build-wrapper-output=thingy91x-oob/${{ env.BUILD_WRAPPER_OUT_DIR }}
105+
--define sonar.projectKey=hello-nrfcloud_firmware
106+
--define sonar.organization=hello-nrfcloud-com-firmware
107+
--define sonar.host.url=https://sonarcloud.io
108+
--define sonar.coverageReportPaths=coverage.xml
109+
--define sonar.inclusions=**/*.c,**/*.h
110+
--define sonar.exclusions=tests/,drivers/sensor/*_dummy/
111+
--define sonar.scm.revision=${{ github.event.pull_request.head.sha }}
112+
--define sonar.pullrequest.key=${{ github.event.pull_request.number }}
113+
--define sonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
114+
--define sonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
115+
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: 30 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

@@ -156,9 +156,11 @@ static void state_init_run(void *o)
156156
STATE_SET(STATE_SAMPLING);
157157
}
158158
}
159+
160+
return SMF_EVENT_HANDLED;
159161
}
160162

161-
static void state_sampling_run(void *o)
163+
static enum smf_state_result state_sampling_run(void *o)
162164
{
163165
struct s_object *state_object = o;
164166

@@ -170,6 +172,8 @@ static void state_sampling_run(void *o)
170172
sample(&state_object->fuel_gauge_ref_time);
171173
}
172174
}
175+
176+
return SMF_EVENT_HANDLED;
173177
}
174178

175179
/* End of state handling */
@@ -200,6 +204,10 @@ static int charger_read_sensors(float *voltage, float *current, float *temp, int
200204
return 0;
201205
}
202206

207+
#if defined(CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX)
208+
#include "memfault/metrics/platform/battery.h"
209+
#endif /* CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX */
210+
203211
static void sample(int64_t *ref_time)
204212
{
205213
int err;
@@ -213,6 +221,9 @@ static void sample(int64_t *ref_time)
213221
struct bat_object bat_object = { 0 };
214222
struct payload payload = { 0 };
215223
int64_t system_time;
224+
#if defined(CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX)
225+
sMfltPlatformBatterySoc soc;
226+
#endif /* CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX */
216227

217228
err = date_time_now(&system_time);
218229
if (err) {
@@ -227,14 +238,28 @@ static void sample(int64_t *ref_time)
227238
return;
228239
}
229240

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

232257
charging = (chg_status & (NPM1300_CHG_STATUS_TC_MASK |
233258
NPM1300_CHG_STATUS_CC_MASK |
234259
NPM1300_CHG_STATUS_CV_MASK)) != 0;
235260

236261
state_of_charge = nrf_fuel_gauge_process(voltage, current, temp, delta, NULL);
237-
262+
#endif /* CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX */
238263
LOG_DBG("State of charge: %f", (double)roundf(state_of_charge));
239264
LOG_DBG("The battery is %s", charging ? "charging" : "not charging");
240265

app/src/modules/environmental/environmental.c

Lines changed: 8 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

@@ -96,9 +96,11 @@ static void state_init_run(void *o)
9696
STATE_SET(STATE_SAMPLING);
9797
}
9898
}
99+
100+
return SMF_EVENT_HANDLED;
99101
}
100102

101-
static void state_sampling_run(void *o)
103+
static enum smf_state_result state_sampling_run(void *o)
102104
{
103105
struct s_object *state_object = o;
104106

@@ -110,6 +112,8 @@ static void state_sampling_run(void *o)
110112
sample();
111113
}
112114
}
115+
116+
return SMF_EVENT_HANDLED;
113117
}
114118

115119
/* End of state handling */

0 commit comments

Comments
 (0)