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.

CCS/LAUNCHXL-CC26X2R1: printf() not work in Flash mode (But"debug mode" work fine)

Part Number: LAUNCHXL-CC26X2R1

Tool/software: Code Composer Studio

Hi,

We have a customer with below concern:

I try to using "printf()" show in "console:CIO window" , when i using "CCS debug mode", it work fine !
"printf()" and "led flashes" regularly and follow my code.

but when i using CCS flash mode (Click flash icon), "printf()" only show once, but led also flashes regularly,
any mistakes? i using Code Composer Studio 10.1.1.00004 and Below is my code,
Thank you!

#include <ti/display/Display.h>
#include <stdio.h>
#include <xdc/runtime/System.h>
#include <unistd.h>
#include <stdint.h>
#include <stddef.h>
#include <ti/drivers/GPIO.h>
#include "ti_drivers_config.h"

/*
* ======== mainThread ========
*/
void *mainThread(void *arg0)
{
uint32_t time = 1;
GPIO_init();
GPIO_setConfig(CONFIG_GPIO_LED_0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON);

while (1) {
printf("Hello world via printf\n");
GPIO_toggle(CONFIG_GPIO_LED_0);
sleep(time);
}
}

  • printf using the CIO mechanism requires a breakpoint to be set, and the CCS debugger reads the message from the target while halted before the target is resumed.

    What do you mean by "CCS flash mode"?

  • Roland,

    Clicking the "flash" (Run As) button in CCS is used for just programming the device.  It does not start a debug session. Thus you are not going to see any printf output as there is no debugger connected.

    If you want to debug then you will want to click on the debug button instead.

    Regards,

    John