MPU Fault on nrfx_i2s_init NRF5340

Hi everyone!

I'm having difficulties in setting up a little project in which I want to pass I2S data over USB. 
I know I'm using the old USB Audio Class endpoints, but everything works fine if I hardcode a buffer and pass it via the usb_audio_send function.

When I want to plug some I2S code, however, I keep getting MPU fault error on nrfx_i2s_init.

Current build configuration is SDK and toolchain V3.4.0, target nrf5340dk/nrf5340/cpuapp

Another issue I encountered is that if I change target to nrf5340dk/nrf5340/cpuapp-ns, output to serial modem no longer works

Full project is attached

Thanks for the help!
Simone

8080.Archive.zip

  • Hi Simone, 

    Thank you for sharing your issue with us and for attaching your project as well. Could you please share the exact error you get from nrfx_i2s_init? This should help debugging efforts. I'll make an effort to reproduce this myself tomorrow, but I'm not able to today due to not having an nRF5340 DK available to me. 

    Another issue I encountered is that if I change target to nrf5340dk/nrf5340/cpuapp-ns, output to serial modem no longer works

    Did you try to connect to other COM/VCOM ports when the ns firmware was flashed to the DK? 

    Best regards,

    Maria

  • Hi Maria, 

    I cannot get errors from nrfx_i2s_init, it just crashes with the following output

    *** Booting nRF Connect SDK v3.4.0-99553055607b ***
    *** Using Zephyr OS v4.4.0-bf801e4e3d19 ***
    [00:00:00.339,599] <inf> main: Entered main
    [00:00:00.339,599] <inf> main: Found USB Microphone Device
    [00:00:21.746,398] <err> os: ***** MPU FAULT *****
    [00:00:21.746,398] <err> os:   Data Access Violation
    [00:00:21.746,398] <err> os:   MMFAR Address: 0x504
    [00:00:21.746,429] <err> os: r0/a1:  0x0000002b  r1/a2:  0x20000000  r2/a3:  0x00000000
    [00:00:21.746,429] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x00000000
    [00:00:21.746,429] <err> os:  xpsr:  0x69000000
    [00:00:21.746,459] <err> os: Faulting instruction address (r15/pc): 0x0000af4c
    [00:00:21.746,490] <err> os: >>> ZEPHYR FATAL ERROR 19: Unknown error on CPU 0
    [00:00:21.746,490] <err> os: Current thread: 0x20000a60 (main)
    [00:00:56.294,982] <err> os: Halting system
    

    Using breakpoints, code cannot continue past nrf_i2s.h line 793

    NRF_STATIC_INLINE void nrf_i2s_configure(NRF_I2S_Type * p_reg, nrf_i2s_config_t const * p_config)
    {
        p_reg->CONFIG.MODE     = p_config->mode;
        ...

    which should be near the configure_pins(p_config) step on nrfx_i2s.c

    If I let code execution continue past that line, my output is the cpu fault reported above

    Thanks for the help 

    Kind Regards, 

    Simone

  • NULL pointer dereference. If I had to guess: p_reg pointer is NULL, probably because the DT overlay is not set up correctly. Check if

    status="okay"; 

    exists for the I2S peripherial.

Related