INTRO FS2016 Semester Closing with Robot Maze Challenge


“Learning-by-doing” is one of the core principles of my embedded systems and robotics course at the Lucerne University. For this the students apply what they learned using a robotics platform. In earlier semesters we did a Sumo battle at the end. This time the challenge was to build a remote controller plus to add the ability to explore and solve a line maze:

maze solving robots

maze solving robots

Continue reading

FreeRTOS V9.0.0 with Static Memory Allocation


I’m using FreeRTOS in most of my applications. There were only a few exceptions where an RTOS has to be used in safety critical systems: there usually it is not permitted to use any dynamic memory allocation because this adds the risk that a memory allocation could fail at runtime because of memory fragmentation or memory leak. And FreeRTOS uses a dynamic memory (heap) for the task stacks and the RTOS resources including semaphore, mutex and queues.

This is now a thing of the past. This week a new FreeRTOS Version 9 was released which does not need any dynamic memory allocation anymore: it is possible now to build completely statically allocated systems with FreeRTOS :-).

Dynamic and Static Memory Allocation in FreeRTOS V9.0.0

Dynamic and Static Memory Allocation in FreeRTOS V9.0.0

Continue reading

NXP FlexIO Generator for the WS2812B LED Stripe Protocol


The challenge with the selection of a microcontroller for a project is: which one has the required number of UART, I2C, SPI? Combine this with the desired package (48pins, 64pins? LQFN?), the needed FLASH and RAM size and then even the hundreds of available microcontroller shrink to a handful only. And many times I need to make compromises: such as I need two hardware I2C, but the microcontroller matching all my other needs has only one I2C hardware. So I might end up with bit-banging the slower I2C bus. Doable, but not ideal.

What is cool that some of the newer NXP Kinetis microcontroller come with an interesting hardware: FlexIO. A peripheral hardware which allows me to implement a custom protocol, including driving WS2812B (Adafruit NeoPixel) LEDs with a FRDM-KL43Z board:

Four NeoPixels with FlexIO

Four NeoPixels with FlexIO

Continue reading

Tutorial: Blinky with NXP Kinetis SDK V2.0 and Processor Expert


In “Mother of Components: Processor Expert with NXP Kinetis SDK V2.0 Projects” I presented an approach how to use Processor Expert components with the NXP Kinetis SDK. This article is a tutorial how to create a blinking LED project with that approach, using McuOnEclipse Processor Expert components and the Kinetis SDK V2.0. As board the FRDM-K22F is used:

Blinky on a FRDM-K22F with SDK V2.0 and Processor Expert

Blinky on a FRDM-K22F with SDK V2.0 and Processor Expert

Continue reading

NXP FTF Hands-On with FreeRTOS Task Aware Debugger


I mentioned the hands-on sessions on FreeRTOS I do this week at NXP FTF Tech Forum in Austin in my previous post. What we are using in the session is an Eclipse plugin in Kinetis Design Studio showing all kinds of FreeRTOS information:

NXP FreeRTOS Plugin in Kinetis Design Studio

NXP FreeRTOS Plugin in Kinetis Design Studio

Continue reading

FreeRTOS Thread Debugging with Segger GDB in Eclipse


NXP FTF Tech Forum in Austin has been a blast! I’m running another FreeRTOS hands-on session (FTF-DES-N2048) this afternoon which yet again is fully booked. But we will squeeze in as many as possible from the waiting list.

One very exciting thing we are going to use is FreeRTOS thread awareness in Eclipse/Kinetis Design Studio: to see and debug the FreeRTOS threads in Eclipse using the Segger GDB and it will show the list of threads in the Debug view:

FreeRTOS Thread Awareness with Segger GDB

FreeRTOS Thread Awareness with Segger GDB

Continue reading

Mother of Components: Processor Expert with NXP Kinetis SDK V2.0 Projects


Unfortunately, now the NXP Kinetis SDK V2.0 does not include Processor Expert support (see “First NXP Kinetis SDK Release: SDK V2.0 with Online On-Demand Package Builder“). But at the Lucerne University we are using more than 150 different custom Processor Expert components we would like to use with that new SDK. So how to make them working with the Kinetis SDK V2.0? Using a Processor Expert as “the mother of all components”:

NXP Kinetis SDK V2.0 and Processor Expert Side-by-Side under Eclipse

NXP Kinetis SDK V2.0 and Processor Expert Side-by-Side under Eclipse

Continue reading

McuOnEclipse Components: 8-May-2016 Release


Time is passing fast, and many components have been updated to make the compatible with the NXP Kinetis SDK V2.0. As a highlight, besides of FreeRTOS the following components are now usable with the NXP Kinetis SDK:

Components compatible with Kinetis SDK

Components compatible with Kinetis SDK

Continue reading

Programming S-Records with GNU ARM Eclipse Debugger Plugins


By default I’m programming the Elf/Dwarf (.elf) file present in the GNU ARM Eclipse debug configuration:

Elf File to be Downloaded

Elf File to be Downloaded

But how to program the board with something different from the .elf file?

Continue reading

Changing Heap and Stack Size for NXP Kinetis SDK V2.0 gcc Projects


With Processor Expert projects it is very easy to change the heap and stack size: There is a setting for this in the Cpu component settings, under the ‘Build options’ tab:

Heap and Stack Size with Processor Expert

Heap and Stack Size with Processor Expert

As there is no Processor Expert in the NXP Kinetis SDK V2.0 (see “First NXP Kinetis SDK Release: SDK V2.0 with Online On-Demand Package Builder“), how to do the same in a SDK V2.0 project?

Continue reading

Fix for GDB and “The system tried to join a drive to a directory on a joined drive”


The bad thing with Eclipse and GDB is: if something is failing, then all what I get is a very cryptic error message when I launch the debugger:

The system tried to join a drive to a directory on a joined drive

The system tried to join a drive to a directory on a joined drive

Continue reading

Debugging Multiple NXP Boards with GDB and P&E


In “Debug Multiple Boards with GDB at the Same Time” I have used the Segger J-Link to debug multiple boards, from the same IDE, at the same time. The remaining question in that article was: how to do the same the P&E Multilink/OpenSDA?

Debugging two NXP FRDM-KL27Z Boards with P&E Debugger the same time

Debugging two NXP FRDM-KL27Z Boards with P&E Debugger the same time

Continue reading

Semihosting with Eclipse and the NXP Kinetis SDK V2.0


The world is changing, and the say is “change is good” :-). In the software and API world, change very often means that a change results into something broken. So I had battled with semihosting working on the NXP Kinetis parts, only to find out that it does not work any more with using the latest version 2.0. The semihosting output e.g. with P&E debug connection remains empty:

No Semihosting output

No Semihosting output

So how to fix this?

Continue reading

FreeRTOS Thread Debugging with Eclipse and OpenOCD


FreeRTOS is probably the number one RTOS used, and Eclipse is likely the most popular IDE I can think of. But debugging FreeRTOS applications with Eclipse and GDB is somewhat limited? What I would like to get at the minimum is this: ability to see all the different threads in the Eclipse debug view like this:

FreeRTOS Threads in Eclipse with OpenOCD

FreeRTOS Threads in Eclipse with OpenOCD

As you might guess from that screenshot: this post is about how to make FreeRTOS tread debugging possible with Eclipse and GDB :-).

Continue reading

NXP Kinetis Design Studio v3.2.0


For my classes I had so far asked the students to install the Kinetis Design Studio (KDS) v3.0.0 and then apply several updates and upgrades available. NXP has now released the v3.2.0 of their KDS (Kinetis Design Studio):

Kinetis Design Studio v3.2.0

Kinetis Design Studio v3.2.0

The v3.2.0 is including all the 3.x.x updates in a single installation which makes things easier to start with. And it now works for Mac OS X “El Capitan” and the latest GNU ARM Eclipse plugins :-).

Continue reading

3D Printed Gameboy and Remote Controller with tinyK20 Board


As a remote controller for the Sumo robot (see “Zumo Robot with Magnetic Encoders“) we have used so far a combination of NXP FRDM-KL25Z board and a Joystick Shield (see “Joystick Shield with nRF24L01 driving a Zumo Robot“). That solution was not ideal, so this weekend I created a 3D printed prototype:

tinyK20 Remote Controller

tinyK20 Remote Controller

Continue reading

nRF24L01+ 2.4 GHz Wireless Connectivity with the tinyK20 Board


I’m using the tiny and inexpensive Nordic Semiconductor nRF24L01+ transceiver (see “Tutorial: Nordic Semiconductor nRF24L01+ with the Freescale FRDM-K64F Board“) in many projects: it costs less than $3 and allows me to communicate with a proprietary 2.4GHz protocol in a low power way (see “IoT: FreeRTOS Down to the Micro Amps“). I have that transceiver now running with the tinyK20 board too:

nRF24L01+ Transceiver with tinyK20

nRF24L01+ Transceiver with tinyK20

Continue reading

Tutorial: Blinky with the FRDM-KL27Z and Kinetis SDK v2


I’m using the FRDM-KL25Z in my classes, and that board is very popular: low price (<$15), reasonable features (48 MHz ARM Cortex M0+, 128 KByte of FLASH, 16 KByte of RAM), and many tutorials elsewhere and on McuOnEclipse :-).

For the next (Fall) semester I’m looking for alternative boards, and one is the Freescale (now NXP) FRDM-KL27Z:

FRDM-KL27Z with Box

FRDM-KL27Z with Box

Continue reading