bleprofile_LED functions are not working

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NiVa_4337911
Level 3
Level 3
First like received

Hi,

I tried to use bleprofile_LED functions in find_me example, but ther are not woring. First configured GPIO as

// Following structure defines GPIO configuration used by the application

const BLE_PROFILE_GPIO_CFG find_me_gpio_cfg =

{

    {

        GPIO_PIN_WP,                               // This need to be used to enable/disable NVRAM write protect

        GPIO_PIN_LED, -1, -1, -1,

        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // Other GPIOs are not used

    },

    /*.gpio_flag =*/

    {

        GPIO_SETTINGS_WP,

        GPIO_SETTINGS_LED, 0, 0, 0,

        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

    }

};

where the GPIO_SETTINGS_LED is

#define GPIO_SETTINGS_LED   (GPIO_OUTPUT | GPIO_INIT_HIGH | GPIO_LED)

Then inside find_me_create function, added the following:

gpio_configurePinWithSingleBytePortPinNum(GPIO_PIN_LED, GPIO_OUTPUT_ENABLE, GPIO_PIN_OUTPUT_HIGH);

I am not sure the above step is required, because already configured in BLE_PROFILE_GPIO_CONFIG (but not as output).

After these configurations, the following functions, bleprofile_LEDOff(), bleprofile_LEDOn() and bleprofile_LEDBlink() have no effects on LED. However, LED can be turn on/off using gpio_setPinOutput(0, GPIO_PIN_LED, GPIO_PIN_OUTPUT_HIGH/GPIO_PIN_OUTPUT_LOW) and without using BLE_PROFILE_GPIO_CFG.

What was the wrong I did with BLE_PROFILE_GPIO_CFG?

Thanking You.

NV

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi Niras,

I would suggest you to use gpio_setPinOutput function instead of bleprofile_LEDOn / Off functions. Seems like the bleprofile_LEDOn functions are not reliable when I tested at my side.

Please go through GPIO & LED section in the following blog : WICED Smart User's Guide

Thanks,

Anjana

View solution in original post

1 Reply
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi Niras,

I would suggest you to use gpio_setPinOutput function instead of bleprofile_LEDOn / Off functions. Seems like the bleprofile_LEDOn functions are not reliable when I tested at my side.

Please go through GPIO & LED section in the following blog : WICED Smart User's Guide

Thanks,

Anjana