Information: Debug the BCM20732 Tag over HCI-UART using a COM port via USB on the PC

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

cross mob
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

The following procedure demonstrates how to use ble_trace (printf based traces) with the WICED Smart SDK TAG:

1.
Open the WICED Smart IDE


2.


In the directory tree on the left hand side, find WICED-Smart-SDKWiced-Smartsparcommonspar_init.c and open it for editing 

Modify the SPAR_APP_SETUP function such that the trace enable flag is set to 2  (per previous posts on the forum, this directs traces to the HCI UART)


Example:

void SPAR_APP_SETUP(void)

{

    bleapp_pre_init = application_init;

    bleapp_trace_enable = 2;        //Direct traces to HCI UART, default value = 1

}

3.

Compile and download to the Tag board your favorite application. I used the Heart Rate Monitor sample application described within the Quick Start guide (ROM.heart_rate_monitor-BCM920732TAG_Q32 download).

4.

When you see Application is running message on the console window, unplug the USB cable from the Tag board.

5.

Find the mini-switch on the Tag board (S4).  If you were able to successfully download the application to the Tag board in step 3 above, then each of the four switches on the mini-switch (S4) are set to the ON position, or UP. Turn off two of the four switches in the middle of S4 (outside switches remain on).  When you are done, the four switches will be set as follows: UP, DOWN, DOWN, UP

6.

Plug the Tag board back into your computer.

7.

Open Windows “Device Manager” and determine which COM port is being used for the Tag board.  On my machine, COM3 was selected.  On Windows 7: Start->Computer->System Properties->Device Manager, then find the entry for “Ports (COM and LPT)”.  If you are not sure which one is being used by the Tag board, you may want to unplug it, then plug it back in while observing which COM port was added.

8.

Now open your favorite terminal emulation program (I use Tera Term) and connect to the COM port you identified in step 7.

-In addition, you will need to make sure the Serial Port settings are as follows (in Tera Term, this is under the Setup->Serial Port menu item): Baud Rate: 115200, parity: None, Stop: 1, Flow Control: None

-You will also want to go into the VT100 terminal settings (in Tera Term, this is under the Setup->Terminal menu item) and insure that the receive coding is set to UTF-8 and the New Line->Receive parameter is set to Auto (“CR” was default under Tera Term)


9.

Debug output should now appear within the terminal emulation window and you are now using the HCI port to output debug traces over the COM port attached via USB to your computer. You can push the Reset button to restart the application and see the startup traces.


In doing such, you are effectively monitoring ble_tracex function calls within the application inside a terminal emulation window attached to the COM port.

To make changes and download a new version of the application to your board, perform the following steps:


1.

Exit the COM port access application described above and used to monitor debug output traces.


2.

Unplug the Tag board and make sure each of the four switches on the mini-switch (S4) are set to the ON position, or UP. 

3.

Plug the Tag board back to your computer and the downloading a new application onto the Tag board should work exactly as described in the Quick Start manual which is available here on the WICED Smart website.

0 Likes
4 Replies
Anonymous
Not applicable

I have a SPIL module board connected to the eval board. That programs and app runs.

But I would like to see trace statements as you have posted in your information but I do not see any.

What should the SW4 switches be set to for this setup?

0 Likes

I know there is internal dialog regarding this subject as well (Local Broadcom FAE and our internal AEs talking to you directly).  Once you find a resolution, can you update the thread here.

0 Likes
Anonymous
Not applicable


The way I have it setup that seems to work for me is as follows

Setup SW4 on TAG board to be ON, OFF, ON, OFF

1. Remove the Rx wire attached to SPIL module board

2. RESET SPIL by power cycling. I just remove & re-insert VBAT attached to it

0 Likes
MiTo_1583836
Level 5
Level 5
50 likes received 25 likes received 10 likes received

A quick note as extra for the point 5) of the description:

"5.

Find the mini-switch on the Tag board (S4).  If you were able to successfully download the application to the Tag board in step 3 above, then each of the four switches on the mini-switch (S4) are set to the ON position, or UP. Turn off two of the four switches in the middle of S4 (outside switches remain on).  When you are done, the four switches will be set as follows: UP, DOWN, DOWN, UP"


There is a shortcut. If you toggle only dip switch #2 to OFF (UART_RXD is pulled down), it is enough to put the system in logging mode over HCI after code download. You also don't need to unplug and plug back the USB, which is convenient.