No, the only inline ASM in this guide is to cause a debugger breakpoint. You also need inline ASM to enable/disable interrupts, and that's about it.
The code in this guide looks ugly because it's written to show how to use the hardware without any abstraction. Higher level APIs like f3 (https://docs.rs/f3/0.3.1/f3/) exist, though not nearly for every chip or peripheral. Even in C, for anything outside the popular Arduino/mbed/etc boards, your choice is usually between buggy vendor bloatware and using the registers directly after carefully reading the datasheet.
On the other hand, mcu companies make a significant amount of their profit based on lock-in(since mcu's are mostly commodities). And the higher level the API's and the rapid development is, the less lock-in companies get.
That together with the fact it costs a lot to develop quality libraries are the main reason to the state we're in today.
As for solutions:
1. ARM did face that problem once, with cores, and played it hand well , they came to mcu vendors and told them - the carrot: using our core will save you money on development(core/compilers/etc). The stick: a startup called luminary-micro , who could do cheap mcu's since all that was free.
- So can this move be played again, today, with peripherals ? maybe build a nice peripheral set, with libraries, well tested, etc - and offer it cheaply to the risc-v guys , and other mcu vendors, including Chinese mcu vendors ?
- Maybe the place to look for quality libraries is at mcu startups ? the last one was the acquired energy-micro , are their libraries better ?
2. The IOT is a big shift. Shifts create different leverage points sometime. Is there something that open-source community can do together to push the vendors towards great libraries in that niche , even if vendors don't like it much?
For example, what if the open-source community focused on one of the hardest building block of the IOT - security ? what if we created a highly proven security IP, proven by the community to a great extent, but used it licensing to push mcu vendors ?
Are there any other ideas how to solve this conflict ?
Rewiring and redesigning all electronics around a new MCU is just an insane undertaking. Irrelevant of API change in the software.
https://www.slideshare.net/MTKDMI/2013-embedded-market-study...
Many of the reasons we're regarding software, indicating that software lock-in is a significant factor.
[1]they called it microprocessors , but pages 54, 60 hint we're talking about mcu's.
It could be that the software is the thing they think first, if you ask the people writing it.
That's the major reason I stay away from embedded development.
They also ship Basic, Pascal, Ada, Oberon and Java, here's a small selection for those curious about the offerings.
http://www.astrobe.com/default.htm
http://www.adacore.com/press/8-bit-avr-microcontroller/
https://spin.atomicobject.com/2015/05/21/generate-embedded-r...
And even before the coding starts, defining good abstractions for complex peripherals is very difficult. Counter/timer modules are the poster child for that. Heck, if you look at the Micropyothon issues on github you will find pages of vigorous debate about GPIO pullup configuration, much less anything complex.
In my experience most bundle their own compiler suite. Nothing like learning what parts of C++03 are/aren't implemented.
Especially in the RTOS space where most the time your program is just an object file being injected into the OS.
I only have experience with AVR and ARM (STM) to be honest.
0. https://github.com/jamesmunns/bluepill
1. https://gist.github.com/uxp/35c9d5d51b2229f5c4c2e5b11c3341e5
I have a presentation under http://plamauer.space/presentation.html - hard to follow without moderation, but pros and cons are at the end.
Also don't expect much. I'm a Mechanical Engineer and it was a bit out of my league, so it didn't go very deep.
The paper will hopefully soon be published: ISBN 978-3-8007-4395-7 "Evaluation of MicroPython as Application Layer Programming Language on CubeSats" in the "ARCS 2017 Conference Proceedings"
It's a mess. A couple of languages like Rust, D, etc. can be hacked on micros due to their compiler suite, but it is always messy. Above guide uses inline assembly to blink a GPIO. Hardware access is on register level. None of this makes your live easier.
In order to be viable for microcontrollers you need two things: * a compiler or interpreter for your target * a Hardware API
There are some projects, like MicroPython and Espruino who realized the importance of the Hardware API. They basically transcend micro-interpreters and RTOS (especially given the languages asyncio features).
Microcontroller vendors ship C/C++ libraries for their hardware. You either have to wrap that, like the micro-interpreters do, or your language has to be able to use them natively.
What Rust on microcontrollers need is a Kickstarter campaign with a nice dev-board as perk to finance a project that implements a nice API for that specific micro.