GNU Coverage (gcov) with NXP S32 Design Studio IDE

The open-source GNU tools provide a rich set of tools to help developing software. Some are clearly more for the high-end application development. But many of the tools are applicable for the more restricted embedded software development process as well. One is gcov, or the GNU Coverage Tool. Coverage is essential for the testing phase, as it tells you what part of code have been used and ‘covered’. This article describes how GNU coverage can be added the NXP S32 Design Studio IDE.

Continue reading

McuOnEclipse Components: 26-Dec-2021 Release

I’m pleased to announce a new release of the McuOnEclipse components, available on SourceForge. This release includes several bug fixes, support for more devices, and updated components like FreeRTOS, MinINI, Percepio Tracealyzer and SEGGER SystemView.

SourceForge

SourceForge

Continue reading

Implementing FreeRTOS Performance Counters on ARM Cortex-M

When using an RTOS like FreeRTOS, sooner or later you have to ask the question: how much time is spent in each task? The Eclipse based MCUXpresso IDE has a nice view showing exactly this kind of information:

FreeRTOS Runtime Information

FreeRTOS Runtime Information

For FreeRTOS (or that Task List view) to show that very useful information, the developer has to provide a helping hand so the RTOS can collect this information. This article shows how this can be done on an ARM Cortex-M.

Continue reading

Be aware: Floating Point Operations on ARM Cortex-M4F

My mantra is *not* to use any floating point data types in embedded applications, or at least to avoid them whenever possible: for most applications they are not necessary and can be replaced by fixed point operations. Not only floating point operations have numerical problems, they can lead to performance problems as in the following (simplified) example:

#define NOF  64
static uint32_t samples[NOF];
static float Fsamples[NOF];
float fZeroCurrent = 8.0;

static void ProcessSamples(void) {
  int i;

  for (i=0; i < NOF; i++) {
    Fsamples[i] = samples[i]*3.3/4096.0 - fZeroCurrent;
  }
}

Continue reading

Remote Debugging with USB based JTAG/SWD Debug Probes

For some projects it is not possible to have the device under debug available on my desk: the board might be in another room, on another site or in a place where physical access is not possible or even dangerous. In that case an IP-based debug probe (see Debugging ARM Cores with IP based Debug Probes and Eclipse) is very useful: as long as I can access its IP address, that works fine. It is an excellent solution even if the board is moving or rotating: hook it up to a WLAN access point and I still can use it as it would be on my desk.

But what if I have a debug probe only connected to USB? This article shows how to turn a USB debug probe into a IP-based debug solution: that way I can easily debug a board from remote, connected to the network:

IP Based Debugging with USB Debug Probe

IP Based Debugging with USB Debug Probe

Continue reading

Debugging the Startup Code with Eclipse and GDB

By default, when debugging an embedded application, the target usually stops at main():

stopped in main

stopped in main

That’s usually fine, but what if I want to debug the code out of reset?

Continue reading

Tutorial: HD44780 Display Driver with NXP MCUXpresso SDK

In the age of high-resolution graphical LCDs using a character display might look like a bit anachronistic. But these displays provide a lot of value for me as they are robust, available in different shapes and number of lines. And such a character display can be a better solution for an industrial application.

hd44780 display with NXP FRDM-KW41Z Board

hd44780 display with NXP FRDM-KW41Z Board

Continue reading

FreeRTOS: how to End and Restart the Scheduler

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:

coverage information from freertos application

coverage information from FreeRTOS application

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 …

Continue reading

McuOnEclipse Components: 30-Sept-2018 Release

I’m pleased to announce a new release of the McuOnEclipse components, available on SourceForge. This release includes several bug fixes, extra support for the NXP S32 Design Studio and SDK and includes FreeRTOS V10.1.1.

SourceForge

SourceForge

Continue reading

Updating the S32K144EVB to Switch between 5V and 3.3V Logic Levels

By default, the NXP S32K144EVB and microcontroller is using a 5V supply voltage and logic levels which is great for noisy environment or any 5V devices. Many of my displays and sensors use 3.3V logic levels, so I would have to use a level shifter from 5V to 3.3V. There is another way: to change the board for 3.3V logic levels so I can use directly things like a SSD1306 display.

S32K144EVB with OLED SSD1306 using 3.3V Logic Levels

S32K144EVB with OLED SSD1306 using 3.3V Logic Levels

Continue reading