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

samples: benchmarks: coremark: migrate to STM logging on nrf54h20dk #17479

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kapi-no
Copy link
Contributor

@kapi-no kapi-no commented Sep 25, 2024

The CoreMark sample now uses logging in the STM standalone mode for the nRF54H20 DK target.

Ref: NCSDK-27517

TODO items:

  • STM log formatting to follow the style used with the CONFIG_LOG_MODE_MINIMAL option
  • Consider adding log flush operations for the ETR target that is responsible for forwarding the logs to the UART instance (CPUAPP)
  • Investigate issues with CONFIG_COMPILER_OPT="-O3" that cause reboots.
  • Expand the documentation

@github-actions github-actions bot added doc-required PR must not be merged without tech writer approval. changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. labels Sep 25, 2024
@kapi-no kapi-no added the DNM label Sep 25, 2024
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 25, 2024

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 14

Inputs:

Sources:

sdk-nrf: PR head: 51c6389c9596c2985f99af2f1c9a40140e1bd636

more details

sdk-nrf:

PR head: 51c6389c9596c2985f99af2f1c9a40140e1bd636
merge base: 7504e21df95756c5fabe8968a50ecca6729f8d69
target head (main): d0cdd9babd7a5904dc931f917e6af3920f083aab
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 (19)
doc
│  ├── nrf
│  │  ├── releases_and_maturity
│  │  │  ├── releases
│  │  │  │  │ release-notes-changelog.rst
samples
│  ├── benchmarks
│  │  ├── coremark
│  │  │  ├── Kconfig.sysbuild
│  │  │  ├── README.rst
│  │  │  ├── boards
│  │  │  │  ├── nrf52833dk_nrf52833.conf
│  │  │  │  ├── nrf52840dk_nrf52840.conf
│  │  │  │  ├── nrf52dk_nrf52832.conf
│  │  │  │  ├── nrf5340dk_nrf5340_cpuapp.conf
│  │  │  │  ├── nrf5340dk_nrf5340_cpunet.conf
│  │  │  │  ├── nrf54h20dk_nrf54h20_cpuapp.conf
│  │  │  │  ├── nrf54h20dk_nrf54h20_cpuapp.overlay
│  │  │  │  ├── nrf54h20dk_nrf54h20_cpuppr.conf
│  │  │  │  ├── nrf54h20dk_nrf54h20_cpuppr.overlay
│  │  │  │  ├── nrf54h20dk_nrf54h20_cpurad.conf
│  │  │  │  ├── nrf54h20dk_nrf54h20_cpurad.overlay
│  │  │  │  │ nrf54l15dk_nrf54l15_cpuapp.conf
│  │  │  ├── prj.conf
│  │  │  ├── prj_multiple_threads.conf
│  │  │  ├── sample.yaml
│  │  │  ├── src
│  │  │  │  │ main.c

Outputs:

Toolchain

Version: f51bdba1d9
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:f51bdba1d9_912848a074

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

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 49
  • ✅ Integration tests
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_mosh
    • test-fw-nrfconnect-nrf-iot_nrf_provisioning
    • test-fw-nrfconnect-nrf-iot_positioning
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread
    • test-fw-nrfconnect-zigbee
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-sidewalk
    • test-sdk-wifi

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

@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publishing GitHub Action.

@kapi-no
Copy link
Contributor Author

kapi-no commented Sep 25, 2024

Third item on TODO list is potentially fixed by the following PR:

nrfconnect/sdk-zephyr#2049

@kapi-no
Copy link
Contributor Author

kapi-no commented Sep 25, 2024

Standard rebase

@kapi-no
Copy link
Contributor Author

kapi-no commented Sep 25, 2024

small fix for UART_CONSOLE

@kapi-no
Copy link
Contributor Author

kapi-no commented Oct 8, 2024

Rebasing to fix conflicts after upmerge

@kapi-no
Copy link
Contributor Author

kapi-no commented Nov 5, 2024

Rebased on top of the newest main branch

@kapi-no kapi-no marked this pull request as ready for review November 5, 2024 12:39
@kapi-no kapi-no requested review from a team as code owners November 5, 2024 12:39
@kapi-no
Copy link
Contributor Author

kapi-no commented Nov 5, 2024

Added changes to address the missing items

@kapi-no
Copy link
Contributor Author

kapi-no commented Nov 5, 2024

Rebased on top of the newest main branch

@kapi-no
Copy link
Contributor Author

kapi-no commented Nov 5, 2024

Added changelog entries.

@github-actions github-actions bot removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Nov 5, 2024
return;
}

LOG_INF("Logging is stalled until the logging core finishes the CoreMark benchmark\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

until the application core finishes - shouldn't be more specific here - it might be not obvious to user that application core is doing logging.

Copy link
Contributor Author

@kapi-no kapi-no Nov 5, 2024

Choose a reason for hiding this comment

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

Hmm, I wanted to generalize it as we may change the logging core. Perhaps until this core finishes? The user gets the domain prefix next to this log

Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't then it say that for every core and "Logging is stalled" only when appcore is busy?

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if even we need this as a log. Comment won't be enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the log here is helpful and is not very intrusive (one log per app core benchmark start). When the app core starts executing the benchmark it looks as if the system stalled. Apart from that, users may omit the note from Readme and get confused when logs do not appear when they are running benchmarks on remaining cores.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Logging is blocked for all cores until this core finishes the CoreMark benchmark

samples/benchmarks/coremark/README.rst Outdated Show resolved Hide resolved
samples/benchmarks/coremark/sample.yaml Show resolved Hide resolved
@@ -130,7 +130,7 @@ int main(void)
k_panic();
}

LOG_INF("Press %s to start the test ...", BUTTON_LABEL);
LOG_INF("Press %s to start the test ...\n", BUTTON_LABEL);
Copy link
Contributor

Choose a reason for hiding this comment

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

this doesn't really improve readability, it looks really weird in the output

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This sample already uses break lines in other places, I wanted to add them here for consistency so that we have a line break before every wait period (e.g. k_sem_take).

samples/benchmarks/coremark/Kconfig.sysbuild Show resolved Hide resolved
Comment on lines +166 to +209
if (IS_ENABLED(CONFIG_APP_MODE_FLASH_AND_RUN)) {
LOG_INF("CoreMark finished! Press the reset button to restart...\n");
} else {
LOG_INF("CoreMark finished! Press %s to restart ...\n", BUTTON_LABEL);
Copy link
Contributor

Choose a reason for hiding this comment

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

likewise here, jarring

@kapi-no
Copy link
Contributor Author

kapi-no commented Nov 13, 2024

Rebase, no file diff has changed

Added a log to indicate the end of benchmark execution in the CoreMark
sample when the target image is built with the following Kconfig option
enabled: CONFIG_APP_MODE_FLASH_AND_RUN.

Ref: NCSDK-27517

Signed-off-by: Kamil Piszczek <[email protected]>
Added a new line before the button press wait period to increase the
visibility in the CoreMark sample.

Ref: NCSDK-27517

Signed-off-by: Kamil Piszczek <[email protected]>
@kapi-no
Copy link
Contributor Author

kapi-no commented Nov 13, 2024

Addressed reviewe comments

@kapi-no
Copy link
Contributor Author

kapi-no commented Nov 14, 2024

small update of the static function name

@kapi-no kapi-no requested review from MarekPieta and removed request for MarekPieta November 14, 2024 14:19
@kapi-no kapi-no removed the DNM label Nov 14, 2024
@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publish GitHub Action.

@kapi-no kapi-no added the DNM label Nov 14, 2024
Optimized the stack size in the multiple thread configuration of the
CoreMark sample.

Signed-off-by: Kamil Piszczek <[email protected]>
The CoreMark sample now uses logging in the STM standalone mode for the
nRF54H20 DK target.

Ref: NCSDK-27517

Signed-off-by: Kamil Piszczek <[email protected]>
Applied the same logging format in the standard logging mode as is
currently used in the multi-domain logging mode in the CoreMark sample.

Ref: NCSDK-27517

Signed-off-by: Kamil Piszczek <[email protected]>
@kapi-no
Copy link
Contributor Author

kapi-no commented Nov 14, 2024

Optimized the stack size in multiple thread configuration to fit the application image into TC RAM block.

@kapi-no
Copy link
Contributor Author

kapi-no commented Nov 14, 2024

Tested all configuration variants and they seemed to work fine after migration to STM-based logging

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.

7 participants