Tutorial: Open-Source Embedded GUI Library LittlevGL with i.MX RT1050-EVK

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 🙂

Hello from LittlevGL

Hello from LittlevGL

Continue reading

Advertisements

Tutorial: Catching Rogue Memory Accesses with ARM Watchpoint Comparators and Instruction Trace

In my “Tutorial: Catching Rogue Memory Accesses with Eclipse and GDB Watchpoints” I have used Eclipse/CDT and GDB watchpoints.  I used a conditional watchpoint, but this comes with a performance hit. In this article I show how to use the ARM Cortex trace hardware to catch specific writes to a memory location. Without severe performance degradation. But for this I need a little helper: the DEADBEEF catcher!

0xdeadbeef catcher

0xdeadbeef catcher

Continue reading

Tutorial: Catching Rogue Memory Accesses with Eclipse and GDB Watchpoints

Eclipse is great: it gives me the tools and capabilities to solve the really hard bugs to find. An example of that ‘hard’ category are ‘rogue’ memory accesses: something in the application is accessing an unwanted memory location and corrupts the data. This might be very sporadic, or takes a long while until it happens. With normal ‘stop-mode’ debugging (setting a normal breakpoint) and stepping usually won’t let me find that bug, as it might be coming from a pointer somewhere. Maybe from an interrupt routine. Or maybe an unitialized or corrupted pointer corrupts to my memory. Usually all what I know is the memory adddress of the data, maybe what is written, but not what or who is writing to that location.

In this article I’m using one of the ‘less-known’ debugging techniques available in Eclipse and CDT and how it works: watchpoints!

Watchpoint with Condition

Watchpoint with Condition

In this article I’m using one of the ‘less-known’ debugging techniques available in Eclipse and CDT and how it works: watchpoints!

Continue reading

First Steps with the NXP i.MX RT1020 EVK Board

Powerful ARM Cortex-M7 microcontroller are on the rise, bridging the gap between traditional microcontroller and Embedded Linux systems. I already published articles for the NXP i.MX RT1052 which is an ARM Cortex-M7 running at 600 MHz. Because the RT105x is available in BGA196 package only, I have as oredered the i.MX RT 1050 EVK which has a similar device on it, but in LQFP package:

i.MX RT1021

i.MX RT1021

Continue reading

Tutorial: Using Runtime Statistics with Amazon FreeRTOS V10

FreeRTOS includes a nice feature to give me information about how much time every task is spending running on the system:

FreeRTOS Runtime Information

FreeRTOS Runtime Information

This tutorial explains that FreeRTOS Runtime Statistics feature and how it can be turned on and used.

Continue reading

MCUXpresso IDE 10.2.1

NXP has just released the 10.2.1 update of their flagship Eclipse based IDE. While the number increase from 10.2.0 to 10.2.1 indicates a minor release, there are a several things which make me move over to that new release.

MCUXpresso IDE 10.2.1 build 795

MCUXpresso IDE 10.2.1 build 795

Continue reading

Debug the Last Launched Application with Eclipse and other Debug Tricks

My usual workflow is: edit – build – debug and repeat. And this for the same project again and again. So here are a few tips how to make these iterations faster with Eclipse. One thing is to use the F11 shortcut to debug the last launched/debugged application:

Debug Last Launched

Debug Last Launched

Continue reading

Porting Processor Expert Projects to MCUXpresso IDE

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.

Adafruit SSD1351 with FRDM-K64F

Ported Project with FRDM-K64F using Adafruit SSD1351 and Processor Expert

Continue reading

Using custom FreeRTOS with S32K SDK and OSIF for ARM

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:

OSIF in S32K for ARM Eclipse Project

OSIF in S32K for ARM Eclipse Project

Continue reading

Execute-Only Code with GNU and gcc

“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.

Locked Code

Locked Code

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.

Continue reading

Creating Disassembly Listings with GNU Tools and Eclipse

In many cases it is very useful to see the generated assembly code produced by the compiler. One obvious way to see the assembly code is to use the Disassembly view in Eclipse:

Disassembly View

Disassembly View

But this requires a debug session. An easier way is to use command line options to generate the listing file(s).

Continue reading

Eclipse Debugging with Pointers and Arrays

In the C programming language it is good practice to pass values by reference (using a pointer), especially for large set of data. For example the following function takes a message string and pointer to integer data which then is printed to the console:

static void printData(const char *msg, const int *intBuf, size_t bufSize) {
  puts(msg); /* print message */
  for(int i=0; i<bufSize;i++) {
    printf("buf[%i] = %i\n", i, intBuf[i]);
  }
}

Continue reading

Tutorial: FreeRTOS 10.0.1 with NXP S32 Design Studio 2018.R1

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:

FreeRTOS 8.2.1 in S32DS 2018.R1

FreeRTOS 8.2.1 in S32DS 2018.R1

So what to do if I want to use the latest FreeRTOS (currently 10.0.1) with all the bells and whistles?

Continue reading

McuOnEclipse Components: 1-July-2018 Release

I’m pleased to announce that a new release of the McuOnEclipse components is available on SourceForge. This release includes several smaller bug fixes and initial component support for the NXP S32 Design Studio and SDK.

SourceForge

SourceForge

Continue reading

Show FreeRTOS Threads in Eclipse Debug View with SEGGER J-Link and NXP S32 Design Studio

By default, the FreeRTOS threads do not show up with the SEGGER J-Link debug connection in the Eclipse based NXP S32 Design Studio IDE. But don’t worry: Here is how to get it working with SEGGER J-Link debug connection:

FreeRTOS Threads in Eclipse Debug View

FreeRTOS Threads in Eclipse Debug View

Continue reading

Measuring ARM Cortex-M CPU Cycles Spent with the MCUXpresso Eclipse Registers View

The ARM DWT (Data Watchpoint and Trace) is an optional feature of the ARM-Cortex-M, and many Cortex-M3, M4 and M7 devices have it implemented. With it comes a cycle counter which counts the cycles spent. In Cycle Counting on ARM Cortex-M with DWT I described an approach how the application on the target can access the cycle counter.

The MCUXpresso IDE shows that cycle counter in the Eclipse Registers view:

Cycle Counter in Register View

Cycle Counter in Register View

Continue reading

Installing Darkest Theme with MCUXpresso IDE 10.2

Is BLACK the color of the season? My students really seem to love these ‘dark’ Eclipse themes. Well, I tried ‘dark’ themes in the past, but I have not been vey excited about it. Somehow I preferred more the ‘black on white background’ thing. But: I have now managed to install the ‘Darkest Dark’ Eclipse theme into the NXP MCUXpresso 10.2 IDE for my daily work, and I feel it hurts my eyes less? Maybe I’m getting older? Or could it really be that ‘dark’ look and feel?

Darkest Dark Theme with MCUXpresso IDE

Darkest Dark Theme with MCUXpresso IDE

Find out for yourself in the following article….

Continue reading