Re: Does FreeRTOS works on Linux?

2021-05-13 Thread Primoz Beltram

On 6. 05. 21 18:00, kernelnewbies-requ...@kernelnewbies.org wrote:

Subject:
Does FreeRTOS works on Linux?
From:
Raul Piper 
Date:
5. 05. 21 20:07

To:
kernelnewbies 


Hello,
I am having an embedded linux system and wanted to use any  RTOS on
it. Can I use Free RTOS?
My project has 2 tasks , one is producer and another is consumer
working parallely.

I have seen Free RTOS used in microcontrollers handling this , how can
this be done in Linux(which such APIs if not Free RTOS).

Regards,
R



Open AMP project (www.openampproject.org) ?

WBR Primoz
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Does FreeRTOS works on Linux?

2021-05-11 Thread loïc tourlonias
On Tue, May 11, 2021 at 5:44 AM Valdis Klētnieks
 wrote:
>
> On Sun, 09 May 2021 08:40:56 +0200, loïc tourlonias said:
>
> > related to our architecture. We are working on a ARM Cortex-A7 which
> > have an isolation between a normal world and a secure world. Linux is
> > working on the normal world for the UI and FreeRTOS is running on the
> > secure world.
>
> Is there an easily comprehensible explanation of how that whole ARM 
> normal/secure
> stuff is supposed to work?
I'll try to explain shortly. On ARM Cortex-A family, the core has two
isolated worlds (normal/secure). The two worlds have their own context
(register, stack ...) and the normal world have less privileges than
the secure world.
The core starts in the secure world and the secure software configures
the context of the normal world before giving the execution to the
normal world with a specific ARM instruction SMC 0.

The communication between normal and secure worlds is done through
SMC. When the normal world requires privileged access (secure clock
configuration for example), it askes the secure world the access by
calling a SMC instruction (with a specific ID), then a SMC exception
is triggered in the secure context. The secure monitor catches this
exception and handles it before returning to the normal world.

I haven't found any block diagram or data flow to explain this.
I've only found some useful links from ARM community:
https://www.microcontrollertips.com/embedded-security-brief-arm-trustzone-explained/
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/architecting-more-secure-world-with-isolation-and-virtualization

HTH

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Does FreeRTOS works on Linux?

2021-05-10 Thread Valdis Klētnieks
On Sun, 09 May 2021 08:40:56 +0200, lo�c tourlonias said:

> related to our architecture. We are working on a ARM Cortex-A7 which
> have an isolation between a normal world and a secure world. Linux is
> working on the normal world for the UI and FreeRTOS is running on the
> secure world.

Is there a easily comprehensible explanation of how that whole ARM normal/secure
stuff is supposed to work?

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Does FreeRTOS works on Linux?

2021-05-10 Thread jim . cromie
On Sun, May 9, 2021 at 12:41 AM loïc tourlonias
 wrote:
>
> > if using a posix thread full fills the requirement of RTOS. The reason
> > I want to use RTOS is , I am porting a Microcontroller code using RTOS
> > (free RTOS) to Linux and
> > afaik FreeRTOS doesnt work on Linux.
> > > FreeRTOS is a standalone OS and depending on your system there may be
> > > an example running on your architecture in parallel of your embedded
> > > Linux. For example, on one of my project with have an ARM Cortex-A7
> > > with Linux running in Normal World and FreeRTOS running in Trusted
> > > world.
> > This is interesting , do you have something to share?
> Sorry, this is intellectual property from my company so I can't share
> source code but we have started from the FreeRTOS porting sample
> related to our architecture. We are working on a ARM Cortex-A7 which
> have an isolation between a normal world and a secure world. Linux is
> working on the normal world for the UI and FreeRTOS is running on the
> secure world. Communication between the two worlds is made by SMC.
>
> Regards
> Loïc
>

You should look at Xenomai

it uses the Adeos interrupt pipeline to pick off and handle certain
interrupts and events
in real-time, and pass the rest off to the linux kernel that does all
setup and housekeeping

they have API interfaces for VXworks, and other commercial RTOSs
one of those APIs is probably your path of least portage.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Does FreeRTOS works on Linux?

2021-05-09 Thread loïc tourlonias
> if using a posix thread full fills the requirement of RTOS. The reason
> I want to use RTOS is , I am porting a Microcontroller code using RTOS
> (free RTOS) to Linux and
> afaik FreeRTOS doesnt work on Linux.
> > FreeRTOS is a standalone OS and depending on your system there may be
> > an example running on your architecture in parallel of your embedded
> > Linux. For example, on one of my project with have an ARM Cortex-A7
> > with Linux running in Normal World and FreeRTOS running in Trusted
> > world.
> This is interesting , do you have something to share?
Sorry, this is intellectual property from my company so I can't share
source code but we have started from the FreeRTOS porting sample
related to our architecture. We are working on a ARM Cortex-A7 which
have an isolation between a normal world and a secure world. Linux is
working on the normal world for the UI and FreeRTOS is running on the
secure world. Communication between the two worlds is made by SMC.

Regards
Loïc

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Does FreeRTOS works on Linux?

2021-05-08 Thread Greg KH
On Fri, May 07, 2021 at 10:14:34PM +0530, Raul Piper wrote:
> On Fri, May 7, 2021 at 12:07 PM Greg KH  wrote:
> >
> > On Thu, May 06, 2021 at 08:12:48PM +0530, Raul Piper wrote:
> > > On Thu, May 6, 2021 at 1:01 AM loďc tourlonias
> > >  wrote:
> > > >
> > > > On Wed, May 5, 2021 at 8:07 PM Raul Piper 
> wrote:
> > > > >
> > > > > Hello,
> > > > Hi
> > > > > I am having an embedded linux system and wanted to use any  RTOS on
> > > > > it. Can I use Free RTOS?
> > > > > My project has 2 tasks , one is producer and another is consumer
> > > > > working parallely.
> > > > I'm afraid I don't understand what you are requesting and I hope that
> > > > someone else understand more clearly. But I'll still explain my
> > > > understanding.
> > > > You want to run a RTOS upon Linux OS, doesn't make it too much OSes?
> > > > Then I have several questions:
> > > > Do you really need a Real Time Operating System, can't you run your
> > > > project in Linux userspace?
> > > I can do that but Linux is not an ROS afaik. Even though i dont have
> > > strict timing requirements , its like a sensor on i2c(producer) and
> > > then another consumer tasks which not
> > > only feeds on this data but also tell the i2c sensor by sending some
> > > commands to it.
> >
> > That should be fine, Linux can be a "Real Time Operating system" if you
> > use the RT patchset if your workloads require it.
> >
> OK I need to check on this RT Patchset if at all I need real time features.
> 
> > If you do NOT have strict timing requirements, then there is no need to
> > worry about any of this, so I do not understand your wish to slow your
> > system down by running a "ROS".  Why?
> >
> Typo this is RTOS (not R OS - Robot operating system ;) )
> > > > Have you tried Linux RTOS extension (again I'm no expert and haven't
> > > > tried them but you can look at Xenomai)?
> > > I will explore this.I was thinking if i can use Posix thread to have
> > > two tasks one reading sensors and another sending commands to it.But
> > > then again i am confused
> > > if using a posix thread full fills the requirement of RTOS. The reason
> > > I want to use RTOS is , I am porting a Microcontroller code using RTOS
> > > (free RTOS) to Linux and
> > > afaik FreeRTOS doesnt work on Linux.
> >
> > What is your "requirement" exactly?
> Read the data from the sensor and also change the type of data sent by the
> sensor by analysing the received data by sending the command to the sensor
> periodically based on trigger.There is some batch of data which a
> "simultaneously" running algorithm
> is evaluating and send the command based on calculated trigger,  to sensor
> to change the data stream.This batch of data is of size 40-60 bytes length
> and may vary each time a batch is  being read.
> So in summary i wany two tasks to run together.
> RTOS is one option
> Posix thread is Another

"real time" has nothing to do with "posix threads" at all.

I suggest reading up on what these terms really mean and figure out your
specific requirements to determine what you have to do here.

good luck!

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Does FreeRTOS works on Linux?

2021-05-08 Thread Raul Piper
On Fri, May 7, 2021 at 12:07 PM Greg KH  wrote:
>
> On Thu, May 06, 2021 at 08:12:48PM +0530, Raul Piper wrote:
> > On Thu, May 6, 2021 at 1:01 AM loďc tourlonias
> >  wrote:
> > >
> > > On Wed, May 5, 2021 at 8:07 PM Raul Piper 
wrote:
> > > >
> > > > Hello,
> > > Hi
> > > > I am having an embedded linux system and wanted to use any  RTOS on
> > > > it. Can I use Free RTOS?
> > > > My project has 2 tasks , one is producer and another is consumer
> > > > working parallely.
> > > I'm afraid I don't understand what you are requesting and I hope that
> > > someone else understand more clearly. But I'll still explain my
> > > understanding.
> > > You want to run a RTOS upon Linux OS, doesn't make it too much OSes?
> > > Then I have several questions:
> > > Do you really need a Real Time Operating System, can't you run your
> > > project in Linux userspace?
> > I can do that but Linux is not an ROS afaik. Even though i dont have
> > strict timing requirements , its like a sensor on i2c(producer) and
> > then another consumer tasks which not
> > only feeds on this data but also tell the i2c sensor by sending some
> > commands to it.
>
> That should be fine, Linux can be a "Real Time Operating system" if you
> use the RT patchset if your workloads require it.
>
OK I need to check on this RT Patchset if at all I need real time features.

> If you do NOT have strict timing requirements, then there is no need to
> worry about any of this, so I do not understand your wish to slow your
> system down by running a "ROS".  Why?
>
Typo this is RTOS (not R OS - Robot operating system ;) )
> > > Have you tried Linux RTOS extension (again I'm no expert and haven't
> > > tried them but you can look at Xenomai)?
> > I will explore this.I was thinking if i can use Posix thread to have
> > two tasks one reading sensors and another sending commands to it.But
> > then again i am confused
> > if using a posix thread full fills the requirement of RTOS. The reason
> > I want to use RTOS is , I am porting a Microcontroller code using RTOS
> > (free RTOS) to Linux and
> > afaik FreeRTOS doesnt work on Linux.
>
> What is your "requirement" exactly?
Read the data from the sensor and also change the type of data sent by the
sensor by analysing the received data by sending the command to the sensor
periodically based on trigger.There is some batch of data which a
"simultaneously" running algorithm
is evaluating and send the command based on calculated trigger,  to sensor
to change the data stream.This batch of data is of size 40-60 bytes length
and may vary each time a batch is  being read.
So in summary i wany two tasks to run together.
RTOS is one option
Posix thread is Another

Based on comments i recieved i will go for posix threads.

For future i think there is less clarity among developers (especially me)
when to use rtos and when not to use. Does using threads gurantees real
time behaviour? If not why to use posix threads, debate is endless . What
are those timing requirements which draws a border between using rtos and
not using rtos.
@GKH if you have some good “practical”references to decide on this subject
please do share.
>
> thanks,
>
> greg k-h
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Does FreeRTOS works on Linux?

2021-05-06 Thread Raul Piper
On Thu, May 6, 2021 at 1:01 AM loïc tourlonias
 wrote:
>
> On Wed, May 5, 2021 at 8:07 PM Raul Piper  wrote:
> >
> > Hello,
> Hi
> > I am having an embedded linux system and wanted to use any  RTOS on
> > it. Can I use Free RTOS?
> > My project has 2 tasks , one is producer and another is consumer
> > working parallely.
> I'm afraid I don't understand what you are requesting and I hope that
> someone else understand more clearly. But I'll still explain my
> understanding.
> You want to run a RTOS upon Linux OS, doesn't make it too much OSes?
> Then I have several questions:
> Do you really need a Real Time Operating System, can't you run your
> project in Linux userspace?
I can do that but Linux is not an ROS afaik. Even though i dont have
strict timing requirements , its like a sensor on i2c(producer) and
then another consumer tasks which not
only feeds on this data but also tell the i2c sensor by sending some
commands to it.
> Have you tried Linux RTOS extension (again I'm no expert and haven't
> tried them but you can look at Xenomai)?
I will explore this.I was thinking if i can use Posix thread to have
two tasks one reading sensors and another sending commands to it.But
then again i am confused
if using a posix thread full fills the requirement of RTOS. The reason
I want to use RTOS is , I am porting a Microcontroller code using RTOS
(free RTOS) to Linux and
afaik FreeRTOS doesnt work on Linux.
> FreeRTOS is a standalone OS and depending on your system there may be
> an example running on your architecture in parallel of your embedded
> Linux. For example, on one of my project with have an ARM Cortex-A7
> with Linux running in Normal World and FreeRTOS running in Trusted
> world.
This is interesting , do you have something to share?
> >
> > I have seen Free RTOS used in microcontrollers handling this , how can
> > this be done in Linux(which such APIs if not Free RTOS).
> >
> HTH
> > Regards,
> > R
> >
> > ___
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Does FreeRTOS works on Linux?

2021-05-05 Thread loïc tourlonias
On Wed, May 5, 2021 at 8:07 PM Raul Piper  wrote:
>
> Hello,
Hi
> I am having an embedded linux system and wanted to use any  RTOS on
> it. Can I use Free RTOS?
> My project has 2 tasks , one is producer and another is consumer
> working parallely.
I'm afraid I don't understand what you are requesting and I hope that
someone else understand more clearly. But I'll still explain my
understanding.
You want to run a RTOS upon Linux OS, doesn't make it too much OSes?
Then I have several questions:
Do you really need a Real Time Operating System, can't you run your
project in Linux userspace?
Have you tried Linux RTOS extension (again I'm no expert and haven't
tried them but you can look at Xenomai)?
FreeRTOS is a standalone OS and depending on your system there may be
an example running on your architecture in parallel of your embedded
Linux. For example, on one of my project with have an ARM Cortex-A7
with a Linux running in Normal World and FreeRTOS running in Trusted
world.
>
> I have seen Free RTOS used in microcontrollers handling this , how can
> this be done in Linux(which such APIs if not Free RTOS).
>
HTH
> Regards,
> R
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Does FreeRTOS works on Linux?

2021-05-05 Thread Raul Piper
Hello,
I am having an embedded linux system and wanted to use any  RTOS on
it. Can I use Free RTOS?
My project has 2 tasks , one is producer and another is consumer
working parallely.

I have seen Free RTOS used in microcontrollers handling this , how can
this be done in Linux(which such APIs if not Free RTOS).

Regards,
R

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies