CSR tools and demo projects

Posted on Posted in Embedded C/C++

Before we look into the details of developing FW from scratch, we’ll have a look at what CSR provides when installing the Audio Development Kit (ADK), their IDE for the CSR8670/CSR8675.

The following utilities are installed alongside the ADK, which are present in the Start Menu under the ADK:

  • BlueFlash – used to program, read or delete the internal flash memory of the chip. This tool is typically not needed (since the ADK handles that for you), but it is sometimes useful to erase the entire memory of the chip, especially if it starts to behave erratically or the ADK fails to program. In those cases doing a full flash erase (by selecting Flash Erase and then Erase Full Chip) should resolve any problems.
  • DfuWizard – CSR’s tool for updating the FW over USB. This is a simple UI to perform DFU from special DFU files that can be created from the binaries. A separate post will explain more about the DFU process.
  • PSTool – this tool provides access to the Persistent Store on the CSR. This is a key-value table in the EEPROM on the chip which allows configuring of the HW and FW. A separate post will dive more deeply into the Persistent Store and its uses.
  • DSP libraries – rebuilds the DSP libraries. This is useful if you need to make code changes to the open-sourced libraries (as opposed to the close-sourced libraries that exist only in binary form).
  • VM libraries – rebuilds the VM (C code) libraries. This is useful if you need to make code changes to the open-sourced libraries (as opposed to the close-sourced libraries that exist only in binary form).
  • Sink Configuration Tool – a utility to configure the Sink project (more on that below). This provides an easy UI to configure the multitude of options that the Sink application uses, which are subsequently stored in the Persistent Store. Typically one would start from one of CSR’s provided example configurations and then modify whatever is needed.
  • Source Configuration Tool – similar to the Sink Configuration Tool, but for the Source project.

CSR also includes several example projects. These reside in the apps folder in the ADK installation folder.

  • my_first_dsp_app – a simple application that configures audio passthrough. It can route the audio through the DSP or directly from ADC to DAC (by defining BYPASS_KALIMBA) and can use the pre-amp if connected to a microphone level and not a line-in level (by defining MIC_INPUT). This project can run both on the CSR8670 and the CSR8675 (and their respective evaluation boards, selectable via the project setting “Development board”), but the bit width is always set to 16 bit, so the 24 bit mode of the ADC and DAC in the CSR8675 aren’t actually used.
  • my_first_24bit_dsp_app – this example is for 24 bit at 96KHz I2S audio handling, both for input and output. This mode is supported both by the CSR8670 and the CSR8675 (although the CSR8670 does not support 24 bits per sample).
  • my_second_dsp_app – showing how to integrate a sample Kalimba filter (an FIR). This example better illustrates the way the DSP handles the audio and how custom filters can be used.
  • sink – this project is for an audio sink, i.e. the endpoint that plays music. This can be used for headphones or speakers, for example. It provides the full capabilities of CSR, including audio via Bluetooth (both A2DP and HFP/HSP), wired (via ADC) or USB, control through Bluetooth Classic (AVRCP), BLE and other features. The sink project is extremely complex, both in the VM and the DSP, and has changed dramatically between ADK 3.5 (still under CSR) and ADK 4 (released after the Qualcomm acquisition). All the features can be controlled both by project settings during compilation and Persistent Store configuration (which is handled via the Sink Configuration Tool). It is possible to modify the code the project and integrate proprietary features, but it is far from simple.
  • source – this project is for an audio source, i.e. the master that transmits the music to the sink. A Bluetooth source is typically a mobile phone or a computer. The source project can be used to provide custom audio handling that will be played on any Bluetooth headphones, speakers or other sinks. The source project is somewhat less complex than the source, with less features and configuration.

Finally, there are several command line tools that are not exposed as part of the ADK Start Menu. These reside in the tools\bin folder in the ADK installation folder. These tools are mostly used internally by the ADK itself, but some of them are useful to know about

  • dfu*.exe – several DFU utilities for creating the DFU files. Their use will be explained in a future DFU post.
  • nvscmd.exe – this is a command line utility similar to the BlueFlash, but it can also access the external flash connected to the CSR chip via SPI.
  • voice_prompt_tool.exe – this is a command line utility that converts audio files to a “voice prompt” format that can be used by the sink application.

3 thoughts on “CSR tools and demo projects

  1. Hi, your guide on the CSR chips have been extremely helpful and informative.

    I hope you dont mind offering a bit of assistance. I purchased a module which uses this SoC and am trying to reprogram it to set it as a transmitter, set it to use the A2DP profile, and enable the aptx low latency mode. I have been struggling to get the CSR IDE and have decided to see if i can just use PSTools and configure the PSkeys to enable the features that I want. I know that the third party vendor could have altered the FW so what im doing might not work; however, if we assume that the FW is not altered, would it be possible to accomplish what I want to only using PSTools? Thanks for the help and I look forward to your PSKeys guide!

    1. That greatly depends on the specific module you are using. If it is a wrapper of the CSR chip with another MCU or a fully customized FW, that probably won’t work. On the other hand, if it is simply a HW PCB that allows you full access to the CSR chip, you are only limited by the FW that is running on the CSR.
      Do note that the regular CSR applications don’t support both sink (the audio endpoint – headphones, speakers, etc.) and source (the audio source – phone, Blutooth dongle, etc.). You need to use a separate FW to work in either mode – the Sink application or the Source application. Since you want the CSR to act as a source, you’d need it to run the Source application, which then can be configured via the PSTool directly, or better yet via the Source Configuration Tool. Finally, if the configuration options for the Source application aren’t enough for your needs, you will have to modify the code and implement the required features.

Leave a Reply

Your email address will not be published. Required fields are marked *