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.

WL1835MOD - unable to initialize stack

Other Parts Discussed in Thread: WL1835MOD, AM3354

We are using WL1835MOD in our design, with AM3354 processor.

After boot up, when we try to initialize the Bluetooth, we get the following error:

uim:@ st_uart_config
uim:Un-Installed N_TI_WL Line displine
uim:begin polling...
(stk) : timed out waiting for ldisc to be un-installed
[   81.077753] (hci_tty): st_register failed -22Stack Initialization on Port -1 0 (UART) Failed: -14.
Unable to open the stack.
However, we are able to use HCI commands to read the Bluetooth address, a snapshot of the messages we get in the prompt is as given below:

root@am335x-evm:/home/testApp# hciconfig
hci0: Type: BR/EDR Bus: UART
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
DOWN
RX bytes:0 acl:0 sco:0 events:0 errors:0
TX bytes:0 acl:0 sco:0 commands:0 errors:0

root@am335x-evm:/home/testApp# 1 hciconfig hci0 up
[ 62.093950] (stc): chnl_id list empty :4
[ 62.098164] (stk) : st_kim_start(stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

uim:read 1 f
[ 62.211629] (stc): st_tty_open rom install

uim:@ st_uart_config
uim: signa(stk) :line discipline installedl received, opening /dev/ttyO2
uim:@ set_baud_rate
uim:set_bau
[ 62.228093] (stk) :TIInit_11.8.32.btsd_rate() done
uim:Installed N_TI_WL Line displine
uim:begin polling...
(stk) :change remote baud rate command in firmware
[ 62.253307] (stk) :skipping the wait event of change remote baud[ 68.155328] (stc): add_channel_to_table: id 4
[ 68.159990] (stc): add_channel_to_table: id 2
[ 68.164585] (stc): add_channel_to_table: id 3
root@am335x-evm:/home/testApp# hciconfig hci0 up
hci0: Type: BR/EDR Bus: UART
BD Address: 1C:BA:8C:83:B1:39 ACL MTU: 1021:6 SCO MTU: 180:4
UP RUNNING
RX bytes:547 acl:0 sco:0 events:27 errors:0
TX bytes:411 acl:0 sco:0 commands:27 errors:0

We are able to detect other Bluetooth device and get its information using HCI command, the messages we get are as given below:

hcitool info 60:a4:4c:98:65: :88
Requesting information ...
BD Address: 60:a4:4c:98:65:88
Device Name: BT Test Device
LMP Version: 4.0 (0x6) LMP Subversion: 0x4103
Manufacturer: Broadcom Corporation (15)
Features page 0: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <sniff mode> <RSSI>
<channel quality> <SCO link> <HV2 packets> <HV3 packets>
<u-law log> <A-law log> <CVSD> <paging scheme> <power control>
<transparent SCO> <broadcast encrypt> <EDR ACL 2 Mbps>
<EDR ACL 3 Mbps> <enhanced iscan> <interlaced iscan>
<interlaced pscan> <inquiry with RSSI> <extended SCO>
<EV4 packets> <EV5 packets> <AFH cap. slave>
<AFH class. slave> <LE support> <3-slot EDR ACL>
<5-slot EDR ACL> <sniff subrating> <pause encryption>
<AFH cap. master> <AFH class. master> <EDR eSCO 2 Mbps>
<EDR eSCO 3 Mbps> <3-slot EDR eSCO> <extended inquiry>
<LE and BR/EDR> <simple pairing> <encapsulated PDU>
<err. data report> <non-flush flag> <LSTO> <inquiry TX power>
<EPC> <extended features>
Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00

When we try to use Linux SPP app to power up the device, we are not able to power up and we get the following error:

SPPM>1 1

BTPM_Initialize() Success: 0.
DEVM_RegisterEventCallback() Success: 5.
SPPM>16

Usage: StartDeviceDiscovery [Duration].
Function Error.
SPPM>16 0

Attempting to Start Discovery (INDEFINITE).
DEVM_StartDeviceDiscovery() Failure: -10035, Local Device is Powered Down.
Function Error.
SPPM>9 1

[ 87.519944] (hci_tty): inside hci_tty_open (ed285200, ed3763c0)
[ 87.526239] (stc): chnl_id 4 already registered
[ 87.530922] (hci_tty): st_register failed -114HCI_OpenDriver:: -4
DEVM_PowerOnDevice() Failure: -14, Unknown Error.
Function Error.

Please help to resolve this issue.

  • Hi Rajeswari,

    You can only use either of "hci0" or "/dev/hci_tty". Since you used "hciconfig hci0 up", the shared transport has registered with the btwilink (hci0) driver. After this, you cannot use the LinuxSPP (or any other bluetooth applications) because it does not use the 'hci0' interface.

    For using the bluetooth applications, please omit the "hciconfig hci0 up" command and see if it helps.

    Regards,
    Gigi Joseph.
  • Thank you for your prompt response.

    We tried using Linux SPP application first, after initializing successfully, we were unable to power up the device.

    So in order to check if the module is alive, we used the HCI commands. 

    So the module responds to HCI commands. We tried without using the HCI command, and using only Linux SPP app, but we are not able to power up.

    Please help.

  • Hi Rajeswari,

    What is the log that you get when you try to run LinuxSPP first? Can you try rmmod btwilink first before trying LinuxSPP?

    Regards,
    Gigi Joseph.
  • Hi Gigi Joseph,

    The log is as given below:

    root

    ifconfig: SIOCGIFFLAGS: No such device
    [ 48.948126] cfg80211: Calling CRDA to update world regulatory domain
    root@am335x-evm:/home/testApp# [ 49.074710] cfg80211: World regulatory domain updated:
    [ 49.080140] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    [ 49.088822] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    [ 49.096957] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    [ 49.105086] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    [ 49.113225] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    [ 49.121356] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)

    root@am335x-evm:/home/testApp# ./diag

    #####################################
    Diagnostics Test v1.0.6
    #####################################

    1. Fingerprint Test
    2. Ambient Test
    3. Ethernet Test
    4. Wifi Test
    5. 3G Test
    6. RTC Test
    7. EEPROM Test
    8. RAM Test
    9. Touchscreen Test
    10. LED Test
    11. USB Test
    12. SD-Card Test
    13. Display Test
    14. PowerSubSystem Test
    15. Flash Test
    16. Bluetooth Test
    17. Audio Test
    18. Battery Test
    19. Sensor Test
    20. Exit Main Menu

    16
    ------------------------

    ===========================
    Select Bluetooth Test Options
    ===========================

    1. Run BlueTooth HID Application

    2. Run BlueTooth SPP-Classic Application

    3. Run BlueTooth SPP-LE Application

    4. Bluetooth Power up

    5. Bluetooth Power down

    6. Return To Main

    ----------------------
    Select One Option : 2

    ----------------------
    Press Ctrl + C to come out of the SPP test application
    ################################################################################

    ************ BT Test Application **************

    ################################################################################


    [ 67.922504] (hci_tty): inside hci_tty_open (ed286200, ed3d56c0)
    [ 67.928778] (stc): chnl_id list empty :4
    [ 67.932957] (stk) : st_kim_start(stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 1 from install

    uim:@ st_uart_config
    uim: signal received, opening /dev/ttyO2
    uim:@ set_baud_rate
    uim:set_baud_rate() done
    uim:Setting speed to 3000000
    uim:@ read_command_complete
    uim: Command complete started
    uim:@ read_hci_event
    uim: read_hci_event
    uim:Command complete done
    uim:Speed changi
    [ 68.096604] (stc): st_tty_open ng to 3000000, 1
    uim:@ set_custom_baud_rate
    (stk) :line discipline installeduim:Installed N_TI_WL Line displine
    uim:begin poll
    [ 68.110791] (stk) :TIInit_11.8.32.btsing...
    (stk) :change remote baud rate command in firmware
    [ 68.132595] (stk) :skipping the wait event of change remote baud(stk) :sleep command in scr
    [ 68.825962] (stk) :sleep command in scr[ 69.771176] (stc): add_channel_to_table: id 4
    [ 69.775768] (stc): add_channel_to_table: id 2
    [ 69.780336] (stc): add_channel_to_table: id 3
    [ 69.802614] (hci_tty): inside hci_tty_release (ed286200, ed3d56c0)
    [ 69.809125] (stc): remove_channel_from_table: id 4
    [ 69.814198] (stc): remove_channel_from_table: id 2
    [ 69.819218] (stc): remove_channel_from_table: id 3
    [ 69.824263] (stc): all chnl_ids unregistered
    [ 69.830290] (stk) :ldisc_install = 0uim:poll broke due to event 10(PRI:2/ERR:8)(stc): st_tty_close

    uim:read 0 from install

    uim:@ st_uart_config
    uim:Un-Installed N_TI_WL Line displine
    Stack Initialization on Port -1 0 (UART) Failed: -3.
    Unable to open the stack.

    ===========================
    Select Bluetooth Test Options
    ===========================

    1. Run BlueTooth HID Application

    2. Run BlueTooth SPP-Classic Application

    3. Run BlueTooth SPP-LE Application

    4. Bluetooth Power up

    5. Bluetooth Power down

    6. Return To Main

    ----------------------
    Select One Option : uim:begin polling...


    We tried the suggestion to 'rmmod btwilink' and then try again , but it did not work. Please help.
  • Hi,

    Which stack/application are you using?
    From the logs, BT on was successful:

    [ 68.110791] (stk) :TIInit_11.8.32.btsing...
    (stk) :change remote baud rate command in firmware
    [ 68.132595] (stk) :skipping the wait event of change remote baud(stk) :sleep command in scr
    [ 68.825962] (stk) :sleep command in scr[ 69.771176] (stc): add_channel_to_table: id 4
    [ 69.775768] (stc): add_channel_to_table: id 2
    [ 69.780336] (stc): add_channel_to_table: id 3


    After that there is a request from user space to turn off BT.

    [ 69.809125] (stc): remove_channel_from_table: id 4
    [ 69.814198] (stc): remove_channel_from_table: id 2
    [ 69.819218] (stc): remove_channel_from_table: id 3


    Please check the userspace app.

    Regards,
    Gigi Joseph.