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.

12 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.

  2. Hello,
    I’m looking for a company to build some software around CSR8670 module. It is a device that connects to an electric guitar and then you can hear the guitar with your bluetooth devices (headphones, speaker, computer).
    The trick is that I want to include guitar effects inside the device using the DSP capabilities of the CSR.
    Can you help me to develop this project?

    1. The CSR8675 is almost identical to the 8670 from the FW standpoint, so all of the information in my posts applies to both.

  3. Hi,

    Do you have a documentation for Persistent Store key for CSR BC417? I have an old board that utilize this chip and so far managed to extract the DFU and reading the PSR. I’d like to use a programmer for it but it’s extremely hard to find so modifying the PSR is my last resort as the chip is used in custom board. Reference board that I found so far (HC-05 and HC-06) utilizes extra pins.

    The actual purpose is to turn an MFi device back to regular Bluetooth, since the device can be detected in Bluetooth but refuses to pair with Non-Apple devices

    1. Qualcomm appears to no longer provide support for this chip (at least not in their regular CreatePoint support website). The closest I could find is the BC57E, but it’s a BlueCore 5 (vs. BlueCore 4 on the BC417). It might be worth reaching out to Qualcomm’s support or sales representatives, although I would get your hopes up – Qualcomm continues with CSR’s terrible customer support.

  4. Hi. Is there any way to get these configuration tools? I got a CSR8675 module from ebay and I would like to change it’s led behavior. Since Qualcomm’s acquisition none of downloads from official site is available. 🙁

    1. As far as I know, neither CSR nor Qualcomm offered or offer now any of these development tools without a (costly) license agreement. Qualcomm’s open resources and tools don’t include anything related to the CSR8670/75, or the newer QCC family of Bluetooth audio chips. Even questions about those chips in their public technical support forums are quickly closed.
      I know that some vendors on eBay and AliExpress selling CSR8670/75 modules also include a copy of the ADK installation, typically of an older version. Naturally this is of questionable legal status.

      1. Well… For one-off diy hobby project buying expensive license is obviously not an option. Do you have any links to these vendors? Damn corporate greed… 🙁

        1. I agree – in general Qualcomm doesn’t really support small/hobby developers. Try searching for “CSR8670 module” in AliExpress – some of those listings claim to include development tools. Again, legality is questionable, and I am by no means endorsing this.

Leave a Reply to Eli Iser Cancel reply

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