AnsweredAssumed Answered

printf cannot work with MQX?

Question asked by Zhang Jay on Aug 17, 2013
Latest reply on Mar 23, 2015 by David E Seymour

Hi,

I have a KL25Z board in my hand, when I use the console component in code warrior, I can use "printf" function to print log with serial port into PC com port.

But when I add the MQXLite and write printf in my code, I cannot get message on my PC.

 

void Task1_task(uint32_t task_init_data) {
  int counter = 0;
  LDD_TDeviceData *blueLed = Bit1_Init(NULL);
  bool ledVal = 1;
  printf("count: %d\n", counter);


  while (1) {
  counter++;
  printf("count: %d\n", counter);
  ledVal = !ledVal;
  Bit1_PutVal(blueLed, ledVal);
  _time_delay_ticks(10);
  /* Write your code here ... */


  }
}

 

with these code, I can see my blue led blink, but I cannot get serial port message.

Why ?

Is there any where to set when using printf in MQX?

Outcomes