how to direct traces to puart

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hiya,

I'm using the 2.1 SDK & a 20737S.

I'd like to be able to re-direct the traces that, when enabled are sent via the HCI UART to the PUART. Is this acheiveable?

0 Likes
1 Solution

Unfortunately, we only support the decoding of the encoded traces through the trace viewer which is included within the SDK.  Perhpas another user can help.

View solution in original post

0 Likes
7 Replies
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

ble_trace_enable can be used  to direct traces.

The preferred method is described here in the "Viewing Traces From WICED Smart TAG" section of the WICED Smart Quick Start Guide (SDK 1.x and TAG2 Board)

This thread also discusses the topic of viewing traces: Information: BCM20732S debug/trace capabilities through the HCI UART port

Note that on the newer SDK, traces are encoded and they need to be viewed within the SDK using the Trace Viewer.

0 Likes
Anonymous
Not applicable

So, using the 20737S with SDK 2.1, it's impossible to output the traces to the Puart meaningfully because the messages are encoded?

0 Likes
Anonymous
Not applicable

Just thinking, if I can route the trace output from the HCI UART to the PUART & that data is encoded, is there any chance I can decode that into the trace output you would otherwise see on the trace viewer in the IDE?

0 Likes

We do not support this officially, but if you look around on the forum you will notice that a few users have figured out  how to work around the encoded traces and view them outside of the SDK.

0 Likes

Try these threads:

Re: How do I interpret the extra tracing data ? (Explains how the mechanism is implemented)

Re: Scrambled output via serial port (marmottus, sbs and kai.ren seem to have found a work around)

tjaekel posted a similar thread which discusses enabling debug using WICED Sense: Re: WICED Sense debug with UART

I also went through this morning and tagged/classified some additional debug related threads and organized them here: WICED Smart Forums

0 Likes
Anonymous
Not applicable

thanks so much for the help!

So far I've learned that you can direct the traces from HCI UART to the PUART in SDK 2.1 by editing "application_setup" in "sparinit.c". Instead of "BLE_APP_ENABLE_TRACING_ON_HCI_UART()" you have "BLE_APP_ENABLE_TRACING_ON_PUART()".

You also have to edit "bleapp_set_cfg" in "APPLICATION_INIT()":

Instead of "

bleapp_set_cfg((UINT8 *)gatt_database,

                   gatt_database_len,

                   (void *)&myApp_cfg,

                   (void *)&myApp_puart_cfg,

                   (void *)&myApp_gpio_cfg,

                   myApp_create);"

you have:

bleapp_set_cfg((UINT8 *)gatt_database,

                   gatt_database_len,

                   (void *)&myApp_cfg,

                   NULL,

                   (void *)&myApp_gpio_cfg,

                   myApp_create);

Taking those steps & you'll get trace data coming out of the PUART. However there are some messages, pertaining to new connections etc that remain encoded. Is there any way or has anyone been successful in decoding these? Even producing some code that could run on a separate processor that could decode it?

Unfortunately, we only support the decoding of the encoded traces through the trace viewer which is included within the SDK.  Perhpas another user can help.

0 Likes