AnsweredAssumed Answered

Printf error on MQX Lite

Question asked by Wenderson Oliveira on Aug 26, 2014
Latest reply on Sep 5, 2014 by Wenderson Oliveira

Hi all,


I'm using the MQX Lite on my FRDM KL25Z.

I'm having a problem with printf inside a loop. This is the code:


void Initial_task(uint32_t task_init_data)
  uint32 ptr;

  #ifdef DEBUG
  for(ptr = 0; ptr < 10; ptr++)
       printf("\n"); //Clear terminal
  printf("\n< start >\n\n");

  printf("\n> Hardware Initializated\n");


      int i;
      if (LED_GetVal())
           printf("\nLED on");


The printf inside the "for" isn't working. When I run that code, the program stops at PE_ISR(Cpu_ivINT_Hard_Fault).

I can make it work by removing the printf function from loop. But, why that isn't working at this loop?