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 use UartLog instead of Display_printf in simple_peripherals

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG, CC2640, LAUNCHXL-CC26X2R1

Hi,

I am trying to use UartLog instead of display_printf in simple_peripheral_oad_onchip project.

Environment

SDK : simplelink_cc13x2_26x2_sdk_5_20_00_52

CCS : Version: 10.1.1.00004

XDS : 3.61.2.27

 

First, I removed two buttons menu and display from project as below.

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/879265/cc2640r2f-how-to-remove-two-buttons-menu-two_btn_menu-and-display-from-simple_peripheral-project

And then I added UartLog in project.

 

1. Added following include statement and function call in main.c

//#include <ti/display/Display.h>

#include <ti/drivers/UART.h>

 

// Comment this in to use xdc.runtime.Log, but also remove UartLog_init below.

//#include <xdc/runtime/Log.h>

#include <ti/common/cc26xx/uartlog/UartLog.h> // Comment out to use xdc Log.

 

/* Initialize the RTOS Log formatting and output to UART in Idle thread.

   * Note: Define xdc_runtime_Log_DISABLE_ALL and remove define UARTLOG_ENABLE

   *       to remove all impact of Log statements.

   * Note: NULL as Params gives 115200,8,N,1 and Blocking mode */

  UART_init();

UartLog_init(UART_open(CONFIG_DISPLAY_UART, NULL));

 

2. Added include statement in simple_peripherals_oad_onchip.c

//#include <ti/display/Display.h>

#include <ti/common/cc26xx/uartlog/UartLog.h>

#include <ti/display/AnsiColor.h>

3. Check UART Log in sysconfig as below.

 

4. Added uart log functions in simple and change Display_printf to Log_info0 as below.

static void SimplePeripheral_init(void)

{

 Log_info0("SimplePeripheral_init");

 //Display_print0(dispHandle, SP_ROW_STATUS_1, 0, "OAD DL Complete, wait for Enable");

Log_info0("OAD DL Complete, wait for Enable");

 

I compiled and run but I didn’t get any output.

 

Can I get some guides and please let me know how can I work.

  • Hi,

    Can you send us a picture to show you're connecting to the right pins? Additionally, I think you'll still need to initialize the UART. See the Examples in the API Documentation for the lines you'll need here. I'd also review some similar posts, one of which here seems very close, with the exception of a CC2640 vs a CC2642. It still may have useful information for debugging.

    Best,

    Nate

  • Hi, 

    Why do you want picture?

    I'm testing using the LAUNCHXL-CC26x2R1.

    XDS110 UART is used to display. 

    This works fine in project_zero.

  • Hi. 

    I compared project_zero_app.cfg and simple_peripheral_oad_onchip_app.cfg

    The difference between the two is that there is no Idle.addFunc('&uartLog_flush'); in simple_peripheral_oad_onchip_app.cfg.

    I added Idle.addFunc('&uartLog_flush') and then uart log is displayed.

    I have another question.

    How can I edit a .cfg file? 

    I added the Idle.addFunc('&uartLog_flush'); manually.

    Is there a configuration to auto-generate this?

  • Hey SY,

    Glad you were able to get this working, and thank you for sharing your fix so that others may view it as well.

    How can I edit a .cfg file? 

    I added the Idle.addFunc('&uartLog_flush'); manually.

    Is there a configuration to auto-generate this?

    Unfortunately, the .cfg file is not an auto-generated file and there are multiple knobs you can turn on/off here with regards to RTOS. For this reason, it's up to the customer to modify as it suits their application, which you have done. I don't know of a different way to approach this other than what you have done already.