Forum Rule: Always post complete source code & details to reproduce any issue!
-
Senior Member
Teensy 4 RTOS
Paul, in this Teensy 4 post you suggested that, while not necessary, Teensy API's would move towards working with an RTOS. Any thoughts on which RTOS you're considering for Teensy 4? I understand that the selection of an RTOS would ultimately be up to the user, but my take on Teensy 4 is that many of its use cases could benefit from one and I'm making the assumption that there will be a preferred RTOS to use.
I'm asking because I'm currently writing some software for the Teensy 3.6, which could likely benefit from either: 1) TeensyThreads and EventResponder or 2) a full blown RTOS. My plan is to move much of this functionality to Teensy 4 when it becomes available and would like to make that transition as painless as possible.
-
Senior Member+
Hi Brian.
You might find this thread interesting. https://forum.pjrc.com/threads/46733...highlight=RTOS for your work. Bill G. has a ported copy - looked it up once but forgot the details. Think that was about when I discovered TeensyThreads.
-
Senior Member

Originally Posted by
mjs513
Thanks! It looks interesting, I would just hate to go that route and end up having to port everything to a different RTOS or TeensyThreads / EventResponder. Especially since it seems like the port to v9 hasn't been completed yet.
After fixing some issues with my build environment, I've been playing a little today with the TeensyThreads / EventResponder framework to try learning it better.
-
I'm also interested in this, as I was just about to start shopping RTOS options myself. Long-term support is what brought me to the Teensy platform.
-
Senior Member+
I know this thread is about ROS on the Teensy 4. But I thought that I would go ahead and document a few things that I found associated with the T3.6:
-
YASQ (yet another stupid question)
What are you good people doing that would require more than a scheduler/state machine?
-

Originally Posted by
BJB
YASQ (yet another stupid question)
What are you good people doing that would require more than a scheduler/state machine?
YASA (….answer)
T3.x is such a small processor that I only need a well understood interrupt sequence, maybe a cooperative scheduler, with/without timed execution
-
Senior Member

Originally Posted by
WMXZ
YASA (….answer)
T3.x is such a small processor that I only need a well understood interrupt sequence, maybe a cooperative scheduler, with/without timed execution
Likewise...my use case is a research quality flight control system for fixed wing and multi-rotor drones. I have some tasks that need to be executed regularly on an interrupt (data acquisition synced to an MPU-9250 data ready signal and control laws), some that need to be run at a fixed interval of time (actuator commands sent a fixed time after data acquisition), some that are lower priority (polling for new GNSS data, data buffering and logging), and some that are lower rate (telemetry and path planning). I may be able to meet these requirements with EventResponder and TeensyThreads; although, I'm not sure I'll get the same guarantees with the scheduler with that approach that I would in FreeRTOS or another RTOS (I don't think I want to write my own scheduler).
With Teensy 4, I'll likely be moving more of the processes on my BeagleBone Black co-processor to the Teensy. Which simply means more threads running at different rates and different priorities sharing data. So the scheduling may become more important with respect to guarantees on running the high priority tasks on time.
I'm most concerned about using the solution / approach that will let me continue expanding the utility of my flight control software without needing to do a major refactor in the future; either because I've added more items for the software to do or because I'm upgrading from Teensy 3.6 to Teensy 4.x.
Brian
-
Member
Custom full-authority ECU for use in the motorsport sector. Modular avionics-level sensor package, datalogging, engine protection, etc.
-
Senior Member
Quick update: I tried Bill Greiman's port of FreeRTOS and, without support or an update, it's basically unusable for Teensy 3.5 / 3.6:
https://github.com/greiman/FreeRTOS-Arduino
Setting ticks faster than 1ms seems to not work, even following the FreeRTOS advice on which macros to use. I think this may be because of limitations in the underlying timer being used. A bigger issue is that floating point math is not supported and produces a hard fault, I suspect having to do with issues in working with the FPU state between threads.
-
Senior Member+
Hi Brian.
Did you check out the other links I posted on RTOS's.
Bill G. Also a port for ChibiOS which he thinks works better: https://github.com/greiman/ChibiOS-Arduino. Even though it Arduino he has a directory for ARM. Also in this post he talks about upgrading his FreeRTOS port: https://forum.pjrc.com/threads/46733...light=freeRTOS.
You could check this out as well: https://github.com/vanbergeijk/teens...eRTOS-template
Mike
-
Senior Member
Hi Mike,
I saw Bill discussing an update to FreeRTOS v9, but it hasn't happened yet on his GitHub and the version posted (FreeRTOS v8) doesn't work. I haven't tried this yet, but that might be next up for me:
https://github.com/vanbergeijk/teens...eRTOS-template
Seems like still a limitation for > 1kHz tick frequency.
I'm still trying to figure out whether TeensyThreads and EventResponder might fit my needs. Additionally, I've been looking at some potential in house type solutions based on articles like:
https://www.embedded.com/design/prot...-Simple-Tasker
-
Senior Member
I'm a little wary of ChibiOS because of its licensing structure. I develop open source, but would like my work to be able to be used in closed source projects.
-
Senior Member+
You could always check out the FreeRTOS site it self to see if there are any questions on 1khz. Also, you could post a issue on Bill's GitHub page. He's usually pretty could at responding. I had to do that with another library of his.
-
Senior Member+
-
Senior Member
-
FreeRTOS running on Teensy 4.0 would be really nice! Teensy is so fast now, that it needs RTOS.
-albertr
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules