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.

TI BLE 1.4.0 version firmware, Used HidEmuKbd project power saving problem

Updated to version 1.4.0 firmware, Project using HIDEmuKbd

Do not modify any of the firmware.

Theoretically, It should be 60sec into the PM3 mode.

The device should into PM3 automatically and stay in PM3 mode,

If idle timer timeout occur.

/ / HID idle timeout in msec; set to zero to disable timeout
# define DEFAULT_HID_IDLE_TIMEOUT 60000

After the test, when the device and PC (Win8 OS) connection, Have been unable to enter the PM3 (most power-saving mode), The current will have been beating from uA to mA

At this time, If the dongle unplug the PC, Such as after a period of time will go directly measure current, Which is about 1uA (as long as no action IO, will always keep this current consumption)

/ / Advertising timeouts in sec
# define HID_INITIAL_ADV_TIMEOUT 60

Directly change the original version 1.3.2 FW, when the device and PC (WIN8) pair, if Device no action, it will 60 seconds after entering the PM3 mode, measure current is about 1uA.

§ Check Option -> C / C + + Compiler -> Preprocessor

Defined symbols: POWER_SAVING is open

§ # define DEFAULT_ENABLE_UPDATE_REQUEST TRUE/FALSE is same situation

  • Hi,

    There is a bug in the hiddev profile, as for 1.4.0 advertising is automatically reenabled after disconnect.

    To avoid this and go to PM3 after idle disconnect, change the function hidDevDisconnected(..) in hiddev.c, so that the bottom part looks like:

      // if bonded and normally connectable start advertising
      if ( ( hidDevBondCount() > 0 ) &&
           ( pHidDevCfg->hidFlags & HID_FLAGS_NORMALLY_CONNECTABLE ) )
      {
        hidDevLowAdvertising();
      }
      else
      {
        uint8 param = FALSE;
        VOID GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &param );
      }
    }

    BR,
    Aslak

  • Hi~

    According to your suggestion it's into PM3 mode.

    But when the device is leave PM3 mode (Wake-by-button), it will not connect with OS

    So~ I have tried to add code the following, the condition as same

    /*********************************************************************
     * @fn      HidDev_Report
     *
     * @brief   Send a HID report.
     *
     * @param   id - HID report ID.
     * @param   type - HID report type.
     * @param   len - Length of report.
     * @param   pData - Report data.
     *
     * @return  None.
     */
    void HidDev_Report( uint8 id, uint8 type, uint8 len, uint8*pData )
    {
      // modify to enable advertising data
      uint8 param = true;
      void GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &param );	
    	
      // if connected
      if ( hidDevGapState == GAPROLE_CONNECTED )
      {
        // if connection is secure
        if ( hidDevConnSecure )
    

  • Hi,

    Using the dongle, reconnection on button press works for me. Also windows 8.

    /*********************************************************************
     * @fn      HidDev_Report
     *
     * @brief   Send a HID report.
     *
     * @param   id - HID report ID.
     * @param   type - HID report type.
     * @param   len - Length of report.
     * @param   pData - Report data.
     *
     * @return  None.
     */
    void HidDev_Report( uint8 id, uint8 type, uint8 len, uint8*pData )
    {
      // if connected
      if ( hidDevGapState == GAPROLE_CONNECTED )
      {
        // if connection is secure
        if ( hidDevConnSecure )
        {
          // Make sure there're no pending reports
          if ( reportQEmpty() )
          {
            // send report
            hidDevSendReport( id, type, len, pData );
    
            return; // we're done
          }
        }
      }
      // else if not already advertising
      else if ( hidDevGapState != GAPROLE_ADVERTISING )
      {
        // if bonded
        if ( hidDevBondCount() > 0 )
        {
          // start high duty cycle advertising
          hidDevHighAdvertising();
        }
        // else not bonded
        else
        {
          // start initial advertising
          hidDevInitialAdvertising();
        }
      }
    
      // hidDev task will send report when secure connection is established
      hidDevEnqueueReport( id, type, len, pData );
    }
    

    The existing code above should automatically and correctly restart advertising on button press.

    Can you determine whether the remote is advertising when you press a button after idle disconnect?

    BR,
    Aslak

  • Hi~

    I try to modify IAR workbench option by optimizations level to balance or speed (default is size), press a button after idle disconnect, device will automatically established connection with HOST.

    In fact, in this situation, I to design other project have occurred. but i don't have idea why ?

    Maybe this is the problem of IAR version ?

    Do you have a better way to solve?

    The following is the my used IAR version:

  • Hi,

    I'm guessing you had to jump through a few hoops to get IAR 8.30 working with the BLE SDK projects. The thing is, the libraries are compiled with 8.20.2 and the linker files are made for 8.20.2. The Bluetooth SIG qualification testing is also done on 8.20 based images.

    I would recommend that you try 8.20.2 and see if that works with the size optimization if you want. It sounds a bit fishy that this should have an impact on whether the device reconnects.

    Best regards,
    Aslak