needed-libraries icon indicating copy to clipboard operation
needed-libraries copied to clipboard

Microcontroller and sensors support

Open FedericoCeratto opened this issue 6 years ago • 8 comments

A project to support microcontroller could provide:

  • nim.cfg and panicoverride.nim files for various microcontrollers and SBCs: AVR (e.g. ATmega), ARM (e.g. STM32), etc
  • macros and templates to access GPIO and more on popular boards
  • libraries to use popular sensors and other devices
  • integration tests to ensure the Nim compiler and parts of the stdlib work on micros
  • tutorials and tools

Related to #81

FedericoCeratto avatar Dec 28 '17 21:12 FedericoCeratto

"integration tests to ensure the Nim compiler / stdlib works on micros" most part of Nim stdlib relies on a GC to work

Yardanico avatar Dec 28 '17 21:12 Yardanico

@Yardanico true, yet some modules do not. Description updated. Also some newer memory management methods should work with more modules.

FedericoCeratto avatar Dec 28 '17 21:12 FedericoCeratto

We should implement some built-in Arduino functions (e.g. analogRead) to make it easier to use the library for beginners.

cfvescovo avatar Mar 16 '19 12:03 cfvescovo

We should provide some sort of extension for popular editors too.

cfvescovo avatar Mar 16 '19 12:03 cfvescovo

There is a lot of work to do here....

cfvescovo avatar Mar 16 '19 12:03 cfvescovo

Maybe some effort should be done for extending the language with minimalistic coroutines and (async) message passing with very limited message sized especially for low-end microcontrollers (STM32L0 like).

This method can let to write rigid embedded software without using full-size RTOS (few size-limited queues corresponds to the required priority number). I feel some advantages here: https://www.state-machine.com/

And this message-passing programming can lead the Nim language to programming for multiple computing nodes in a cluster or computing grids, where we still have no good tools to write programs easily.

ponyatov avatar Aug 21 '19 19:08 ponyatov

Would tinygo provide some inspiration for GC issue?

TinyGo is a project to bring Go to microcontrollers and small systems with a single processor core. It is similar to emgo but a major difference is that we want to keep the Go memory model (which implies garbage collection of some sort).

nickdex avatar Sep 26 '19 15:09 nickdex

We already have --newruntime as a superior, GC-free solution.

Araq avatar Sep 27 '19 05:09 Araq