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");
  #endif

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

  SetAudio(2);

  for(;;)
  {
      int i;
      if (LED_GetVal())
      {
           printf("\nLED on");
           _time_delay_ticks(2000);
      }
  }

 

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?

 

Thanks

Outcomes