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.

CC2642R: How to add debug prints in persistent app

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

Hi all,

I am working on cc2642 + SDK(v5.10). I am using three projects (BIM,Persistent and Simple peripheral OAD onchip)for my application and creating SUPER hex to flash the device. I have enable UART in syscfg file in projects.My device will be either in persistent mode or application mode. when my device is in simple peripheral app  i can see the debug prints on TERATERM.I have added some debug prints in Persistent app also to identify if device is in persistent app or not. From  main application when i write a request for OAD RESET,device goes to persistent app but it does not print the debugs which i have added in it.Any other requirement to add debug in persistent app? Secondly,device name in persistent app is "OAD persistent app" remains same even when i have changed it from "oad_persistent_app.c" file. is there any other source that set the ble name in persistent app?

Need help on above 2 queries.

Thanks

  • Hello,

    I have assigned an expert to comment on these queries.

    Regards,

    Jan

  • Hey Bipin,

    I have enable UART in syscfg file in projects

    In addition to enabling UART, what other modifications were done to the Persistent app? UART debug prints are not enabled by default in this project so you will have to do more than just enable it in SysConfig. I would look at the Simple Peripheral OAD example to see what's needed there in terms of initializing the board to use UART, along with any Display driver initializations used.

    Secondly,device name in persistent app is "OAD persistent app" remains same even when i have changed it from "oad_persistent_app.c" file. is there any other source that set the ble name in persistent app?

    Put simply, if you have connected to the device in the past, your phone (or any central) may have old cached data about the peripheral and display the old name. I performed this test by changing the name of the persistent app like you mentioned, but before connecting I cleared any bonds stored on my phone of this device. I was able to discover the new device with the newly advertised name with no problem. Depending on your central device, you may also be seeing the scanRspData name displayed and not the attDeviceName, so be sure to change that as well for good measure.

  • Hey Bipin,

    To follow up, it's actually alot simpler to enable debug prints. Here are the steps to follow:

    • In the persistent_app.opt file (located in Tools>Defines), disable the -DDisplay_DISABLE_ALL macro by adding an X to it. In addition, add the BOARD_DISPLAY_USE_UART define.
    • In oad_persistent_app.c, uncomment line 609, where the Display_open() function is called.
    • Then, add a test print after the display has been opened.
    • Rebuild the project

    Here are the code changes in the .opt file as well as an example print statement.

    -DxDisplay_DISABLE_ALL
    -DBOARD_DISPLAY_USE_UART
    
    //example test print
    Display_print0(dispHandle, 0, 0, "Hello World");

  • Thanks for the response Ammar, but after making said changes, its giving me linking error.I tried this earlier before posting on forum but there was linking error so i thought i am doing something wrong.

    Any help?

  • Can you go to the Console window and find what "unresolved symbols" the error refers to?

    I performed the above steps on an unmodified SDK example and did not encounter any issues.

  • hi,

    after adding "-DxDisplay_DISABLE_ALL" ,it gives undefines symbol for "tbmRowItemLast" which is never referenced in my workspace.

  • Hey Bipin,

    The tbmRowItemLast is an item found in our two_btn_menu.c file. This is not included in the persistent app project by default, so I'm curious why you are experiencing this error. Can you try a clean rebuild of the persistent app project?

  • Hi Ammar,

    Issue was with "#define SP_ROW_SEPARATOR_1   (TBM_ROW_APP + 0)" macro where TBM_ROW_APP uses tbmRowItemLast  in two_btn_menu.c.I had used used "SP_ROW_SEPARATOR_1   " in display_printf but header was not included of two_btn_menu hence it was giving the issue.Thanks for the support