13 Replies Latest reply on Feb 6, 2015 10:08 AM by MichaelF_56

    How can I use ble_trace() for application debug?

    userc_2071

      Hi,

       

      I found some functions in WICED, ble_tracex(), which are similar with printf().

       

      So I want to know that how can I use ble_tracex() function to debug application through HCI uart port? If so, it will be good for application development.

       

       

      Regards,

       

      Kai Ren

        • 1. Re: How can I use ble_trace() for application debug?
          userc_2071
          Can anyone answer my question?
          • 2. Re: How can I use ble_trace() for application debug?
            userc_2062
            Hi,

             

             

            You can choose the UART by setting bleapp_trace_enable = 1 or 2 in sparinit.c.  Dont use the

             

            ble_trace functions too soon though.  Wait for the app to be fully started up or you will have

             

            bad problems. 

             

             

            --Blake.
            • 3. Re: How can I use ble_trace() for application debug?
              ArvindS_76
              In your APPLICATION_INIT() function, if you set ble_trace_enable = 1, ble_trace* functions will print to the peripheral UART. If you set this to 2 instead, debug traces will go to the HCI UART. Since the 20732 ROM uses HCI UART RXd to detect the presence of a host device (for download mode), make sure that you disconnect RXd line, leaving the TXd line connected and then power cycle the device (or the device will enter download mode again).

               

               

              Setting ble_trace_enable = 0 instead will disable all debug messages.
              • 4. Re: How can I use ble_trace() for application debug?
                userc_2071
                I can debug when variable is 2. Thanks a lot!
                • 5. Re: How can I use ble_trace() for application debug?
                  userc_2071
                  In your APPLICATION_INIT() function, if you set ble_trace_enable = 1, ble_trace* functions will print to the peripheral UART. If you set this to 2 instead, debug traces will go to the HCI UART. Since the 20732 ROM uses HCI UART RXd to detect the presence of a host device (for download mode), make sure that you disconnect RXd line, leaving the TXd line connected and then power cycle the device (or the device will enter download mode again).

                   

                   

                  Setting ble_trace_enable = 0 instead will disable all debug messages.

                   

                   

                  Hi,

                   

                  I want to set ble_trace_enable = 1, to use puart port as debug port. But the result is nothing.

                   

                  When I send some words to BCM20732_TAG, it echo these words back. Baud rate is 57600.

                   

                  Do I need to initial puart or do some extra action for puart?

                   

                   

                  Kaiser
                  • 6. Re: How can I use ble_trace() for application debug?
                    MichaelF_56
                    Hi,

                     

                    I found some functions in WICED, ble_tracex(), which are similar with printf().

                     

                    So I want to know that how can I use ble_tracex() function to debug application through HCI uart port? If so, it will be good for application development.

                     

                     

                    Regards,

                     

                    Kai Ren

                     

                     

                    Take a look at this post here and see if it answers your question Kai: http://forum.broadcom.com/showthread.php?91088-Information-BCM20732S-debug-trace-capabilities-through-the-HCI-UART-port
                    • 7. Re: How can I use ble_trace() for application debug?
                      ArvindS_76
                      Hi,

                       

                      I want to set ble_trace_enable = 1, to use puart port as debug port. But the result is nothing.

                       

                      When I send some words to BCM20732_TAG, it echo these words back. Baud rate is 57600.

                       

                      Do I need to initial puart or do some extra action for puart?

                       

                       

                      Kaiser

                       

                       

                      What is your applications BLE_PROFILE_PUART_CFG? By default, the baud rate for BRCM sample applications is set to 115200. Have you hooked up your terminal application to the GPIOs in this configuration?
                      • 8. Re: How can I use ble_trace() for application debug?
                        userc_2071
                        What is your applications BLE_PROFILE_PUART_CFG? By default, the baud rate for BRCM sample applications is set to 115200. Have you hooked up your terminal application to the GPIOs in this configuration?

                         

                        This is BLE_PROFILE_PUART_CFG in proximity_plus.c, I have defined BLEDEBUG. So, P32 and P33 are puart pin.

                         

                        PLACE_IN_DROM const BLE_PROFILE_PUART_CFG bleprox_mod_puart_cfg =

                         

                        {

                         

                            /*.baudrate   =*/ 115200, 

                         

                        #ifdef BLEDEBUG

                         

                            /*.txpin      =*/ 32, //20730A0 module need to use 32 instead, normally it is 31

                         

                            /*.rxpin      =*/ 33, //GPIO pin number

                         

                        #else

                         

                            /*.txpin      =*/ PUARTDISABLE | 32,

                         

                            /*.rxpin      =*/ PUARTDISABLE | 33,

                         

                        #endif

                         

                        };

                         

                        On schematic, I found that U11s pin1 and pin2 are connected with P32 and P33, then I solid out two wire and use http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm this type of usb2rs232 cable to monitor puart port.

                         

                        BTW, I dont know how to hook up the terminal application to the GPIOs.

                         

                        [ATTACH=CONFIG]177[/ATTACH]
                        • 9. Re: How can I use ble_trace() for application debug?
                          MichaelF_56
                          Hello Kai.ren,

                           

                           

                          I apologize for the delay in getting back to you.

                           

                           

                          Based on the photo you attached, I think I see what the problem is you are having jumpering to P33(Pin 24 on the chip, PUART_RX) and P32(Pin 25 on the chip, PUART_TX) coming off leads from the unused serial flash located in U11.

                           

                           

                          If you take a look at the schematic, R100 and R101 are DNI. Since it appears from the photo you provided that you are jumpering off the leads on the serial flash itself, there is no connection either to P33 or P32.

                           

                           

                          What you want to try is to solder your leads in the same manner on the side of the ball allocated to the DNI resistors that is closest to the BCM20732.
                          • 10. Re: How can I use ble_trace() for application debug?
                            userc_2071
                            Hello Kai.ren,

                             

                             

                            I apologize for the delay in getting back to you.

                             

                             

                            Based on the photo you attached, I think I see what the problem is you are having jumpering to P33(Pin 24 on the chip, PUART_RX) and P32(Pin 25 on the chip, PUART_TX) coming off leads from the unused serial flash located in U11.

                             

                             

                            If you take a look at the schematic, R100 and R101 are DNI. Since it appears from the photo you provided that you are jumpering off the leads on the serial flash itself, there is no connection either to P33 or P32.

                             

                             

                            What you want to try is to solder your leads in the same manner on the side of the ball allocated to the DNI resistors that is closest to the BCM20732.

                             

                            Hi,

                             

                            A low level mistake, sorry.

                             

                            I have installed two 0Ohm resistors on R100 and R101, instead of your method, sold leads from the closest pot of BCM20732. It can printf some strings.

                             

                            Thanks,

                             

                            BTW, does my method have any side effect?
                            • 11. Re: How can I use ble_trace() for application debug?
                              MichaelF_56
                              I spoke to the firmware team about using this method of debug and they confirmed that there are no serious side effects expected. They did explain that debug printfs are synchronous calls, so they change the timing slightly, but as long as the same logical GPIOs (P32/P33 in this case) are not needed for a different function, then there should be no side effect. Of course in production it is always best to disable all traces.
                              • 12. Re: How can I use ble_trace() for application debug?
                                userc_5593

                                Hi mwf_mmfae:

                                I had the same question with Kai.

                                I had try to access

                                Take a look at this post here and see if it answers your question Kai:http://forum.broadcom.com/showthread.php?91088-Information-BCM20732S-debug-trace-capabilities-through-the-HCI-UART-port

                                but I got :

                                Message

                                Roger Wang, you do not have permission to access this page. This could be due to one of several reasons:

                                1. Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
                                2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

                                How to do set the ble_trace_enable=2 ?

                                Thanks

                                Roger Wang

                                • 13. Re: How can I use ble_trace() for application debug?
                                  userc_5593

                                  Hi mwf_mmfae:

                                  I had find out :

                                  extern UINT8                    bleapp_trace_enable;

                                  in bleprofile.h

                                  that is the same ble_trace_enable ?

                                  May I use this bleapp_trace_enable=2 for debug my firmware  ?

                                  • 14. Re: How can I use ble_trace() for application debug?
                                    MichaelF_56

                                    The link above goes to the website where the forums were hosted originally.  These were moved to the current site 14 months ago.

                                     

                                    That thread specifically is here: Information: BCM20732S debug/trace capabilities through the HCI UART port

                                     

                                    Note that while ble_trace_enable can be used on this manner to direct traces, there is a new method which is easier to use and described within the WICED Smart Quick Start Guide (SDK 1.x and TAG2 Board)

                                     

                                    I linked to the Quick Start guide which refers to the 20732 and TAG1 board as that appears to be what you are using.

                                     

                                    The Quick Start guide here is for the A1 20736/37 and the newer TAG3 board: The specified item was not found.

                                     

                                    The Quick Start guide is a great source for setting up traces on the older chip/TAG board.