-
Notifications
You must be signed in to change notification settings - Fork 21
sdh: simplifications and improvements #388
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
Open
lemrey
wants to merge
17
commits into
nrfconnect:main
Choose a base branch
from
lemrey:sdh
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2b9ee6a
doc: add an entry for sdh
lemrey 1e893a9
sdh: remove NRF_SDH_BLE
lemrey 28089a4
sdh: soc: split seeding SoftDevice random in a separate file
lemrey a767014
sdh: introduce observer priorities (high, lowest, etc.)
lemrey c200b77
sdh: ble: add GATTS and GATTC event strings to the table
lemrey 4229682
sdh: add a menu for clock configuration
lemrey 307d8e5
sdh: add a menu for BLE configuration
lemrey c8c251d
sdh: ble: export nrf_sdh_ble_evt_tostr() and nrf_sdh_soc_evt_tostr()
lemrey ab5e941
sdh: update the assert message in the polling loop
lemrey 822882b
sdh: merge request/state observers
lemrey 565a9cf
sdh: update the doxygen for _enable_request() and _disable_request()
lemrey 093c9f1
sdh: remove nrf_sdh_ble_app_ram_start_get()
lemrey 9431dee
sdh: remove nrf_sdh_request_continue()
lemrey a0bd9e2
sdh: remove nrf_sdh_is_enabled()
lemrey 39652c2
sdh: let nrf_sdh_is_suspended() only check for sdh state
lemrey e07d39b
sdh: rename variable
lemrey 381bff5
sdh: remove semicolons at the end of observer macros
lemrey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -27,6 +27,10 @@ No changes since the latest nRF Connect SDK Bare Metal release. | |||||
SoftDevice Handler | ||||||
================== | ||||||
|
||||||
* Added: | ||||||
|
||||||
* The :option:`NRF_SDH_SOC_RAND_SEED` Kconfig option to control whether to automatically respond to SoftDevice random seed requests. | ||||||
|
||||||
* Removed: | ||||||
|
||||||
* The ``NRF_SDH_BLE`` Kconfig option. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be like this:
Suggested change
|
||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
#include <nrf_soc.h> | ||
#include <nrf_sdh_soc.h> | ||
#include <psa/crypto.h> | ||
#include <cracen_psa.h> | ||
#include <zephyr/logging/log.h> | ||
|
||
LOG_MODULE_DECLARE(nrf_sdh, CONFIG_NRF_SDH_LOG_LEVEL); | ||
|
||
static void on_rand_seed_evt(uint32_t evt, void *ctx) | ||
{ | ||
uint32_t nrf_err; | ||
psa_status_t status; | ||
uint8_t seed[SD_RAND_SEED_SIZE]; | ||
|
||
if (evt != NRF_EVT_RAND_SEED_REQUEST) { | ||
/* Not our business */ | ||
return; | ||
} | ||
|
||
status = cracen_get_trng(seed, sizeof(seed)); | ||
if (status != PSA_SUCCESS) { | ||
LOG_ERR("Failed to generate true random number, psa_status %d", status); | ||
return; | ||
} | ||
|
||
nrf_err = sd_rand_seed_set(seed); | ||
|
||
/* Discard seed immediately */ | ||
memset(seed, 0, sizeof(seed)); | ||
|
||
if (nrf_err != NRF_SUCCESS) { | ||
LOG_ERR("Failed to seed SoftDevice RNG, nrf_error %#x", nrf_err); | ||
return; | ||
} | ||
|
||
LOG_DBG("SoftDevice RNG seeded"); | ||
} | ||
|
||
NRF_SDH_SOC_OBSERVER(rand_seed, on_rand_seed_evt, NULL, 0); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.