Show Posts
Pages: [1]
1  Development / Other Software Development / Re: RTuinOS: A Real Time Operating System (RTOS) for Arduino 1.0.1 on: June 02, 2014, 02:09:51 pm
Hello,

Unfortunatley I can't reproduce your problem as I have a different system (Windows, avr-gcc 4.3.2), which obviously doesn't have this problem.

A basic, general tip: Run the same build command without the -s; the actually used compiler and linker command lines will become apparent in the console output and if you compare them with the online help of these tools you might get a step ahead. Then copy the critical command line and enter them directly in the shell to see if you can reproduce the same error. If so, you can start manipulating the command line until you get the linker succeesfully run or let it at least print more meaningful messages.

If the printed error messages were literally correct all you'd to do is to remove the three options from the command line; none of them is essential. (Although it could indeed be just a matter of differences in the linker interface of our two versions, I don't really believe so. I'd rather guess that the reported problem is a subsequent fault and that you will have to find the true problem.)

Given, you've found a properly working linker command line it's straight forward to change the makefiles so that they adopt your findings. Open file makefile/compileLinkAndUpload.mk and change the definition of variable lFlags. Look for "Linking project".

And please let us know ...

Thanks,
Peter

P.S. Please note, that this topic refers to the first release of RTuinOS (0.9). Meanwhile, version 1.0 has been released. If you still work with the first release, the first thing you should do is to download, install and try the current revision. Please visit http://forum.arduino.cc/index.php?topic=184593.0 to get more information
2  Development / Other Software Development / Re: RTuinOS: A Real Time Operating System (RTOS) for Arduino 1.0.1 on: March 24, 2014, 03:44:52 pm
What do you think about Raspberry Pi, which seems to be even somewhat cheaper than the Due?
3  Development / Other Software Development / Re: RTuinOS 1.0: Second Release of the Real Time Operating System (RTOS) for Arduino on: December 02, 2013, 02:55:27 pm
Thanks for the compliments!

I agree, making RTuinOS an IDE compatible library would probably increase its
everybody-usability. Unfortunately, at the moment I'm not planning to do so:
  -) The time. Meanwhile I'm busy with another project
  -) The tight integration into the IDE is a risk. One important chapter of the RTuinOS
manual highlights the problems with isolated RTOS, that come along without a powerful
framework of libraries. The IDE has such a framework, but none of the libraries can safely
be used for RTuinOS applications just like that. Multi-threading has not been an issue when
these libraries had been developed and one needs to do a careful code review prior to using
them. Therefore, a project like RTuinOS always is a bit different by principle
  -) Once setup, working with a makefile and a powerful editor like Emacs can be more
efficient than working with an IDE. Although a side effect only, developing a re-usable,
generic makefile is considered an important added value of the RTuinOS project. This
makefile can easily be used with any RTuinOS-free Arduino application. Only a little bit of
configuration is required.

The platform issue has been tackled with respect to the host. Linux, Windows and Mac should
be supported with version 1.0. Support of the different AVR controllers is only given by
comments and hints. Only a few code locations need modification but without having the
devices for testing I'd not dare to publish an implementation. Support of the 32 Bit ARM
architecture is however an interesting, challenging task and I can imagine to try it one
day (having a lot of time ...).

Implementing an RTOS without assembler code is an illusion. However, a more proper solution
would be a separation of proper, portable C code from handwritten assembler code files. I
didn't do so for simplicity/time/effort reasons. It would have meant to learn another
couple of things. (I didn't work with the GNU assembler so far.) A redesign of the code
would probably lead to such a separation. And it's even worse than just being controller
dependent; actually, we are compiler-revision-dependent. RTuinOS exploits very particular,
proprietary GNU C features; even the next release of GCC could break the code.
4  Development / Other Software Development / RTuinOS: DCF77 decoder task, re-usable, self-contained, easy to integrate on: October 30, 2013, 03:36:48 pm
Dear Arduino Fans,

we present a demo application for RTuinOS: A re-usable, self-contained
DCF77 task. DCF decoding as such is nothing new, you'll find many hits for
DCF77 and Arduino in the net; the added value of this sample is the
demonstration how easy and elegant such a decoder can be encapsulated when
using an RTOS. A functional interface decouples the DCF task from actual
I/O operations; it's safe and easy to integrate the task into various
applications that deal with time information. The additional task
increases the mean CPU load by only 1%.

The DCF task is distributed with a tiny test and development application,
which does nothing else than running the DCF task and printing the results
to the Arduino Serial Monitor. This sample application is called dcf77.

Secondary, the archive contains a modified copy of RTuinOS' test case
tc14. Among more, this test case implements a real time clock. The DCF
task is added to this sample in order to synchronize the real time clock
with the DCF time information. The modified test case is called tc14_dcf.

Please inspect tc14_dcf to find out how simple it is to integrate the
re-usable, self-contained DCF task. Consider to use a diff tool to find
the changes between the original and the modified sample.

The samples do of course require an external DCF receiver connected to the
Arduino board. Such a receiver can be purchased in the net for a few
Euros. The pin which the receiver's (digital) output signal is connected
to and the polarity of this signal are compile time constants in the
sample code. Please refer to the code documentation in the C file headers
for details, particularly tc14_dcf/tc14_adcInput.cpp.

Both sample applications can be compiled with RTuinOS 1.0. Unzip the
archive into the folder <RTuinOSInstallDir>/code/applications of your
RTuinOS installation and open a shell window. CD to the root directory
<RTuinOSInstallDir>, where GNUmakefile is located. Run make like:

make -s build APP=dcf77
make -s build APP=tc14_dcf

make -s upload APP=dcf77
make -s upload APP=tc14_dcf

The make target "upload" must be used only if the Arduino board is
connected. Maybe you have to specify the USB port on the command line,
please refer to the RTuinOS User Guide.

The code can directly be run on an ATmega 2560 board. Other boards might
need modifications, please refer to the RTuinOS User Guide.

Forum members, who are logged in, can download the archive of the DCF
decoder task directly from this topic; everybody can find it at
https://github.com/PeterVranken/RTuinOS

For forum members RTuinOS 1.0 is available at
http://forum.arduino.cc/index.php?topic=184593.0; everybody can find it in
GitHub at https://github.com/PeterVranken/RTuinOS and at
https://github.com/sudar/RTuinOS.


Kind regards

Peter Vranken
5  Development / Other Software Development / Re: RTuinOS: A Real Time Operating System (RTOS) for Arduino 1.0.1 on: August 26, 2013, 07:05:01 am
A new release of RTuinOS is available. This is the second release or version 1.0.2. It
introduces mutexes and semaphores. The kernel code, the makefile, the code
samples and the manual have been revised. The makefile based build process now
supports Linux, Mac OS and Windows.

Please refer to http://forum.arduino.cc/index.php?topic=184593.0 in this forum for
details. Or visit GitHub at https://github.com/PeterVranken/RTuinOS to get a safe
download.
6  Development / Other Software Development / RTuinOS 1.0: Second Release of the Real Time Operating System (RTOS) for Arduino on: August 26, 2013, 06:43:16 am
Dear Arduino Fans,

RTuinOS, the Real-Time Operating System (RTOS) for Arduino, has been
revised and is now released as 1.0.

Two technical changes have been made in comparison to the first release
(December 2012, version 0.9,
http://arduino.cc/forum/index.php?topic=138643.0): The event concept has
been generalized. Events can now be broadcasted events, semaphores or
mutexes. This permits to implement all the usual inter-task communication
patterns. Please refer to the user guide and the diverse code samples for
details.

The second technical change is a complete revision of the makefile. It has
been improved in many aspects and it now supports three operating systems;
the RTuinOS samples (as well as your applications) can be built under
Linux, Windows and Mac OS. Many thanks to Sudar Muthu
(mailto:sudar@sudarmuthu.com, http://HardwareFun.com), who has made the
port from Windows to the other systems.

To us Arduino is a toy and we believe it's the same to many of you. To
strengthen this idea we added one particular sample (tc14), which does not
only prove the operability of RTuinOS but also implements a true
application of the Arduino 2560 Mega board with the LCD shield. Different
tasks measure the analog input voltage and compute other information and
handle the button input. All of these tasks share the display to present
their information. The code is not only a test case but also instructive
and meant as a practical how-to-do guide. We hope this sample will spark
your interest in running RTuinOS on your Arduino board!

RTuinOS 1.0 is distributed as setup (a ZIP archive), which contains all
source files and the complete documentation, also with source files.
Building the samples can be started immediately after unzipping and
setting a single environment variable (not necessary for those, who
already run RTuinOS 0.9).

Forum members can download the setup from the forum, but in the past this
turned out to be unreliable. A second location for the download of the
setup is https://github.com/PeterVranken/RTuinOS. Click on the desired ZIP
file entry (RTuinOS-1.0.2.zip), then on button Raw to start the download.

Furthermore, Sudar Muthu set up a GitHub repository meanwhile which hosts
all the source files. This repository will become the principal location for
future development of RTuinOS. Please visit https://github.com/sudar/RTuinOS.

Thank you for your kind interest in RTuinOS; your feedback is welcome.

With kind regards

Peter Vranken
7  Development / Other Software Development / Re: RTuinOS: A Real Time Operating System (RTOS) for Arduino 1.0.1 on: May 28, 2013, 01:59:58 am
Hi Henry,

I'm very sorry, but actually I didn't intend to support the Arduino IDE.
RTuinOS and its applications are intended to be built by makefile only.
The make processor is part of the Arduino installation, so there should be
no basic problem doing so. Accept maybe for the inconvenience if you
should not be familiar with using makefiles so far. But if so, you'll soon
learn to appreciate the advantages.

The Arduino IDE is superior with respect to getting acquainted to Arduino,
to browse the samples and documentation, to learn about the system and to
develop simple projects. However, to my opinion it's not the appropriate
tool for professional work. One will tend to use an advanced environment
like Eclipse or Emacs for software projects of larger scale. These
environments easily integrate the Arduino environment if you provide a
makefile, which defines the required build rules. But you can run the make
build also as simple as by typing a short command line. Please refer to
the RTuinOS manual, sections 4.1. to get an example.

The makefile, which comes along with RTuinOS is quite generic. It should
be applicable for most RTuinOS applications without the need for any
change. You will just have to set one or two variables (e.g. on the
command line) to specify the name of your application and the COM port
which your Arduino board is connected to. Please refer to the manual,
sections 4.2. for details.

Please refer also to section 4.6 of the manual, which discusses the
possibility of using the original Arduino libraries in RTuinOS
applications. The strongest disadvantage of any RTOS implementation for
Arduino is the fact, that the official Arduino development does not found
on this RTOS, that the Arduino libraries do not consider the specifics of
an RTOS. For a real use case (which is anything beyond playing and
learning) you will not be able to use the original libraries but you will
have to write the required I/O access code on your own. Doing the
development work with the Arduino IDE becomes even more questionable
because of this fact.

Kind regards

Peter
8  Development / Other Software Development / Re: RTuinOS: A Real Time Operating System (RTOS) for Arduino 1.0.1 on: January 22, 2013, 04:47:02 pm
Hello Bucknaz,

thanks for your hint, you were right, the attachment of this post became
invalid. I removed and uploaded it again but the file is still reported to
be invalid.

To circumvent the download problem, I tried to place the setup file of
RTuinOS at github, please see
https://github.com/PeterVranken/RTuinOS/blob/master/RTuinOS-0.9.1.zip. You
have to follow this link and and click on Button "Raw" to start the file
download.

If memory size is a concern RTuinOS may be your choice. It's not
particularly designed for a minimum of memory usage but it does not waste
it neither.

RTuinOS is configured by an included header file. #define's enable or
disable code sections according to the demands of your application. If you
carefully design your application you will be satisfied by the achieved
memory usage. Nowadays, the code size typically barely matters and the
RAM size mainly depends on your application. Don't use threads which are
not really required; each thread requires the instantiation of a static
task descriptor variable in RAM plus an extension of the scheduler
internal thread lists plus a private stack area. The number of threads is
the main cost of RAM.

A design goal of RTuinOS is the understandability of the implementation.
Its documentation gives some hints how to further optimize the code with
respect to RAM consumption. These hints together with the clearly
documented code could enable you to tailor RTuinOS to your specific
demands.

Kind regards,

Peter
9  Development / Other Software Development / Re: RTuinOS: A Real Time Operating System (RTOS) for Arduino 1.0.1 on: January 07, 2013, 11:49:16 am
The implementation uses assembler code, which makes it CPU and compiler dependent. RTuinOS is not compatible with ARM and it has not been designed for easy portability
10  Development / Other Software Development / Re: RTuinOS: A Real Time Operating System (RTOS) for Arduino 1.0.1 on: January 02, 2013, 03:37:47 pm
Hello,

here are some answers to the recently posted questions:

The development of RTuinOS has been made from scratch. I've tracked the
effort: It took about 90 hours to do the implementation (including
specification, makefile and all the test cases) and about 70 hours to
write the documentation.

I didn't hear about protothreads before and can't compare it to RTuinOS.

DuinOS is the port of FreeRTOS for our micro controller. FreeRTOS exists
for many years and has been ported to many controllers. Actually, it has
been designed to be easily portable to other controllers; this is one of
its major features. Obviously, FreeRTOS is much more mature than RTuinOS,
it would be overweening to announce RTuinOS as a comparable competitor of
FreeRTOS.

The only goal for developing RTuinOS was enthusiasm for Arduino and the
RTOS topic. When I got acquainted to Arduino a few month ago I was really
enthusiastic about the concept which put the ease of use on the first
place. I immediately bought a MEGA board, made some simple experiments
first and looked then for a challenging task. I'm professionally working
with existing RTOSs and took the chance to develop another one.

There's no university background, it's just a leisure time project.

The test cases which come along with RTuinOS have been developed together
with RTuinOS. You call it a proof of concept and this will hit the point.
RTuinOS is new and not proven in practice. There are no real life
applications of RTuinOS so far. If being used in a productive environment
this needs to be considered a major risk. For leisure time projects it
should be alright.

This is the first time I issued self-made software in the net and I'm not
so familiar with the various sites for publishing free software and how to
do. I going to investigate it and notify the Arduino Forum if I find
another adequate upload location. Furthermore, I will take a look at the
Arduino Playground. Thank you for your hints.

Kind regards

Peter
11  Development / Other Software Development / Re: RTuinOS: A Real Time Operating System (RTOS) for Arduino 1.0.1 on: December 28, 2012, 09:04:00 am
Please note, that the download of the attached setup is possible only for members of the forum, which have signed in.

Regards
Peter
12  Development / Other Software Development / RTuinOS: A Real Time Operating System (RTOS) for Arduino 1.0.1 on: December 22, 2012, 10:21:48 am
Dear Arduino Fans,

I've made a small Real-Time Operating System (RTOS) for Arduino, called
RTuinOS.

Meanwhile a number of test cases are running stable and I decided to
publish it now. Instead of lots of explanation I put chapter "Introduction"
of the manual here. Please find the complete installation (including the
complete manual) attached to this thread. The manual should be your
starting point of reading.

Thank you for your kind interest in RTuinOS; your feedback is welcome.

With kind regards
Peter Vranken

P.S. A new release of RTuinOS is available. Please refer to
http://forum.arduino.cc/index.php?topic=184593.0 in this forum for details.
Or visit GitHub at https://github.com/PeterVranken/RTuinOS to get a download.

P.S. Meanwhile it turned out that the download of the setup file via this
post is not reliable. Occasionally, the operation aborts and reports an
invalid file. The reason is unclear. To circumvent the download problem, I
placed the setup file of RTuinOS at github, please see
https://github.com/PeterVranken/RTuinOS/blob/master/RTuinOS-0.9.1.zip. You
have to follow this link and and click on Button "Raw" to start the file
download.


Introduction

Arduino (www.arduino.cc) is a popular open source and open hardware micro
controller platform for various purposes, mainly located in leisure time
projects. Arduino comes along with a simple to use integrated development
environment, which contains the complete tool chain to write source code,
to browse through samples and libraries, to compile and link the software
and to upload it to the board and flash it. The RTuinOS project adds the
programming paradigm of a real time operating system to the Arduino world.

Real time operating systems, or RTOS, strongly simplify the implementation
of technical applications which typically do things in a quite regular
way, like checking inputs and setting outputs accordingly every (fixed)
fraction of a second. For example, the temperature controller for a
heating installation could be designed this way. Temperature sensors,
which report the room temperatures are evaluated and the burner and maybe
some valves are controlled to yield the desired target temperature.
Furthermore, using a real time system the program could coincidentally and
regularly update a display to provide feedback - at the same or any other
rate. Regular, time based programming can be done without the need of CPU
consuming waiting loops as used in the implementation of Arduino's library
functions delay and delayMicroseconds. Real time operating systems
characterize the professional use of micro controllers.

RTuinOS is a small real time operating system (RTOS) for the Arduino
environment. It is simple to use and fits well into the existing Arduino
code environment. It adds the concept of pseudo-parallel execution threads
to the sketches.

The traditional Arduino sketch has two entry points; the function setup,
which is the place to put the initialization code required to run the
sketch and function loop, which is periodically called. The frequency of
looping is not deterministic but depends on the execution time of the code
inside the loop.

Using RTuinOS, the two mentioned functions continue to exist and continue
to have the same meaning. However, as part of the code initialization in
setup you may define a number of tasks having individual properties. The
most relevant property of a task is a C code function, which becomes the
so called task function. Once entering the traditional Arduino loop, all
of these task functions are executed in parallel to one another and to the
repeated execution of function loop. We say, loop becomes the idle task of
the RTOS.

A characteristic of RTuinOS is that the behavior of a task is not fully
predetermined at compile time. RTuinOS supports regular, time-controlled
tasks as well as purely event controlled ones. Tasks can be preemptive or
behave cooperatively. Task scheduling can be done using time slices and a
round robin pattern. Moreover, many of these modes can be mixed. A task is
not per se regular, its implementing code decides what happens and this
can be decided context or situation dependent. This flexibility is
achieved by the basic idea of having an event controlled scheduler, where
typical RTOS use cases are supported by providing according events, e.g.
absolute-point-in-time-reached. If the task's code decides to always wait
for the same absolute-point-in-time-reached event, then it becomes a
regular task. However, situation dependent the same task could decide to
wait for an application sent event - and give up its regular behavior. In
many RTOS implementations the basic characteristic of a task is determined
at compile time, in RTuinOS this is done partly at compile time and partly
at runtime.

RTuinOS is provided as a single source code file which is compiled
together with your other code, which now becomes an RTuinOS application.
In the most simple case, if you do not define any task, your application
will strongly resemble a traditional sketch: You implement your setup and
your loop function; the former will be run once at the beginning and the
latter repeatedly.

RTuinOS on its own can't be compiled, there need to be an application.
RTuinOS is organized as a package which combines the RTuinOS source file
with some sample applications which are the test cases at the same time.
The source code of each sample application is held in a separate folder,
named tc<nn>. Any of these can be selected for compilation. You may add
more folders, holding the source code of your RTuinOS applications. A
starting point of your application folder can be a copy of any of the
folders tc<nn>. The compilation always is the same. Run the makefile,
where the name of the folder (which doesn't need to be tc<nn>) is an
option on the command line. Refer to the manual for more.

The most relevant document to read is the manual of RTuinOS, found as
manual.pdf. The manual introduces the basic concept of RTuinOS and gives
an overview of its features and limitations:

Chapter 2 explains the basic principles of operation. Some core
considerations of the implementation are highlighted, but the relevant
documentation of the implementation is the code itself. It is commented
using doxygen (www.doxygen.org) tags; the compiled doxygen documentation
is part of this project. It contains only the documentation of the global
objects of RTuinOS; to fully understand the implementation you will have
to inspect the source code itself, please refer to [1], [2], [3].

Chapter 3 lists and documents all elements of RTuinOS' API.

Chapter 4 explains how to write a well-working RTuinOS-application. The
chapter starts with a short recipe, which guarantees soon success. Here is
where you may start reading if you are already familiar with the concept
of an RTOS.

The manual closes with chapter 5, which gives an overview of possible
improvements and still missing and maybe later released features.
13  Development / Suggestions for the Arduino Project / Re: Bug in Arduino v1.0.1? on: September 27, 2012, 02:24:18 am
The problem seems to be more than a wrong error message because of a syntax error. I got the same error message during development. So far I've no clue where it comes from and this makes me nerveous. By comparison of a still well compiling and working revision of my project and one which produces this error message I found out that -- in my case -- it depends on the compiler settings. If the only change of -O1 into -Os (optimzation level one to optimization for minimum code size) the project runs and compiles well.

I use a makefile project, where the settings for compiler and linker and the set of compiled C files are taken one by one from the Arduino 1.0.1 IDE (command lines copied from the IDE's output window). My only modifications are enabling of some more output files (linker map file, assembler listings) and adding some more include folders. And for some reasons I tried different optimization levels (resulting in -O1 which made compilation fail).

The code size of the well working compilation with -Os is about 6 or 7 kByte (the value shown by avrdude at download) thus far below the absolute code size maximum of my ATmega2560. There seems to be a more  tricky problem with the linker. Is there a specific section, which must not grow beyond e.g. 8k or something like this?

By the way, getting thisproblem, I wondered in which way the linker would report section exceeded problems and purposely declared a much too large array in RAM, which definitely doesn't fit into my RAM. And got no problem indication from the linker at all! Is it really possible that it doesn't keep track of memory overflow?

Regards,
Peter
Pages: [1]