Can't create two tasks

TUAZ TORCHON, Dimitri dimitri.tuaztorchon at
Mon Nov 2 15:11:50 UTC 2015

Hi everyone,

I use RTEMS on a MicroBlaze processor (implemented in a Spartan6 FPGA, on a SP605 evaluation kit), and I can't create two tasks. I have tried this simple code :

rtems_task Init(
  rtems_task_argument ignored
  rtems_status_code status_rtems;

  printf("\n*** Test begins *** \n\n");

  Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
  Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );

  /* Creating and executing task 1 */
  status_rtems = rtems_task_create(
                                   Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
                                   RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
  printf("\n At the end of task create 1, status_rtems = %d\n",(int)status_rtems);

  status_rtems = rtems_task_start( Task_id[ 1 ], print1, 1 );
  printf("\n At the end of task start 1, status_rtems = %d\n",(int)status_rtems);

  /* Creating and executing task 2 */
  status_rtems = rtems_task_create(
                                   Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
                                   RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ]
  printf("\n At the end of task create 2, status_rtems = %d\n",(int)status_rtems);

  status_rtems = rtems_task_start( Task_id[ 2 ], print2, 1 );
  printf("\n At the end of task start 2, status_rtems = %d\n",(int)status_rtems);


rtems_task print1(rtems_task_argument unused){
  printf("\nTask 1 is executing !\n");


rtems_task print2(rtems_task_argument unused){
  printf("\nTask 2 is executing !\n");


And in my terminal I've got this :

*** Test begins ***

At the end of task create 1, status_rtems = 0

At the end of task start 1, status_rtems = 0

At the end of task create 1, status_rtems = 13

At the end of task start 1, status_rtems = 14

Task 1 is executing

As you can see, task 1 is created, and executes fine. But the creating of task 2 return the status : RTEMS_UNSATISFIED - not enough memory for stack/FP context.
However, I have plenty of space left on my RTEMS Workspace, and I do not use floating point context.
Going deeper with GDB, I have found that is the allocation in the heap that goes bad :
In function _Heap_Allocate_aligned_with_boundary (in cpukit/score/src/heapallocate.c), the Heap_Block "block" and "free_list_tail" have their fields next and prev pointing to themself.

I also tried to delete task 1 after the creation (the deleting was successful), but I have got the same error when creating task 2.

As anyone of you has an explication ?

Thanks a lot,
Dimitri Tuaz

Ce courriel (incluant ses eventuelles pieces jointes) peut contenir des informations confidentielles et/ou protegees ou dont la diffusion est restreinte. Si vous avez recu ce courriel par erreur, vous ne devez ni le copier, ni l'utiliser, ni en divulguer le contenu a quiconque. Merci d'en avertir immediatement l'expediteur et d'effacer ce courriel de votre systeme. Airbus Defence and Space et les sociétés Airbus Group declinent toute responsabilite en cas de corruption par virus, d'alteration ou de falsification de ce courriel lors de sa transmission par voie electronique.
This email (including any attachments) may contain confidential and/or privileged information or information otherwise protected from disclosure. If you are not the intended recipient, please notify the sender immediately, do not copy this message or any attachments and do not use it for any purpose or disclose its content to any person, but delete this message and any attachments from your system. Airbus Defence and Space and Airbus Group companies disclaim any and all liability if this email transmission was virus corrupted, altered or falsified. 
Airbus Defence and Space SAS (393 341 516 RCS Versailles) - Capital: 16.587.728 EUR - Siege social: 51-61 Route de Verneuil, 78130 Les Mureaux, France
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list