This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/WL1831MOD: BTS_Configure_HCI_Baud_Rate() Result: -14

Part Number: WL1831MOD
Other Parts Discussed in Thread: AM3358, WL1831

Tool/software: Linux

I'm trying to validate the hardware on a custom board. 

I have a AM3358 connected to WL1831. 

When I run the LinuxDEVM I'm getting an error for SetDevicePower 1:

DEVM>1 1

BTPM_Initialize() Success: 0.
DEVM_RegisterEventCallback() Success: 5.
DEVM>10 1

echo 0 > /sys/class/gpio/gpio57/value
echo 1 > /sys/class/gpio/gpio57/value
echo 0 > /sys/class/gpio/gpio57/value
echo 1 > /sys/class/gpio/gpio57/value
BT COMM PORT (/dev/ttyS0): 5
Changing HCI baud rate to 3000000
Error: Could not change Bluetooth Chip's Baud Rate to 3000000. BTS_Configure_HCI_Baud_Rate() Result: -14.
echo 0 > /sys/class/gpio/gpio57/value
DEVM_PowerOnDevice() Failure: -4, Unknown Error.
Function Error.
DEVM>

The Linux console is /dev/ttyS1. 

  • I found that I was missing tibt from my device tree, so I added that, but it is still not working:

       tibt {
           compatible = "tibt";
            /*nshutdown_gpio: */
             /*0x64 ( PIN_OUTPUT_PULLUP | MUX_MODE7 )  */
             /* (U16) gpmc_a9.gpio1[25] */
            /* gpio1[0] is 32, 32+25=57 */
           nshutdown_gpio = <57>; 
           dev_name = "/dev/ttyS0";
           flow_cntrl = <1>;
           baud_rate = <3000000>;
       };
    

    error:

    DEVM>1 1
    
    BTPM_Initialize() Success: 0.
    DEVM_RegisterEventCallback() Success: 5.
    DEVM>10 1
    
    echo 57 > /sys/class/gpio/export
    sh: write error: Device or resource busy
    echo out > /sys/class/gpio/gpio57/direction
    echo 0 > /sys/class/gpio/gpio57/value
    echo 1 > /sys/class/gpio/gpio57/value
    echo 0 > /sys/class/gpio/gpio57/value
    echo 1 > /sys/class/gpio/gpio57/value
    BT COMM PORT (/dev/ttyS0): 1
    Changing HCI baud rate to 3000000
    Error: Could not change Bluetooth Chip's Baud Rate to 3000000. BTS_Configure_HCI_Baud_Rate() Result: -14.
    echo 0 > /sys/class/gpio/gpio57/value
    DEVM_PowerOnDevice() Failure: -4, Unknown Error.
    Function Error.
    DEVM>

  • Here is more information on my problem.

    bluetooth related config settings:

    CONFIG_BT=m
    CONFIG_BT_BREDR=y
    CONFIG_BT_RFCOMM=m
    # CONFIG_BT_RFCOMM_TTY is not set
    # CONFIG_BT_BNEP is not set
    # CONFIG_BT_HIDP is not set
    CONFIG_BT_HS=y
    CONFIG_BT_LE=y
    # CONFIG_BT_LEDS is not set
    # CONFIG_BT_SELFTEST is not set
    CONFIG_BT_DEBUGFS=y
    
    #
    # Bluetooth device drivers
    #
    # CONFIG_BT_HCIBTUSB is not set
    # CONFIG_BT_HCIBTSDIO is not set
    CONFIG_BT_HCIUART=m
    CONFIG_BT_HCIUART_H4=y
    # CONFIG_BT_HCIUART_BCSP is not set
    # CONFIG_BT_HCIUART_ATH3K is not set
    CONFIG_BT_HCIUART_LL=y
    CONFIG_BT_HCIUART_3WIRE=y
    # CONFIG_BT_HCIUART_INTEL is not set
    # CONFIG_BT_HCIUART_BCM is not set
    # CONFIG_BT_HCIUART_QCA is not set
    # CONFIG_BT_HCIUART_AG6XX is not set
    # CONFIG_BT_HCIUART_MRVL is not set
    # CONFIG_BT_HCIBCM203X is not set
    # CONFIG_BT_HCIBPA10X is not set
    # CONFIG_BT_HCIBFUSB is not set
    # CONFIG_BT_HCIVHCI is not set
    CONFIG_BT_MRVL=m
    CONFIG_BT_MRVL_SDIO=m

    I changed the baud rate to 115200 and now I get a different error.

    tibt device tree:

    tibt {
               compatible = "tibt";
               nshutdown_gpio = <57>;
               dev_name = "/dev/ttyS0";
               flow_cntrl = <1>;
               baud_rate = <115200>;
         }
    

    new error:

    DEVM>1 1
    
    BTPM_Initialize() Success: 0.
    DEVM_RegisterEventCallback() Success: 5.
    DEVM>10 1
    
    echo 57 > /sys/class/gpio/export
    sh: write error: Device or resource busy
    echo out > /sys/class/gpio/gpio57/direction
    echo 0 > /sys/class/gpio/gpio57/value
    echo 1 > /sys/class/gpio/gpio57/value
    echo 0 > /sys/class/gpio/gpio57/value
    echo 1 > /sys/class/gpio/gpio57/value
    BT COMM PORT (/dev/ttyS0): 1
    Error: Could not get the script version from the controller. TIBTS_Get_Script_Version() Result: -14.
    echo 0 > /sys/class/gpio/gpio57/value
    DEVM_PowerOnDevice() Failure: -4, Unknown Error.
    Function Error.
    DEVM>quit
    
    

  • The error is:

    Error: Could not get the script version from the controller. TIBTS_Get_Script_Version() Result: -14.

    The AM3358 seems to be communicating to the WiLink.

    signals from AM3358 perspective, from bottom: 1 yellow RX, 2 green TX, 3 blue CTS, 4 pink, RTS

  • Bill,

    Have you made sure to use the most recent version of the Service pack? The version number xxx.xxx.xxx of the TIInit_xxx.xxx.xxx.bts file is automatically detected in the BluetopiaLinux/BluetopiaPM by TIBTS_Get_Script_Version(), but only if the service pack is correctly loaded into the device.
  • dale said:
    Have you made sure to use the most recent version of the Service pack?

    I've been working with Bill on this issue.  He has the most recent version (SP 4.2).

    dale said:
    The version number xxx.xxx.xxx of the TIInit_xxx.xxx.xxx.bts file is automatically detected in the BluetopiaLinux/BluetopiaPM by TIBTS_Get_Script_Version(), but only if the service pack is correctly loaded into the device.

    The BT stack loads the SP, right?  There's not a step we're missing somewhere to "manually" load the Service Pack is there?

  • dale said:
    Bill,

    Have you made sure to use the most recent version of the Service pack? The version number xxx.xxx.xxx of the TIInit_xxx.xxx.xxx.bts file is automatically detected in the BluetopiaLinux/BluetopiaPM by TIBTS_Get_Script_Version(), but only if the service pack is correctly loaded into the device.

    I believe so. Is this the correct link? 

    what does 'correctly loaded to the device' mean? 

    I have the file at this location, is this right?

    # ls -l /lib/firmware/TIInit_11.8.32.bts
    -rwxr-xr-x 1 root root 74975 Jan 19 14:56 /lib/firmware/TIInit_11.8.32.bts

    this is the md5sum:

    # md5sum /lib/firmware/TIInit_11.8.32.bts
    b1e142773e8ef0537b93895ebe2fcae3 /lib/firmware/TIInit_11.8.32.bts
    #

  • Bill,

    That's correct, having the .bts file in that directory should automatically include it.

    Regarding making changes to the device tree (original post), we recommend changing the baud rate via the process outlined here. Please try removing tibt from the device tree and making the changes detailed in the wiki I've linked, then try running the demo again.

    In the meantime, I'll look for other possible reasons you're getting the error with TIBTS_Get_Script_Version().

  • dale said:

    Please try removing tibt from the device tree and making the changes detailed in the wiki I've linked, then try running the demo again.

    I have removed tibt from the device tree.

    here is my bt-en.sh:

    echo 54 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio54/direction
    echo 1 > /sys/class/gpio/gpio54/value
    echo "Done enabling BT"
    
    gpio="nshutdown_gpio=54"
    tty="tty=/dev/ttyS0"
    flow="flow_cntrl=1"
    baud_rate="baud_rate=3000000"
    mkdir /home/root/tibt
    echo $gpio > /home/root/tibt/config
    echo $tty >> /home/root/tibt/config
    echo $flow >> /home/root/tibt/config
    echo $baud_rate >> /home/root/tibt/config
    
    cp TIInit_11.8.32.bts /lib/firmware
    cd /mnt/storage/BluetopiaPM/bin
    ./SS1BTPM &
    ./LinuxDEVM

    here is the result of trying Initialize and SetDevicePower 1:

    DEVM>1 1
    
    BTPM_Initialize() Success: 0.
    DEVM_RegisterEventCallback() Success: 5.
    DEVM>10 1
    
    echo 54 > /sys/class/gpio/export
    sh: write error: Device or resource busy
    echo out > /sys/class/gpio/gpio54/direction
    echo 0 > /sys/class/gpio/gpio54/value
    echo 1 > /sys/class/gpio/gpio54/value
    echo 0 > /sys/class/gpio/gpio54/value
    echo 1 > /sys/class/gpio/gpio54/value
    BT COMM PORT (/dev/ttyS0): 1
    Changing HCI baud rate to 3000000
    Error: Could not change Bluetooth Chip's Baud Rate to 3000000. BTS_Configure_HCI_Baud_Rate() Result: -14.
    echo 0 > /sys/class/gpio/gpio54/value
    DEVM_PowerOnDevice() Failure: -4, Unknown Error.
    Function Error.
    DEVM>quit

  • Bill,

    I will try to reproduce the issue on my end and get back to you, do you get the same issue when trying to run other sample applications? As far as I know, the instructions listed in the wiki shouldn't cause any problems with getting the device initialized and the power on.
  • dale said:
    Bill,

    do you get the same issue when trying to run other sample applications?

    yes, here is output from SS1Tool

    # ./SS1Tool
    echo 0 > /sys/class/gpio/gpio54/value
    echo 1 > /sys/class/gpio/gpio54/value
    echo 0 > /sys/class/gpio/gpio54/value
    echo 1 > /sys/class/gpio/gpio54/value
    BT COMM PORT (/dev/ttyS0): 2
    Changing HCI baud rate to 3000000
    Error: Could not change Bluetooth Chip's Baud Rate to 3000000. BTS_Configure_HCI_Baud_Rate() Result: -14.
    echo 0 > /sys/class/gpio/gpio54/value
    The Bluetooth device is disabled and an error occurred while attempting enable it (-4).
    #

    are there any other tools you want me to run?

  • Everything looks fine with the bt-en.sh file, as long as it the correct permissions before running I don't see any reason why it would fail. As I continue to look for a software related reason, have you ensured that everything is correct with the custom board and hardware?
  • dale said:
    have you ensured that everything is correct with the custom board and hardware?

    Thanks for your help on this Dale.

    Brad Griffis has looked at the schematic for this board.

    I'm not sure what hardware issue that could cause this error:

    Error: Could not change Bluetooth Chip's Baud Rate to 3000000. BTS_Configure_HCI_Baud_Rate() Result: -14.

    I have a scope if you would like me to take any more measurements.

  • I fixed this problem.

    I noticed during kernel initialization that this message was printed:
    [ OK ] Started Serial Getty on ttyS0.

    I modified meta/conf/machine/(machine).conf and removed the all serial ports from this variable except for the one in use by the console:

    SERIAL_CONSOLES = "115200;ttyS1"
  • Good find, Bill!  Thanks for letting us know the root cause and for closing out the thread.  I'm sure this info will help others that bump into similar issues.