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.

WL1835MOD: How to log the HCI commands send from Bluetopia PM to bluetooth chip?

Part Number: WL1835MOD

Tool/software:

Hello TI,

I want to log the data stream between Bluetopia PM and the hardware. I can I do that?

I tried with this snipped in my app but do not get any output:

static int SetBluetoothDebug()
{
    char* filename = "/home/root/debuglog.dat";
    Boolean_t remote = FALSE;
    int Result = BTPM_SetDebugZoneMask(remote, 0xFFFFFFFF);
    if(Result != 0) {
        printf("BTPM_SetDebugZoneMask(%s) Failure: %d, %s.\n", remote?"Remote":"Local", Result, ERR_ConvertErrorCodeToString(Result));
        return -4;
    }
    // DEVM_BLUETOOTH_DEBUG_TYPE_ASCII_LOG_FILE DEVM_BLUETOOTH_DEBUG_TYPE_FTS_LOG_FILE
     Result = DEVM_EnableBluetoothDebug(TRUE, DEVM_BLUETOOTH_DEBUG_TYPE_ASCII_LOG_FILE, 0, strlen(filename), filename);
    if(Result != 0) {
       printf("DEVM_EnableBluetoothDebug(%s) Failure: %d, %s.\n","TRUE", Result, ERR_ConvertErrorCodeToString(Result));
       Result = -4;
    }
    return Result;
}

I added these defines before I build the Bluetopia PM:

CFLAGS += $(INCLUDES) -DDEBUG_ENABLED -DDEBUG_ZONES=31

  • Hi Thomas,

    Bluetopia PM has a handy logging function available in the DEVM example. Here is a guide on how to get them up and running 

    https://www.ti.com/lit/an/swpa234/swpa234.pdf

    You can then see these logs and HCI data with a sniffer application such as Frontline

    Best,

    Rogelio

  • In my code snippet im my post I already use the DEVM_EnableBluetoothDebug. My question is whether the parameters are correct or what is the reason why no log file is created.

  • Hi RogelloD,

    we are using Bluetopia Plattform manager, so we try to Enable Bluetooth Debugging as descriebed in the document.
    3.1 Logging with Bluetopia Stack.
    As you can see in the snippet that Thomas posted, but we do not get any output, in the file.
    Any suggestions or ideas?

    Many thanks for your help.

  • Hello,

    I apologize for the delay, Ive been out sick. So the file does get created? Using the LinuxDEVM example, the log file gets created in the BluetopiaPM folder under whatever name you give it.

    Could you sanity check this on your system by running the terminal command on LinuxDEVM and confirming the file gets created and starts logging. Also once you start the log you will need to run commands that send HCI instructions for logs to appear.

    Best,

    Rogelio