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.

CC2340R5: minimal example demonstrating the broadcaster role

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

i'm looking for something "smaller" than the basic_ble example shipped with SDK 8.x, which **ONLY** supports the broadcaster role....

i see a source file name app_broadcaster.c, but i'm not sure how to build an app with just this functionality....

i'm not interest in the "terminal menu" either....

my ultimate object is to shrink my executable size, so any suggestions on how to eliminate stuff from this minimal example would be greatly appreciated....

  • Hi,

    You can remove the menu by selecting "Disable The Display Module" in SysConfig under the Advanced Settings of the BLE tab

    To reduce even more the executable, remove strip the unused modules, such as UART2, in SysConfig.

    Regards,
    Tanguy

  • this is WAY too big for my use-case, where all i need is a beacon....

    i noticed the SDK contains a ti/drivers/rcl/handlers/ble5.c file, which seems to provide low-level access to the BLE patch images....  and i see functions in there for issuing various BLE commands -- including advertising....

    i've already worked with the generic.c handler in conjunction with your rfPacketTX example....  but i couldn't ANY code in the SDK that actually used the ble5.c handler....

    an example of advertising at this level would likely solve my problem....

  • what i can tell, this example is literally built upon the rfPacketTx example -- though it would load the BLE images into the radio itself, instead of the propRF (generic) images....

    more to the point, i assume this code would use the generic.c RCL handler....

    i was looking for somethat used the ble5.c handler -- which has commands and features more aligned with the BLE protocol....  for example, i can pass a mask of advertising channels to the RCL_Handler_BLE5_adv command; sequencing through the channels is handled in ble5.c....

    while this could theoretically be done with no more than basic radio TX/RX, there is clearly extra logic inside ble5.c which i'd like to leverage....  more important, ble5.c uses a large number of radio registers **specific** to the BLE patches....

    silly question, but why does TI ship ble5.c (as well as ble_cs.c and ieee.c) with the SDK and yet provide no examples of how to use these handlers???

  • The ble5.c is meant to be used with BLE stack.

    Please refer to RCL docs here for the handlers (e.g. ble, generic, ...): https://dev.ti.com/tirex/explore/content/simplelink_lowpower_f3_sdk_8_10_01_02/docs/rcl/html/index.html 

  • i've read the docs and the code....  can i look at the source code in the BLE stack that actually uses ble5.c???

    i believe i have simple advertising working....  what i'm not entirely sure about, however, is passing my advertising packet to the handler via the FIFO....  do i include the length of my advertising packet in the FIFO txPacket???

    i can see the packet being removed from the FIFO inside the handler....  but i think it's not quite pointing to the correct place....

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (c) 2013-2022, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    from what i tell using power analyzer, this program IS advertising once per-second on all three channels at 5dB....

    i believe the actual advertising packet (advData) is NOT be transmitted, however....

    when i single step through the handler code, it seems to pick off the value 0x2 (the first length byte) as the type of advertising being used....

    could you verify that i'm passing the buffer in correctly

  • Thanks for sharing your progress.

    Our SDK does not support using BLE in this way, and we expect developers to use the BLE Stack Library provided to use any BLE functionalities.

    For simpler operations, such as only BLE broadcasting advertisements, the above example could be used, as in my previously mentioned post it was ported from an existing implementation (TIDA00759, BLE PIR sensor).

    If you need advertising on different channels/frequencies, each TX command has a frequency field.