Configuring nRF5340 audio example with standard nRF5430_dk, using external i2s ADC and SW Codec

Hello,

I'm evaluating the nRF5340 for a fairly basic bluetooth le audio transmitter device.

I'm using a standard nRF5430 development kit due to price/availability.  I have a breakout for a Cirrus CS5343 A/D converter with i2s.

I want to test basic functionality with some of the nRF5340 Audio example, specifically I want to cut out the hardware codec stage and transmit audio directly from the i2s input.

I'm fairly new to this build system so the multiple default pinctrl configurations plus the Kconfig configurations are confusing me.

In prj.conf, I have added:

CONFIG_AUDIO_SOURCE_I2S=y
CONFIG_SW_CODEC_LC3=y

Additionally I have changed configurations in menuconfig, mainly configuring i2s as the audio source.

One thing that's tripping me up is understanding pinctrl and how I can cleanly create a "new" board, essentially the standard dk, with some of the audio_dk pin configurations for i2s.

Is what I'm describing doable in the context of the provided audio project? Or have I gone down a wrong path?

Parents Reply Children
  • Hi, I had solved this LED issue, it was a matter of fixing the naming convention that the audio example expected. but I'm hitting a more difficult issue with the ble bring-up. Should I continue here?

    Essentially, I followed the crash down to settings_init.c, here's my backtrace:

    #0  settings_subsys_init () at /home/matt/.local/lib/ncs/zephyr/subsys/settings/src/settings_init.c:34
    #1  0x0001969a in bt_settings_init () at /home/matt/.local/lib/ncs/zephyr/subsys/bluetooth/host/settings.c:318
    #2  0x0001c6a4 in bt_enable (cb=cb@entry=0x88a1 <on_bt_ready>) at /home/matt/.local/lib/ncs/zephyr/subsys/bluetooth/host/hci_core.c:3691
    #3  0x00008c0c in ble_core_init (ready_callback=ready_callback@entry=0x2c01 <on_ble_core_ready>)
        at /home/matt/Documents/Projects/nrf5340_test/nrf5340_audio/src/bluetooth/ble_core.c:250
    #4  0x00002ff8 in main () at /home/matt/Documents/Projects/nrf5340_test/nrf5340_audio/src/main.c:194


    After single stepping past here, I end up in an error handler:

    (gdb) bt
    #0  error_handler (reason=<optimized out>, esf=<optimized out>) at /home/matt/Documents/Projects/nrf5340_test/nrf5340_audio/src/utils/error_handler.c:36
    #1  0x0005d292 in k_sys_fatal_error_handler (reason=<optimized out>, esf=<optimized out>)
        at /home/matt/Documents/Projects/nrf5340_test/nrf5340_audio/src/utils/error_handler.c:58
    #2  0x0003f4f2 in z_fatal_error (reason=reason@entry=3, esf=esf@entry=0x20011b40 <z_interrupt_stacks+1888>)
        at /home/matt/.local/lib/ncs/zephyr/kernel/fatal.c:131
    #3  0x000615c8 in z_arm_fatal_error (reason=3, esf=0x20011b40 <z_interrupt_stacks+1888>) at /home/matt/.local/lib/ncs/zephyr/arch/arm/core/aarch32/fatal.c:63
    #4  0x000615d4 in z_do_kernel_oops (esf=<optimized out>, callee_regs=<optimized out>) at /home/matt/.local/lib/ncs/zephyr/arch/arm/core/aarch32/fatal.c:108
    #5  0x0001757e in _oops () at /home/matt/.local/lib/ncs/zephyr/arch/arm/core/aarch32/swap_helper.S:570
    #6  <signal handler called>
    #7  0x00008402 in net_core_timeout_handler (timer_id=<optimized out>) at /home/matt/Documents/Projects/nrf5340_test/nrf5340_audio/src/bluetooth/ble_core.c:43
    #8  0x000437ea in z_timer_expiration_handler (t=0x20001450 <net_core_timeout_alarm_timer>) at /home/matt/.local/lib/ncs/zephyr/kernel/timer.c:63
    #9  0x000435ce in sys_clock_announce (ticks=<optimized out>) at /home/matt/.local/lib/ncs/zephyr/kernel/timeout.c:270
    #10 0x00037602 in sys_clock_timeout_handler (chan=<optimized out>, expire_time=<optimized out>, user_data=0x0 <i2c_dump_msgs>)
        at /home/matt/.local/lib/ncs/zephyr/drivers/timer/nrf_rtc_timer.c:450
    #11 0x000378b2 in process_channel (chan=chan@entry=0) at /home/matt/.local/lib/ncs/zephyr/drivers/timer/nrf_rtc_timer.c:508
    #12 0x00037918 in rtc_nrf_isr (arg=<optimized out>) at /home/matt/.local/lib/ncs/zephyr/drivers/timer/nrf_rtc_timer.c:532
    #13 0x00017636 in _isr_wrapper () at /home/matt/.local/lib/ncs/zephyr/arch/arm/core/aarch32/isr_wrapper.S:259
    #14 <signal handler called>
    #15 sys_slist_init (list=0x2000aa88 <settings_load_srcs>) at /home/matt/.local/lib/ncs/zephyr/include/zephyr/sys/slist.h:198
    #16 settings_store_init () at /home/matt/.local/lib/ncs/zephyr/subsys/settings/src/settings_store.c:178
    #17 0x00015556 in settings_init () at /home/matt/.local/lib/ncs/zephyr/subsys/settings/src/settings.c:35
    #18 0x0001584e in settings_subsys_init () at /home/matt/.local/lib/ncs/zephyr/subsys/settings/src/settings_init.c:34
    #19 0x0001969a in bt_settings_init () at /home/matt/.local/lib/ncs/zephyr/subsys/bluetooth/host/settings.c:318
    #20 0x0001c6a4 in bt_enable (cb=cb@entry=0x88a1 <on_bt_ready>) at /home/matt/.local/lib/ncs/zephyr/subsys/bluetooth/host/hci_core.c:3691
    #21 0x00008c0c in ble_core_init (ready_callback=ready_callback@entry=0x2c01 <on_ble_core_ready>)
        at /home/matt/Documents/Projects/nrf5340_test/nrf5340_audio/src/bluetooth/ble_core.c:250
    #22 0x00002ff8 in main () at /home/matt/Documents/Projects/nrf5340_test/nrf5340_audio/src/main.c:194

    I was comparing the two dts/dtsi files for the standard dk and audio dk, and I did not see anything suspicious that would cause the ble initialization to fail.

  • I think you got an error in ncs/zephyr/subsys/settings/src/settings_init.c:36.

    err = settings_backend_init() /* func rises kernel panic once error */

    I think you need to compare your configs with the sample's. Look for entries that matches CONFIG_SETTINGS_*.

    You can either search all the .config input files or the generated final config file: */build/zephyr/.config .

Related