The FreeRTOS ported to the Arduino "DUINOS" had many problems and the author had to make "special libraries" to allow the Arduino commands/functions to work with their FreeRTOS port.
FreeRTOS on The Maple?
(89 posts) (15 voices)-
Posted 5 years ago #
-
Have folks looked at TinyOs?
http://www.tinyos.net/I have been (a bit:-) obsessed about networks of collaborative robots for a while, which is why I became interested in TinyOS.
It is designed for a 'mote' network, and has its own distributed, wireless mesh, network implementation.
http://docs.tinyos.net/index.php/FAQIt is rather wierd. Programs are often written in a special version of C called nesC, which is parsed by the toolchain to build a minimal image, and guarantee certain properties (don't ask which, I'll have to dig out the book).
AFAIR, the 'outer structure' needs to use nesC, but the rest could be C.
It appears that there is already an initial port to stm32f:
http://tschmid.webfactional.com/projects/1/though this is not likely to progress much further according to their judgement of STM32F low-power modes. They are continuing with other Cortex-M3, so the basic toolchain should be workable.
Posted 5 years ago # -
I have looked at the TinyOs but the cat's meow is Synapse's RF engines which uses a subset of Python for over the air logic programming. (up to 3 miles LOS) The RF engines operate at 3.2 volts VCC and also on batteries for years. Interfacing to the Maple is a "SNAP". The Maple provides 15 interrupts max. for the RF engine for interfacing.
My RF controller mimic's the Apple ipod iTouch. For a better name it is a Maple x-Touch controller with QVGA touch screen with micro SD and sound, DS3231 RTC, Snap RF Engine interface, along with a future WiFly and sensor interface. This x-Touch controller receives and tranmsits security, enviromental and sensor data.
The Maple is perfect for my application because of the massive amount of interrupts
and hardware resources that it provides. It would take several Arduino's to duplicate
my Maple X-Touch Snap RF controller. That is why by having a RTOS, whether it is built in or as an additional library addon would be very helpful.Posted 5 years ago # -
Synapse RF Engine does look lovely. Which ones do you recommend?
TinyOS is an open source, BSD licensed, operating system, and development tools. It has several parts, one is it's own wireless networking software. It is more like Synape SNAP, than the Synapse Wireless RF engine.
If you are using the Synapse RF engine, it's likely you could use TinyOS, though there'd be work. But that is true for any RTOS.
Posted 5 years ago # -
For simplest implement any OS i suggest make next mosifications
in systick.c
volatile uint32 systick_timer_millis = 0;
...
void SysTickHandler(void) {
systick_timer_millis++;
}
to
volatile uint32 systick_timer_millis = 0;
void (*systick_user_callback)(void) = NULL; // User systick callback function
void systick_set_callback(void (*systick_callback)(void))
{
systick_user_callback = systick_callback;
}
...
void SysTickHandler(void) {
systick_timer_millis++;
if (systick_user_callback != NULL)
(*systick_user_callback)();
}
and in systick.h add one line
void systick_set_callback(void (*systick_callback)(void));after this changes any OS can be implemented via SysTick interrupts
Posted 5 years ago # -
Quote: "Synapse RF Engine does look lovely. Which ones do you recommend?"
Reply: The 200 series (Atmel with 2 Mbps) late Oct/Nov.
Note: For the UK, I think you need the 900MHZ 300 series?Note: Python is built into each module. Python is the RTOS (SNAP)
Posted 5 years ago # -
Perry H can this be done without "disturbing" the Maple firmware?
Quote: from x893 ...
For simplest implement any OS i suggest make next mosifications
in systick.c
volatile uint32 systick_timer_millis = 0;
...
void SysTickHandler(void) {
systick_timer_millis++;
}
to
volatile uint32 systick_timer_millis = 0;
void (*systick_user_callback)(void) = NULL; // User systick callback function
void systick_set_callback(void (*systick_callback)(void))
{
systick_user_callback = systick_callback;
}
...
void SysTickHandler(void) {
systick_timer_millis++;
if (systick_user_callback != NULL)
(*systick_user_callback)();
}
and in systick.h add one line
void systick_set_callback(void (*systick_callback)(void));after this changes any OS can be implemented via SysTick interrupts
Posted 5 years ago # -
Most of RTOS use SysTick hardware to implement task switching.
Maple (and Arduino) not support any way to inject to it.
Only use other timer (it need changes in RTOS soft) or make this changes in core (better if all interrupt handlers support this methods).
I post MaplCoOS library codes here http://akb77.com/g/mcu/maplecoos/Posted 5 years ago # -
This is great X893! I don't believe it? How could you have finished this RTOS for the Maple
in such a short period of time? Anyway, thanks for the contribution!
Now, I will run some testing on your MapleCoOS library.Posted 5 years ago # -
it finished. very helpfull for beginner (as me) to publish codes on your side except outside. i think very helpfull (not deal with maple and arduino also) preserve custom interrupt handers. in C very simple method return true if no other action needed and false if default handler action. it open new horizont to core injection library (or custom handler) without any change in core.
Posted 5 years ago # -
x893 - Very nice work.
I admit I haven't read the CoOS documentation, so this may be 'obvious' ...
In setup:
void setup() { // initialize the digital pin as an output: pinMode(ledPin, OUTPUT); CoInitOS(); CoCreateTask(task_init, (void *)0, 10, &task_init_Stack[TASK_STK_SIZE-1], TASK_STK_SIZE); CoStartOS (); }
It calls
CoCreateTask(task_init ...
and task_init is
void task_init(void *pdata) { CoCreateTask(led_blink, (void *)0, LCD_BLINK_PRI, &led_display_Stack[TASK_STK_SIZE - 1], TASK_STK_SIZE ); CoCreateTask(uart_print, (void *)0, UART_PRINT_PRI, &uart_print_Stack[TASK_STK_SIZE - 1], TASK_STK_SIZE ); CoExitTask(); /*!< Delete 'task_init' task. */ }
Instead, could setup just have been:
void setup() { // initialize the digital pin as an output: pinMode(ledPin, OUTPUT); CoInitOS(); CoCreateTask(led_blink, (void *)0, LCD_BLINK_PRI, &led_display_Stack[TASK_STK_SIZE - 1], TASK_STK_SIZE ); CoCreateTask(uart_print, (void *)0, UART_PRINT_PRI, &uart_print_Stack[TASK_STK_SIZE - 1], TASK_STK_SIZE ); CoStartOS (); }
Or is it necessary to have the task_init?
Posted 5 years ago # -
yes - i use example from CoOS. you can optimize calls as you want. remove task_init and use in setup proc task initialization. all steps directly from CoOS docs
Posted 5 years ago # -
x893 - Thank you. I thought I might have missed something.
Does CoOS do anything to try to detect a task running beyond the end of its stack?
Posted 5 years ago # -
I think all questions about CoOS here
http://coocox.org/Forum/forum.php?id=1Posted 5 years ago # -
<General comments about x893's RTOS library MapleCoOS>
#1. The sketch example provided by X893 can be expanded by using other functions in the library. His 9 keywords can be expanded to include ALL the others in the library. Be sure to inspect the file "OsConfig.h" to enable and disable additional options/code.
#2. MapleCoSO makes it very convient to prioritize tasks. (preemptive priority)
#3. The use of this library for commercial purposes is still unknown?
#4. Help information:
Instructions/User Guide for the MapleCoOS or CooCox CoOS (download PDF) can be found on this link: Also, the online version can also be found at this same link.
http://coocox.org/CoOS.htm
(For CoOS specific help join their user forum.)BTW ... good job X893 on the library conversion!
Posted 5 years ago #
Reply »
You must log in to post.