All Projects → feilipu → Arduino_freertos_library

feilipu / Arduino_freertos_library

Licence: mit
A FreeRTOS Library for all Arduino AVR Devices (Uno, Leonardo, Mega, etc)

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Arduino freertos library

Bare Arduino Project
Start your Arduino projects right out of the box
Stars: ✭ 505 (-3.44%)
Mutual labels:  arduino, avr
Logic Analyzer
Logic Analyzer, for Arduino, AVR, ESP8266 and STM32 with a very nice working processing interface, you could run it also on any Android device.
Stars: ✭ 203 (-61.19%)
Mutual labels:  arduino, avr
Marlin
Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. | Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
Stars: ✭ 12,217 (+2235.95%)
Mutual labels:  arduino, avr
Avr8js
Arduino (8-bit AVR) simulator, written in JavaScript and runs in the browser / Node.js
Stars: ✭ 102 (-80.5%)
Mutual labels:  arduino, avr
Libhydrogen
A lightweight, secure, easy-to-use crypto library suitable for constrained environments.
Stars: ✭ 247 (-52.77%)
Mutual labels:  arduino, avr
Qpn
QP-nano real-time embedded framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
Stars: ✭ 107 (-79.54%)
Mutual labels:  arduino, avr
Blog
A set of various projects based on ESP8266, ESP32, ATtiny13, ATtiny85, ATtiny2313, ATmega8, ATmega328, ATmega32, STM32 and more.
Stars: ✭ 198 (-62.14%)
Mutual labels:  arduino, avr
Attinycore
Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8
Stars: ✭ 974 (+86.23%)
Mutual labels:  arduino, avr
Helios
The free embedded operating system.
Stars: ✭ 223 (-57.36%)
Mutual labels:  arduino, avr
Avr Hal
embedded-hal abstractions for AVR microcontrollers
Stars: ✭ 217 (-58.51%)
Mutual labels:  arduino, avr
Erika3
ERIKA Enterprise v3 RTOS
Stars: ✭ 98 (-81.26%)
Mutual labels:  arduino, avr
Microcore
An optimized Arduino hardware package for ATtiny13
Stars: ✭ 348 (-33.46%)
Mutual labels:  arduino, avr
Deepsleepscheduler
DeepSleepScheduler is a lightweight, cooperative task scheduler library with configurable sleep and task supervision.
Stars: ✭ 59 (-88.72%)
Mutual labels:  arduino, avr
Mightycore
Arduino hardware package for ATmega1284, ATmega644, ATmega324, ATmega324PB, ATmega164, ATmega32, ATmega16 and ATmega8535
Stars: ✭ 413 (-21.03%)
Mutual labels:  arduino, avr
Tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
Stars: ✭ 9,068 (+1633.84%)
Mutual labels:  arduino, avr
Atmega Soldering Station
T12 Quick Heating Soldering Station
Stars: ✭ 183 (-65.01%)
Mutual labels:  arduino, avr
Ir Tester
Quick IR Value Tester
Stars: ✭ 14 (-97.32%)
Mutual labels:  arduino, avr
Calunium
Arduino clone based on the ATmega644P/ATmega1284P
Stars: ✭ 30 (-94.26%)
Mutual labels:  arduino, avr
Megacore
Arduino hardware package for ATmega64, ATmega128, ATmega640, ATmega1280, ATmega1281, ATmega2560, ATmega2561, AT90CAN32, AT90CAN64 and AT90CAN128
Stars: ✭ 206 (-60.61%)
Mutual labels:  arduino, avr
Homebrew Avr
Homebrew AVR Toolchain
Stars: ✭ 294 (-43.79%)
Mutual labels:  arduino, avr

This is a fork of Richard Barry's freeRTOS, optimised for the Arduino AVR devices.

It has been created to provide access to FreeRTOS capabilities, with full compatibility to the Arduino environment. It does this by keeping hands off almost everything, and only touching the minimum of hardware to be successful.

Arduino_CI

Usage & Further Reading

Read the short blog post on Arduino FreeRTOS to get started. And there is another much older post on using FreeRTOS with AVR, which may be useful to read too. There are some further posts I've written on Hackster.IO, but they're essentially the same content.

The canonical source for information is the FreeRTOS Web Site. Within this site, the Getting Started page is very useful. This is the source for FreeRTOS usage (as distinct from installing and using this Arduino Library).

My other AVRfreeRTOS Sourceforge Repository or AVRfreeRTOS Github has plenty of examples, ranging from blink through to a synthesiser.

This library was the genesis of generalised support for the ATmega platform within FreeRTOS.

General

FreeRTOS has a multitude of configuration options, which can be specified from within the FreeRTOSConfig.h file. To keep commonality with all of the Arduino hardware options, some sensible defaults have been selected.

The AVR Watchdog Timer is used to generate 15ms time slices, but Tasks that finish before their allocated time will hand execution back to the Scheduler. This does not affect the use of any of the normal Timer functions in Arduino.

Time slices can be selected from 15ms up to 500ms. Slower time slicing can allow the Arduino MCU to sleep for longer, without the complexity of a Tickless idle.

Watchdog period options:

  • WDTO_15MS
  • WDTO_30MS
  • WDTO_60MS
  • WDTO_120MS
  • WDTO_250MS
  • WDTO_500MS
  • WDTO_1S
  • WDTO_2S

Note that Timer resolution is affected by integer math division and the time slice selected. Trying to measure 50ms, using a 120ms time slice for example, won't work.

Stack for the loop() function has been set at 192 bytes. This can be configured by adjusting the configMINIMAL_STACK_SIZE parameter. If you have stack overflow issues, just increase it. Users should prefer to allocate larger structures, arrays, or buffers using pvPortMalloc(), rather than defining them locally on the stack.

Memory for the heap is allocated by the normal malloc() function, wrapped by pvPortMalloc(). This option has been selected because it is automatically adjusted to use the capabilities of each device. Other heap allocation schemes are supported by FreeRTOS, and they can used with additional configuration.

Upgrading

Errors

  • Stack Overflow: If any stack (for the loop() or) for any Task overflows, there will be a slow LED blink, with 4 second cycle.
  • Heap Overflow: If any Task tries to allocate memory and that allocation fails, there will be a fast LED blink, with 100 millisecond cycle.

Errata

Testing with the Software Serial library shows some incompatibilities at low baud rates (9600), due to the extended time this library disables the global interrupt. Use the hardware USARTs.

Compatibility

  • ATmega328 @ 16MHz : Arduino UNO, Arduino Duemilanove, Arduino Diecimila, etc.
  • ATmega328 @ 16MHz : Adafruit Pro Trinket 5V, Adafruit Metro 328, Adafruit Metro Mini
  • ATmega328 @ 16MHz : Seeed Studio Stalker
  • ATmega328 @ 16MHz : Freetronics Eleven
  • ATmega328 @ 12MHz : Adafruit Pro Trinket 3V
  • ATmega32u4 @ 16MHz : Arduino Leonardo, Arduino Micro, Arduino Yun, Teensy 2.0
  • ATmega32u4 @ 8MHz : Adafruit Flora, Bluefruit Micro
  • ATmega1284p @ 16MHz: Sanguino, WickedDevice WildFire
  • ATmega1284p @ 24.576MHz : Seeed Studio Goldilocks, Seeed Studio Goldilocks Analogue
  • ATmega2560 @ 16MHz : Arduino Mega, Arduino ADK
  • ATmega2560 @ 16MHz : Seeed Studio ADK

The new megaAVR 0-Series devices (eg. ATmega4809) are not fully compatible with this library. Their Timer configuration is substantially different from previous devices, and forms part of a new avr8x architecture. It may be a while until avr-libc is updated to include support for megaAVR devices, but when that happens further work will be added here.

Files & Configuration

  • Arduino_FreeRTOS.h : Must always be #include first. It references other configuration files, and sets defaults where necessary.
  • FreeRTOSConfig.h : Contains a multitude of API and environment configurations.
  • FreeRTOSVariant.h : Contains the AVR specific configurations for this port of freeRTOS.
  • heap_3.c : Contains the heap allocation scheme based on malloc(). Other schemes are available, but depend on user configuration for specific MCU choice.

PlatformIO

Arduino FreeRTOS is available in the PlatformIO library manager for use in a PlatformIO project.

Watchdog period is configurable using build-flags:

build_flags =
  -DportUSE_WDTO=WDTO_15MS

Code of conduct

See the Code of conduct.

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):


Phillip Stevens

🚧💻👀

Hector Espert

💻

Floessie

💻

Derekduke

💻

Balaji.V

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].