Hello_via_task Ada example on Rapberry

Joel Sherrill joel.sherrill at oarcorp.com
Tue Jul 14 20:26:01 UTC 2015



On 7/14/2015 3:13 PM, Jan Sommer wrote:
> One question. If the Ada main thread is created using pthread in the beginning and then creates new task
>(in Ada), do these tasks take their stack from the Ada main thread or do they get their own stack
>allocated from available memory?

Ada tasks are just pthreads and their stack comes from the workspace.

One option is some selectively placed debug statements.

+ score/src/objectallocate.c already has a debug section you
can turn on to print on object allocation failure. This would
let you know if you ran out of pthreads, semaphores, etc.

+ libcsupport/src/malloc.c for a NULL being returned.

+ score/src/wkspace.c - _Workspace_Allocate for a NULL being
returned. There is a printk in here which prints every allocation
and the return addresses.

If it is a resource issue, that should help narrow it down.

> Am Sonntag, 12. Juli 2015, 18:31:57 schrieb Jan Sommer:
>> Am Sonntag, 12. Juli 2015, 10:26:56 schrieb Joel Sherrill:
>>> Just to make sure we are on the same page, what gcc version?
>>
>> gcc 4.9.2
>>
>>>
>>> It sounds like the number of resources configured might be off. Can you try unlimited objects and unified workspace? They are CONFIGURE_ parameters.
>>>
>>
>> I added
>> #define CONFIGURE_UNIFIED_WORK_AREAS
>> #define CONFIGURE_UNLIMITED_OBJECTS
>> to the rtems-init.c of the Ada examples I hope this does not conflict with the other defines like
>> #define CONFIGURE_MAXIMUM_TASKS                         20
>> #define CONFIGURE_MAXIMUM_SEMAPHORES          20
>>
>> #define CONFIGURE_GNAT_RTEMS
>> #define CONFIGURE_MAXIMUM_ADA_TASKS      20
>>
>> #if !defined(CONFIGURE_MAXIMUM_FAKE_ADA_TASKS)
>>    #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
>> #endif
>>
>> #if !defined(ADA_APPLICATION_NEEDS_EXTRA_MEMORY)
>>    #define ADA_APPLICATION_NEEDS_EXTRA_MEMORY 0
>> #endif
>>
>> /* Account for any extra task stack size */
>> #define CONFIGURE_MEMORY_OVERHEAD \
>>    (ADA_APPLICATION_NEEDS_EXTRA_MEMORY + GNAT_MAIN_STACKSPACE)
>>
>> Still the task hangs after it calls the delay.
>>
>> Best regards,
>>
>>    Jan
>>
>> _______________________________________________
>> users mailing list
>> users at rtems.org
>> http://lists.rtems.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
>

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list