Csr Bluesuite

1
Table of Contents
23456789101112131415161718192021222324
'
v3.2 Combined AV Headset

User Guide

May 2005
Churchill House
Cowley Road
United Kingdom
Tel: +44 (0)1223 692000
www.csr.com
blab-ug-005Pa
This material is subject to CSR's non-disclosure agreement.

Advertisement

Related Manuals for CSR BlueLab v3.2

Summary of Contents for CSR BlueLab v3.2

  • Page 1: User Guide

    Churchill House Cambridge Business Park Cowley Road Cambridge CB4 0WZ United Kingdom Registered in England 3665875 Tel: +44 (0)1223 692000 Fax: +44 (0)1223 692001 www.csr.com © Cambridge Silicon Radio Limited 2005 blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement.
  • Page 2: Table Of Contents

    Table 7.1: Button Functionality in AV Mode .. 18 Table 7.2: Button Functionality in HFP Mode.. 19 Table 7.3: Button Functionality in HSP Mode.. 20 blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. © Cambridge Silicon Radio Limited 2005 Contents Page 2 of 24..
  • Page 3: Introduction

    It is envisaged that product developers may define their own Man Machine Interface (MMI) and add such features as battery monitoring to create a finished end-product. © Cambridge Silicon Radio Limited 2005 Page 3 of 24 blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement.
  • Page 4: Target Audience

    Target Audience The target audience for this document is hardware and software developers using the Combined AV Headset application that accompanies BlueLab v3.2 as a basis for their own product developments. © Cambridge Silicon Radio Limited 2005 Page 4 of 24 blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement.
  • Page 5: Target Hardware

    Target Hardware Target Hardware The target hardware is CSR’s BlueCore3-Multimedia Development Board (DEV-PC-1307 Rev C). The user will ® also need a suitable AV source capable of providing a Bluetooth wireless technology-compliant SBC encoded audio stream. Note: CSR’s BlueCore3-Multimedia Development Board (DEV-PC-1307 Rev A) is not suitable to run this application.
  • Page 6: Bluelab Installation

    Program Files directory. Installation procedure CSR recommend that any applications running on the PC are closed before installing the BlueLab software. Insert the Bluelab CD-ROM into the computer’s CD drive. Right-click on the Windows Start menu and explore the CD-ROM.
  • Page 7: Mp3 Support

    An independent license for such use is required. For details, please visit http://www.mp3licensing.com. 4.2.2 Wolfson external CODEC support The Combined AV application shipped with BlueLab v3.2 includes support for the Wolfson (WM8731) CODEC. To enable support for the Wolfson CODEC simply add (as shown below) before building the application.
  • Page 8: Combined Av Headset Application

    Combined AV Headset Application When BlueLab v3.2 has been successfully installed, the Combined AV Headset application can be built and executed using the application source code, shipped with BlueLab v3.2. This section guides you step-by-step through the process of building and executing this application.
  • Page 9: Figure 5.2: Start Xide

    If previous application development work has been carried out on the BlueCore3-Multimedia Development Board, CSR recommends that you restore the factory setting of the BlueCore chip. A .psr file has been added to BlueLab v3.2 to simplify this process, for further information see section 5.3. © Cambridge Silicon Radio Limited 2005..
  • Page 10: Figure 5.3: Open Sbc_decode Workspace

    However, if a reduction in latency is required, two other options are available as defined by STREAMING_STANDARD_LATENCY Note: The values controlled by these definitions can be changed in the code, if required blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. BlueLabappsav_headset_hfp STREAMING_LOW_LATENCY © Cambridge Silicon Radio Limited 2005..
  • Page 11 Step 5: Open av_headset_hfp Workspace Select , navigate to Project Open Workspace av_headset_hfp.xiw blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. the sbc_decoder DSP application. BlueLabappsav_headset_hfp © Cambridge Silicon Radio Limited 2005 Combined AV Headset Application and select Page 11 of 24..
  • Page 12: Building The Combined Headset Application With Mp3 Support

    Step 1: Installing the MP3 add-on Having installed BlueLab v3.2, install channel). blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. to build the av_headset_hfp VM application. to download and execute the application. The application image BlueLab_3.2-release-mp3.exe..
  • Page 13: Cvc Echo Cancellation And Noise Reduction Software

    Please see the ParamMgr User guide (CSR reference blab-ug-007Pa). Restoring Factory Chip Settings The factory settings can be restored using the PSTool application supplied with BlueLab v3.2. To restore the factory default settings using PSTool: Open the PSTool application.
  • Page 14 Combined AV Headset Application The PSTool application dialog appears: Select menu: Merge / File An ‘Open Persistent Store File’ dialog appears: © Cambridge Silicon Radio Limited 2005 Page 14 of 24 blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement.
  • Page 15 Open The PSkeys that may result in unexpected chip behaviour, will be restored to their factory defaults. Note: This may take a few minutes. blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. factory_restore.psr file. ……toolsbinfactory_restore.psr. © Cambridge Silicon Radio Limited 2005..
  • Page 16: Pairing

    . Change &035b = 0038 0038 0038 0038 to &035b = 0034 0034 0034 0034. When the application is run in xIDE the PIN will then be set to 4444. blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. . This stops the application debugger and halts operation. VOL- VOL+ avcontrol.exe..
  • Page 17: Operation

    Long press - Button held for more than two seconds Short press - Button held for less than two seconds blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. reference application. Refer to section 5.3 for compile instructions (default ) button for at least two seconds.
  • Page 18: Av Mode

    VOL- Held (Acted on every 1s) PLAY/PAUSE Pressed STOP Pressed FORWARD Pressed BACKWARD Pressed Table 7.1: Button Functionality in AV Mode blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. AV Mode Vol Up Vol Up Vol Down Vol Down Play/Pause music..
  • Page 19: Hfp + Av

    Noise Reduction to the microphone send-out signal. 3 Beeps, PSTHRGH mode: Pass through mode where the audio is routed through the Kalimba, disabling Hands-free, effectively bypassing any audio processing. blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. Incoming Connecting Connected..
  • Page 20: Hsp + Av

    Noise Reduction to the microphone send-out signal. 3 Beeps, PSTHRGH mode: Pass through mode where the audio is routed through the Kalimba, disabling Hands-free, effectively bypassing any audio processing. blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. Incoming Connecting Connected..
  • Page 21: Decoder Behaviour Settings

    Note: The decoder project must be rebuilt in xIDE when any of these parameter values is changed in the source code. See the xIDE on-line help (DSP Reference guide/File List/codec/stream_decode) for further explanation. blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. $decoder_codec_stream_struc . The numerical values can be simply ©..
  • Page 22: Document References

    Document References Document BlueLab v3.2 Combined AV Headset Release Note BlueLab v3.2 Release Note BlueLab v3.2 ParamMgr User Guide (for CVC only) blab-ug-005Pa This material is subject to CSR’s non-disclosure agreement. Reference blab-srn-002Pa blab-srn-001Pa Blab-ug-007Pa © Cambridge Silicon Radio Limited 2005..
  • Page 23: Terms And Definitions

    BlueCore Group term for CSR’s range of Bluetooth wireless technology chips ™ BlueLab CSR’s development toolset for building applications to run in the firmware’s VM ® Bluetooth Set of technologies providing audio and data transfer over short-range radio connections Cambridge Silicon Radio ™..
  • Page 24: Document History

    CSR reserves the right to make technical changes to its products as part of its development programme. While every care has been taken to ensure the accuracy of the contents of this document, CSR cannot accept responsibility for any errors.

Table of Contents

  • CSR BlueCore USB SPI programmer/debugger
    • CSR chips supported by programmer
    • Programmer hardware
    • Software
      • Installing prebuilt drivers
      • Using the driver
      • Building for Wine
      • Building DLL for Windows

This is USB SPI programmer and debugger for CSR BlueCore bluetooth chips, basedon FTDI FT232R USB to UART converter chip. Programmer hardware can be madeusing simple FT232RL breakout board, or built as a dedicated programmer usingincluded schematic. Programmer driver works by replacing USB SPI programmerdriver, usbspi.dll, in CSR applications and is currently ported to Linux/Wineand Windows.

Project home page: https://github.com/lorf/csr-spi-ftdi.

CSR chips supported by programmer

Generally, all CSR BlueCore chips starting with BlueCore 2 should be supported.Programmer was tested with the following chips:

  • BC417143 (on HC-05 module)
  • BC57F687A
  • CSR8645
  • BC212015 (reported by Alex Nuc, see Chip notes)

Chip notes

  • BlueCore chips require either 3.3V or 1.8V I/O voltage level. Check thedatasheet.
  • Some chips (like CSR8645) share SPI pins with PCM function. For such chips tobe accessible via SPI, SPI_PCM# pin should be pulled up to I/O voltagesupply through a 10K resistor.
  • On some chips SPI_DEBUG_EN (on BC6140) or SPI_PIO# (on CSR1010) pinshould be pulled up directly to I/O voltage supply to enable SPI port.
  • BlueCore chips which integrate battery charger has charger configurationenabled by default. Such chip may shutdown shortly after power on if Youdon't connect charged battery. Battery charger configuration is defined inPSKEY_USR0 and can be changed using appropriate Configuration Tool orPSTool. See sample PSR files for disabling charger in misc/.
  • BlueCore 2 chips (such as BC212015) are not supported in BlueSuite 2.4 andabove. It's also reported that to flash/dump these chips it's required tolower SPI speed. So for BC2 chips it's recommended to use BlueSuite 2.3 andset SPIMAXCLOCK=200option.

Programmer hardware

Programmer hardware is based on FT232R chip. It is possible that latergeneration FTDI chips, such as FT2232C/D/H or FT232H, will also work, but thiswas not tested.

Using FT232RL breakout board as a programmer

You can build a simple programmer using popular FT232RL breakout boards (searchEbay for 'FT232RL adapter' for example). Pinout specified in spi.c file.Change it at will. Note that FTDI boards usually provide 5V or 3.3V I/O levelswhile CSR chips require 3.3V or 1.8V I/O level. You may supply appropriateVCCIO to FTDI chip or use logic level converter if levels don't match. Seedescription of VCCIO pin in FTDI chip datasheet for details.

This is a default pinout:

SignalFT232RL pinFTDI pin nameFTDI GPIO bitCSR pin
CS#2DTR#D4SPI_CS#
CLK3RTS#D2SPI_CLK
MOSI6RI#D7SPI_MOSI
MISO9DSR#D5SPI_MISO
TX1TXDNot usedUART_RX
RX5RXDNot usedUART_TX
LED_RD10DCD#D6--
LED_WR11CTS#D3--
GND7, 18, 21GND--GND

SPI and UART BlueCore pins could be connected directly to FTDI pins, but I'drecommend to wire them through the 220 Ohm (or so) resistors.

TX and RX connections are optional and provide connectivity to BlueCore UART.

LED connections are optional. Wire LED cathodes through the current limitingresistors (330 Ohm works fine) to the appropriate FTDIpins. Wire LED anodes to FTDI 3V3 pin.

Other pinouts can be specified with FTDI_PINOUTOption.

Don't power BlueCore chip from FT232R internal 3.3V regulator! It's currentdraw may exceed FT232R 50mA limit, which may cause communication errors.

Also see notes on Counterfeit FT232RL chips.

Dedicated programmer

KiCad schematic for a dedicated programmer can be found inhardware/ subdirectory.

Counterfeit FT232RL chips

Cheap (< $5) FT232RL modules usually contain counterfeit FT232RL chips(1,2,3). I'vegot such chip (this one has read-only EEPROM, S/N A50285BI, probably it's ageneration 2 counterfeit) andverified csr-spi-ftdi to work with it.

There is a known data loss issue with counterfeit FT232RL chip and ASM1042 USB3.0 controller. If You encounter it (You'll get an error on stderr, seeTroubleshooting), try to replug the programmer to othercontroller. Note that genuine FT232RL works fine with this controller.

Counterfeit IC also may produce some communication errors, but they areautomatically retried, so in general it works well enough.

Some versions of Windows FTDI driver tend to intentionallybrick1st generation counterfeit chips by setting their PID to 0x0000. Thereareunbrick(2) andprotectprocedures, but csr-spi-ftdi will work on the bricked chips too.

Software

CSR software

This driver is tested with CSR BlueSuite 2.1 - 2.6.0 and with CSR BlueLab 4.1,but should work with other CSR software, such as SDK, ADK, Configuration Tool,Parameter Manager. Newer versions of BlueSuite can be found athttps://www.csrsupport.com/PCSW. Older versions of BlueSuite can be found athttps://www.csrsupport.com/PCSWArchive. Access to these pages requiresregistration.

Installing prebuilt drivers

Prebuilt drivers for Linux and Windows can be downloaded fromhttps://github.com/lorf/csr-spi-ftdi/releases/latest.

Installing on Ubuntu/Debian Linux

Install Wine:

Install CSR BlueSuite in Wine. Find all instances of usbspi.dll installed andmove them out of the way:

Copy usbspi.dll.so to Wine system directory:

Alternately You can specify location of the .dll.so file in WINEDLLPATHenvironment variable, see wine(1) man page for details.

Allow yourself access to FTDI device

After that You'll need to add yourself to plugdev group and relogin.

Installing on Windows

  1. Install CSR package such as BlueSuite;
  2. Make a backup of usbspi.dll in your application directory (e.g. inC:Program Files (x86)CSRBlueSuite 2.6.0);
  3. Copy lib-win32/usbspi.dll to your application directory;
  4. Connect Your FTDI device to computer;
  5. Download and run Zadig from http://zadig.akeo.ie/. In Options menu choose'List all devices', choose Your FTDI device ('FT232R USB UART' or similar),choose libusbK driver, press 'Replace driver' or 'Install driver'. Thiswill install generic libusb-compatible driver for your FTDI chip. There is atutorial on running libftdi programs on Windows here:http://embedded-funk.net/running-libftdi-under-windows/;
  6. Run your CSR apps.

Using the driver

Choosing USB transport

Older BlueSuite defaults to use CSR SPI LPT programmer, to use csr-spi-ftdi Youneed to select USB SPI transport. Use -TRANS 'SPITRANS=USB SPIPORT=1' optionfor command line tools. Importmisc/spi-set-usb-transport.reg to change thedefault.

Options

Csr-spi-ftdi driver supports several options that can be set as environmentvariables or using the -TRANS option to most CSR commandline apps.

  • SPIMAXCLOCK - Maximum SPI clock frequency in kHz, default is 1000.Practical values range from 20 to 2000. CSR app may slow SPI clock down whenread or write verification fails. Some commands are always executed at 20kHz.
  • FTDI_LOG_LEVEL - sets csr-spi-ftdi log level, available log levels:quiet, err, warn, info, debug. Adding a ,dump option provides hexdumps of transferred data. Example: FTDI_LOG_LEVEL=info,dump. Default:warn.
  • FTDI_LOG_FILE - specify log file name. Can be set to stdout to log tostandard output, or to stderr to log to standard error stream. Default:stderr.
  • FTDI_INTERFACE (since version 0.5.1) - specify interface on multi-interfacechips (FT2232, FT4232). Default: A.
  • FTDI_PINOUT (since version 0.5.2) - specify a pinout. Available pinouts:
    • default - default pinout as described in Using FT232RL breakout board asa programmer.
    • noleds - this is the same as default but without LEDs.
    • hwspi - pinout for use with MPSSE chips (FT2232, FT4232, FT232H), usesthe same pins as hardware SPI. Note that hardware SPI capability is notused, just the same pinout is used for convenience. This pinout can be usedwith adapters like TIAOTUMPA.The pinout is as follows: CS - DBUS3, CLK - DBUS0, MOSI -DBUS1, MISO - DBUS2.
    • hwspi+leds - this is the same as hwspi but adds read and write LEDs onDBUS4 and DBUS5 pins respectively.

For other options see misc/transport-options.md.

Communication speed

Reading or writing a 1 MB flash on HC-05 module takes about 60 seconds. DumpingHC-05 PS keys takes about 40 seconds.

Running csr-spi-ftdi in a virtual machine slows things down presumably due tolatency added by USB virtualization. E.g. running csr-spi-ftdi under VirtualBoxslows transactions down about 4x times.

Useful commands

These commands should be executed from directory where BlueSuite is installedor this directory should be in your PATH.

  • Display chip ID, this is also a quick communication test:

  • Display chip ID, firmware version and flash size:

  • Save firmware backup (only for chips with flash, backup will include PSkeys):

    This creates two files, csr-fw-backup.xpv and csr-fw-backup.xdv.

  • Flash firmware from files csr-fw.xpv and csr-fw.xdv:

  • Collect debug logs:

  • Lower SPI speed 5 times:

  • Save chip settings (PS Keys) backup into csr-pskeys.psr:

  • Merge some settings from pskeys.psr to the chip:

  • Backup whole EEPROM image to a file:

  • Restore EEPROM contents from backup file:

Troubleshooting

  • Decreasing SPI speed using SPIMAXCLOCKoption may help in caseof communication failures.
  • Unable to start read (invalid control data) errors are usually harmless,since read attempts are retried. If You've got a pile of theese errors andprogrammer doesn't work - check connections, voltage levels, try to lower SPIconnection resistor values or connecting ~ 1nF capacitors in parallel withresistors. Decreasing SPI speed using SPIMAXCLOCKoption mayalso help.
  • WARNING: Attempt %d to read sector %d warnings are also harmless if they arenot result in error.
  • Couldn't find LPT port error means You use spilpt.dll driver instead ofusbspi.dll. Try importingmisc/spi-set-usb-transport.reg or adding-trans 'SPITRANS=USB SPIPORT=1' option on command line.
  • Lost %d of %d bytes of data in transit or ERROR: Download Failed, Sector %d - probably an indication of counterfeit FT232RL plugged into ASM1042 USB3.0 controller. Try to replug into other controller. See Counterfeit FT232RLchips.

Building for Wine

Building Wine DLL on 32-bit Debian/Ubuntu Linux

Install build tools:

Install development libraries: Patternmaker 7.5 serial.

Build with command:

Building Wine DLL on 64-bit Debian/Ubuntu Linux

Install build tools:

Install 32 bit stuff:

Build with command:

Installing

Install CSR BlueSuite in Wine. Find all instances of usbspi.dll installed andmove them out of the way:

Install Wine dll into the Wine libraries directory:

Alternately You can specify location of the .dll.so file in WINEDLLPATHenvironment variable, see wine(1) man page for details.

Building DLL for Windows

Cross-compiling DLL for Windows on Debian/Ubuntu using MinGW

Install MinGW cross-development environment:

Download precompiled libusb forwindows and extract it to thelibusb directory:

Build libftdi from source:

Build with command:

Bugs

  • See Issues on github to listcurrent bug reports or to report a bug.
  • Current implementation of 1.4 SPI API (used in BlueSuite starting from 2.4)is based on a wild guess and is just a wrapper around 1.3 functions. Itdoesn't support multiple programmers connected at the same time and maycontain other bugs.

Thanks

  • This project is a derivative of Frans-Willem Hardijzer's reverse-engineeredspilpt.dll drivers;
  • Thanks to unicorn from http://www.nebo-forum.kiev.ua/ for the idea of aDLL for Wine.
  • Thanks to all the Contributors!

Related projects

  • LPT programmer and general info by RobinGross;
  • Reverse-engineered SPILPT driver + Arduino SPILPTdriver by Frans-WillemHardijzer, for Windows;
  • USBSPI programmer based on CSR BC3 chipusing original firmware by Jernej Škrabec;
  • USBSPI programmer software for Linux(git mirror) by Jernej Škrabec;
    • USBSPI protocolanalysis;
    • Using USBSPI onLinux;
  • Remote debugging protocolimplementaton (gitmirror)
  • USBSPI programmer based on StellarisLaunchpad by Frans-WillemHardijzer, for Windows;
  • See a list of related projects in the wiki.

Other sources of information

  • BlueSuite 2.5.0 'source code'https://www.csrsupport.com/document.php?did=38692 - it doesn't containsource code for SPI drivers but at least development header files inCSRSource/result/include/ are of some help. It seems CSR removed it fromdownload.
Comments are closed.