Welcome to ‘Alice in Wonderland‘! For a university research project using an ARM Cortex-M33 we are evaluating position-independent code as way to load applications or part of it with a bootloader. It sounds simple: just add -fPIC to the compiler settings and you are done.
Unfortunately, it is not that simple. That option opened up a ‘rabbit hole’ with lots of wonderful, powerful and strange things. Something you might not have been aware of what could be possible with the tools you have at hand today. Leading to the central question: how is position-independent code going to work with an embedded application on an ARM Cortex-M?
Let’s find out! Let’s start a journey through the wonderland…
Managed linker scripts are great on one side: the simplify the otherwise complex GNU linker script handling. On the other side it requires knowledge how to tweak them in case ‘non-standard’ behavior is needed.
This is about one of my ‘long running projects’: I happily can report that the missing last piece has been installed after 16 months from the start of the project: the ‘3D-Printed-Supported-Driftwood-Bath-Tub-Shower-Gel-Holder’ 🙂 :
This is the ‘official finish’ of a complete bathroom renovation and remodeling. It has been a joint project with the help of friends, contractors, my family and my brother in law (who is an outstanding carpenter and cabinetmaker), plus the Ultimaker2 3D printer which contributed many ‘background and hidden’ features.
I invite you to a virtual time travel. I hope you enjoy it and get inspired….
For a research project we selected the NXP LPC55S16 but because it has due the silicon shortage it is not available probably for the next 52 weeks (yikes!) we can use the EVK Board.
The FatFS file system from Elm Chan is the de-facto file system for many embedded systems. As such it comes integrated with silicon vendor SDKs like the NXP MCUXpresso SDK. The problem is that the SDK only has examples for things on the board, and because that board does not have a SD card socket, no example for using FatFS with an SDK card is provided :-(. So I had to create one, and you can get it from GitHub.