Extracting CS47L63 driver from nRF5340 Audio DK application

After some considerable effort, I have extracted the CS47L63 driver from the nrf5340_audio application, and finally have the absolute bare minimum proof of concept code that builds and functions exactly as expected.

But only if debug optimizations (-Og) are enabled in the build configuration.

Without those, the CS47L63 does not initialize correctly, and its driver tries to use I2C instead of SPI to communicate, which of course fails. Note that cs47l63_comm_init() does not produce any log errors, but does not return 0.

I don't know how to debug the issue because it works flawlessly when debug optimizations are enabled, but not without, and my Zephyr knowledge is too limited to discern my subtle mistake. I'm asking for a more experienced developer to please point me in the right direction.

The /src/drivers/ directory only contains 4 files copied verbatim from the nrf5340_audio repo, and my main.c is incredibly sparse, so it should be very easy to understand (it just briefly beeps the internal tone generator).

I have attached the project, and would greatly appreciate whatever assistance or guidance anyone can provide.

nrfadk_codec_test.zip

Parents
  • Did you ever find a solution? 

    I am also trying to salvage parts from the nrf5340_audio application but it such a behemoth that using it as a base for understanding the various components of the audio dk is frustrating.  Frankly it is surprising Nordic don't offer some smaller example projects to illustrates its functions more simply or at least at add support for the dk to some of their existing examples.  I am trying to get the i2s echo example working on the audio dk - hence trying to extract the codec from nrf5340_audio to replace the one it uses.

    The nrf5340_audio project does not even build in VS Code, despite threads on here saying they were working on it years ago.  Given Nordic have pretty much moved 100% to VS Code now seems fairly unlike them.

    There are many threads on here with audio dk queries without very good answers.

Reply
  • Did you ever find a solution? 

    I am also trying to salvage parts from the nrf5340_audio application but it such a behemoth that using it as a base for understanding the various components of the audio dk is frustrating.  Frankly it is surprising Nordic don't offer some smaller example projects to illustrates its functions more simply or at least at add support for the dk to some of their existing examples.  I am trying to get the i2s echo example working on the audio dk - hence trying to extract the codec from nrf5340_audio to replace the one it uses.

    The nrf5340_audio project does not even build in VS Code, despite threads on here saying they were working on it years ago.  Given Nordic have pretty much moved 100% to VS Code now seems fairly unlike them.

    There are many threads on here with audio dk queries without very good answers.

Children
No Data
Related