I really love tiny and bread board friendly boards, especially if they are very affordable and can be use with Eclipse based tools. So I was excited to see the NXP LPC845-BRK board to be available at Mouser, so I ended up ordering multiple boards right away. Why multiple? Because they only cost CHF 5.95 (around $6)!
It is a common thing to boot a Linux system (see the Raspberry Pi) from a micro SD card. It is not that common for a microcontroller. The NXP i.MX RT ARM Cortex-M7 fills that gap between these two worlds. No surprise that it features a ROM bootloader which can boot from a micro SD card.
Most host or desktop systems (say Linux, Mac or Windows) have a normal use case where you start the operating system say in the morning and shut it down in the evening, and then you leave the machine. Embedded Systems are different: they are not attended, and they are supposed to run ‘forever’. Not every embedded system needs to run an OS (or in that world: Real-Time Operating System or RTOS), but the same applies here: after the RTOS is started, it is not intended that it will shutdown and restart. To the extend that you won’t they support the ‘shutdown’ and ‘restart’ functionality at all. In case of gathering coverage information this would be really useful:
In the case of FreeRTOS: what if I really need to shutdown the RTOS and restart it again, as by default this is not supported. This is what this article is about …
GDB supports a mode which allows the GDB debug client to read memory while the target is running. This allows features like ‘live variables’: that way I can see the variables refreshed and changing over time without halting the target. Another functionality which comes with that feature is to check stopped threads or to see all threads in the system.
Modern microcontroller come with plenty of internal FLASH memory. On the other side, many high performance MCUs as the NXP i.MX RT are ‘flashless’, because the silicon process for high performance cores is not matching the FLASH memory technology, so they are using external serial SPI or Quad-SPI (QSPI) memory instead.
Why not using an external SPI FLASH for a ‘normal’ microcontroller too?
Working with low power modes can be challenging. It can severely affect debugging capabilities of a microprocessor or microcontroller. I ported a FreeRTOS application using the Tickless Idle Mode to the NXP i.MX RT1064 board, and all of a sudden, the board was unresponsive to any debugger connection. Luckily the board was not really bricked, but it took me while to find a way to recover it. So for when you end up in a situation with a ‘bricked’ i.MX RT1064 board, this article might be helpful for you to recover it.
Dealing with variable width character encoding as with UTF-8 is pretty much a standard these days, at least in the Desktop programming world. This is not so much true when programming embedded devices and microcontroller. In any case, Eclipse has you covered. This is especially helpful dealing with non-ASCII character codes in comments:
With Eclipse as IDE it is very easy to debug an application on a board. Still sometimes it is useful to get one level down and control the GDB server directly.
Unit testing is a common practice for host development. But for embedded development this still seems mostly a ‘blank’ area. Mostly because embedded engineers are not used to unit testing, or because the usual framework for unit testing requires too many resources on an embedded target?
What I have used is the μCUnit framework which is a small and easy to use framework, targeting small microcontroller applications.
Not ready for the complexity of a full blown Embedded Linux, but need that extra compute performance? Need an ARM Cortex-M7 running at 600 MHz module on a half-sized business card, ready to be integrated? Here we go: the Embedded Artists i.MX RT1052 OEM module:
Compute modules are very common in the Embedded Linux space, for example see this Toradex module. The reason is simple: these high-performance boards simplify the design, as I don’t have to care about the BGA packages and the external SDRAM and FLASH devices: everything is on a module I can easily integrate into my base board.
Most embedded projects need an user input device. For the NXP i.MX RT1050-EVK board I have recently added a 480×272 full color touch LCD (see “Adding a Rocktech Capacitive Touch LCD to the NXP i.MX RT1052 EVK“). I have looked at different commercially available GUI libraries, but none of them really were matching my expectations: either very expensive or closed source, or an overkill for small LCDs and projects. But then I have found LittlevGL: free-of-charge, open source, easy to use, well documented and has everything I need. And it really looks gorgeous 🙂
In this short article I show you how to enable one of the hidden gems in Eclipse: how to get a description of the library function used in the code
The McuOnEclipse GitHub repository hosts many Processor Expert projects and is very popular (cloned more than 1000 times, thank you!). Processor Expert is a powerful framework which generates driver and configuration code, simplifying application development for a wide range of microcontroller and families. But Processor Expert won’t be developed further by NXP and is not part of MCUXpresso IDE. While it is possible to install Processor Expert into MCUXpresso IDE 10.2, how can these projects used ini an IDE *without* Processor Expert? This article describes how to port an existing Processor Expert project into the NXP MCUXpresso IDE.
In “Tutorial: FreeRTOS 10.0.1 with NXP S32 Design Studio 2018.R1” I showed how to use a custom FreeRTOS with the S32 Design Studio (ARM). The OSIF (OS Interface) provides an operating system and services abstraction for the application which is used by other S32K SDK components:
“There is no ‘S’ for Security in IoT” has indeed some truth. With all the connected devices around us, security of code should be a concern for every developer. “Preventing Reverse Engineering: Enabling Flash Security” shows how to prevent external read-out of critical code from device. What some microcontroller have built in is yet another feature: ‘Execute-Only-Sections‘ or ‘Execute-Only-Memory‘. What it means is that only instruction fetches are allowed in this area. No read access at all. Similar like ‘read-only’ ‘execute-only’ it means that code can be executed there, but no other access from that memory is allowed.
In this article I describe the challenges for a toolchain like the GNU gcc, and how to compile and link code for such an execute-only memory.
NXP not only sells general purpose microcontroller, but as well a portfolio of automotive devices which includes the S32K which is ARM Cortex based. For this device family, they offer the S32 Design Studio (or S32DS) with its own Eclipse distribution and SDK. The interesting part is that the S32DS includes Processor Expert (which is a bit different from the ‘mainstream’ Processor Expert). It comes with its own components for the S32K SDK which includes a component for FreeRTOS. But that component in S32DS 2018.R1 comes with an old V8.2.1 FreeRTOS component:
So what to do if I want to use the latest FreeRTOS (currently 10.0.1) with all the bells and whistles?
By default, the GNU compiler (gcc) optimizes each compilation unit (source file) separately. This is effective, but misses the opportunity to optimize across compilation units. Here is where the Link Time Optimization (LTO, option -flto) can help out: with a global view it can optimize one step further.
The other positive side effect is that the linker can flag possible issues like the one below which are not visible to the compiler alone:
type of '__SP_INIT' does not match original declaration [enabled by default]