I want to thank Guylhem, who allowed the content copy under the terms that his name and a link to his page must be given. But I don't know about the PSKEY author's part - so it could be illegal.
To toggle your chip between BCSP UART and H4 UART mode, type the following commands:
for bcsp 230400 : 1f9 0001 191 03b0 0006 00fa 0014 0004 0000 0004 001e 0064 000a
for h4 115200 : 1f9 0003 191 01d8 00a8 00fa 0014 0004 0000 0004 001e 0064 000a
If you do not type both, you may kill your chip. If you do a mistake, you may kill it too. If you assume a wrong baud rate, idem. Even if you do everything right, something may happen!
So you have been warned if anything bad happens to you.
From PSKEY author:
CSR chips have a "persistent store" (PS) that stores the configuration parameters. The content of the persistent store is retained when the device is powered off. The persistent store is made of keys: each key is identified by a 16-bit number and stores a variable number of words (16-bit numbers). In order to toggle BCSP and change the initial baudrate, two keys have to be changed: - key 1f9 (also known as PS_KEY_HOST_INTERFACE). This key has length 1 and the possible values are: 0001 for BCSP 0002 for USB 0003 for H4 any other values are untested and better avoided -key 191 (also known as PS_KEY_UART_CONFIG). This key has length 10. *the first word is the speed the chip communicates to the serial port, in units of 244.140625 bit/s (!). This means that: 01d8 (decimal 472) means 472*244.140625=approx 115200 bit/s 03b0 (decimal 944) means 944*244.140625=approx 230400 bit/s 0ebe (decimal 3774) means 3774*244.140625=approx 921600 bit/s 1000 (decimal 4096) means 4096*244.140625=exactly 1000000 bit/s *the second word configures chip's serial comm settings. The bits mean 0: =0 means 1 stop bit, =1 means 2 stop bits 1: =0 means no parity, =1 means parity bit enabled 2: =0 means odd parity, =1 means even parity 3: =0 means HW flow control (RTS/CTS) disabled, =1 means HW flow control enabled 4: =0 means automatic RTS disabled, =1 means automatic RTS enabled 5: RTS position 6: =0 means TX zero disabled, =1 means TX zero enabled 7: =0 means non-BCSP disabled, =1 means non-BCSP enabled 8: rate delay LSB position 9: rate delay MSB position 10-15: don't know, better leave them to 0 For BCSP, this word should be 0006, binary 0000000000000110: this means 1 stop bit, even parity, no RTS/CTS, non-BCSP disabled For H4, this word should be 00a8, binary 0000000010101000: this means 1 stop bit, no parity, RTS/CTS enabled, non-BCSP enabled *the other 8 words should be left as they are. In most cases they are 00fa 0014 0004 0000 0004 001e 0064 000a. In order to be able to use a CSR chip with BlueZ, BCSP must be disabled. This means that -key 1f9 should be set to 0003 -key 191 should be set to 01d8 00a8 00fa 0014 0004 0000 0004 001e 0064 000a (the last 8 words should retain thir old values) This will also tell that, at power-up, the UART speed is 115200 b/s (the initial 01d8 in key 191). This is compatible with hciattach's "csr" option, that expects a speed of 115200 at startup, then changes it in csr() function with a CONFIG_UART packet. If you want a different initial speed, replace 01d8 with the appropriate value, then use "any" option instead of "csr" in hciattach. !!!!!!!!!IMPORTANT!!!!!!!!!!! When toggling BCSP, FIRST change BOTH keys 1f9 and 191, THEN reset the chip (changes only take effect after a reset), otherwise the chip could become unusable!!!!!!!!!!!!! CSR provides a Windows tool called "PS Tool" to alter the PS keys. For Linux, I wrote a program derived from OpenBT stack that reads and changes PS keys (not publicly downloadable yet). However, the best solution would be to integrate the functionality in the official OpenBT. Don't know if it is possible, since the user-space version of OpenBT seems severely unmaintained. Fabrizio Gennari Philips Research Monza via G.Casati 23, 20052 Monza (MI), Italy tel. +39 039 2037816, fax +39 039 2037800