Git Product home page Git Product logo

csr-spi-ftdi's Introduction

Table of Contents

CSR BlueCore USB SPI programmer/debugger

Download Release

This is USB SPI programmer and debugger for CSR BlueCore bluetooth chips, based on FTDI FT232R USB to UART converter chip. Programmer hardware can be made using simple FT232RL breakout board, or built as a dedicated programmer using included schematic. Programmer driver works by replacing USB SPI programmer driver, usbspi.dll, in CSR applications and is currently ported to Linux/Wine and 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 the datasheet.
  • Some chips (like CSR8645) share SPI pins with PCM function. For such chips to be accessible via SPI, SPI_PCM# pin should be pulled up to I/O voltage supply through a 10K resistor.
  • On some chips SPI_DEBUG_EN (on BC6140) or SPI_PIO# (on CSR1010) pin should be pulled up directly to I/O voltage supply to enable SPI port.
  • BlueCore chips which integrate battery charger has charger configuration enabled by default. Such chip may shutdown shortly after power on if You don't connect charged battery. Battery charger configuration is defined in PSKEY_USR0 and can be changed using appropriate Configuration Tool or PSTool. See sample PSR files for disabling charger in misc/.
  • BlueCore 2 chips (such as BC212015) are not supported in BlueSuite 2.4 and above. It's also reported that to flash/dump these chips it's required to lower SPI speed. So for BC2 chips it's recommended to use BlueSuite 2.3 and set SPIMAXCLOCK=200 option.

Programmer hardware

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

Using FT232RL breakout board as a programmer

You can build a simple programmer using popular FT232RL breakout boards (search Ebay 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 levels while CSR chips require 3.3V or 1.8V I/O level. You may supply appropriate VCCIO to FTDI chip or use logic level converter if levels don't match. See description of VCCIO pin in FTDI chip datasheet for details.

This is a default pinout:

Signal FT232RL pin FTDI pin name FTDI GPIO bit CSR pin
CS# 2 DTR# D4 SPI_CS#
CLK 3 RTS# D2 SPI_CLK
MOSI 6 RI# D7 SPI_MOSI
MISO 9 DSR# D5 SPI_MISO
TX 1 TXD Not used UART_RX
RX 5 RXD Not used UART_TX
LED_RD 10 DCD# D6 --
LED_WR 11 CTS# D3 --
GND 7, 18, 21 GND -- GND

SPI and UART BlueCore pins could be connected directly to FTDI pins, but I'd recommend 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 limiting resistors (330 Ohm works fine) to the appropriate FTDI pins. Wire LED anodes to FTDI 3V3 pin.

Other pinouts can be specified with FTDI_PINOUT Option.

Don't power BlueCore chip from FT232R internal 3.3V regulator! It's current draw 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 in hardware/ subdirectory.

Counterfeit FT232RL chips

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

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

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

Some versions of Windows FTDI driver tend to intentionally brick 1st generation counterfeit chips by setting their PID to 0x0000. There are unbrick (2) and protect procedures, 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 at https://www.csrsupport.com/PCSW. Older versions of BlueSuite can be found at https://www.csrsupport.com/PCSWArchive. Access to these pages requires registration.

Installing prebuilt drivers

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

Installing on Ubuntu/Debian Linux

Install Wine:

sudo apt-get install wine

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

find ~/.wine -iname usbspi.dll -exec mv {} {}.orig \;

Copy usbspi.dll.so to Wine system directory:

sudo cp -p lib-wine-linux/usbspi.dll.so /usr/lib/i386-linux-gnu/wine/

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

Allow yourself access to FTDI device

cat <<_EOT_ | sudo tee -a /etc/udev/rules.d/99-ftdi.rules
# FT232R
SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="0660", GROUP="plugdev"
_EOT_

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. in C:\Program Files (x86)\CSR\BlueSuite 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". This will install generic libusb-compatible driver for your FTDI chip. There is a tutorial 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 You need to select USB SPI transport. Use -TRANS "SPITRANS=USB SPIPORT=1" option for command line tools. Import misc/spi-set-usb-transport.reg to change the default.

Options

Csr-spi-ftdi driver supports several options that can be set as environment variables 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 when read or write verification fails. Some commands are always executed at 20 kHz.
  • FTDI_LOG_LEVEL - sets csr-spi-ftdi log level, available log levels: quiet, err, warn, info, debug. Adding a ,dump option provides hex dumps 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 to standard output, or to stderr to log to standard error stream. Default: stderr.
  • FTDI_INTERFACE (since version 0.5.1) - specify interface on multi-interface chips (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 as a programmer.
    • noleds - this is the same as default but without LEDs.
    • hwspi - pinout for use with MPSSE chips (FT2232, FT4232, FT232H), uses the same pins as hardware SPI. Note that hardware SPI capability is not used, just the same pinout is used for convenience. This pinout can be used with adapters like TIAO TUMPA. 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 on DBUS4 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. Dumping HC-05 PS keys takes about 40 seconds.

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

Useful commands

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

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

      BlueFlashCmd.exe -chipver
    
  • Display chip ID, firmware version and flash size:

      BlueFlashCmd.exe -identify
    
  • Save firmware backup (only for chips with flash, backup will include PS keys):

      BlueFlashCmd.exe -dump csr-fw-backup
    

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

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

      BlueFlashCmd.exe csr-fw
    
  • Collect debug logs:

      BlueFlashCmd.exe -trans "SPIDEBUG=ON \
          SPIDEBUG_FILE=csr-spi-debug.log FTDI_LOG_LEVEL=debug,dump \
          FTDI_LOG_FILE=ftdi-debug.log" -identify
    
  • Lower SPI speed 5 times:

      BlueFlashCmd.exe -trans SPIMAXCLOCK=200 -dump csr-fw-backup
    
  • Save chip settings (PS Keys) backup into csr-pskeys.psr:

      pscli.exe dump csr-pskeys.psr
    
  • Merge some settings from pskeys.psr to the chip:

      pscli.exe merge pskeys.psr
    
  • Backup whole EEPROM image to a file:

      e2cmd.exe dump eeprom-backup.hex
    
  • Restore EEPROM contents from backup file:

      e2cmd.exe download eeprom-backup.hex
    

Troubleshooting

  • Decreasing SPI speed using SPIMAXCLOCK option may help in case of 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 and programmer doesn't work - check connections, voltage levels, try to lower SPI connection resistor values or connecting ~ 1nF capacitors in parallel with resistors. Decreasing SPI speed using SPIMAXCLOCK option may also help.
  • WARNING: Attempt %d to read sector %d warnings are also harmless if they are not result in error.
  • Couldn't find LPT port error means You use spilpt.dll driver instead of usbspi.dll. Try importing misc/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 USB 3.0 controller. Try to replug into other controller. See Counterfeit FT232RL chips.

Building for Wine

Building Wine DLL on 32-bit Debian/Ubuntu Linux

Install build tools:

sudo apt-get install -y build-essential

Install development libraries:

sudo apt-get install -y wine-dev libc6-dev libstdc++-dev libftdi-dev

Build with command:

make -f Makefile.wine all

Building Wine DLL on 64-bit Debian/Ubuntu Linux

Install build tools:

sudo apt-get install -y build-essential gcc-multilib g++-multilib

Install 32 bit stuff:

sudo apt-get install -y wine-dev:i386 libc6-dev-i386 libstdc++-dev:i386 libftdi-dev:i386

Build with command:

make -f Makefile.wine all

Installing

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

find ~/.wine -iname usbspi.dll -exec mv {} {}.orig \;

Install Wine dll into the Wine libraries directory:

sudo make -f Makefile.wine install

Alternately You can specify location of the .dll.so file in WINEDLLPATH environment 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:

sudo apt-get install -y mingw-w64 cmake

Download precompiled libusb for windows and extract it to the libusb directory:

wget https://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.20/libusb-1.0.20.7z
7z x -olibusb libusb-1.0.20.7z

Build libftdi from source:

wget http://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.2.tar.bz2
tar xjvf libftdi1-1.2.tar.bz2
cd libftdi1-1.2
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-i686-w64-mingw32.cmake \
    -DLIBUSB_INCLUDE_DIR=../libusb/include/libusb-1.0 \
    -DLIBUSB_LIBRARIES="-L../../libusb/MinGW32/static -lusb-1.0" \
    -DCMAKE_INSTALL_PREFIX=../libftdi1 .
make all install
cd ..

Build with command:

make -f Makefile.mingw all

Bugs

  • See Issues on github to list current 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. It doesn't support multiple programmers connected at the same time and may contain other bugs.

Thanks

Related projects

Other sources of information

  • BlueSuite 2.5.0 "source code" https://www.csrsupport.com/document.php?did=38692 - it doesn't contain source code for SPI drivers but at least development header files in CSRSource/result/include/ are of some help. It seems CSR removed it from download.

csr-spi-ftdi's People

Contributors

frans-willem avatar lorf avatar tom-van avatar zougloub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csr-spi-ftdi's Issues

Issue with the FT232RL ("Error detecting chip type...")

Hello everybody!
I'm getting an issue with the Blue Flash saying the following message:
"Error detecting chip type (Unable to start read (invalid control data)).
Select a SPI transport to attemp reconnect."

This is what I have done/find out so far:

  • I've already try using the BlueSuite 2.5 and 2.6.2, both end in the same issue;

  • Tried a setup with external psu (5V@2A cellphone charger) and shared GND;

  • Did the wiring with and without resistors;

  • I'm pretty sure my ftdi chip is a counterfit one;

  • Tried the Blue Suite tools on two different computers (WIN 7 & WIN10);

  • Tried using 2 bluetooth modules I have (HC-05, HC-06), both with the BC417 143BGC K415AP;

  • The markings on my ftdi chip are: 1119-C GND82401 FT232RL (On the Blue Flash it appears as FT232R A500C697);

  • The drivers were installed sucessfully and I didn't found any issue on device manager;

  • Double checked the wiring;

  • Both bluetooth modules are working fine;

  • Tried slowing down the clock to 100kHz;

All my tries ended in the same way with the same error message stated earlier in this post.

Both BlueFlashCmd.exe -chipver & BlueFlashCmd.exe -identify have failed as can be seen on the logs below;

Any ideas to solve this?

Thank you guys!

Here are my logs:

BlueFlashCmd.exe -chipver

blueflashcmd, version 2.5.0.93 Release
Copyright (C) 2002-2012, Cambridge Silicon Radio Ltd.

17:46:46.929617: all:spi.c:567:spi_init: csr-spi-ftdi 0.5.3-a5, git rev 1f342f2, libftdi 1.4-unknown
17:46:47.304387: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.304387: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.306386: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.306386: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.309384: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.309384: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.313382: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.313382: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.318379: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.318379: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.321377: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.321377: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.324375: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.324375: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.327373: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.327373: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.330371: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.330371: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.333368: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.333368: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.338366: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.338366: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.342364: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.342364: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.345362: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.345362: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.348360: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.348360: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.351358: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.351358: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.354357: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.354357: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.357354: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.357354: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.360353: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.360353: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.363351: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.363351: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.366348: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.366348: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.369347: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.369347: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.373349: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.373349: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.376345: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.376345: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.379339: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.379339: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.382339: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.382339: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.385337: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.385337: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.387336: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.387336: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.390334: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.390334: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.393332: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.393332: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.396331: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.396331: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.399329: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.399329: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.402326: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.402326: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.405325: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.405325: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.408323: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.408323: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.410322: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.410322: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.413320: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.413320: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.416318: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.416318: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.419316: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.419316: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.422314: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.422314: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.426312: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.426312: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.430309: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.430309: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.433306: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.433306: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.436306: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.436306: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.439304: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.439304: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.442302: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.442302: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.445301: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.445301: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.448298: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.448298: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.451297: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.451297: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.454295: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.454295: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.457292: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.457292: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.461291: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.461291: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.464288: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.464288: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.467287: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.467287: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.471282: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.471282: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.474282: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.474282: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.477280: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.477280: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.480279: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.480279: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.482277: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.482277: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.485285: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.485285: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.488273: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.488273: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.491272: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.491272: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.494270: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.494270: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.498268: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.498268: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:46:47.501266: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:46:47.501266: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)

ERROR: Error detecting chip type (Unable to start read (invalid control data))

*** FTDI Statistics ********************************************************
csr-spi-ftdi version: 0.5.3-a5 (git rev 1f342f2)
libftdi version: 1.4-unknown
Time open: 0.23 s
Time in xfer: 0.00 s (0.00% of open time)
Reads: 64 (128 bytes, 2.00 bytes avg read size)
Writes: 64 (192 bytes, 3.00 bytes avg write size)
Xfer data rate: 1.#R KB/s (320 bytes in 0.00 s)
IOPS: 1.#R IO/s (128 IOs in 0.00 s)
FTDI chip: FT232R (3), buffer size: 384 bytes
FTDI stats: 1.#R xfers/s (1.#R short reads/s,
135 xfers/5 short reads in 0.00 s,
1.00 xfers/IO, 81.00 bytes/xfer)
SPI max clock: 1000 kHz, min clock: 1000 kHz, slowdowns: 0


Failed

BlueFlashCmd.exe -identify

blueflashcmd, version 2.5.0.93 Release
Copyright (C) 2002-2012, Cambridge Silicon Radio Ltd.

17:50:53.524485: all:spi.c:567:spi_init: csr-spi-ftdi 0.5.3-a5, git rev 1f342f2, libftdi 1.4-unknown
17:50:53.872271: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.872271: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.875271: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.875271: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.877269: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.877269: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.880268: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.880268: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.883266: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.883266: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.886264: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.886264: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.890262: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.892258: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.895259: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.896256: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.898257: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.898257: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.902253: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.902253: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.906252: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.907251: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.912248: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.912248: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.916246: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.918242: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.920243: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.921240: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.925240: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.928238: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.931234: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.931234: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.936581: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.937233: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.940235: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.941229: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.944232: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.946225: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.949226: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.949226: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.953222: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.953222: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.957219: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.959216: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.964215: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.964215: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.967213: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.970210: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.973207: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.973207: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.976213: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.979205: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.983202: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.983202: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.986204: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.989199: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.995198: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:53.995198: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:53.998194: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.001190: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.005188: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.005188: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.008188: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.008188: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.016183: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.016183: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.019181: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.021179: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.027175: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.027175: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.031173: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.031173: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.034170: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.034170: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.036173: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.037168: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.040167: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.042166: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.046163: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.047165: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.050161: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.050161: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.053159: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.053159: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.057158: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.058156: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.061154: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.061154: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.064152: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.064152: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.067150: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.068151: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)
17:50:54.073147: err:basics.cpp:461:spifns_sequence_read: Control data: 0xff 0xff
17:50:54.074145: err:basics.cpp:483:spifns_sequence_read: Unable to start read (invalid control data)

ERROR: Error detecting chip type (Unable to start read (invalid control data))

*** FTDI Statistics ********************************************************
csr-spi-ftdi version: 0.5.3-a5 (git rev 1f342f2)
libftdi version: 1.4-unknown
Time open: 0.23 s
Time in xfer: 0.00 s (0.00% of open time)
Reads: 47 (94 bytes, 2.00 bytes avg read size)
Writes: 47 (141 bytes, 3.00 bytes avg write size)
Xfer data rate: 1.#R KB/s (235 bytes in 0.00 s)
IOPS: 1.#R IO/s (94 IOs in 0.00 s)
FTDI chip: FT232R (3), buffer size: 384 bytes
FTDI stats: 1.#R xfers/s (1.#R short reads/s,
116 xfers/20 short reads in 0.00 s,
1.00 xfers/IO, 69.00 bytes/xfer)
SPI max clock: 1000 kHz, min clock: 1000 kHz, slowdowns: 0


Failed

FTDI reading 0xdeaf always

Hello,

I hit a wall with a CSR8675, every read returns:

[2164504327]read ff9a  Failed
10:00:26.478968: dump:basics.cpp:470:spifns_sequence_read: read16(addr=0xff9a, len16=1) (size=2, crc32=0xf4e7e8bb):
  0000  af de                                            ..
[2164504376]read ff9a deaf
10:00:26.525843: dump:basics.cpp:470:spifns_sequence_read: read16(addr=0xff9a, len16=1) (size=2, crc32=0xf4e7e8bb):
  0000  af de                                            ..
[2164504425]read ff9a deaf

There is also an issue with clocks (clocks on FTDI is always x4 the speed regardless of the parameter -20kHz = 80kHz-) and last versions (0.5.2 and 0.5.3 doesnt work with FT232RL, it seems the pin doesn't match the <0.5.1).

In any case, the problem checked with the oscilloscope is the reading of 0xdeaf.

Any idea why this is happening ?

Thank you.

Unhandeld exception when communicating with HC05

Hello,

I tried this code a year ago and it worked good. Now I wanted to use it again with the same setup but it always breaks when Blueflash communicates with the Module. I tried it on two different PCs with wine-1.6.2, windows7 and windows10 and tried the prebuild version and build it myself. It is always the same behaviour. I also tried different usb Ports.

TLDR:
OS: Xubuntu with wine-1.6.2 or windows7 or windows10
Bluesuite: 2.4
usbspi.dll: prebuild-0.5.1, prebuild-0.5.2 and ownbuild-0.5.2 (for all OSs)
FTDI-CHIP: probably real FT232RL
Problem: Bluesuite crashes when using the usbspi.dll.

Here is the stacktrace I got from wine when using the prebuild version of the dll.

Unhandled exception: page fault on read access to 0x45455246 in 32-bit code (0x7e089124).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
EIP:7e089124 ESP:0033d4fc EBP:0033d544 EFLAGS:00010202( R- -- I - - - )
EAX:45455246 EBX:7e098000 ECX:798ef768 EDX:00000000
ESI:0041a5c0 EDI:00000001
Stack dump:
0x0033d4fc: 7e0938f6 7e092f89 0000016d 00000004
0x0033d50c: 7e0930c3 00000001 00000010 45455246
0x0033d51c: 0000d6c0 00000000 5a7d53b4 00010b9d
0x0033d52c: 00000000 00000000 00000000 00000000
0x0033d53c: 7e098000 7e098000 0033d594 7e087897
0x0033d54c: 00000001 00000010 45455246 0000d6c0
Backtrace:
=>0 0x7e089124 spi_xfer+0xfe() in usbspi (0x0033d544)
1 0x7e087897 in usbspi (+0x7896) (0x0033d594)
2 0x7e087fcc spifns_stream_sequence+0xe2() in usbspi (0x0033d5d4)
0x7e089124 spi_xfer+0xfe in usbspi: movzwl 0x0(%eax),%eax
Modules:
Module Address Debug info Name (65 modules)
PE 340000- 35f000 Export pttransport
PE 400000- 412000 Deferred blueflash
PE 10000000-10023000 Deferred flash
PE 5d360000-5d370000 Deferred mfc80deu
PE 78130000-781cb000 Deferred msvcr80
PE 781d0000-782e0000 Deferred mfc80
ELF 7b800000-7ba54000 Deferred kernel32
-PE 7b810000-7ba54000 \ kernel32
ELF 7bc00000-7bcda000 Deferred ntdll
-PE 7bc10000-7bcda000 \ ntdll
ELF 7bf00000-7bf04000 Deferred
PE 7c420000-7c4a7000 Deferred msvcp80
ELF 7e071000-7e09d000 Dwarf usbspi
-PE 7e080000-7e09d000 \ usbspi
ELF 7e09d000-7e192000 Deferred comctl32
-PE 7e0a0000-7e192000 \ comctl32
ELF 7e1ec000-7e22d000 Deferred usp10
-PE 7e1f0000-7e22d000 \ usp10
ELF 7e278000-7e2ad000 Deferred uxtheme
-PE 7e280000-7e2ad000 \ uxtheme
ELF 7e2ad000-7e2b4000 Deferred libxfixes.so.3
ELF 7e2b4000-7e2c0000 Deferred libxcursor.so.1
ELF 7e2c0000-7e2d3000 Deferred libxi.so.6
ELF 7e2d3000-7e2d7000 Deferred libxcomposite.so.1
ELF 7e2d7000-7e2e4000 Deferred libxrandr.so.2
ELF 7e2e4000-7e2f0000 Deferred libxrender.so.1
ELF 7e2f0000-7e2f7000 Deferred libxxf86vm.so.1
ELF 7e2f7000-7e2fb000 Deferred libxinerama.so.1
ELF 7e2fb000-7e302000 Deferred libxdmcp.so.6
ELF 7e302000-7e306000 Deferred libxau.so.6
ELF 7e306000-7e32c000 Deferred libxcb.so.1
ELF 7e32c000-7e477000 Deferred libx11.so.6
ELF 7e477000-7e48c000 Deferred libxext.so.6
ELF 7e48e000-7e4b2000 Deferred imm32
-PE 7e490000-7e4b2000 \ imm32
ELF 7e4b4000-7e541000 Deferred winex11
-PE 7e4c0000-7e541000 \ winex11
ELF 7e669000-7e693000 Deferred libexpat.so.1
ELF 7e693000-7e6dc000 Deferred libfontconfig.so.1
ELF 7e6dc000-7e707000 Deferred libpng12.so.0
ELF 7e707000-7e722000 Deferred libz.so.1
ELF 7e722000-7e7d2000 Deferred libfreetype.so.6
ELF 7e7fa000-7e870000 Deferred shlwapi
-PE 7e810000-7e870000 \ shlwapi
ELF 7e870000-7e91f000 Deferred msvcrt
-PE 7e880000-7e91f000 \ msvcrt
ELF 7e945000-7ea5c000 Deferred gdi32
-PE 7e950000-7ea5c000 \ gdi32
ELF 7ea5c000-7ebaa000 Deferred user32
-PE 7ea70000-7ebaa000 \ user32
ELF 7ebaa000-7ec16000 Deferred advapi32
-PE 7ebc0000-7ec16000 \ advapi32
ELF 7ec16000-7ec29000 Deferred libnss_files.so.2
ELF 7ec29000-7ec36000 Deferred libnss_nis.so.2
ELF 7ec36000-7ec51000 Deferred libnsl.so.1
ELF 7ef83000-7efd8000 Deferred libm.so.6
ELF 7efe7000-7f000000 Deferred version
-PE 7eff0000-7f000000 \ version
ELF f7355000-f735f000 Deferred libnss_compat.so.2
ELF f7361000-f7366000 Deferred libdl.so.2
ELF f7366000-f751c000 Deferred libc.so.6
ELF f751c000-f7539000 Deferred libpthread.so.0
ELF f7561000-f7716000 Dwarf libwine.so.1
ELF f7717000-f773c000 Deferred ld-linux.so.2
ELF f773f000-f7740000 Deferred [vdso].so
Threads:
process tid prio (all id:s are in hex)
0000000e services.exe
0000001e 0
0000001d 0
00000014 0
00000010 0
0000000f 0
00000012 winedevice.exe
0000001c 0
00000019 0
00000017 0
00000013 0
0000001a plugplay.exe
00000020 0
0000001f 0
0000001b 0
0000002b explorer.exe
0000002d 0
0000002c 0
0000002e (D) C:\Program Files (x86)\CSR\BlueSuite 2.4\BlueFlash.exe
0000002f 0 <==
System information:
Wine build: wine-1.6.2
Platform: i386 (WOW64)
Host system: Linux
Host version: 4.4.0-112-generic

Connect 2 modules with each other in transceiver mode

Hi There,

I was trying to program my module in a way by which I can listen and transmit to another module at the same time. The goal is to build 2 motorcycle headsets which can connect to each other, listen as well as transmit when Push to talk button is pressed. I have tried doing my own bit of research and programming but it has rendered unhelpful. I have looked at the documentation for CSRA chips and can see that they support full-duplex. This functionality is also seen when I pair the chip to my phone but I'm trying to achieve this functionality by pairing 2 modules with each other

If anyone here could help me out I would be grateful. Any help is again highly appreciated.

Invalid stream

Hello!
So i was flowing a guide to do this hack to a ps2 controller i did everything but now i get an error saying "invalid stream select a SPI transport to attempt reconnect"
Can someone help me?
my hc-05 is powered by an arduino mega and i have 100 ohms resistors from the DTR,R1,RTS,DSR to the hc-05

i have windows 10 is that a problem?
untitled

What's Correct Wiring?

This issue gives a wiring that's different that the default ReadMe wiring.

Which is the correct one to use? I'm on BlueSuite 2.6.x, csr-spi-ftdi-0.5.3-a9, FTDI232RL (must be clone, since DSR pin is marked "RSD"), CSR8645.

Neither work for me. Getting "error detecting chip (Unable to start read (invalid control data))"

Both mention "SPI_CS#" pin on the CSR8645, but my 8645 has no such "SPI_CS#" pin. Does it mean the "CSB" pin?

The alternate wiring uses the Tx and Rx pins. Should those be connected to Tx and Rx pins on the CSR8645?

The CSR8645 won't even power up using alternate wiring (note, i'm powering the CSR with an external power supply, not the power output of the FTDI board).

FTDI pin name CSR pin name
CTS CSB
Tx SPI_CLK
Rx MOSI
RTS MISO
  • I used pull-up resistor on SPI_PCM. Not using any other resistors.
  • Tried with FTDI jumper in both 5v and 3.3v positions (tho' i think it's irrelevant, since i'm powering the CSR with a separate power supply).

thx

CSR 8645 UART

According to the documentation CSR 6845 has a SERIAL (UART) port. How activate it to control the module via UART (playback control)?

ADK3.5 BlueFlash.exe Segmentation fault and can't found device.

$ uname -a
Linux localhost.localdomain 3.19.3-200.fc21.x86_64 #1 SMP Thu Mar 26 21:39:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Wine-gdb> c
Continuing.
12:51:01.883: warn:basics.cpp:242:spifns_enumerate_ports: No FTDI device found, calling port enum callback (1, "No FTDI device found", 0x33e67c)
fixme:msvcrt:__clean_type_info_names_internal (0x3c04e0) stub
fixme:msvcrt:__clean_type_info_names_internal (0x3d9450) stub
12:51:02.063: warn:basics.cpp:242:spifns_enumerate_ports: No FTDI device found, calling port enum callback (1, "No FTDI device found", 0x33dc2c)
fixme:msvcrt:__clean_type_info_names_internal (0x3d04e0) stub
fixme:msvcrt:__clean_type_info_names_internal (0x3d9450) stub
12:51:03.661: warn:basics.cpp:242:spifns_enumerate_ports: No FTDI device found, calling port enum callback (1, "No FTDI device found", 0x33df6c)
fixme:msvcrt:__clean_type_info_names_internal (0x3d04e0) stub
fixme:msvcrt:__clean_type_info_names_internal (0x3d9450) stub
12:51:05.364: err:spi.c:120:spi_err: No FTDI device found.

Program received signal SIGSEGV, Segmentation fault.
0x003443d0 in ?? ()
Wine-gdb> bt
#0  0x003443d0 in ?? ()
#1  0x7df2f599 in spi_open () from /lib/wine/spilpt.dll.so
#2  0x7df2c53d in spifns_open_port () from /lib/wine/spilpt.dll.so
#3  0x7df2c8b5 in spifns_sequence_setvar_spiport ()
   from /lib/wine/spilpt.dll.so
#4  0x7df2cf22 in spifns_sequence_setvar () from /lib/wine/spilpt.dll.so
#5  0x7df2dcd4 in spifns_stream_sequence () from /lib/wine/spilpt.dll.so
#6  0x0034dbfb in ?? ()
#7  0x01f268ff in ?? ()
Backtrace stopped: Cannot access memory at address 0x6aec8b59

So I make the following change.

diff --git a/Makefile.wine b/Makefile.wine
index 22e08b7..17bc634 100644
--- a/Makefile.wine
+++ b/Makefile.wine
@@ -1,7 +1,7 @@
 TARGET_PLATFORM ?= linux

-WINE_LIB ?=    /usr/lib/i386-linux-gnu/wine
-I386_LIB ?=    /usr/lib/i386-linux-gnu
+WINE_LIB ?=    /usr/lib/wine
+I386_LIB ?=    /usr/lib/
 STDCXX_LIB ?=  /usr/lib/gcc/i686-linux-gnu/$(WINEGCC_VER)

 WINEGCC_VER := $(shell env LC_ALL=C winegcc -v 2>&1 | awk '/^gcc version/ {print $$3}' | cut -d. -f1,2)
@@ -16,9 +16,9 @@ LDFLAGS +=    -shared -m32 -static-libgcc -s
 #64 bit winegcc tries to link with 64 bit wine libs even if -m32 is specified.
 # Direct it to the 32bit libraries.
 LDFLAGS += -L$(WINE_LIB) -L$(I386_LIB) -L$(STDCXX_LIB)
-#LDLIBS=   -lftdi -lusb
+LDLIBS=    -lftdi1 -lusb
 # Build with static versions of libraries
-LDLIBS +=  $(I386_LIB)/libftdi.a $(I386_LIB)/libusb.a
+#LDLIBS += $(I386_LIB)/libftdi.a $(I386_LIB)/libusb.a

 MAKEFILE = $(firstword $(MAKEFILE_LIST))

diff --git a/spi.c b/spi.c
index 1308615..225b71f 100644
--- a/spi.c
+++ b/spi.c
@@ -1,4 +1,4 @@
-#include <ftdi.h>
+#include <libftdi1/ftdi.h>
 #include <stdint.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -10,6 +10,7 @@
 #endif
 #include <sys/time.h>
 #ifdef __WINE__
+#include <unistd.h> // usleep
 #include "wine/debug.h"
 #endif

@@ -117,8 +118,8 @@ static void spi_err(const char *fmt, ...) {
     va_start(args, fmt);
     vsnprintf(buf, sizeof(buf), fmt, args);
     LOG(ERR, buf);
-   if (spi_err_cb)
-        spi_err_cb(buf);
+   //if (spi_err_cb)
+    //    spi_err_cb(buf);
     va_end(args);
 }

No Segmentation fault. but can't find my device.
The shell output

fixme:winediag:start_process Wine Staging is a testing version containing experimental patches.
fixme:winediag:start_process Please report bugs at http://bugs.wine-staging.com (instead of winehq.org).
fixme:service:scmdatabase_autostart_services Auto-start service L"Parspi" failed to start: 3
12:59:01.009: warn:basics.cpp:242:spifns_enumerate_ports: No FTDI device found, calling port enum callback (1, "No FTDI device found", 0x33e67c)
fixme:msvcrt:__clean_type_info_names_internal (0x3c04e0) stub
fixme:msvcrt:__clean_type_info_names_internal (0x3d9450) stub
fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (0x33dbe8 1 C) semi-stub
fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (0x33da18 1 C) semi-stub
12:59:01.226: warn:basics.cpp:242:spifns_enumerate_ports: No FTDI device found, calling port enum callback (1, "No FTDI device found", 0x33dc2c)
fixme:msvcrt:__clean_type_info_names_internal (0x5404e0) stub
12:59:03.903: warn:basics.cpp:242:spifns_enumerate_ports: No FTDI device found, calling port enum callback (1, "No FTDI device found", 0x33ae4c)
fixme:msvcrt:__clean_type_info_names_internal (0x5404e0) stub
fixme:msvcrt:__clean_type_info_names_internal (0x3d9450) stub
12:59:05.008: warn:basics.cpp:242:spifns_enumerate_ports: No FTDI device found, calling port enum callback (1, "No FTDI device found", 0x33df6c)
fixme:msvcrt:__clean_type_info_names_internal (0x3d04e0) stub
fixme:msvcrt:__clean_type_info_names_internal (0x3d9450) stub
12:59:06.257: err:spi.c:120:spi_err: No FTDI device found
12:59:08.539: warn:basics.cpp:242:spifns_enumerate_ports: No FTDI device found, calling port enum callback (1, "No FTDI device found", 0x33ae4c)
fixme:msvcrt:__clean_type_info_names_internal (0x3d04e0) stub
fixme:msvcrt:__clean_type_info_names_internal (0x3d9450) stub

ADK does not work with driver

The new ADK Configuration Tool (for qcc300x) seems to load the driver but then refuses to work with it.
Could be that Qualcomm added something to the driver that is missing here.

It looks like ahi.dll & testengine.dll is responsible for getting devices; needs to be reverse engineered :P

Programming CSR 8645 over SPI using Raspberry PI GPIO

Hi,
I'm trying to read the firmware of CSR 8645 over SPI using Raspberry PI GPIO. The connection between the CRS 8645 and Raspberry PI should be right since if I used the file ./spidev_test -D /dev/spidev0.0 from here https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md, I receive back the correct sequence of bit.
Hence, I read this http://members.efn.org/~rick/work/rpi.csr.html and I used the provided C file, but it did not work for me. I tried to modify some parameters in the file according to different pin out of CSR 8645 with respect to HC05 BC4 series chip without success.
Finally, I found this useful guide. I would avoid to buy a dedicated programmer if I can. I followed the hint "For such chips to be accessible via SPI, SPI_PCM# pin should be pulled up to I/O voltage supply through a 10K resistor". However, for me the behaviour is the opposite. If I connect SPI_PCM# called SPI_EN pin to +VCC through a resistor and I use ./spidev_test -D /dev/spidev0.0 I cannot receive back the correct sequence of bit, it seems to work with opposite logic.
My CSR 8645 is contained in a BTM98 v3.1 chip and I'm doing reverse engineering since I do not have the datasheet. I have the datasheet of BTM98 V2.0 and I supposed the same pin out configuration.
Any suggestion?

Thank you

P.S. By using the C code of http://members.efn.org/~rick/work/rpi.csr.html I get this
sudo ./csrbt -y 150000 -s 500000 -o read -f dump1.bin Reading: addr_offset = 0x0 p_data->offset = 0x0 can't send spi message: Invalid argument
while with verbose option
sudo ./csrbt -y 150000 -s 500000 -o read -f dump1.bin -v Set realtime priority Thread Attribute init Thread set schedule policy Thread set inherited schedule Poll thread created spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz) Reading: addr_offset = 0x0 p_data->offset = 0x0 gpio now 0x21200900 0x00024009 gpio now 0x24200900 0x00024024 Reading: addr_offset = 0x400 p_data->offset = 0x0 gpio now 0x21200900 0x00024009 gpio now 0x24200900 0x00024024 Reading: addr_offset = 0x800 p_data->offset = 0x0
..
gpio now 0x21200900 0x00024009 gpio now 0x24200900 0x00024024

Invalid control data...

Hi, can i get an hint maybe whats going wrong maybe

image
image
Yep the cables are servo cables but i didnt find other connectors this evening 😄

blueflashcmd unable to reset device.

This feels really similar to the issue just closed. I'm pretty sure the CSR side of things works as I've tested it with a regular windows setup and a CSR programmer.

I seem to be able to do chipver until the cows come home without problems. I've slowed the clock down considerably which hasn't made much of a change.

The code for spifns_bluecore_xap_stopped() is strange:

/* Check the response to read command */
/* From CSR8645 datasheet: "When CSR8645 BGA is deselected (SPI_CS# = 1),
 * the SPI_MISO line does not float. Instead, CSR8645 BGA outputs 0 if the
 * processor is running or 1 if it is stopped. */
if (xferbuf[0])
    return SPIFNS_XAP_STOPPED;
return SPIFNS_XAP_RUNNING;

but afaict xferbuf[0] is read right after spi_xfer_begin(). That has the chip deselected for most of it, but ends by selecting it. So perhaps it only works most of the time due to a race condition?

The setup I'm running is under wine. I've looked at most of this on a scope and on a salea, but haven't zoomed in on the reset sequence yet.

Figured I'd send this if anything here seemed useful already.

Replacement for DK-USB-SPI-10225

Would this firmware flashed in an FTDI be a potential replacement for CSR's USB SPI flasher?
I'm currently buying these modules to flash CSR1010 chips, but they seem to be really fragile, not well protected and I've already burned quite a lot of them. This is why such a replacemente would be ideal.
Sorry to be asking this as an issue, but I couldn't find a discussion board on this repo.
Thanks in advance!

Wifi driver for joystick

hi , sorry to open a ticket for my question, but I have some questions that your probably advise is really appreciated
Actually I've been trying to send some game keys, base on HID protocol to the computer by wifi link(ESP8266). PC computer with OS like Microsoft Windows instantly make "HID-compliant game controller" driver with typical USB joystick , my question is, how make specific driver which is shows up same as "HID-compliant game controller" but listen to specific IP address instead of USB
tnx

Scambio di due costanti

E' necessario correggere un errore minore riscontrato durante il testing del programma:

  1. costanti relative alla disambiguazione da invertire (498-504 di match)

v 0.5.3-a5 and Wine 3.0-1ubuntu1 problem

Having seg fault errors with the newest version of your driver. Older 0.5.2 works just fine. Have not tried the versions in between. Wine 32 bit v 3.0-1ubuntu1 on Linux Mint 19 Mate, CSR BlueSuite v2.6.4.

History:
Had been using the 0.5.2 driver on several versions of Linux Mint over a few years. Always used Bluesuite v2.6.4 and Wine v 1.6.? Once I got it setup it always worked. Just used PSTool, BlueFlashCmd, and pscli from CSR.

I then decided to upgrade from Mint 18.3 to 19 to get all the cool new bells and whistles. The upgrade went fine except for wine. The default install for wine on 19 wants to install the 64 bit version of wine. BlueSuite does not like that version it turns out. After several tries I found a combination that allowed the CSR software to install under wine.
FYI the wine install:
sudo dpkg --add-architecture i386 && apt update
sudo apt install wine-stable wine32 wine64 libwine libwine:i386 fonts-wine
WINEARCH=win32 WINEPREFIX=~/.wine wine wineboot (creates the .wine folder for 32 bit apps)

After that when installing Bluesuite it did complain about something missing from winbind so I installed winbind from the package manager and reran the Bluesuite install and got no more error.

I then did your procedure to install your usb driver v 0.5.3-a5. When I ran both PSTool or pscli they recognize the FT232R chip but would seg fault almost immediately. BlueFlashCmd did not seg fault but did not seem to recognize the chip.
Then just for giggles I tried the driver version of yours I have always been using and it works just fine.

I hope this helps others reduce the time it takes to getting this to work.
Thanks for your work on this driver. I can still be Windows free! - for the most part.

CH341A Support?

Hello! This question is a bit off topic, but I was curious to know if the same procedure for the using BlueSuit with FT232RL can also be done with the CH341A chip too? The CH341A breakout board that I'm using can be found here . Both the CH341A and FT232RL pinouts appear to be similar. I have all of the drivers and software required for the operation of the CH341A and I have BlueSuit 2.6.6. I just don't know what to do next. I am trying to connect to a CSR8630 chip to the CH341A board via USB-SPI interface. I'd appreciate it if anyone could help me out here! ;)

Blueflash.exe doesn't open when I've connected the FTDI to HC-05

When I launch blueflash.exe with ftdi connected but HC-05 not connected, the program shows my FTDI as "FT232R alcdut1" I've double checked my connections and made sure proper supply is fed to HC05 module.
is it possible that my ftdi board is the problem here?

btw, my hc05 module came with a breakout board..

"Error: Failed to Stop Processor"

Hello, I have a project called USB Typewriter, where I turn old typewriters into computer keyboards. I'm developing a new Bluetooth application and while I think your project is ingenious, I am having a problem with implementing it.

I'm trying to flash a HC-05 board using an FT232RL breakout from Sparkfun and BlueLab 4.1.

But here is my problem:
The only communication I am able to do is reading the Firmware ID from the chip using the Blue Flash tool. Blue Flash says "Processor Running," but when I click the "Stop Processor" button, it returns "Error: Failed to Stop Processor." So, I cannot read or flash the chip.

I am sure that I followed the README very closely: SPI is connected through 1K resistors, with GND and VCCIO directly connected to my target board's 3.3V supply (not to the breakout board supply). There are no other devices on the SPI bus. The DLLs have been replaced with the API 1.3 win32 file you included, and I installed the LibusbK driver using the Zadig tool. The programmer appears in my CSR applications as "FTDI USB UART AH02LW22". Even so, all of the CSR tools I have tried either freeze up or give a "could not stop processor" error.

Looking with my oscilloscope, I see the the same routine repeating: two wakeup pulses are sent, then 5ms later a read is executed. (I recognize this pattern from looking at Frans-Willem's Arduino code). However, there is no useful activity on MISO -- it stays low for the first read (returning 0x00), then it goes high and returns 0xFF for every wakeup/read after that.

Do you know what could be causing this problem? Could it be something with the reset pin (there is no mention of reset in the README, so I hold reset high). Or could I just have a dud HC-05 board? I thought I'd ask you before I went and tried to de-solder it from my board (not fun). Any help you could give would be extremely appreciated.

Hardware question

Hello,

I have question abiut F1 500mA PTC.

I can not find any kind of sutch element. Can You give me an example of it??

Best regards,
SileliS

Unable to start read (invalid control data)

Hey,

I'm trying to dump (and flash) my HC-05 with the HID firmware. I followed the "Installing on Windows" and used the prebuild dll (v1.4 + BlueLab41) and it spits this out:

D:\Downloads\CSR\BlueLab41>BlueFlashCmd.exe -TRANS "SPITRANS=LPT SPIPORT=1" -DUMP OriginalFirmware
CSR BlueFlash Tool (Command Line) BlueSuite-2.1.1-Release

Copyright (C) 2002-2008 Cambridge Silicon Radio Ltd.

11:41:04.462: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.480: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.496: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.511: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.527: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.559: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.592: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.608: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.624: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.658: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.704: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
11:41:04.739: err:basics.cpp:554:spifns_sequence_read: Unable to start read (invalid control data)
...

My wiring corresponds to "Using FT232RL breakout board as a programmer" and looks like:
wiring

Could you give me a starting point to check whats wrong? Wiring? FTDI? HC-05? Software? Driver?

Thank you very much!

Avrcp protocol

I am looking for information about AVRCP protocol, I would like to receive information about the name of the current song and the status of play / pause. How to get them and communicate with csr8645

Bluecore can't connect to CSRA64215

Hi @lorf , I am hoping you can tell me where I am going wrong!

Connections:

CSRA64215 Resistor FTDI BATT
GND GND
3.3V 3.3V
SPI_EN 10KΩ 3.3V
SPI_MOSI 220KΩ RI
SPI_CLK 220KΩ RTS
SPI_CSB 220KΩ DTR
SPI_MISO 220KΩ DSR

I am using BlueSuite 2.6.x and my env is Windows 10, I am using the generic fake FTDI with pinout from eBay and I am using libusbK with your .dll replacing the one within BlueSuite.

BlueSuite detects the FTDI interface but when attempting to connect I get "Error detecting chip type (unable to start read (invalid control data))"

Any input would be appreciated.

Please, help to flash CSR BC212015 via SPI (FTDI)

Hi!
Have trouble with bluetooth module D-Link DBT-120 on CSR BC212015 chip. After some manipulations it not work in HCI mode. (some Pskey are incorrect).
I have FTDI board (FT232R chip with full pins availible). On BT module i see 4 pins SPI port: MOSI, MISO, CS, CLK. I solder them to FTDI board, install Bluesuite 2.5.8, change spilpt.dll to correct api 1.4 version for win, install libusbK drivers for FTDI, using zadig tool, connect FTDI with solder BT module to USB, run Pstool, but it could not communicate with chip. I tried launch dfuwizard and blueflash and blueflash in cmd (with "-lpt 1" command it says error with libusb blabla...), but can't flash my chip or erase it.
Please, help! What should i do?
Thank You!
PS: I have 2 notebooks: win 7 (x86) and win 7 (x64)

Just a question

Does it work for CSR8645 and CSRA64215? Will it work with a USB to TTL converter or even an arduino?

Addressing more that one of these on a single computer.

I put together one of these and it works great under Linux/Wine. Thank you very much. I have an application that will require two of these tied to one computer. Is there a way to address each individually with the various CSR tools?

invalid control data after reset the chip

Thank you for your driver. I have successful program the BlueCore 3 chip but after reset some persistent store using PSTool, BlueFlash and PSTool now cannot detect the chip and only show the error.

err:basics.cpp:481:spifns_sequence_read: Unable to start read (invalid control data)
ERROR: Error detecting chip type (Unable to start read (invalid control data))
debug_log.zip

FT230X Support

Hi,

FT230X support appears to be commented out from the source code. Is there a reason? With the FT233R chips broken bit bang modes, FT230X seems like a really good replacement.

Thanks

RN-42 Firmware Truncation

When I chose the RN-42 Firmware available here https://drive.google.com/file/d/0B2oHzSfiLL8PdU1tWmhvS19EWG8/view

Blueflash Reports that the image size is bigger than flash size, and the firmware gets truncated.

"Image size is greater than Flash Size. Image will be truncated"

The upload happens, but PS Tool does not list the data from the persistent storage.
image size

If anyone has seen this issue happen, please advise how to solve it.

Having trouble programming a CSR8635 Wireless Stereo Bluetooth 4.0 Audio Receiver

Hello! hoping someone can help me with this.

I am attempting to program one of these boards https://www.ebay.com.au/itm/CSR8635-Wireless-Stereo-Bluetooth-4-0-Audio-Receiver-Board-USB-Amplifier-Module-/122023226338?hash=item1c6926abe2
the pinout of which can be found here https://cdn.discordapp.com/attachments/473739346961498134/492328381614915595/HTB11N6wHpXXXXb5XXXXq6xXFXXXI.jpg

I am currently using a cheap 232 FTDI adaptor and it seems no matter what i do i just get the common "Unable to start read (invalid control data)" error. I have double, triple, quadruple checked the spi connections. ground is connected to the ftdi ground and i have tried connecting vbat directly to 5V and through a diode to limit the voltage to ~4.4v I have also connected power_en directly to vbat.
I have also tried this with a board that i have been using as an audio receiver. connected gnd and spi connections, powered it on and... nothing just "Unable to start read (invalid control data)"

I should mention i am on linux running BlueFlashCmd.exe under wine. I have also tried BlueFlash.exe it detects the FTDI adaptor but when i select it the application crashes.

Edit: i also have one of these but as far as i can tell blue flash does not even detect it https://www.ebay.com.au/itm/CSR-USB-SPI-ISP-Bluetooth-USB-SPI-Download-Module-Chip-Programmer-Debugger-New/322814866732?hash=item4b2943f52c:g:viYAAOSwwpdW8-V-

Edit2: after playing around with things a bit more i got the CRS SPI adaptor working in a vm but when i try to use it i get "Error detecting chip type (Read failed on USB-SPI). Select a SPI transport to attempt reconnect."

Altering XDV before flashing

Not necessarily a bug in the driver but does anybody know here if the XDV file has any type of checksum or signature? We need to alter the XDV file to fine tune a firmware we own but if we modify the original XDV, BlueFlash is uploading some type of default data and skipping our XDV altogether. The original XDV works just fine.

I can't find any information for the chip CSR 5 on this regard.

Any help will be appreciated!

Chip select and SPI clock not working correctly

Hello,

I got an issue with communicating with a CSR8645 using a FTDI232R (A94FFLDD) and BlueSuite 2.5.8. I can't get any proper communication and the following error is always returned:

"20:49:41.151676: err:basics.cpp:481:spifns_sequence_read: Unable to start read (invalid control data)"

Because of this I decided to measure the SPI interface using an oscilloscope which resulted in the following signals:

SPI

The chip select is low most of the time and only high for a short pulse in the beginning of an SPI frame. Also the SPI frequency is always ~77kHz independed from which value I set via command line.
Do you know what might cause this issue and how I can solve this?
Thank you very much in advance!

Kind regards,

kcl_93

wine 4.0 changes

Using Linux Mint 19.1 Mate and it updated wine from v 3 to v 4 and that broke PStools, pscli, and BlueFlashCmd. I discovered how to fix it however.
In Wine 3 we needed to put your usbspi.dll.so into location /usr/lib/i386-linux-gnu/wine/. In Wine 4 That directory is not used. The directory you need to put your driver in is /opt/wine-stable/lib/wine/.
Once you do that it all works again. Did this on 2 different machines with 2 different adapters and both work.

CSR8645 dead by 3.3V?

I wanted to program my CSR8645 using a FT232RL chip with 3.3V.
I didn't manage to get a connection ("Unable to start read (invalid control data)").
However the red leds stopped working. I don't know why.

Do you know how to check if the module is alive or dead?

Thanks for your ideas!

Invalid Control Data on any chip.

Hello, I have problem, I try to re-program CSR8645 and HC05 and nether of these work. I try on XP, 7 and 10 but it has no effect. Always got error like this: Unable to start read (Invalid Control Data)

Counterfeit problem with latest driver and the DSP

Hi guys, I'm here to say that I got a counterfeit ftdi chip and it has issues with drives after 0.5.1 and this is solvable by just using an older driver, probably because of the bit bang issue that counterfeits have. But, it doesn't work with the UFE(universal front end), that is used to change the DSP parameters(equalizer, CVC, noise cancelling, etc...), I've saw a guy complaining about some functions that are on the UFE driver and that are missing on the FTDI driver.

Was this(DSP comm) corrected on the latter version?
Is there anyway to patch 0.5.3 for counterfeits?

I'm using a counterfeit FTDI232RL and CSR8635 breakout boards.

Fake HC-05/HC-06 modules with BlueCore3 chips relabeled as BC417

I have a problem, please advise: I have exactly an HC-05 board from Ali Express, which I want to upgrade to RN42 firmware. I got connected to HC-05 (LED blinking when "processor running"), I dumped backup firmware and settings, uploaded RN42 firmware, clicked "Start Processor" and got "Processor Running" but LED doesn't blink, it's off. When I try to connect with PSTool I get an error: "unable to find entries in the look-up table on chip". When I flash backup firmware back everything works again, but when I flash RN-42 - same thing, can't get to settings, LED not blinking, but can start and stop processor, get firmware version, verify etc. Any advice? Is it driver-related or hardware-related? Anyone had similar issue? Thanks.

FT2232HL not init

Hello, i'm trying connect to csr8645 via ft2232hl board (0x0403:0x6010). I followed your indications, install libusbk drivers, etc, also i activated ftdi debug, but i don't know what it's happening. Could you help me? I paste the debug stdout on windows 7, i also tested in windows xp, but the problem it's the same.

OUTPUT:

C:\Program Files (x86)\CSR\BlueSuite 2.6.2>blueflashcmd -trans "SPITRANS=USB SPI
PORT=1 SPIDEBUG=ON SPIDEBUG_FILE=C:\csr-debug.log FTDI_LOG_LEVEL=debug,dump FTDI
_LOG_FILE=C:\csr-spi-ftdi-debug.log" -identify
blueflashcmd, version 2.6.2.632 Release
Copyright Cambridge Silicon Radio Limited 2002 - 2015.

13:21:50.962166: info:basics.cpp:103:spifns_init: Detected SPI API version 0x010
4, using version 0x0104
13:21:50.963167: debug:spi.c:525:spi_init: spi_nrefs=0, spi_dev_open=0
13:21:50.963167: all:spi.c:534:spi_init: csr-spi-ftdi 0.5.0, git rev 92e495e

13:21:50.981168: debug:spi.c:487:spi_enumerate_ports: find all: 0x0403:0x6001
13:21:50.998169: debug:spi.c:487:spi_enumerate_ports: find all: 0x0403:0x0000
13:21:51.014169: debug:spi.c:487:spi_enumerate_ports: find all: 0x0403:0x6010
13:21:51.032170: err:spi.c:505:spi_enumerate_ports: FTDI: ftdi_usb_get_strings()
failed: libusb_get_string_descriptor_ascii() failed
13:21:51.033171: debug:spi.c:567:spi_deinit: spi_nrefs=1, spi_dev_open=0
13:21:51.034171: debug:basics.cpp:137:spifns_get_last_error
13:21:51.034171: debug:basics.cpp:147:spifns_clear_last_error
#13:21:51.034171: debug:spi.c:567:spi_deinit: spi_nrefs=0, spi_dev_open=0

ERROR: FTDI: ftdi_usb_get_strings() failed: libusb_get_string_descriptor_ascii()

failed

Failed

Thank you very much for you help.

Different pinout on Bluetooth Module and FT232 not being recognized.

According to your pinout ( https://github.com/lorf/csr-spi-ftdi/blob/master/README.md#using-ft232rl-breakout-board-as-a-programmer ) I don't know how to plug the pins in the CSR8635.
csr 8635 modul 2

This is my pinout and in my TDA7492P module there are 7 pads right under the BT module. From left to right: SPI_PCM, GND, VBAT, MOSI, CLK, CSB (?), MISO.

How should I connect those pads?

Also my FT232 module is not being recognised. Downloaded MProg to look if the ID was erased to 0000 but it's still 6001 and it seems to recognise it. But PSTools can't find it. Installed drivers from zadig's program like you recommended.

Where can I get CSR DSP Equalizer configurator?

I'm trying to configure the internal Kalimba DSP in CSR8635 but I can't seem to find the software to configure it. The datasheet says it works with CSR8600 Rom Series configurator.
Does anyone have a copy or knows where I can get one in my hands?

Resetting XAP

Hello,

I am trying to reconfigure a CSR8635. I have a cheap (probably counterfeit) FT232 module and I create 1.8v for the VCCIO with a voltage divider (I don't have a 1.8V regulator).

I've connected everything, started the programmer and this is what I get for identify:


C:\Users\nodep>blueflashcmd -identify
blueflashcmd, version 2.3.0.15
Copyright (C) 2002-2010, Cambridge Silicon Radio Ltd.
17:47:53.273164: all:spi.c:534:spi_init: csr-spi-ftdi 0.5.0, git rev 92e495e

Resetting XAP

And it just hangs there. I waited more then 10 minutes. Sometimes I get several lines of:


17:48:08.526063: err:basics.cpp:446:spifns_sequence_read: Unable to start read (invalid control data)
17:48:08.531068: err:basics.cpp:446:spifns_sequence_read: Unable to start read (invalid control data)
17:48:08.536697: err:basics.cpp:446:spifns_sequence_read: Unable to start read (invalid control data)

The funny thing is that the SPI is very busy all this time. I've checked both with a scope and logic analyzer.

I could send you a Saleae capture of the traffic on the SPI, if that helps.

Thank you!

Programming tool for QCC3003

Hello.
Im trying to program a QCC3003 but it seems like bluesuite doesn't support it ( "Device Platform CSR86xx")
What are you supposed to use for QCC3003? And does it support FTDI?
I got some QCC ADK software from a chinese website but if i add the DLL it still doesn't regonize my flasher.
I have a defect CSR SPI programmer which the ADK did detect but it didn't detect the FTDI

No FTDI device found / FT232R USB

I am a bit hesitant to submit this is a bug, because it might be personal incompetence - but I cannot get the CSR Tools (BlueSuite 2.6.6, tried older 2.5 before) to work.

CMD Output is:

22:20:15.530489: all:spi.c:567:spi_init: csr-spi-ftdi 0.5.3-a5, git rev 1f342f2, libftdi 1.4-unknown
22:20:15.920445: err:spi.c:709:spi_open: No FTDI device found

ERROR: Couldn't find SPI port

Failed

-> since it says "csr-spi-ftdi 0.5.3" the library seems to be correctly installed

I am using an FTDI232, zadig replaced the driver without any problem - It is listed in device manager as "FT232R USB UART" under "libusbK USB Devices" - so to my understanding it should at least be discovered?

Thanks for helping!

Where can you get Bluesuite now?

Seems like bluesuite downloads has been removed from the CSR website, at least for me anyways.

Is there an alternative place to download it?

Wrong wiring table in readme?

Hi!
I am trying to hack my JBL Flip 4, which has CSR8675 inside.

I have soldered up an ftdi thing according to this table I found in readme:

Signal FT232RL pin FTDI pin name FTDI GPIO bit CSR pin
CS# 2 DTR# D4 SPI_CS#
CLK 3 RTS# D2 SPI_CLK
MOSI 6 RI# D7 SPI_MOSI
MISO 9 DSR# D5 SPI_MISO

PSTool says "error detecting chip type".
After a few checks and such, I started probing with scope to see what's going on. And found out, that neither of the FTDI pins I soldered wires to give off any signals. Instead, I'm seeing what looks like CLK on Tx, and what looks like MOSI on Rx, and what looks like CS on CTS. Now assuming I got these pins sorted out, which one should I use as MISO?

CSR8645 RGB

Hello guys,

I just working on my project of headphones with CSR8645. I wondered If I could use 3 leds output for controling single RGB led. I saw that CSR supports it. But I cant find anything in config tool (everywhere just 2 leds). Thanks for help!

Can read chipver, but identify and other blueflashcmd commands fail

I'm using an FT232RL based FTDI adapter called the USB BUB to communicate with a HC-05 module. I'm pretty sure I have it wired up properly as I am getting some promising debug output from chipver, but it's inconsistent.

blueflashcmd ... chipver

debug output:

[**********][Timestamp since epoch]
[1808698280][TID: 247208][SID: 01]
[1808698280]read ff9a 4826
[1808698286]read ff9a 4826
[1808698287]Core type bluecore
[1808698287]FF9A=0x4826 FE81=0x00FF
[1808698287]Chip type = 4, Family = 1, DisplayName="BC4-EXT (cyt)"
[1808698287]Pre BC7
[1808698287]bluecore_chip

console out:

blueflashcmd, version 2.6.0.450 Release
Copyright Cambridge Silicon Radio Limited 2002 - 2015.

16:29:02.243486: all:spi.c:558:spi_init: csr-spi-ftdi 0.5.1, git rev b60665a
GBL_CHIP_VERSION = 0x4826
Result:
*** FTDI Statistics ********************************************************
csr-spi-ftdi version: 0.5.1 (git rev b60665a)
Time open: 0.03 s
Time in xfer: 0.01 s (34.38% of open time)
Reads: 4 (8 bytes, 2.00 bytes avg read size)
Writes: 2 (6 bytes, 3.00 bytes avg write size)
Xfer data rate: 1.24 KB/s (14 bytes in 0.01 s)
IOPS: 545.00 IO/s (6 IOs in 0.01 s)
FTDI chip: FT232R (3), buffer size: 384 bytes
FTDI stats: 1181.00 xfers/s (90.00 short reads/s,
13 xfers/1 short reads in 0.01 s,
2.00 xfers/IO, 37.00 bytes/xfer)
SPI max clock: 25 kHz, min clock: 25 kHz, slowdowns: 0

Success

However it sometimes fails altogether

debug:

[**********][Timestamp since epoch]
[1807884228][TID: 243504][SID: 01]
[1807884228]read ff9a Failed
[1807884232]read ff9a Failed
[1807884236]read ff9a Failed
[1807884239]read ff9a Failed
...
[1807884337]read ff9a Failed
[1807884342]read ff9a 4c00
...
[1807884421]read ff9a Failed
[1807884425]read ff9a Failed

console:

16:15:28.195339: all:spi.c:558:spi_init: csr-spi-ftdi 0.5.1, git rev b60665a
16:15:28.378221: err:basics.cpp:479:spifns_sequence_read: Unable to start read (invalid control data)
16:15:28.382224: err:basics.cpp:479:spifns_sequence_read: Unable to start read (invalid control data)
...
16:15:28.570839: err:basics.cpp:479:spifns_sequence_read: Unable to start read (invalid control data)
16:15:28.574843: err:basics.cpp:479:spifns_sequence_read: Unable to start read (invalid control data)
blueflashcmd, version 2.6.0.450 Release
Copyright Cambridge Silicon Radio Limited 2002 - 2015.

ERROR: Error detecting chip type (Unable to start read (invalid control data))

Failed
*** FTDI Statistics ********************************************************
csr-spi-ftdi version: 0.5.1 (git rev b60665a)
Time open: 0.21 s
Time in xfer: 0.00 s (2.34% of open time)
Reads: 63 (126 bytes, 2.00 bytes avg read size)
Writes: 62 (186 bytes, 3.00 bytes avg write size)
Xfer data rate: 60.94 KB/s (312 bytes in 0.00 s)
IOPS: 25000.00 IO/s (125 IOs in 0.00 s)
FTDI chip: FT232R (3), buffer size: 384 bytes
FTDI stats: 25600.00 xfers/s (0.00 short reads/s,
128 xfers/0 short reads in 0.00 s,
1.00 xfers/IO, 83.00 bytes/xfer)
SPI max clock: 50 kHz, min clock: 50 kHz, slowdowns: 0

I get this output from identify

debug:

[**********][Timestamp since epoch]
[1809817385][TID: 247924][SID: 01]
[1809817385]read ff9a 4826
[1809817389]read ff9a 4826
[1809817390]Core type bluecore
[1809817390]FF9A=0x4826 FE81=0x00FF
[1809817390]Chip type = 4, Family = 1, DisplayName="BC4-EXT (cyt)"
[1809817390]Pre BC7
[1809817390]bluecore_chip
[1809817394]write 006a 0003
[1809817397]write 006a 0003
[1809817397]write 006a 0003
[1809817397]write 006a 0003
[1809817398]write 006a 0003
[1809817409]write 006a 0003
[1809817409]write 006a 0003
[1809817409]write 006a 0003
[1809817409]write 006a 0003
[1809817418]write 006a 0003
[1809817422]read 0073 0082
[1809817424]read 0073 0082
[1809817426]read 0073 0082
[1809817428]read 0073 0082
[1809817430]read 0073 0082
[1809817432]read 0073 0082
[1809817434]read 0073 0082
[1809817436]read 0073 0082
[1809817438]read 0073 0082
[1809817440]read 0073 0082
[1809817442]verified write a000 0000
[1809817444]verified write a001 0000
[1809817446]verified write a002 00e0
[1809817450]read ffe9 0000
[1809817450]read ffe9 0000
[1809817450]verified read ffe9 0000
[1809817452]verified write ffe9 0054
[1809817454]verified write ffea 0000
[1809817458]read ff7e 0000
[1809817458]read ff7e 0000
[1809817458]verified read ff7e 0000
[1809817460]verified write ff7e 0000
[1809817462]verified write ffde 0000
[1809817466]read ffe8 0000
[1809817466]read ffe8 0000
[1809817466]verified read ffe8 0000
[1809817469]verified write ffe8 0000
[1809817471]verified write 0076 0002
[1809817471]write ff91 0005
[1809817474]verified write 0077 0001
[1809817477]verified write 006a 0000
[1809817479]read ff91 ffff
[1809817481]read ff91 0000
[1809817483]read ff91 0000
[1809817483]write 006a 0002
[1809817483]write 006a 0002
[1809817483]write 006a 0002
[1809817483]write 006a 0002
[1809817486]write 006a 0002
[1809817486]write 006a 0002
[1809817486]write 006a 0002
[1809817486]write 006a 0002
[1809817489]write 006a 0002
[1809817489]write 006a 0002
[1809817489]write 006a 0002
[1809817489]write 006a 0002
[1809817491]write 006a 0002
[1809817491]write 006a 0002
[1809817491]write 006a 0002
[1809817491]write 006a 0002
[1809817491]write 006a 0002
[1809817493]write 006a 0002
[1809817493]write 006a 0002
[1809817493]write 006a 0002
[1809817512]write 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
[1809817512]write 006a 0002
[1809817514]write 006a 0002
[1809817519]read ffeb 00ff
[1809817519]read ffeb 00ff
[1809817519]verified read ffeb 00ff
[1809817523]read ffec ffff
[1809817523]read ffec ffff
[1809817523]verified read ffec ffff
[1809817525]write ffe0 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
[1809817528]verified write ffeb 00ff
[1809817531]verified write ffec ffff
[1809817532]write f9c0 0009
[1809817532]write f9c0 0009
[1809817532]write f9c0 0000
[1809817532]write f9c0 0000
[1809817543]write f9c0 0000
[1809817547]write f9c0 0009
[1809817547]write f9c0 0009
[1809817547]write f9c0 0000
[1809817547]write f9c0 0000
[1809817560]write f9c0 0000
[1809817562]write 006a 0003
[1809817565]write 006a 0003
[1809817565]write 006a 0003
[1809817565]write 006a 0003
[1809817565]write 006a 0003
[1809817576]write 006a 0003
[1809817576]write 006a 0003
[1809817576]write 006a 0003
[1809817576]write 006a 0003
[1809817587]write 006a 0003
[1809817593]read 0073 Failed
[1809817596]read 0073 Failed
[1809817599]read 0073 Failed
...
[1809817940]read 0073 Failed
[1809817943]read 0073 Failed

console:

blueflashcmd, version 2.6.0.450 Release
Copyright Cambridge Silicon Radio Limited 2002 - 2015.

16:47:41.452445: all:spi.c:558:spi_init: csr-spi-ftdi 0.5.1, git rev b60665a
Resetting XAP
Identifying XAP
16:47:41.739729: err:basics.cpp:479:spifns_sequence_read: Unable to start read (invalid control data)
16:47:41.744225: err:basics.cpp:479:spifns_sequence_read: Unable to start read (invalid control data)
16:47:41.747226: err:basics.cpp:479:spifns_sequence_read: Unable to start read (invalid control data)
...
16:47:42.098902: err:basics.cpp:479:spifns_sequence_read: Unable to start read (invalid control data)
16:47:42.102904: err:basics.cpp:479:spifns_sequence_read: Unable to start read (invalid control data)
16:47:42.106408: err:spi.c:118:spi_ftdi_xfer: FTDI: write data failed: [-1] usb bulk write failed
^C

But again, as with chipver, it sometimes completely fails without any successful reads/writes.

I'm hoping you can help shed some light on the issue.

For further reference, here are some bad photos of my wiring setup.

2016-08-08 16 14 18
2016-08-08 16 12 15

CSR8675 supporting ?

Hi, is it supports CSR8675 chips ? Is somebody had to deal with this chip ?
Any issues or hacks to perform configuration ?

Before buying trying to collect as much possible information, cause can't find any data about compatibility with this dll or configuration program.

Planing to use this lib with CSR86xx configuration tool.

Any help and ideas appreciate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.