greiman / ChRt

ChibiOS/RT for Arduino AVR, SAMD, Due, Teensy 3.x, Teensy 4.0.
88 stars 26 forks source link

SAMD21 tickless #10

Closed sslupsky closed 3 years ago

sslupsky commented 4 years ago

Hello,

I came across your repo while investigating ChibiOS. I note that tickless mode is not supported for the SAMD architecture. My question is, is there any particular limitation(s) of the SAMD that prevents implementation of tickless mode? Or, is it simply that no one has taken the time to develop tickless timer functions for the SAMD? Other than the timer, is there anything else required to support tickless for SAMD?

greiman commented 4 years ago

It is likely that tickless mode could be implemented for SAMD.

I looked for timer libraries for SAMD and found the Adafruit library. It is 900 lines of code with lots of features and options but is not suitable.

The Teensy 4.0 timer is a perfect match to the required API. Many functions are a single line of code. See this.

The AVR code is lifted from ChibiOS with slight mods.

I may look into developing SAMD code. The SAMD timers are generic, capable of 8, 16, and 32 bits but need lots of code. Sort of like SERCOM which supports serial, SPI, and I2C, require lots of code an are not effecient.

sslupsky commented 4 years ago

I will look further and let you know if I come up with anything.

I came across Zephyr the other day. It sounds interesting. Any thoughts on how it compares to ChRt? Have you any experience with Zephyr on SAMD?

greiman commented 4 years ago

Zephyr looks like a interesting project. It appears to focus on IOT. I suspect it will become an OS used by large companies. If it handles the security and connectivity problems for a wide range of IOT devices and apps it will be a valuable resource for partner companies.

My problem with Zephyr is the scale of the project. The download is 13,061 Files, 2,542 Folders, 487 MB (511,481,675 bytes).

I looked at SAMD support. I found Arduino Zero which had only the most basic support. I don't think it could support Arduino libraries.

My goal with ChibiOS was to provide a small fast multi-thread kernel in the Arduino environment.