Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Due to restrictions of the ARM EABI, uC/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 can be found in the IAR project menu under Options... > General Options  > Library Options.

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

//app variables
#pragma data_alignment = 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.

  • No labels