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

DNM: Ble stack and init #20205

Closed
wants to merge 133 commits into from
Closed

DNM: Ble stack and init #20205

wants to merge 133 commits into from

Conversation

frkv
Copy link
Contributor

@frkv frkv commented Feb 5, 2025

Just for test

Just for testing. Changes will be taken in #19720 if this works

test_low_level: PR-1765
test_rs: PR-1483
test_fem: PR-1483
test_ble_mesh: ble_mesh_upmerge_test
test_crypto: PR-750
test_suit_dfu: PR-450
test_tfm: PR-194
test_secdom_samples_public: NCSDK-NONE_upmerge_jan2025
test_audio: PR-294
test_wifi: sdk-nrf-pr-19720
test_nrf: sdk-nrf-pr-19720
test_proprietary: PR-93

juhaylinen and others added 20 commits February 10, 2025 21:42
Use zsock_addrinfo to avoid dependency on the POSIX subsystem.

Remove CONFIG_POSIX_API from provisioning tests.

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
... because this causes conflicting types compilation errors in library
files it uses.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Test scenarios `shell.device_filter` and
`init.check_init_priorities` should be fixed in
Zephyr first.

Signed-off-by: Katarzyna Giądła <katarzyna.giadla@nordicsemi.no>
This option was replaced with IEEE802154_L2_PKT_INCL_FCS in upstream
Zephyr. See Zephyr PR 83449.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
MBEDTLS PSA requires more stack sizes. Increasing the stack sizes
for both nrf54840 and nrf54l15.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
-This added SYS_INIT will ensure that psa_crypto_init is called
 in kernel *after* Hw_CC3XX is executed to ensure that mutexes are
 ready to be used.

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
-Changing default y for nrf_security to use
 DT_HAS_ZEPHYR_PSA_CRYPTO_RNG_ENABLED instead of depending
 on ENTROPY_PSA_CRYPTO_RNG. Doing this avoids a dependency
 loop on ENTROPY_GENERATOR

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
-This commit is only used to enact testing. The dependency for
 PR nrfconnect#2464 to the previous commit is inherent, but we would like
 to have a commit that is pickable in the upmerge

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
This is required by PSA in NCS, so make sure it is selected
NRF_SECURITY_ENABLER.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
-Enabling ENTROPY_GENERATOR for BT_HOST_CRYPTO_PRNG and BT_ECC
 as a workaround of having ENTROPY_GENERATOR in sample/tests

Also the heap size required for bsim is larger than on
actual target, reason unknown.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
The NRF_RNG_ENTROPY_DRIVER provides entropy though the PSA APIs.

This is used to seed/reseed the Oberon PSA random drivers
(CTR_DRBG/HMAC_DRBG). Before this was only used to allow enabling
this PSA driver with the devices which use the DT label 'rng'.

We extend that now to allow this driver to be used with the fake
entropy node which uses the DT label 'prng'.

This is needed to unblock development until real RNG is enabled
for all the needed applications/samples.

In practice this means that when 'prng' is enabled a device can
generate random numbers with the psa_generate_random call.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
-Adding CONFIG_MBEDTLS_FORCE_LEGACY_MD for cc3xx/oberon legacy
 psa_tls to avoid that MBEDTLS_MD_SOME_PSA is getting set

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
-Fixes issues with nRF54H20 and nRF5340dk in upmerge. This can be
 seen as a workaround
-Adjusting board-files for central_uart and peripheral_uart
 for nRF5340 and nRFH20 cpuapp

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
-HKDF reports errors when MBEDTLS_MD_SOME_PSA is set. Setting this
 configuration to avoid trying to resolve with PSA APIs.
 This configurations and these tests to be removed with more
 standardization on PSA crypto

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
Increased stack sizes to prevent the stack overflows.

Jira: NCSDK-31374

Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
-Adjusting CONFIG_HEAP_MEM_POOL_SIZE down from 2048 to 1536 to try
 to get the smallest devices to build

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
-Setting main stack size to 3584 for nRF54LX series that enable rng
 to avoid stack overflow

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
-This commit removes CONFIG_MAIN_STACK_SIZE in BLE Samples.
 The adjustments were initially made to give more stack than upstream,
 but due to the change to PSA crypto it ends up being something that
 limits higher stack sizes (e.g. on CRACEN devices)

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
-Note that nRF52810 devices is removed to avoid failures in twister
-This removes default-set stack sizes to get more BLE samples
 to work in the latest upmerge

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
-Note that this removed nRF52805, nrf52810 and nrf52811 from build
 in the peripheral_uart_minimal. This may be reverted if there is a
 movement of more items to the BT_LONG_WORKQUEUE instead of using
 system workqueueue
-Removing overrides to stack-sizes for peripheral_uart sample
 regular and minimal configuration

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
@frkv frkv force-pushed the ble_stack_and_init branch from bd872da to e5920ec Compare February 11, 2025 08:21
PerMac and others added 3 commits February 11, 2025 10:21
As in the topic

Signed-off-by: Maciej Perkowski <maciej.perkowski@nordicsemi.no>
Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
-Ended up with defaults likely to low

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
-Removing nRF54L05 because it is overflowing on RAM size (~500 bytes).
 This commit can be reverted when/if the sample is optimized a bit
 for RAM size.

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
@frkv frkv force-pushed the ble_stack_and_init branch from e5920ec to 0c94067 Compare February 11, 2025 09:26
-There was no pattern to increase stack-size for nRF54H20 devices
 likely leading to a few issues of stack overflow. Thiscommit
 adds a pattern to set the stack-sizes a bit up for nRF54H20
 CPUAPP and CPURAD

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
@NordicBuilder
Copy link
Contributor

Memory footprint analysis revealed the following potential issues

applications.nrf_desktop.zdebug[nrf52840gmouse/nrf52840]: RAM size increased by 5884[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52840gmouse/nrf52840]: ROM size increased by 23092[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_fast_pair.gmouse[nrf52840gmouse/nrf52840]: RAM size increased by 5884[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_fast_pair.gmouse[nrf52840gmouse/nrf52840]: ROM size increased by 19416[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease[nrf52840gmouse/nrf52840]: RAM size increased by 5888[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease[nrf52840gmouse/nrf52840]: ROM size increased by 22032[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
sample.matter.template.release[nrf52840dk/nrf52840]: ROM size increased by 1744[B] in comparison to the main[8a5cdf9] branch. - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic)
applications.nrf_desktop.zdebug.uart.kmu_provision[nrf54l15dk/nrf54l10/cpuapp]: RAM size increased by 6836[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug.uart.kmu_provision[nrf54l15dk/nrf54l10/cpuapp]: ROM size increased by 30804[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug.usb_next[nrf52840gmouse/nrf52840]: RAM size increased by 5900[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug.usb_next[nrf52840gmouse/nrf52840]: ROM size increased by 23792[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_dongle[nrf52840dk/nrf52840]: RAM size increased by 6520[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_dongle[nrf52840dk/nrf52840]: ROM size increased by 21296[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease.usb_next[nrf52840dk/nrf52840]: RAM size increased by 5988[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease.usb_next[nrf52840dk/nrf52840]: ROM size increased by 22416[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease[nrf52kbd/nrf52832]: RAM size increased by 3504[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease[nrf52kbd/nrf52832]: ROM size increased by 12560[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
sample.matter.template.release[nrf7002dk/nrf5340/cpuapp]: ROM size increased by 21468[B] in comparison to the main[8a5cdf9] branch. - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic)
applications.nrf_desktop.zdebug[nrf52833dongle/nrf52833]: RAM size increased by 4540[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52833dongle/nrf52833]: ROM size increased by 11712[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52840dk/nrf52840]: RAM size increased by 5968[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52840dk/nrf52840]: ROM size increased by 23104[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_mcuboot_qspi[nrf52840dk/nrf52840]: RAM size increased by 5968[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_mcuboot_qspi[nrf52840dk/nrf52840]: ROM size increased by 23264[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease[nrf52840dongle/nrf52840]: RAM size increased by 6420[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease[nrf52840dongle/nrf52840]: ROM size increased by 20460[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
sample.matter.template.debug[nrf7002dk/nrf5340/cpuapp]: ROM size increased by 20884[B] in comparison to the main[8a5cdf9] branch. - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic)
applications.nrf_desktop.zdebug[nrf52833dk/nrf52833]: RAM size increased by 4540[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52833dk/nrf52833]: ROM size increased by 11712[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf54l15dk/nrf54l05/cpuapp]: RAM size increased by 4572[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease[nrf54l15dk/nrf54l15/cpuapp]: RAM size increased by 6836[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease[nrf54l15dk/nrf54l15/cpuapp]: ROM size increased by 27588[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug.uart.kmu_provision[nrf54l15dk/nrf54l15/cpuapp]: RAM size increased by 6836[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug.uart.kmu_provision[nrf54l15dk/nrf54l15/cpuapp]: ROM size increased by 30804[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug.usb_next[nrf52840dk/nrf52840]: RAM size increased by 5984[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug.usb_next[nrf52840dk/nrf52840]: ROM size increased by 23804[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52dmouse/nrf52832]: RAM size increased by 3988[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52dmouse/nrf52832]: ROM size increased by 13920[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52kbd/nrf52832]: RAM size increased by 3484[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52kbd/nrf52832]: ROM size increased by 13620[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_dongle.usb_next[nrf52840dk/nrf52840]: RAM size increased by 6536[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_dongle.usb_next[nrf52840dk/nrf52840]: ROM size increased by 21996[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_keyboard[nrf52840dk/nrf52840]: RAM size increased by 5968[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_keyboard[nrf52840dk/nrf52840]: ROM size increased by 23300[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_nrf21540ek[nrf52840dk/nrf52840]: RAM size increased by 5968[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_nrf21540ek[nrf52840dk/nrf52840]: ROM size increased by 23104[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_nrf21540ek_multicore[nrf5340dk/nrf5340/cpuapp]: RAM size increased by 6417[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_nrf21540ek_multicore[nrf5340dk/nrf5340/cpuapp]: ROM size increased by 21468[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease_fast_pair.keyboard[nrf52kbd/nrf52832]: RAM size increased by 2912[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease_fast_pair.keyboard[nrf52kbd/nrf52832]: ROM size increased by 8516[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52840dongle/nrf52840]: RAM size increased by 6520[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf52840dongle/nrf52840]: ROM size increased by 21300[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_4llpmconn[nrf52840dongle/nrf52840]: RAM size increased by 6408[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_4llpmconn[nrf52840dongle/nrf52840]: ROM size increased by 21312[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_fast_pair.gmouse.uart.kmu_provision[nrf54l15dk/nrf54l15/cpuapp]: RAM size increased by 6780[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_fast_pair.gmouse.uart.kmu_provision[nrf54l15dk/nrf54l15/cpuapp]: ROM size increased by 31136[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_keyboard.usb_next[nrf52840dk/nrf52840]: RAM size increased by 5984[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_keyboard.usb_next[nrf52840dk/nrf52840]: ROM size increased by 23940[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_wwcb[nrf52840dk/nrf52840]: RAM size increased by 5968[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_wwcb[nrf52840dk/nrf52840]: ROM size increased by 23108[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf5340dk/nrf5340/cpuapp]: RAM size increased by 6417[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug[nrf5340dk/nrf5340/cpuapp]: ROM size increased by 21468[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_keyboard.uart.kmu_provision[nrf54l15dk/nrf54l15/cpuapp]: RAM size increased by 6836[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_keyboard.uart.kmu_provision[nrf54l15dk/nrf54l15/cpuapp]: ROM size increased by 30792[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_mcuboot_smp[nrf52840dk/nrf52840]: RAM size increased by 4944[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug_mcuboot_smp[nrf52840dk/nrf52840]: ROM size increased by 23716[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease[nrf5340dk/nrf5340/cpuapp]: RAM size increased by 6457[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease[nrf5340dk/nrf5340/cpuapp]: ROM size increased by 19112[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zrelease_keyboard[nrf54l15dk/nrf54l05/cpuapp]: RAM size increased by 4600[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug.usb_next[nrf52840dongle/nrf52840]: RAM size increased by 6536[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebug.usb_next[nrf52840dongle/nrf52840]: ROM size increased by 22000[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebugwithshell[nrf52840dk/nrf52840]: RAM size increased by 5968[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)
applications.nrf_desktop.zdebugwithshell[nrf52840dk/nrf52840]: ROM size increased by 27992[B] in comparison to the main[8a5cdf9] branch. - link (cc: @MarekPieta)

Note: This message is automatically posted and updated by the CI (latest/sdk-nrf/PR-20205/24)

Copy link

This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 7 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Mar 15, 2025
@github-actions github-actions bot closed this Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.