Pages: [1]   Go Down
Author Topic: ChibiOS/RT 2.4.0 RTOS update  (Read 1856 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1673
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have updated the ChibiOS/RT library to version 2.4.0.

This library is a simple way to use the ChibiOS/RT RTOS on 328 and Mega Arduinos.

The download is ChibiOS20120221.zip at http://code.google.com/p/beta-lib/downloads/list.

The main new thing for AVR is support for pal (digital I/O).  If you want to try this edit halconfig.h and change line 47 to this.
Code:
#define HAL_USE_PAL                 TRUE
I have not tested pal, just checked that it compiles with the above define.  A lot of edits will be required since the default board is a Olimex AVR-MT-128 proto board.

There are a huge number of internal changes.  The diff between 2.2.8 and 2.4.0 versions of the utility folder in the Arduino library has 4739 lines.

There are a lot of new files.  Most of the new files are for features not supported for AVR

« Last Edit: February 21, 2012, 10:45:44 am by fat16lib » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

Thanks for your effort porting to ChibiOS, I was searching for something similar, because programming without an RTOS sometimes is not easy (and i don't want to start one more discussion about bare metal programming vs RTOS, it just depends on the complexity, even for such a limited device there is space for a RTOS in my opinion, usefull for some types of requirements). The problem I face in your porting is how to use it. i'm not familiar with ChibiOS, can you give some tips on how to use your port? From what I saw in the readme you are integrating it in the Arduino environment, so the IDE will still be the Arduino even using the ChibiOS (something like the DuinOS)? Does it work with the Arduino 022? or with 1.0? And the diferent folders, I didn't understand well what to change between the supplied folders and the original files from the chibiOS. If you can give some tips on how to do it it will be great!

Best regards

Fernando
Logged

Netherlands
Offline Offline
Jr. Member
**
Karma: 1
Posts: 93
Profile before you Optimize.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very nice indeed. Thanx very much.

I've read that the delay function does not work (correctly?) in an interrupt handler routine. Can delay (or standard libs that use delay - like LCD) be used in the threads of ChibiOS?
Logged


0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1673
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino delay function will block all lower priority threads or all threads if used in an interrupt routine.

Arduino delay is just a loop that does not release the CPU:
Code:
void delay(unsigned long ms)
{
uint16_t start = (uint16_t)micros();

while (ms > 0) {
if (((uint16_t)micros() - start) >= 1000) {
ms--;
start += 1000;
}
}
}

You should use ChibiOS thread functions like:
Quote
void    chThdSleep (systime_t time)
    Suspends the invoking thread for the specified time.

void    chThdSleepUntil (systime_t time)
    Suspends the invoking thread until the system time arrives to the specified value.

You can use scheduler functions to put a thread to sleep or wake a thread.

You can often use synchronization functions in place of delay.

Documentation is here http://chibios.sourceforge.net/docs/kernel_avr_gcc_rm/group__base.html.

Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks / OpenLCB rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, nice documentation!   The pages are very clear, the tree is great, and the references to the actual code.  Is the underlying structure of those webpages available to other groups?   
Thanks.
Logged

Dr. David Harris
OpenLCB Dev Team

Pages: [1]   Go Up
Jump to: