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.

eHCILL deep sleep on CC256x

Hi!

I'd like to make use of Ti's eHCILL deep sleep mode using the HCI H4 Transport. 

How can I activate eHCILL deep sleep mode?

How does eHCILL work in detail and what do I need to implement to get it working?

 

Thanks a lo!, best regards,

 Matthias

 

 

  • Mattias,

    You activate eHCILL with the HCI_VS_Sleep_Mode_Configurations (0xFD0C) command

    The format is: { 0x0c, 0xfd, 0x09 , 0x01, Deep_Sleep_Enable, 0,  0xff, 0xff, 0xff, 0xff, 100, 0 }. Deep_Sleep_Enable: 1 for eHCILL, 0 for off.

     

    eHCILL allows both the host and the baseband controller to independently enter sleep mode without loosing their synchronization with the HCI H4 Transport Layer. It uses custom HCI H4 packet types and the CTS and RTS UART handshake lines to signal each other. The custom packet types are: HCILL_GO_TO_SLEEP_IND (0x30), HCILL_GO_TO_SLEEP_ACK (0x31), HCILL_WAKE_UP_IND (0x32), and HCILL_WAKE_UP_ACK (x032) as in its HCILL predecessor.

    After enabling eHCILL, the baseband controller will signal that it goes to sleep by sending HCILL_GO_TO_SLEEP_IND. The host should then pull up RTS to stop the baseband conroller from sending data and acknowledges the HCILL_GO_TO_SLEEP_IND  by sending HCILL_GO_TO_SLEEP_ACK. At this point, the clock for the MCU UART can be disabled to save energy.

    When the baseband controller wants to send new data/events to the host, it raises the CTS line for 150 us. The host can use an IRQ on that line to wake up from sleep. The host then reinitializes its UART and releases the RTS line when it is ready. On RTS release, the baseband controller can send HCILL_WAKEUP_IND, which should be answered with HCILL_WAKE_UP_ACK by the host.

    If the baseband controller should be woken by the host during sleep, the host sends HCILL_WAKEUP_IND first and then lowers the RTS line. The HCILL_WAKEU_IND will wake the baseband controller. When the baseband controller is wake again, it responds with HCILL_WAKEUP_ACK. After receiving the HCILL_WAKEUP_ACK, the host can transmit data to the baseband controller as usual. If the baseband controller tries to wake the host while the host waits for the HCILL_WAKEUP_ACK, the host will receive HCILL_WAKE_UP_IND instead. This also confirms the wake up and the host can start sending data.

     

    regards,

  • Hi

    Thanks!

    I got it to work within BTstack, my implementation is here: http://code.google.com/p/btstack/source/browse/trunk/src/hci_transport_h4_ehcill_dma.c

     

    p.s. HCILL_WAKE_UP_ACK probably should be 0x33 :)

    Matthias