nim-on-samd21
micronucleus
nim-on-samd21 | micronucleus | |
---|---|---|
4 | 3 | |
9 | 1,636 | |
- | 0.6% | |
0.0 | 2.5 | |
over 1 year ago | 3 months ago | |
C | C | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
nim-on-samd21
- How to get clean simple C output?
-
New embedded programming language with C as a host language
C++ has decent industry acceptance in embedded nowadays, or at least that has been my impression.
After C++, rust is likely the most popular, quite a lot of effort has been put into running rust on embedded, see eg https://github.com/rust-embedded. However, once again to my understanding, industry acceptance is still highly marginal.
After that, there's a bunch of toy-ish efforts to run other languages. Zig, nim, python and javascript variants, etc. Usually anything that has C ABI compatibility should be possible to get up and running (without writing a compiler backend from scratch). I've had fun with some toy projects using nim for ARM cortex-M targets (https://github.com/EmbeddedNim/svd2nim, https://github.com/auxym/nim-on-samd21, https://github.com/EmbeddedNim/picostdlib).
Using Nim (and eg svd2nim to generate the equivalent of CMSIS headers for register access in pure nim), it would be entirely possible to write even the low level stuff (SPI drivers and whatnot) in 100% nim, with the same performance as C and better safety (better static type system and compile-time checks, etc). Runtime (eg overflow) checks and garbage collection are available (at the cost of some performance) but optional. See eg. a pretty basic higher-level API for GPIO access, that provides native performance, since the abstraction is implemented as macros (compile-time abstraction): https://github.com/auxym/nim-on-samd21/blob/master/src/port....
-
Emulator of Original Dell Charger Using ATTINY85
To be clear: Ratel isn't my project, just something I'm following due to interest.
In the interest of shameless self promotion :), my own experimentations are :
https://github.com/EmbeddedNim/svd2nim
https://github.com/auxym/nim-on-samd21
And I've used and contributed to picostdlib (https://github.com/beef331/picostdlib), the rp2040 support library.
All just as a hobby, but it's interesting to learn that some companies are actually looking into Nim for firmware! Embedded seems like such a slow moving industry. I believe the author of Nesper and Nephyr also developed them for professional work.
- Ask HN: What's Your Side Project?
micronucleus
-
Building the worlds jankiest serial to USB cable from scavenged parts
You can actually bit-bang low speed USB on Arduino [0]. There is even a bootloader [1] for ATtiny. It is obviously not compatible with Arduino, but those tiny boards look too cute to ignore [2]. Also, you can use USB port both for downloading firmware and your application.
[0] https://github.com/obdev/v-usb
[1] https://github.com/micronucleus/micronucleus
[2] https://cpldcpu.wordpress.com/2014/04/25/the-nanite-85/
-
Emulator of Original Dell Charger Using ATTINY85
The Digispark[1] and its clones use the ATTINY85 and offer flashing over USB via the Micronucleus bootloader[2] using V-USB[3]. It comes at the cost of a significant chunk of flash storage, but the convenience is excellent. Plus, V-USB support means you can emulate all sorts of USB devices. I've used it to build a DIY NES controller adapter, but it's commonly used as a cheap Rubber Ducky[4]. For projects where USB interfacing makes sense, it can be a good fit.
1: http://digistump.com/products/1
2: https://github.com/micronucleus/micronucleus
3: https://www.obdev.at/products/vusb/index.html
4: https://shop.hak5.org/products/usb-rubber-ducky-deluxe
-
Writing bootloader to practice programming skills?
So it looks like they're using the micronucleus bootloader for the linked example. That bootloader not only does the normal bootloader job, but also acts as a bitbanging USB device in order to communicate with the computer over USB. The USB bitbanging is a huge endeavor to undertake on top of writing a bootloader.
What are some alternatives?
kcgi - minimal CGI and FastCGI library for C/C++
HoodLoader2 - 16u2 Bootloader to reprogram 16u2 + 328/2560 with Arduino IDE
picostdlib - Nim wrapper for the raspberry pi stdlib
cc2538-bsl - Python cross-platform script to upload firmware via the serial boot loader onto the CC13xx, CC2538 and CC26xx SoC.
nimOnAVR - Nim language test program for Arduino UNO/Nano or its compatibles
libusb - A cross-platform library to access USB devices
svd2nim - Convert CMSIS ARM SVD files to nim register memory mappings
ATTinyCore - Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8
dell-charger-emulator - Emulator of original Dell charger using ATTINY85
lk2nd - Secondary little kernel (lk) bootloader for Qualcomm MSM8953 devices