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.

Tida 00374 modified

Other Parts Discussed in Thread: TIDA-00374, CC2650

Hi all,

i am trying to develop my own application based on TIDA 00374 project (both hardware and firmware)

Initially I had to send to a central  device some data, i.e. battery level, temperature and one pin status. I put the data in dinamically changing non connectable advertising packets: 1 packet/sec for 10 seconds, so 10 packets in a cycle. Then the microcontroller is turned off for about 1 minute.

I have modified a bit  the tida00374 firmware and it works. 

Now i have to implement this task: the central (i'm using BTOOL) can decide to connect to my board when it needs to modify the status of one particular pin of the microcontroller. 

So the board now shoud behave as a peripheral. The original TIDA is a simple broadcaster, so peripheral task isnt implemented, and in general the firmware structure is a lot different compared to project zero or simplebleperipheral firmware, so i'm a bit confused about how to continue. 

Can anyone  give me some advice on what application i have to follow?

Thank you

Vito

  • Hi Vito,

    Which version of the BLE SDK are you using? I would suggest reviewing our BLE Beacon app note to start:
    www.ti.com/.../swra475.pdf

    Here is a forum post from someone who was able to switch between connectable and non connectable advertisements:
    e2e.ti.com/.../477588
  • Hi Rachel, 

    thanks for your reply.

    First of all i have to say i am new to ble. I'm learning step by step :)

    I think the ble sdk used in TIDA-00374 is different compared, for instance, to the one used in project zero.

    I've searched the functions/commands in the tida firmware to implement scan response, connection, services etc, but i'am a bit confused. There is the rfdriver folder

    but i cant understand if the files and the funtions implemented there are useful for my case and how to use it.

    Maybe it's better to modify project zero and customize it cause i think it's much more commented and i can find help here.

  • Hi Vito,

    Since you are new to TI BLE, I would recommend going through SimpleLink Academy. It's a great resource for learning how our code is structured and how you can modify it for various commands: software-dl.ti.com/.../overview.html

    It would probably be best to start with a CC2650 Launchpad because there will be some hardware differences but you should be able to modify the board files to work with the TIDA-00374 hardware.
  • Yes, i'm developing the firmware with CC2650 LP indeed.

    Thanks for the link.

    Vito

  • Hi Rachel,
    i have a quetion: is it possibile to change, in project zero, from general advertising to limited advertising of 10s? i've tried to change something but it didnt work.
    Thank you.
  • I modified the declaration below in peripheral.c and it works.

    static uint8_t gapRole_AdvertData[B_MAX_ADV_LEN] =
    {
    0x02, // length of this data
    GAP_ADTYPE_FLAGS, // AD Type = Flags
    // Limited Discoverable & BR/EDR not supported
    0x01/* (GAP_ADTYPE_FLAGS_GENERAL | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED)*/,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    };

  • Hi Rachel,

    working on project zero i'm trying to send a certain number of advertisement packet, containing some changing data, such as temperature, battery level and button status, in limited advertising mode.

    Modifying the application main loop as reported below more or less it works, but actually i'm not totally sure about the "GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), (void *)advertData);" instruction position in the code: when i try to modify the advertising off time, to 0 to 10 seconds, for example, advertising actually can't stop (and then restart).

    static void ProjectZero_taskFxn(UArg a0, UArg a1)
    {
    // Initialize application
    ProjectZero_init();
    HCI_EXT_SetTxPowerCmd(HCI_EXT_TX_POWER_MINUS_21_DBM); //transmit power set to -21 dbm

    // Application main loop
    // Waits for a signal to the semaphore associated with the calling thread.
    // Note that the semaphore associated with a thread is signaled when a
    // message is queued to the message receive queue of the thread or when
    // ICall_signal() function is called onto the semaphore.
    ICall_Errno errno = ICall_wait(ICALL_TIMEOUT_FOREVER);

    for (;;)
    {


    Temperature = AONBatMonTemperatureGetDegC();

    if(Temperature > 45)
    PIN_setOutputValue(Solen_BuzzPinHandle, Board_BuzzR, 1);


    Battery_1 = AONBatMonBatteryVoltageGet()>>8;
    Battery_2 = AONBatMonBatteryVoltageGet();



    uint8_t advertData [] =
    {

    Temperature,
    Battery_1,
    Battery_2,
    Button_Status,

    };


    GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), (void *)advertData);

    if (errno == ICALL_ERRNO_SUCCESS)

    ...

    Moreover as i said in the post before, to set limited discoverable mode i modified in peripheral.c the following instruction

    static uint8_t gapRole_AdvertData[B_MAX_ADV_LEN] =
    {
    0x02, // length of this data

    0x01

    0x01

    };

    in this way first advertisement data packet is 02:01:01 and then it is updated. But actually i shoud have even the first packet with temperature, battery, etc... data...

    Can you help me?

    Cheers,

    Vito
  • Hi Vito,

    How are you setting your advertising timeout? You will need to call GAP_SetParamValue with TGAP_LIM_ADV_TIMEOUT.

    You also need to make sure you end advertisements before updating the advertisement data.

    SimpleLink Academy covers changing advertisement data in Task 4 of BLE Fundamentals: software-dl.ti.com/.../ble_01_basic.html

    Check BLE Core 4.2 Part C Section 11 for help with the advertising format.