[NEWS] The ChibiOS Book

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: [NEWS] The ChibiOS Book

Post by Tectu »

Giovanni wrote:The material keeps growing. Probably it would be a good idea to create 2 distinct books. The first one would be about RTOS concepts and the RT kernel in details. The second about the HAL and playing with the STM32 (more "fun").

This would also let me to focus on the kernel part and have it ready earlier.

As suggested earlier ;-)
It's definitely the right move to make in my opinion.


~ Tectu
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NEWS] The ChibiOS Book

Post by Giovanni »

Tectu wrote:As suggested earlier ;-)
It's definitely the right move to make in my opinion.


~ Tectu


Credit given :)

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: [NEWS] The ChibiOS Book

Post by barthess »

Chapter 5 - Introduction to the RT Kernel/Thread Working Areas:
Could you explain purpose of all this sections a bit more? Most of them are port-dependent, but could you explain all of them for certain MCUs?

Chapter 7 - RT System Layer/Abnormal Termination:
Some time (years) ago (hell, how fast the time runs!) I introduced "post mortem UART driver" for stm32. What about standard HAL driver for that purpose? Especially with combo with http://sourceforge.net/p/chibios/feature-requests/37/
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NEWS] The ChibiOS Book

Post by Giovanni »

OK about the more info.

About the feature request, there is a specific reason, the message is not used because some MCUs simply don't have enough memory to hold all messages, see AVR where strings are stored in RAM by default. In 3.0 I had to reduce the usage because there are more assertions in 3.0.

The only thing really needed is an halt function, everything else is available in the stack trace, function, line, file. A descriptive string is not really required.

Because the above, any advanced logging capability will have to be custom, the kernel just needs to provide the required hooks.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NEWS] The ChibiOS Book

Post by Giovanni »

I started adding code samples in the latest two chapters, I would like to have some feedback about the examples style, too complex? too abstract? not sufficient?

Thanks,

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: [NEWS] The ChibiOS Book

Post by barthess »

1)"Spawning and Resynchronizing". Should chThdShouldTerminateX() must be used instead of chThdTerminatedX()

2) "Processing Frames"

Code: Select all

  /* If the network is down all the waiting threads are notified.*/
  if ((NET->SR & NET_SR_ERROR) != 0 {
    /* Entering I-Locked state and waking up all threads with a
       special message.*/
    chSysLockFromISR();
    chThdDequeueNextI(&rx_frames_queue, MSG_RESET);
    chSysUnlockFromISR();
 
    /* Resetting interrupt source.*/
    NET->SR &= ~NET_SR_ERROR;
  }

may be chThdDequeueAllI()?

3) "Priority Ceiling". Example should be closer to real usage. I feel that the solution is an elegant, but can not think of a use case for it.

4) "Time Bounded Loop".

Code: Select all

  systime_t start = chVTGetSystemTime();
  systime_t end = now + MS2ST(200);

should "now" variable be replace by "start"?

5) Passing of arguments (void *arg) to thread functions and VT callbacks should be described a bit more.

6) Examples are good from my point of view but we need some feedback from newcomers.

Offtopic:
Now I am understand destination of chThdYield() function.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NEWS] The ChibiOS Book

Post by Giovanni »

Thanks for finding all the errors :)

I just couldn't think to a better example for priority change, it is something that should be avoided too.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NEWS] The ChibiOS Book

Post by Giovanni »

It is becoming huge I fear, I haven't yet added all the chapters related to kernel yet too...

I think the first one will be like a huge RTOS manual with lots of example, the name could be: "ChibiOS/RT 3.0 - The Ultimate Guide". This one could be ready for the 3.0 release.

The second book could be about the HAL on a specific platform, STM32 initially I think: "ChibiOS/RT and HAL - Learning on the STM32". This one more oriented to an hand-on experience.

BTW I wouldn't mind if other authors write something similar for other platforms, we could share effort and, hopefully, income.

About the book, I think that lulu.com could be a good idea, prices are interesting and they are able to produce both paper and ebooks. I think paper will be more popular because the size.

Giovanni
User avatar
jcw
Posts: 55
Joined: Thu May 23, 2013 12:59 am

Re: [NEWS] The ChibiOS Book

Post by jcw »

I don't think this has been mentioned yet - if you're writing in Markdown, this is another great site for publishing, IMO: https://leanpub.com/p - see also https://leanpub.com/lean for the point of it all.

And if you're not using Markdown: http://freecode.com/projects/pandoc can convert most text formats to it (as well as the other way around and numerous other combinations).

-jcw

PS. I'm really looking forward to the ChibiOS book!
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NEWS] The ChibiOS Book

Post by Giovanni »

Hi,

Tanks for the links, I am using the docuwiki text format right now but I think it can be converted to that format.

The book is about at 50% of the raw material, working on the hardest part now: events.

Giovanni
Post Reply