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.

CC2564B Deep Sleep - Entering and exiting in HCILL mode.

Hi!

I've been reading the available information about Deep Sleep and its HCILL mode. However, I still home some doubts on how to implement it correctly on the host MCU, which is an STM32L486.


The wiki description at http://processors.wiki.ti.com/index.php/CC256x_eHCILL_Low_Power_Protocol states that Deep Sleep is initiated by the CC2564B when it sends the HCILL_GO_TO_SLEEP_IND OpCode to the MCU. The MCU then must then raise RTS and the send the corresponding HCILL_GO_TO_SLEEP_ACK message.

My question here is how should I capture the HCILL_GO_TO_SLEEP_IND OpCode? Does it trigger some higher level HCI event? If so, which event does it trigger?

If not, does it mean I must modify the HCI IRQ handler to detect this OpCode and act accordingly? If so, how do I prevent from confusing a byte belonging to some other HCI message with the HCILL_GO_TO_SLEEP_IND OpCode, without parsing every valid HCI OpCode and without implementing one more state machine?

Thanks!

Nico.

  • Hi Nico,

    This is already handled by the TI Bluetooth Stack - you don't need to do anything. The below line in the sample code is what enables HCILL
    HCI_DRIVER_SET_COMM_INFORMATION(&HCI_DriverInformation, 1, 115200, cpHCILL_RTS_CTS);

    The mechanism is based on the first byte received from the device.

    0x30: SLEEP_IND
    0x31: SLEEP_ACK
    0x32: WAKE_UP_IND
    0x33: WAKE_UP_ACK

    If it's an HCI event, then the first byte will be 0x04 , 0x02 for ACL & 0x03 for SCO .

    Regards,
    Gigi Joseph.
  • Hi Gigi!

    Thanks a lot for your reply.

    So, I understand that the TI BT Stack takes care of the HCILL protocol. However, I'd like to know how to correctly setup the host for sleep mode. I would need to define a couple of functions to enter/exit MCU sleep mode, but could you please let me know what is the correct place to trigger the call to these functions?

    I've been looking at Bluetopia's HCITRANS.c file, and in particular function HCITR_COMSuspend(). This seems like the function that should be called as part of the HCILL protocol compliance, as it configures the RTS and CTS pins to comply with the protocol. What I cannot find, is the place where this function is called, as I think that such place would be a good place to call the MCU sleep entering function.

    On the other hand, I couldn't find an HCI function that would be called when exiting HCILL Deep Sleep, as that would be the place to configure the MCU when it is awakened by the CTS interrupt asserted by the CC2564B.

    Could you please provide guidelines for a correct implementation?

    Thanks and best regards!
    Nico.
  • Hi Nico,

    You can take a look at Samuel's answer at: e2e.ti.com/.../1495355 and confirm if this is the information you are looking for.

    Regards,
    Gigi Joseph.
  • Hi Gigi!

    Thank you for your reply.

    Samuel's answer you're refering to seems to be what I'm looking for. I will dig deeper into it, and will be back to you in case I have any further questions.


    Best regards,

    Nico.