You might wonder what ‘Zork‘ is? Zork is one of the first and earlist fictive computer games, written around 1977 and 1979, written in MDL on a DEC PDP-10 by members of the MIT Dynamic Modelling group (see https://en.wikipedia.org/wiki/Zork). I believe the first time I have played Zork was around 1984 on a Commodore 64.
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:
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]
Hardware Timers are essential to most embedded applications: I use them mostly for triggering actions at a given frequency, such as acquiring data from a sensor. With using an RTOS I can do a similar thing using a task: the task will run with a given frequency and I can periodic work in it. However, using a task might be too much overhead doing this. The good news is that there is a much more efficient way to do this in FreeRTOS with Software Timers. And this is what this tutorial is about: how to use Software Timers with FreeRTOS.
Decisions, decisions! Such long weekends like Pentecost are a real challenge for a family with engineers:
- Should we join that record long traffic jam to Italy and be stuck for more than 4 hours and analyze it?
- Or: should we stay home, turn the BBQ smoker engine on fire, load it with baby back pork rib racks for a slow-and-low smoke treatment, while doing some on-the-side IDE and technology exploration?
Well, my family vote was kind of clear: they have chosen that second option. Not to mention that hidden technology piece in it, but that was part of the deal ;-).
And I’m sorry: this article is not about BBQ (for this see “Smoking BBQ Baby Back Ribs – Swiss Style“), it is about technology: I’m using the NXP MCUXpresso IDE and tools for many of my projects (see “Eclipse MCUXpresso IDE 10.1 with integrated MCUXpresso Configuration Tools“). Right before the this extended weekend, NXP has released the new v10.2.0 version, so here is where that technology exploration piece comes into play. Checking the release notes, this version number change includes so many cool stuff I decided to have a look and to check it out. Of course always having an electronic eye on the baby back ribs!
I apologize: I have not been blogging much in the past weeks :-(. One reason is that I’m working on a DIY SMT/SMD Pick&Place machine which keeps me busy most of my spare time :-). I admit that this project is not finished yet, but now is the time I can give a sneak preview: a SMD/SMT pick and place machine:
One of the great things with the FreeRTOS operating system is that it comes with free performance analysis: It shows me how much time is spent in each task. Best of all: it shows it in a graphical way inside Eclipse too:
To solve the real hard problem of Embedded Systems development, I usually need all the data I can get from the target. The Percepio Tracealizer is such a tool which can stream application and FreeRTOS trace from the target over a Segger J-Link connection using the Segger RTT protocol. I’m using that combination a lot.
Streaming trace data that way does not need a dedicated hardware like ETM Trace. Using RTT is usually not much intrusive and affects the performance of the target in the 1-2% range (of course depending on the amount of data).
But what worried me for several weeks is that after moving to FreeRTOS V10.0.0 and the same time updating the Segger libraries, the target performance was heavily affected:
Doing Mini Sumo robot competition is really fun, and there is yet another one coming to end the current university semester. For several years we have used our own sumo robot, and this is the one used in the course this year too. But for future and extended events we are exploring a new robot. I proudly present the concept of the next generation sumo robot for the year 2018:
“Amazon FreeRTOS – IoT operating system for microcontrollers”: The announcement of FreeRTOS V10.0.0 was one of the biggest news last week for me. Not only is there now a Version 10, the bigger news is that FreeRTOS is now part of Amazon. Wow! Now this explains why Richard Barry (the founder behind FreeRTOS) was kind of hiding away for about a year: he joined Amazon as a principal engineer about a year ago. I think we all have to wait and see what it means for FreeRTOS.
The NXP Freedom boards are very popular. Many of them are inexpensive (less than $20), include a debug interface and can be easily extended with extra shields or boards. Especially the FRDM-KL25Z is very popular: I’m getting told because of Processor Expert and tutorials available on web sites like this one ;-).
Unfortunately there are no small or breadboard friendly Kinetis boards available. There is the NXP LPC800-DIP but with no onboard debugger and without Processor Expert support. We have the tinyK20, but projects tend to use more CPU power, FLASH and RAM space than what the tinyK20 board (50 MHz, 128 KByte FLASH, 16 KByte RAM) can provide. So we ended up designing the big brother of the first tinyK20: the tinyK22 with 120 MHz, 512 KByte of FLASH and 128 KByte of RAM.
Back in March 2017, NXP had rolled the MCUXpresso IDE starting with Version 10.0.0. With the intent to unify the SDK, LPCXpresso, CodeWarrior, Kinetis Design Studio and Processor Expert into one unified and integrated set of tools. V10.0.0 was a good start. The MCUXpresso IDE V10.0.2 in July was more of a smaller update, and the Pin and Clock configuration tools were not integrated, no added tool for peripheral configuration.
A week ago the MCUXpresso V10.1.0 has been released which shows where the journey is going: an free-of-charge and code size unlimited Eclipse based integrated set of tools to configure, build and debug Cortex-M (Kinetis, LPC and i.MX RT) microcontroller/processor based applications.
I have used it for a week, and although many things are still new, I thought I’m able to give an overview about what is new.
I’m using many microcontroller in my projects. And a lot more are available out there in the ecosystem. Like many others, I tend to select what I am familiar with. But is this the correct approach to select the hardware and tools for a next project?