Skip to content

Conversation

@koffes
Copy link
Contributor

@koffes koffes commented Dec 4, 2025

Using the high CPU load monitoring feature, print a message using printk when the CPU load exceeds a defined threshold.

OCT-3414

@koffes koffes requested a review from a team as a code owner December 4, 2025 15:28
Copilot AI review requested due to automatic review settings December 4, 2025 15:28
@koffes koffes requested a review from a team as a code owner December 4, 2025 15:28
@NordicBuilder NordicBuilder added the doc-required PR must not be merged without tech writer approval. label Dec 4, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds high CPU load monitoring to the nRF5340 Audio application by integrating Zephyr's CPU load subsystem. When CPU usage exceeds 98%, a callback prints a warning message using printk instead of the logging subsystem to ensure the message is displayed even when high-priority threads monopolize CPU time.

  • Added CPU load monitoring with a 98% threshold and callback handler
  • Configured CPU load subsystem with periodic logging every 5 seconds
  • Updated release notes to document the new high CPU load monitoring feature

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
applications/nrf5340_audio/src/utils/peripherals.c Implements CPU load callback that prints warning when load exceeds 98%
applications/nrf5340_audio/prj.conf Enables CPU load subsystem and configures periodic logging
doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst Documents the new high CPU load callback feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Dec 4, 2025

CI Information

To view the history of this post, click the 'edited' button above
Build number: 4

Inputs:

Sources:

sdk-nrf: PR head: a974eed5bb16cc462d1000cb6eb265bc404d31bb

more details

sdk-nrf:

PR head: a974eed5bb16cc462d1000cb6eb265bc404d31bb
merge base: d0f84cb57d7e07a99e2cd487eeb8c0503dd579de
target head (main): a4367fdc0db21331df42b79fd16d5797b559f732
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (3)
applications
│  ├── nrf5340_audio
│  │  ├── prj.conf
│  │  ├── src
│  │  │  ├── utils
│  │  │  │  │ peripherals.c
doc
│  ├── nrf
│  │  ├── releases_and_maturity
│  │  │  ├── releases
│  │  │  │  │ release-notes-changelog.rst

Outputs:

Toolchain

Version: 43683a87ea
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:43683a87ea_5ea73affbf

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ❌ Build twister
    • sdk-nrf test count: 12
  • ❌ Integration tests
    • ❌ test-sdk-audio
Disabled integration tests
    • test-fw-nrfconnect-nrf_lrcs_mosh
    • test-fw-nrfconnect-nrf_lrcs_positioning
    • desktop52_verification
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps-main
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread-main
    • test-low-level
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

You can find the documentation preview for this PR here.

Preview links for modified nRF Connect SDK documents:

https://ncsdoc.z6.web.core.windows.net/PR-26101/nrf/releases_and_maturity/releases/release-notes-changelog.html

Comment on lines 184 to 187
* Added:
* High CPU load callback using the Zephyr CPU load subsystem.
The callback uses a printk, as the logging subsystem will be scheduled out if higher priority threads take all CPU time.
This will make it easier to debug high CPU load situations in the application.
Copy link
Contributor

@peknis peknis Dec 5, 2025

Choose a reason for hiding this comment

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

Suggested change
* Added:
* High CPU load callback using the Zephyr CPU load subsystem.
The callback uses a printk, as the logging subsystem will be scheduled out if higher priority threads take all CPU time.
This will make it easier to debug high CPU load situations in the application.
* Added high CPU load callback using the Zephyr CPU load subsystem.
The callback uses a :c:func:`printk` function, as the logging subsystem is scheduled out if higher priority threads take all CPU time.
This makes debugging high CPU load situations easier in the application.

@koffes koffes force-pushed the OCT-3414-activate-high-cpu-load-monitor branch from e71f64e to e7b8f51 Compare December 5, 2025 09:57
@koffes koffes requested review from alexsven and peknis December 5, 2025 09:58
@koffes koffes force-pushed the OCT-3414-activate-high-cpu-load-monitor branch from e7b8f51 to 08fa00d Compare December 5, 2025 10:01
Copilot AI review requested due to automatic review settings December 5, 2025 10:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@peknis peknis left a comment

Choose a reason for hiding this comment

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

Ok after fixing the issues pointed out by Copilot.

Using the high CPU load monitoring feature, print a message using printk
when the CPU load exceeds a defined threshold.

OCT-3414

Signed-off-by: Kristoffer Skøien <[email protected]>
@koffes koffes force-pushed the OCT-3414-activate-high-cpu-load-monitor branch from 08fa00d to a974eed Compare December 5, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-required PR must not be merged without tech writer approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants