Hello,
I hope you are having a nice day. I just updated from nrf Connect SDK v2.4.2 to v2.5.0 when I encountered this bug.
Part of my application is based on the nrfx_prs sample (https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/boards/nrf/nrfx_prs/src/main.c). When I found my project no longer ran correctly, I went back to review the nrfx_prs example application. Unfortunately the sample does not work correctly either anymore.
Clearly the manner of specifying frequency has been changed for nrfxlib. Previously, the frequency specification looked like:
nrfx_spim_config_t spim_config = NRFX_SPIM_DEFAULT_CONFIG( NRF_SPIM_PIN_NOT_CONNECTED, NRF_SPIM_PIN_NOT_CONNECTED, NRF_SPIM_PIN_NOT_CONNECTED, NRF_DT_GPIOS_TO_PSEL(SPIM_NODE, cs_gpios)); spim_config.frequency = NRF_SPIM_FREQ_1M; spim_config.skip_gpio_cfg = true; spim_config.skip_psel_cfg = true;
However, this frequency specification seems to no longer be valid. I didn't notice a nrfx usage update note in the version change-log, but I perhaps missed it. The correct specification now seems to be something like:
spim_config.frequency = NRFX_MHZ_TO_HZ(1);
So although the nrfx_prs sample builds, the sample hits a run time assertion: [note this code was run on an nrf5340dk board]
*** Booting nRF Connect SDK v2.5.0 *** nrfx PRS example on nrf5340dk_nrf5340_cpuapp -> press "Push button 1" to trigger a transfer -> press "Push button 2" to switch the type of peripheral nrfx_spim_init() failed: 0x0bad0004
It seems there may be some other curiosities with the SPI initialization that I will now examine, but I wanted to bring this issue to your attention as soon as possible.
If you could let me know what is now best practice for executing peripheral resource sharing, I would appreciate it.
Thanks!