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.

CC2541: SimpleBLEPeripheral and CC2540_MINIDK

Other Parts Discussed in Thread: CC2540, CC2541, CC2541DK-MINI

Hi

I'm playing with both SimpleBLEPeripheral and SimpleBLEBroadcaster and it seems that the value CC2540_MINIDK takes is different in each. It's 1 in SBLEP but 0 in SBLEB.

How is the value determined? For the same device, they somehow take different values. Is it meant to be a flag for the compiler? Why would it take the value 1 in SBLEP but 0 in SBLEB?

Cheers

  • Hello Steve,

    Can you provide more details here, specifically as to what "value" relates to?

    Best wishes
  • Hi JXS

    I run the debugger in IAR and CC2540_MINIDK is 1 in SBLEP, resulting in no advertising and device goes to sleep. With SBLEB, the value is 0 and it advertises fine.

    SBLEB only advertises if I force initial_advertising_enable = TRUE as in

    #if defined( CC2540_MINIDK )
    // For the CC2540DK-MINI keyfob, device doesn't start advertising until button is pressed
    //uint8 initial_advertising_enable = FALSE;
    uint8 initial_advertising_enable = TRUE;
    #else
    // For other hardware platforms, device starts advertising upon initialization
    uint8 initial_advertising_enable = TRUE;
    #endif



    Thanks

  • Hi Steve,

    Please see "4.2.1 Making the Keyfob Discoverable" in SWRU270. (Mini DK User Guide).

    You can use IAR to see out Advertising is enabled for Limited & General Advertising. The APIs for controlling Advertising can be found in the SW Developer's Guide (SWRU271), refer to GAP_SetParamValue.

    Best wishes
  • Hi

    But mine isn't a Keyfob. It's just a CC2541 mounted on a PCB. My issue is that SBLEP *thinks* it's a Keyfob (setting CC2540_MINIDK to 1).

    I'm not sure if this might contribute to the problem: the file CC2541DB/SimpleBLEPeripheral.ewp has the following line:

    <state>CC2540_MINIDK</state>

    and many of the .cout files have -DCC2540_MINIDK=1 in them.

    Thanks
  • Hello,

    Have you considered removing that cond. compile statement around the Advertisement setup code? I would do a search and selectively remove the code based on the customization needed for your system.

    Best wishes
  • Hi

    I've figured out the issue now. The SBLEP project comes with 6 different configurations where the default is CC2541DK-MINI_Keyfob, which causes the flag to be set.

    What I need is just to choose the CC2541 configuration.

    Thanks