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.

[FAQ] CC2642R: Tips and tricks to use "BLE_LOG_INT_" functionalities

Part Number: CC2642R


As you may have seen, some new logging features have been added to the BLE examples.

For example, in simple_peripheral.c you will find the functions BLE_LOG_INT_INT, BLE_LOG_INT_STR, BLE_LOG_INT_TIME.

1- When this functionality should be used?

This functionality can help debug. Its main advantage is the fact the logs are not modifying the timing of the application (as UART logging would do) and do not require to have a debugger attached. It is possible to let the application run freely then consult the logs get latter.

2- How to enable this functionality?

  • verify your project is instrumented for this functionality (verify if you can find some calls to BLE_LOG_INT_TIME in it)
  • add the BLE_LOG predefined symbol to your project
  • copy paste the file osal.c from the <SDK>\source\ti\ble5stack\osal\src\common folder into your project
  • rebuild the project
  • flash the device and let it run

3- Where are the logs?

The logs are stored in the buffer named "gBleLogBuffer". Please review the file osal.c if you wish to modify the size of the buffer. Please note this buffer is cyclic, once fulled, older logs are erased and replaced by newer.
The logs can easily be accessed using your IDE and looking at the content of gBleLogBuffer.

4- More tips?

When using CCS, the "Expressions" window is probably not the best tool to display the content of gBleLogBuffer (because the gBleLogBuffer is too long). I recommend using the "Memory Browser" and configure it to display characters.

Even better, still using the memory browser, you can save the memory (right click > save memory). A window will appear. Select a place for your file, chose "Binary" as file type, click next. Select the start Address (basically write "gBleLogBuffer") and the length of the log you need. Click Finish. Then you can open the log file with any code editor.

I am sure it will help,