Audio DK "beep" sample

Can anyone please point me in the direction of sample code for the nRF5340 Audio DK that demonstrates a simple beep.

I'm not yet interested in multiple threads, or huge DMA transfers, or the ridiculously behemoth Bluetooth sample application. Just a single beep using the onboard DAC.

I've already scoured the nRF SDK docs, and searched Github for every keyword I can think of, but can find absolutely nothing to bootstrap my self edification.

It's incredibly frustrating to have invested so much money in the hardware and the insane amount of time sunk studying Zephyr, only to be met with a complete lack of resources for the most basic functionality of an ostensible "Audio DK".

I'm more than capable of extrapolating from a working sample, but cannot even find a toehold. Any and all suggestions are welcome.

  • Hello ace.johnny,

    The nRF5340 Audio DK was created for developing Bluetooth LE Audio projects which is why the recommended starting point is the nRF5340 Audio application. The application is not meant to be used to test the functionality of the components on the board.

    I recommend that you try the Zephyr sample I2S echo and modify it to work with CS47L63 as the codec and nRF5340 Audio DK as the target board.

    If you want to use the nRF5340 Audio application as a basis, the hw_codec files in nrf5340_audio/src/modules is a suitable start.

    Best regards,

    Maria

  • Can you share any strategies for forking the I2S echo sample and "modifying it to work" with the Cirrus codec?

    I can coax it to build, but not function.

    Obviously I need to replace the contents of the codec.c file. Any more guidance than that?

    Are there any other CS47L63 examples? Because I've been unable to find them.

  • I eventually figured it out; here's the guidance I wish someone had shared with me...

    /modules/hal/cirrus-logic/cs47l63 contains the codec driver and its essential support functions defined in the various files from those subdirectories.

    /nrf/applications/nrf5340_audio/src/drivers/cs47l63_comm.c implements the driver communication in Zephyr using threads, mutexes, and semaphores for the SPI connection, interrupts, and callbacks.

    /nrf/applications/nrf5340_audio/src/drivers/cs47l63_reg_conf.h contains all the necessary register data to setup and enable the sundry codec subsystems such as clocks, gpios, analog/digital inputs, I2S serial ports, headphone output, and the internal signal routing required for the nRF5340 Audio DK. The CS47L63 datasheet describes these in detail.

    /nrf/applications/nrf5340_audio/src/modules/hw_codec.c demonstrates how to combine all these disparate files into working code that can be integrated within a larger multithreaded application using features such as ZBus, Shell, and KConfig options.

    Once all that infrastructure is in place, simply send data to the &i2s0 peripheral and it will be rendered by the codec's DAC output. Or, alternatively, modify the codec's internal routing so that its built-in test tone or white noise generators are sent to the DAC output instead.

Related