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.

WL1835 Bluetooth Enable Sleep mode

Other Parts Discussed in Thread: AM3354, WL1835

We are using WL1835 module with AM3354 processor with the TIBluetopiaPMWiLink8LinuxAddOnforSitaraAM335x-4.0.1.4.2 addon package. We are trying to put the Bluetooth module in Sleep mode. We are using the function VS_Enable_Sleep_Mode in our application to enable sleep mode.

The above function takes the BluetoothStackId and the VS_Enable_Sleep_Mode_Params_t structure as parameters. We have set the DeepSleepEnable member of the structure to TRUE and DeepSleepMode to '0' (HCILL). And the other parameters as unchanged.

The function returns success.

But how do we ensure that the module is in sleep mode? 

We are trying to see the change in the RTS line of the Bluetooth module when it wakes up. But RTS remains low all the time irrespective of sleep or active state. There is no problem in the Bluetooth communication though. Is there any configuration to be done to enable RTS pulses?

Regards,

Harini

  • Hi,

    First could you please make sure that the HCI_VS_HCILL_Parameters (0xFD2B) is set before running the HCI_VS_Sleep_Mode_Configurations, see http://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_HCILL_Parameters_.280xFD2B.29

    Please try enabling the logs in St_ll.c and see.

  • Hi Sundeep,

    Yes, we are setting HCILL parameters using VS_Update_HCILL_Parameters command before running VS_Enable_Sleep_Mode. Inactivity timeout and retransmit timeout are set to zero. And rts pulse width is set to 0xff. That doesn't make any difference.

    We added debug prints in St_ll.c and ran the LinuxSPP demo app. We see that sleep is enabled by default. We are able to see that the device goes to sleep state when there is no activity and wakes up otherwise. However there is no change in the RTS and CTS lines. They are held low after power on.

    LinuxSPP is run and inquiry command is given. Here is the log:

    root@am335x-evm:/home/testApp# ./LinuxSPP 1 0 ttyO1 115200
    [ 732.015457] (hci_tty): inside hci_tty_open (ed283358, ed3e8200)
    [ 732.022547] (stc): chnl_id list empty :4
    st_ll_enable
    [ 732.028141] (stk) : st_kim_start
    [ 732.136034] (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(stc): st_tty_open ng to 3000000, 1
    uim:@ set_custom_baud_rate

    [ 732.197421] (stk) :line discipline installeduim:Installed N_TI_WL Line displine(stk) :TIInit_11.8.32.bts
    uim:begin polling...

    [ 732.219392] (stk) :change remote baud rate command in firmware(stk) :skipping the wait event of change remote baud
    [ 732.412934] (stk) :sleep command in scr(stk) :sleep command in scr
    [ 733.873363] (stc): add_channel_to_table: id 4
    [ 733.878136] (stc): add_channel_to_table: id 2
    [ 733.882722] (stc): add_channel_to_table: id 3
    [ 733.891575]
    [ 733.891575] returning state 2
    [ 733.896857]
    [ 733.896857] returning state 2
    [ 733.902318]
    [ 733.902318] returning state 2
    [ 733.907389]
    [ 733.907389] returning state 2
    [ 733.913437]
    [ 733.913437] returning state 2
    [ 733.918453]
    [ 733.918453] returning state 2
    [ 733.924197]
    [ 733.924197] returning state 2
    [ 733.929478]
    [ 733.929478] returning state 2
    [ 733.935584]
    [ 733.935584] returning state 2
    [ 733.947690]
    [ 733.947690] returning state 2
    [ 733.953295]
    [ 733.953295] returning state 2
    [ 733.958374]
    [ 733.958374] returning state 2
    [ 733.963746]
    [ 733.963746] returning state 2
    [ 733.969135]
    [ 733.969135] returning state 2
    [ 733.974212]
    [ 733.974212] returning state 2
    [ 733.979519]
    [ 733.979519] returning state 2
    [ 733.984582]
    [ 733.984582] returning state 2
    [ 733.989851]
    [ 733.989851] returning state 2
    [ 733.994874]
    [ 733.994874] returning state 2
    [ 734.000094]
    [ 734.000094] returning state 2
    [ 734.005129]
    [ 734.005129] returning state 2
    Stack Initialization on Port -1 0 (UART) Success[ 734.010768]
    [ 734.010768] returning state 2
    ful.
    Device Chipset Version: 4.0
    Bluetooth D[ 734.019993]
    [ 734.019993] returning state 2
    evice Address: 34B1F7E181C8
    [ 734.028957]
    [ 734.028957] returning state 2
    [ 734.036095]
    [ 734.036095] returning state 2
    [ 734.041483] ability_Mode(cmConnectable).
    [ 734.041483] returning state 2

    [ 734.050391]
    [ 734.050391] returning state 2
    [ 734.055392]
    [ 734.055392] returning state 2
    [ 734.060604]
    [ 734.060604] returning state 2
    [ 734.065594]
    [ 734.065594] returning state 2
    GAP_Set_Discoverability_Mode(dmGeneralDiscoverable, 0).
    GAP_Set_Pairability_Mode(pmPairableMode).
    GAP_Register_Remote_Authentication() Success.

    ******************************************************************
    * Command Options: Inquiry, DisplayInquiryList, Pair, *
    * EndPairing, PINCodeResponse, PassKeyResponse, *
    * UserConfirmationResponse, *
    * SetDiscoverabilityMode, SetConnectabilityMode,*
    * SetPairabilityMode, *
    * ChangeSimplePairingParameters, *
    * GetLocalAddress, GetLocalName, SetLocalName, *
    * GetClassOfDevice, SetClassOfDevice, *
    * GetRemoteName, ServiceDiscovery, *
    * Open, Close, Read, Write, *
    * EnableDebug, Help, Quit. *
    ******************************************************************
    Server>[ 734.170327]
    [ 734.170327] Inside st_ll_sleep_state
    [ 734.175637]
    [ 734.175637] sleep indication recvd
    [ 734.180749]
    [ 734.180749] device want to sleep
    [ 734.185685] send_ll_cmd: writing 31
    returning state 0

    Server>inquiry

    [ 755.845423]
    [ 755.845423] returning state 0
    [ 755.850421] send_ll_cmd: writing 32
    WAKE_IND
    [ 755.862048]
    [ 755.862048] Inside st_ll_sleep_state
    [ 755.867361]
    [ 755.867361] wake ack rcvd
    Return Value is 0 GAP_Perform_Inquiry() SUCCESS.
    Server>[ 755.971507]
    [ 755.971507] Inside st_ll_sleep_state
    [ 755.976814]
    [ 755.976814] sleep indication recvd
    [ 755.981927]
    [ 755.981927] device want to sleep
    [ 755.986862] send_ll_cmd: writing 31
    returning state 0
    [ 756.802814]
    [ 756.802814] Inside st_ll_sleep_state
    [ 756.808123]
    [ 756.808123] wake indication recvd
    [ 756.813143]
    [ 756.813143] device want to wakeup
    [ 756.818168] send_ll_cmd: writing 33
    returning state 2
    [ 756.823705]
    [ 756.823705] Inside st_ll_sleep_state
    [ 756.828999]
    [ 756.828999] wake ack rcvd

    GAP Inquiry Entry Result: 0080254818F6.

    Server>[ 756.921577]
    [ 756.921577] Inside st_ll_sleep_state
    [ 756.926893]
    [ 756.926893] sleep indication recvd
    [ 756.932005]
    [ 756.932005] device want to sleep
    [ 756.936942] send_ll_cmd: writing 31
    returning state 0
    [ 766.113402]
    [ 766.113402] Inside st_ll_sleep_state
    [ 766.118734]
    [ 766.118734] wake indication recvd
    [ 766.123754]
    [ 766.123754] device want to wakeup
    [ 766.128782] send_ll_cmd: writing 33
    returning state 2
    [ 766.134333]
    [ 766.134333] Inside st_ll_sleep_state
    [ 766.139629]
    [ 766.139629] wake ack rcvd

    GAP_Inquiry_Result: 1 Found.
    GAP Inquiry Result: 1, 0080254818F6.

    Server>[ 766.232142]
    [ 766.232142] Inside st_ll_sleep_state
    [ 766.237461]
    [ 766.237461] sleep indication recvd
    [ 766.242572]
    [ 766.242572] device want to sleep
    [ 766.247506] send_ll_cmd: writing 31
    returning state 0


    Regards,
    Harini

  • Hi,

    I think the flow control is not enable, Could you please check the UART serial driver?
  • Hi Sundeep,

    We have enabled flow control in our dts file and in uim.c.
    But that doesn't make any difference.

    What else could be missing?

    Regards,
    Harini
  • Hi,

    As mentioned earlier, It could be problem with UART serial driver.
    see the post e2e.ti.com/.../1178645 with slimier discussion, which might help
  • Hi Harini,

    The easiest way to see if the deep sleep mode is being entered is to measure the current on Vbat to WL183x. Attached is a picture that shows Vbat during a BLE connection. The first peak is a connection event with no data and so host is not alerted. On the second event there is data and so data is exchanged and current consumption goes up.

    Iain

    WL183x – Bluetooth Waking up Host from Sleep.pptx

  • Hi Lain,

    We measured the current on Vbat. We do not see any pulse as shown in the ppt when the device wakes up. But we do see the "wake up indication" and "wake up ack"debug prints from St_ll.c on the terminal.

    Regards,
    Harini
  • Sleep should be enabled by default in the TIInit_11.8.32.bts file.

    Which version are you using? The latest is at

    It is service pack 3.6.1

    Iain