AnsweredAssumed Answered

Printf not working correctly for MQX_Lite?

Question asked by Amit Kumar on Jul 23, 2014
Latest reply on Jul 23, 2014 by Amit Kumar

Hi

I am using codewarrior 10.5. I have created a new MQX Lite project. In that I am using Console_IO PE component. When I tried printing string it works well. When I tried printing integer values, I noticed some strange behavior. i.e

1. "\n" is not working when using at the end of a string.

2. For the following program, the values are coming abruptly

         

void Init_task(uint32_t task_init_data)

{

int i;

     while(1)

      {

          printf ("i = %d\n", i++);

           _time_delay_ticks(1000);

      }

}

 

the o/p I am getting in terminal window is

 

serial.jpg

I am using K60 uc. The above o/p is for one shot. i.e it repeats each time after _time_delay_ticks(1000);

I found one document MQX_IO drivers. http://cache.freescale.com/files/32bit/doc/user_guide/MQX_IO_User_Guide.pdf   on page no 16, there are functions for IO so for printf we can use _io_printf but that is giving an error.

How do I fix this issue. Initially I will be displaying the data in terminal window later I will be storing the values in SD card. But if this error persists then It won't be possible. Please look into this matter.

 

Kind Regards

Amit Kumar

Outcomes