RES: Trying to get Idle Task ID

Wendell Pereira da Silva wendell.silva at
Wed Jan 27 20:29:15 UTC 2010

Hi Fabricio,

I got something even strange. 

I tried here the following code:

rtems_id id;
rtems_status_code lenStatus =

printk("%d, %d\n", lenStatus, id);

I got RTEMS_SUCCESSUL and id == 0 (zero).
But when id == 0, it is supposed to be RTEMS_SELF!

Could anyone else help us?

BSP: sparc/erc32


-----Mensagem original-----
De: rtems-users-bounces at [mailto:rtems-users-bounces at] Em nome de Fabrício de Novaes Kucinskis
Enviada em: quarta-feira, 27 de janeiro de 2010 16:33
Para: 'RTEMS Users'
Assunto: Trying to get Idle Task ID

Hi all,

I'm trying to get the total amount of time used by any task (in
microseconds) as an unsigned long value that I can insert in a telemetry

For this purpose, my code is based on "rtems_cpu_usage_report_with_plugin",
and, AFAICT, it works correctly.

The function receives the task ID, loops through the Objects Information
Table, identifies the correct task and gets the amount of time.

The problem is that I cannot get the Idle task ID. I tried
"rtems_task_ident(rtems_build_name('I', 'D', 'L', 'E'))", but I receive an
"RTEMS_INVALID_NAME" error. I tried with "idle" and "Idle", with no results.
I also tried a constant from the CPU Usage chapter in the RTEMS C Users
Manual, "0x0401001", and got the same error.

>From an old (2006) post, I discovered that the Idle task name is a string,
so I tried to cast that string into a rtems_name variable. No way!

So, how can I get the Idle task name or ID? (I'm using RTEMS 4.8.1)

Thanks in advance,

Fabrício de Novaes Kucinskis - DEA / INPE
Onboard Data Handling Group - SUBORD
Aerospace Electronics Division
Brazilian National Institute for Space Research

rtems-users mailing list
rtems-users at

More information about the users mailing list