Pages: 1 ... 4 5 [6] 7 8 ... 13   Go Down
Author Topic: DuinOS: small and simple rtos  (Read 47770 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
CJH Innovations
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, but it is not a memory issue.
I moved the HEAP size down to as low as 200 and still no difference.
WiShield SimpleServer works until I choose the ATmega328 + DuinOS board in the IDE.

The only feature of FreeRTOS that I found was uxTaskGetStackHighWaterMark() which returns STACK information, not HEAP info.

I'll continue my quest for a software conflict.
Logged

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

You will still need to lower the default heap size for FreeRTOS in order to use the SimpleServer example of WiShield.  When I compiled that app with FreeRTOS and using the default 1200 byte heap size it was using 2352 bytes of SRAM which is obviously too much.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
CJH Innovations
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for all of your help. I am new to the Arduino platform and have not been able to find the info that I need without asking.

So, how did you determine that it required 2352 bytes of RAM?


Logged

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

See the post here on how to manually calculate the static memory usage:
http://web.goodrobot.com/blog/2009/10/arduino-crashes-and-memory-usage/

There is also a binary called avr-size that is available on some platforms that will do this for you.  It is something the Arduino IDE probably should be doing automatically for you but doesn't.
« Last Edit: December 08, 2009, 10:17:05 pm by chumbud » Logged

Pisa, Italy
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, is there a repository (svn, git, whatever) of this project?
The forum isn't really comfortable to keep track of changes.
Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 188
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

We will put online it as soon as possible. I think it will be a wiki, as chumbud suggested. We released the v0.1 Alpha as soon as it was ready (or something similar to ready), and are working on the project, which is part of a bigger project. We have finished this week a lot of things (but not directly related to DuinOS) and I hope will have news soon.

Regards, and thanks!
Julián
http://robotgroup.com.ar
« Last Edit: December 09, 2009, 08:02:15 pm by juliandasilva » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Julian,

Good stuff.  Thanks for doing this.  I'm an old embedded systems programmer who's been away from it for about 20+ years.  I cut my teeth with preemptive multitasking systems so it's good to have something familiar in the Arduino environment.

I've been reading on the FreeRTOS site and others and it looks like the taskENTER_CRITICAL() just disables interrupts.  Help me connect the stale synapses in my brain on the matter.  If I am updating data in an interrupt routine then I'm pretty safe but in tasks I need the critical sections to ensure nothing gets changed by an interrupt.  

What about println() functions?  Are they thread safe?  I got the impression they are not.

Anyway, keep up the good work.  Can't wait until your next rev.  Let us know if there's an area you'd like us to work on.
Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 188
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Mark, thanks for your comments. The critical sections are not necessary in most cases. Just when you are making something very time-critical (for example emulating by software bus protocols, like OneWire, wich is not working yet with DuinOS).

The taskENTER_CRITICAL() disables the interrupts and saves the SREG, but because the FreeRTOS kernel is portable, it may be doing something else in other MCUs.

Regarding the println functions, they seem to be working. Looking at the code, I do not expect problems with them (did you see something wrong?), please tell me if if there is any issue.

One open issue where it's possible to do something is the mentioned OneWire library.  Another possibilites are writing examples.

Many thanks! and regards,
Julián
http://robotgroup.com.ar
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
CJH Innovations
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Julian,
Your comment about the OneWire interface makes me want to ask about the other interfaces.
Do you have the SPI and Two Wire systems working with DuinOS?
Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 188
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

We did not test them yet, but:

- According to other users previous posts in this forum, the I2C is working.

- The main problem with OneWire is that it uses a lot of delayMicroseconds, and that it emulates by sofware the bus. By other hand, I2C (well TWI here) and SPI are mostly done by the AVR's hardware, so I expect them to work, just like the serial works,

Regards,
Julián

Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 188
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, we have the DuinOS wiki on line! It's a small wiki yet, but please make it grow!

The main page URL is:

http://www.multiplo.org/duinos/wiki

And here is the Tracker page, where everyone can comment which Arduino libraries are working, which are not, and report bugs:

http://www.multiplo.org/duinos/wiki/index.php?title=Tracker

Many thanks in advance for your contributtions here!

Regards,
Julián

« Last Edit: December 27, 2009, 01:05:41 pm by juliandasilva » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Robots love Arduinos
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Julian,

This is just great!.  I've been looking at FreeRTOS and other OSes for microprocessors like Micrium's. I'm working on my first robot and pre-emptive multitasking seems such a natural fit for robot software.

Now to find a JavaVM for the Arduino. Perhaps the Mega.

The only thing about these small OSes, though,  is there is no memory management/protection which can make debugging a real beast.

Dennis
Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 188
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Dennis, thanks for your comments!

Regarding the VM, I think one of the biggest advantages of Arduino over other platforms (like stamps, or the ones based on Java) is that it executes native code. But, if you really want a VM, you can try this one  (I did not test it and it's not Java, it's Python):

http://code.google.com/p/python-on-a-chip/

and yes, for the Mega, as you said, cause the M328 is too small to fit it.

Well, good luck with your robot! Please feel free to contribute to the wiki, or if you have sample code running with DuinOS it's welcome too!

Regards,
Julián
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Julian,

I'm having trouble with Serial.println() locking up my Seeeduino Mega.  I have a simple PIR on the pin 3 interrupt that toggles a state value when changed.  It gives a binary semaphore that the task loop is waiting on.  The Loop() routine is just spitting out text to let me know it's alive.

The task prints out a string followed by a byte hex value (eg. Serial.print(PIR_state, HEX) ).  Seems if I just spit out text is fine, but any value stops things up good.

To simplify things, I had the loop() function give the semaphore and the same thing happened - text worked, values did not.

I added the #ifdef statements you suggested for SerialHardware.cpp and .h.  Any thoughts?

Let me know if you'd like me to post on the bug tracker.
Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 188
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Mark, could you upload the whole code here so we can test it? Then if it still does not work, you can add it to the Tracker.

Of course, as the documentation is a wiki, you can add it there directly, but I think by the moment more people will read the code here first and may suggest a solution.

Thanks!

Regards,
Julián
Logged

Pages: 1 ... 4 5 [6] 7 8 ... 13   Go Up
Jump to: