Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Due to restrictions of the ARM EABI, µCuC/OS-II task stacks must be 8-byte aligned for proper printing of floating point types, in addition to using the large or full printf formatter. The printf formatter  formatter can be found in the IAR project menu under Options...->General Options->Library  > General Options  > Library Options.

This can be accomplished using the data_alignment pragma pragma, e.g.

Code Block

...

noformat
language
cpp
//app variables
#pragma data_aligment = 8
OS_STK myTaskStack[STACK_SIZE];
  
...
  
// prototypes
static void myTask(void* unused);

...

//create the task
osErr = OSTaskCreateExt(

     myTask,
  
   (void *) 0,
  
   (OS_STK*) (&myTaskStack[STACK_SIZE-1]),
  
   PRIORITY,
      PRIORITY,

     (OS_STK*) &myTaskStack,
  
   STACK_SIZE,
  
   (void *) 0,
  
   OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR
   );

...

...

 

See also http://supp.iar.com/Support/?Note=85413.