nrfx_prs sample broken with nrf Connect SDK v2.5.0

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!

  • Hi,

    Thank you for bringing this to our attention!

    You are correct, this sample does not seem to have been updated correctly for v2.5.0.

    I will report this internally and we will update the sample on the main branch as soon as possible.

  • Hi  , did you find any cause for the SPI initialization? I also got issue with this error

    nrfx_spim_init() failed: 0x0bad0003

    According to this issue (this link), the SCK pin need to be set according to the SPI Mode. But after apply the fix, I got the system crash with error:

    [00:00:01.110,107] <err> os: mem_manage_fault: ***** MPU FAULT *****
    [00:00:01.110,168] <err> os: mem_manage_fault:   Data Access Violation
    [00:00:01.110,229] <err> os: mem_manage_fault:   MMFAR Address: 0x50c
    [00:00:01.110,351] <err> os: esf_dump: r0/a1:  0x00000000  r1/a2:  0x80000000  r2/a3:  0x80000000
    [00:00:01.110,443] <err> os: esf_dump: r3/a4:  0x00000000 r12/ip:  0x00008000 r14/lr:  0x00014e3d
    [00:00:01.110,565] <err> os: esf_dump:  xpsr:  0x01000000
    [00:00:01.110,656] <err> os: esf_dump: Faulting instruction address (r15/pc): 0x00014e94
    [00:00:01.110,748] <err> os: z_fatal_error: >>> ZEPHYR FATAL ERROR 19: Unknown error on CPU 0
    [00:00:01.110,809] <err> os: z_fatal_error: Current thread: 0x20002408 (unknown)
    [00:00:02.870,666] <err> os: k_sys_fatal_error_handler: Halting system

    If anyone have any suggestion, I would love to hear from you.

    Please let me know if you got any solution. Thank you very much.

  • Hi,

    Can you create a new ticket for this question?

    regards

    Jared 

Related