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.

CC2652R7: Use of BLE_LOG_INT function

Part Number: CC2652R7

Hello,

BLE_LOG_INT_INT, BLE_LOG_INT_STR,BLE_LOG_INT_TIME functions are used multiple times in the simple peripheral and simple central code. Are these functions being used for some internal application or can we use them to log information to a file? Also, I am not able to locate the documentation for usage of these function.

Thanks,

Garvit

  • Hello Clement,

    I have taken following steps according to the thread you suggested - 

    1) verify your project is instrumented for this functionality (verify if you can find some calls to BLE_LOG_INT_TIME in it) -

    I found following lines in simple central project -  BLE_LOG_INT_TIME(0, BLE_LOG_MODULE_APP, "APP : ---- got GAP_DEVICE_INIT_DONE_EVENT", 0)

    2) add the BLE_LOG predefined symbol to your project 

    I added following code to simple_central.c - 

    #ifdef BLE_LOG

    #define BLE_LOG_MODULE_CTRL 0x01
    #define BLE_LOG_MODULE_HOST 0x02
    #define BLE_LOG_MODULE_APP 0x04
    #define BLE_LOG_MODULE_OSAL_TASK 0x08
    #define BLE_LOG_MODULE_RF_CMD 0x10

    void bleLog_int_int(void *handle, uint32_t type, uint8_t *format, uint32_t param1, uint32_t param2);
    void bleLog_int_str(void *handle, uint32_t type, uint8_t *format, uint32_t param1, char *param2);
    void bleLog_int_time(void *handle, uint32_t type, uint8_t *start_str, uint32_t param1);

    #define BLE_LOG_INT_INT(handle, type, format, param1, param2) bleLog_int_int(handle, type, format, param1, param2)
    #define BLE_LOG_INT_STR(handle, type, format, param1, param2) bleLog_int_str(handle, type, format, param1, param2)
    #define BLE_LOG_INT_TIME(handle, type, start_str, param1) bleLog_int_time(handle, type, start_str, param1)
    #else
    #define BLE_LOG_INT_INT(handle, type, format, param1, param2)
    #define BLE_LOG_INT_STR(handle, type, format, param1, param2)
    #define BLE_LOG_INT_TIME(handle, type, start_str, param1)

    #endif //BLE_LOG

    3) copy paste the file osal.c from the <SDK>\source\ti\ble5stack\osal\src\common folder into your project

    I included both osal.c and osal.h file in application folder of simple central project

    4) rebuild the project and flash the device and let it run - Done

    In the memory browser I have done the following setting -

    and I am getting following error - 

    Thanks, 

    Garvit

  • Hi Garvit,

    I checked, and it seems the buffer is still named "gBleLogBuffer". There might be something else not correct there.

    Can you confirm you have added the BLE_LOG predefined symbol to your project? It means you should right click on the project > Properties > Build > Arm Compiler > Predefined Symbols then add a new symbol.

    I added following code to simple_central.c -

    If I may, I don't think this is required.

    I hope this will help,

    Best regards,