MCUXpresso IDE V11.2.1

I have started the semester and labs using the MCUXpresso IDE V11.2.0 which has been available from July this year. The past week I received the notification that the update V11.2.1 is available: time to check it out….

MCUXpresso IDE V11.2.1

MCUXpresso IDE V11.2.1

Continue reading

FreeRTOS V10.4.1 with SEGGER SystemView V3.12

Amazon has released in the past week the FreeRTOS version V10.4.0. Time to upgrade, actually the most recent version 10.4.1! The same time the SEGGER SystemView V3.12 was released back in April this year. No surprise: with the FreeRTOS changes they don’t work out of the box: but no worries, I have you covered and applied all the needed patches and changes to have them working again together: the latest FreeRTOS v10.4.x with Segger SystemView v3.12:

Segger SystemView 3.12 with FreeRTOS 10.4.2

Segger SystemView 3.12 with FreeRTOS 10.4.2

Continue reading

DIY Portable Video Conference, Sharing and Teaching Device

COVID-19 is by far not over, and in Switzerland the infection rate is going up again (2nd wave?). During the spring 2020 semester university lock-down we moved pretty much everything to a ‘distance learning’ setup. With that experience and with the request to prepare for the fall semester, I have constructed a DIY conference and teaching device which should make things simpler and easier: a combination of video camera, speaker phone and a muting device:

Desk with Communicator

Desk with Communicator C2020

Continue reading

Eclipse Gems, Tips & Tricks: Faster Debugger Start

This article is part of a ‘mini series’ about hidden gems, tips and tricks around Eclipse.
The topic of this one is how to accelerate the start of the debugger.

Nothing to be done

Nothing to be done

Continue reading

From C to C++: Converting Eclipse C Projects

Creating a new project with Eclipse for a microcontroller these days is fairly easy, and I have the choice if I want to start the project with C or C++:

Choice of C and C++ for a new project

Still the embedded microcontroller world is dominated by C and not C++. So while it is easy to start with a C++ project, most vendor provided example or tutorial project are C projects. So how can I transform such project to C++?

Continue reading

How to use Eclipse CDT Environment Variables in C/C++ Code

When using a logging framework it is useful to use the current file name or line number. The ANSI C/C++ standard defines the __LINE__ and __FILE_ preprocessor macros for this.

But what about the project name, if it is a release or debug build, the microcontroller used or other things like the operating system which was used to build the binary?

Target Chip Name

Target Chip Name

This (and even more) can be easily provided by Eclipse to the C/C++ application being built with CDT.

Continue reading

How to get Data off an Embedded System: FatFS with USB MSD Host and FreeRTOS Direct Task Notification

This is a follow-up article of my earlier project presented in “FatFS, MinIni, Shell and FreeRTOS for the NXP K22FN512“. I wanted to extend it with a USB MSD (memory stick) device: The USB storage device gets automatically mounted, and depending on a configuration (.ini) file on the memory device I can perform various actions, for example automatically copy data from the SD card to the USB device. For example the system logs data, and to get the data I insert the memory stick, it copies the data on it and automatically unmounts it, and I can remove the memory stick.

FRDM-K22F USB Host Mode with Memory Sticks

FRDM-K22F USB Host Mode with Memory Sticks

Continue reading

Disabling NMI (Non Maskable Interrupt) Pin

The NMI is a special interrupt on ARM Cortex-M architecture: as the name indicates, it cannot be ‘masked’ by the usual ‘disable interrupts’ flags (PRIMASK, BASEPRI), similar to the Reset signal.

cortex-m-vector-table

cortex-m-vector-table (Source: adapted from arm.com)

Dealing with the reset signal is kind of obvious, and most designs and boards have it routed to a reset button or similar. The NMI is less obvious if you don’t pay attention to it: most ARM-Cortex implementations and boards have the NMI signal routed to a pin and are ‘hiding’ it in the schematics behind a normal GPIO pin or port: if you don’t pay attention to the NMI functionality, the board might not work as intended.

Continue reading

McuLog: Logging Framework for small Embedded Microcontroller Systems

An essential tool especially developing larger applications or distributed firmware is to use logging. This article presents an open source logging framework I’m using. It is small and easy to use and can log to a console, to a file on the host or even to a file on an embedded file system as FatFS.

Log Output

Log Output

Continue reading

Tutorial: Adding FreeRTOS to where there is no FreeRTOS

FreeRTOS is pretty much everywhere because it is so simple and universal, and it runs from the smallest to the biggest systems. But it still might be that for the microcontroller device you have selected there is no example or SDK support for it from your vendor of choice. In that case: no problem: I show how you could easily add FreeRTOS plus many more goodies to it.

Binky on NXP LPC845-BRK Board

Binky on NXP LPC845-BRK Board

Continue reading

FatFS, MinIni, Shell and FreeRTOS for the NXP K22FN512

I’m using the NXP Kinetis K22FN512 in many projects, either with the FRDM-K22F or on the tinyK22: with 120 MHz, 512 KByte FLASH and 128 KByte it has plenty of horsepower for many projects. The other positive thing is that it is supported by the NXP MCUXpresso IDE and SDK. I have now created an example which can be used as base for your own project, featuring FreeRTOS, FatFS, MinIni and a command line shell.

FRDM-K22F with SD Card

FRDM-K22F with SD Card

Continue reading

FreeRTOS Task Runtime Statistics for NXP i.MX RT1064

FreeRTOS has many cool features, and one is that it can report the CPU percentage spent in each task. The downside is that to get this kind of information some extra work is needed. In this article I show how to do this for the NXP i.MX1064.

FreeRTOS Runtime Information

FreeRTOS Runtime Information

Continue reading

Tutorial: Rename, Copy or Clone Eclipse Projects with MCUXpresso

Especially in a lab or classroom environment it is convenient to start with a template project, and then explore different ways to shape the project for different needs. As for any IDE of this world, this requires an understanding of the inner workings to get it right. So in this article I show how to copy, clone or rename properly an Eclipse ‘template’ project in the MCUXpresso IDE.

Template Project

Template Project

Continue reading

Copyright Law for Makers and Educators

Maker spaces and ‘FabLabs’ are popular and accessible in many areas. 3D printers are on the cheap, and powerful laser cutters are in the range of the fearless hobbyist. You can get dirty-cheap PCBs from China in less than a week (ok, probably not right now because of Corona virus) and it is easy to SMD solder parts these days with a DIY SMD PnP machine and OpenPnP. With the right equipment and skill set it is possible to build many cool projects. It is very rewarding and a great learning thing. Blog about it so other can learn too. And it even could get featured on Hackaday.

But: The risk is that someone might send you letter about a ‘Copyright Infringement’. Sadly, this is what happened to me for one of my recent projects. I don’t think that ‘take down’ letter was justified, but I learned a great deal what I should have done differently to avoid that situation. So in the end, it was a learning opportunity, which I believe is worth to share. In essence: what can a maker or educator do?

hackaday building a giant meta-clock made of smaller clocks

Hackaday: building a giant meta-clock made of smaller clocks (image: original image from Hackaday)

Continue reading

Tutorial: Maximum Clock Frequency for Kinetis using MCUXpresso Clock Tools

The tinyK22 board with the NXP K22FN512 is a bread-board-friendly small board with a 8 MHz external oscillator:

tinyK22 Board

tinyK22 Board

This tutorial is about how to use the NXP MCUXpresso Clock configuration and configure the board to the maximum clock frequency of 120 MHz. The same steps apply to many other boards, including the FRDM-K22F one.

Continue reading