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.

One thought on “CSR tools and demo projects

Leave a Reply

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