NIL 4.0.0 Documentation

Discussions and support about ChibiOS/NIL, the almost nil RTOS.
User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 81 times
Been thanked: 46 times

NIL 4.0.0 Documentation

Postby tfAteba » Sat Jan 18, 2020 4:00 pm

Hello Giovanni,

I don't see the documentation of the NIL 4.0.0, may be it is not released yet?
I'm looking on this page: http://www.chibios.org/dokuwiki/doku.php?id=chibios:documentation:start

I need to update AVR NIL demo because of new method on the NIL API.
THD_TABLE_ENTRY have been replace by THD_TABLE_THREAD in file: includet/ch.h:583:#define THD_TABLE_THREAD(_prio, _name, _wap, _funcp, _arg)

So I need to know the new parameters used by the new API. It is present in code source but I wanted to look at the online documentation.
Is there another place to look please?
regards,

Theo.

User avatar
Giovanni
Site Admin
Posts: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: NIL 4.0.0 Documentation

Postby Giovanni » Sat Jan 18, 2020 6:38 pm

Hii,

It is not yet released but you could look at the demos in trunk.

Note that there is a huge difference, threads can be defined in the table OR created at runtime. In chconf.h you can define how many priority level you need, then you can have one thread at each priority level (or none). It is not possible to have multiple threads at same priority, just like the previous NIL.

The table has one extra parameter for each thread: the priority:

In chconf.h:

Code: Select all

/**
 * @brief   Maximum number of user threads in the application.
 * @note    This number is not inclusive of the idle thread which is
 *          implicitly handled.
 * @note    Set this value to be exactly equal to the number of threads you
 *          will use or you would be wasting RAM and cycles.
 * @note    This values also defines the number of available priorities
 *          (0..CH_CFG_MAX_THREADS-1).
 */
#if !defined(CH_CFG_MAX_THREADS)
#define CH_CFG_MAX_THREADS                  8
#endif


In main.c:

Code: Select all

/*
 * Threads creation table, one entry per thread.
 */
THD_TABLE_BEGIN
  THD_TABLE_THREAD(0, "blinker1",     waThread1,       Thread1,      NULL)
  THD_TABLE_THREAD(1, "blinker2",     waThread2,       Thread2,      NULL)
  THD_TABLE_THREAD(4, "tester",       waThread3,       Thread3,      NULL)
THD_TABLE_END


Note that the "tester" thread needs 2 free priority levels before and after itself, it needs those empty slots to create its own threads during execution. Zero is the highest priority, the main has implicitly the lowest priority and is the idle thread (just like before).

Giovanni

User avatar
tfAteba
Posts: 526
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 81 times
Been thanked: 46 times

Re: NIL 4.0.0 Documentation

Postby tfAteba » Sun Jan 19, 2020 12:41 am

Yes, I look at STM32 demo to make changes.

Thanks for all details on how thing works.
regards,

Theo.


Return to “ChibiOS/NIL”

Who is online

Users browsing this forum: No registered users and 1 guest