Unable to generate BLE trace in NRF52840, when enabling MBED Trace feature

I have enabled the MBED Tracing for my application and also compiled the application using the mbed-os debug profile and I don’t see any traces being generated on the COM ports. I am currently troubleshooting a hang when initializing the BLE stacking using the method below and the mbed_app.json has the following configuration set. I am currently on MBED-OS-5.15

{
   "target_overrides":{
      "*":{
         "mbed-trace.enable": true,
         "mbed-trace.max-level": "TRACE_LEVEL_DEBUG"
      }
   }
}

I am trying to figure out what in the BLE initialization process is causing the application to hang, within the CORDIO BLE Feature Code base. The code hangs when the BLE Init is invoked and is as shown in the code below.

//set the event handler.
 m_ble.gap().setEventHandler(this);
//init the BLE Stack.
m_ble.init(this,&TestBle::OnTestBleDeviceInitialized);

Thanks,
Ajay

Hello,

BR, Jan

Hi Johnny,

Thanks for taking the time to respond. However that additional change still doesn’t seem to do anything. The Application hangs at the line of code mentioned earlier and there is no trace output being generated by the CORDIO layer as to what is happening during the initialization of the BLE Stack, that causes the failure.

Any other thoughts as to what I may be missing in order to get the trace o/p?

Thanks,
Ajay

You can try implementation from MbedOS 6 BLE if also working under MbedOS5, but probably not.

BR, Jan

Thanks once again for your timely response. I will try and upgrade the MBED version and see if this fixes the hang to begin with and if not if the trace works. One of the earlier documents for MBED OS 5 with regards to tracing had a requirement to add a feature called “COMMON_PAL”, however with the MBED OS 5.15 features folder, I don’t see this feature being available. do you have any idea if this feature needs to be in the mbed_app.json for the mbed tracing to work?

Thanks,
Ajay

I have not personal experience with this, but it seems like it is possible.

"target.features_add": ["COMMON_PAL"],

BR, Jan

Hi @JohnnyK ,

I would like to thank you for your contributions to the Mbed OS forums. You are helping lot of people and making this forum a better place.

Martin

2 Likes