What we've been reading in June (2021)
Here are the articles, videos, and tools that we’ve been excited about this June.
We hope you enjoy these links, and we look forward to hearing what you’ve been reading in the comments or on the Interrupt Slack.
Articles & Learning
Position-Independent Code with GCC for ARM Cortex-M | MCU on Eclipse by Erich Styger
It’s not trivial to get compiled application binaries to run on different firmware, but it is possible! In this fantastic article, Erich details how you can compile your firmware and application code separately and use a Procedure Linkage Table and shared libraries to accomplish the task. This is a strategy we used heavily at Pebble to enable our third-party SDK and app store!
A General Overview of What Happens Before main() | Embedded Artistry by Phillip Johnston
One of the best articles detailing what your embedded devices are doing before they jump into the
main()function. The “Further Reading” section is also a goldmine of articles on the topic.
ISR Contexts in Embedded C and C++ — Selecting the correct function at compile time by Joel Filho
A detailed article on how to pick the appropriate function, either regular or ISR-safe, at both runtime and compile time. Joel goes into a variety of ways to get the compiler to do this for you and provides a nice comparison table at the end discussing the pros and cons of each strategy. Some of the strategies even work with C as well!
Enter the EFM32 Gecko | LimitedResults by LimitedResults
Using a similar attack vector used with an nRF52, LimitedResults was able to bypass the Authentication Access Port (AAP) on the SiLabs EFM32 line of Cortex-M chips.
Optimize Zephyr Project Configuration and Overlays by Jared Wolff
Jared writes about how to configure a Zephyr project using overlays.
Dumping and extracting the SpaceX Starlink User Terminal firmware | COSIC by KU Leuven
The author and security research group dig into the SpaceX Starlink device trying to gain access to the firmware. It turns out that the serial console login is disabled with a fuse and can be remotely disabled as well if detected it is outside of a geo-fence (smart!). The group did obtain root access ultimately, but that’s probably for a future article after it’s patched.
Benchmarking OpenCV on STM32 MCUs | Embedded.com
OpenCV is usually run on higher performance MCU’s and CPU’s, but here, it’s running on an STM32F7! The article claims that the device can detect (not comprehend) a QR code in 3 seconds, and do face detection in 10-15 seconds.
Reverse engineering and fixing a bug in the firmware of a “ThinkPad Compact USB Keyboard with TrackPoint” | Magic Smoke by Dennis Schneider
I love this so much. Dennis was frustrated by a hardware quirk on his Lenovo keyboard which triggered a click at an inapropriate time while scrolling. His solution? Dump the firmware, print out and understand the assembly, modify the firmware, and load it. Problem solved!
Tools & Projects
Pinfigurator: A microcontroller search tool by Kevin Lynagh
A microcontroller search tool that allows you to find exactly the MCU you are looking for based on requirements, such as CPU, RAM, ROM, or peripheral requirements.
OTGMessenger: Off The Grid Messenger
A complete hardware & software project which repurposes a Nokia e63 phone and transforms it into a secure long-range mobile device to communicate with other nearby devices. It’s built upon an STM32H7 and an ISM LoRA radio.
MicroShell is a lightweight pure C implementation of shell emulator dedicated for embedded bare-metal systems. Full-featured with auto-completion, backspace, directory management, and asynchronous callbacks. It’s even unit tested! What to try it for yourself? Check out the browser demo.
Mimicc – Mock generator for C and C++
Mimicc is a clang-based C/C++ compiler and mocking framework that turns function and method declarations directly into runnable mocks. Works out of the box with CppUTest and GoogleTest, and would be a good replacement for CppUMock, fff, or CMock. Comes with a CLI to help generate the mock files, and works on Mac & Linux.
Prusa-Firmware-Buddy - 3D Printer firmware
The firmware that runs on 3D printers from Prusa Research. If you’re looking for inspiration on how to set up a project, this is a good reference. It includes setups for VSCode, Vim, and Eclipse, has a convenient
build.pywrapper, and uses
clang-formatfor formatting. It also includes a custom GUI, localization, a custom filesystem, and many other modules. Definitely take a look!
Embedded Template Library by John Wellbelove
A C++ template library specifically designed for constrained embedded systems. It’s compatible with C++ 03, does not require dynamic memory allocation, no reliance on the STL, and max sizes are determined at compile time.
When it comes to git history, less is more | Stephen Brennan
A nice thought-piece on large, arguably either useless or beneficial changesets. The main argument is that large PR’s that just change formatting make git history more difficult to work with and make backporting changes to old branches nearly impossible.
Arm Transfers CMSIS-Pack Technology to Linaro | Linaro
Title says it all.