GNU Link Time Optimization finds non-matching Declarations

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]
Warning by LTO

Warning by LTO

Continue reading

Advertisements

Tutorial: Understanding and Using FreeRTOS Software Timers

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.

FreeRTOS Software Timers

FreeRTOS Software Timers

Continue reading

Do you Speak Klingon? How to change the Eclipse IDE UI Language with Babel

We in Switzerland are proud about the fact that our country has four official languages: Italian, French, German and Romansh. Most of Swiss people speak at least two of them, plus the inofficial fifth language (English).

Eclipse is even better than that and speaks 46 different languages. If you are not happy with the default language, try out Babel! And yes, Eclipse has a language pack for Klingon too:

Babel Language Packs in Klingon

Babel Language Packs in Klingon

🙂

Continue reading

Understanding FreeRTOS Task Stack Usage and Kernel Awareness Information

When using the FreeRTOS Task List in the Eclipse based MCUXpresso IDE, it shows the list of tasks with their stack size used. But with the default FreeRTOS settings it is not able to determine the correct stack size and shows a warning icon:

Warning for Stack Usage

Warning for Stack Usage

Continue reading

Overview of MCUXpresso IDE v10.2.0

Decisions, decisions! Such long weekends like Pentecost are a real challenge for a family with engineers:

  1. Should we join that record long traffic jam to Italy and be stuck for more than 4 hours and analyze it?
  2. 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!

MCUXpresso IDE v10.2.0

MCUXpresso IDE v10.2.0

Continue reading

Upgrading a Laser Cutter with Cohesion3D Mini and LCD

I’m very happy with my 50W Laser Cutter (see “Getting Control over a 50 Watt CO2 Laser Cutter from China“). My main decision factors were (and still are): Software, software, tools and again software, and down in the list finally the hardware. Same thing for that laser cutter. After several upgrades (see “50W Laser Cutter Upgrades“), it was time replace the stock controller hardware with a new one including LCD display:

New Laser Cutter LCD Panel

New Laser Cutter LCD Panel

Continue reading

Debugging ARM Cores with IP based Debug Probes and Eclipse

Using IP (Ethernet) based debug probes is a very handy thing: I don’t have to be directly connected to the debug probe (e.g. with the USB cable). This article explains how to use an IP-based Segger or P&E probe with the Eclipse based MCUXpresso IDE.

LAN Based Debugging

LAN Based Debugging

Continue reading

Recovering OpenSDA Boards with Windows 10

Windows 8 and 10 have added a ‘feature’ to scan and index devices attached to the host machine. This means that bootloaders or MSD (Mass Storage Device) programming implementations on evaluation boards developed in the Windows 7 age might not be prepared for that. Up to the point that it can impact the bootloader as outlined in “Bricking and Recovering OpenSDA Boards in Windows 8 and 10“. So far one of the easiest way to get out that situation was to use a Windows 7 machine. But if you only have a Windows 10 machine available, this article describes the needed steps to update the bootloader with Windows 10 host machines.

OpenSDA LED

OpenSDA LED

Continue reading

Listing Code and Data Size with GNU nm in Eclipse

The map file produced by the GNU linker includes lots of information, however it is very cryptic to read. In “Listing Code and Data Size for each Source File with GNU and Eclipse” I showed how the GNU size utility can be used to report the code and data size for each object file. The Eclipse based MCUXpresso IDE comes with another nice view which shows detailed information about code and data allocation:

Symbol Viewer in MCUXpresso IDE

Symbol Viewer in MCUXpresso IDE

Continue reading

McuOnEclipse Components: 1-Apr-2018 Release

It’s April Fool’s Day, but be assured this is not a joke ;-): I’m pleased to announce that a new release of the McuOnEclipse components is available in SourceForge. This release includes several smaller bug fixes and components have been upgraded for FreeRTOS V10.0.1.

SourceForge

SourceForge

Continue reading

Converting Binary Files to Intel Hex Format with the SRecord Tool

I’m dealing a lot with bootloaders recently (see “Flash-Resident USB-HID Bootloader with the NXP Kinetis K22 Microcontroller“), and bootloaders are sometimes very picky about what file format they are able to consume. So what if I have a binary (see “S-Record, Intel Hex and Binary Files“) file and I need to convert it into the Intel Hex format?

converted binary to intel hex

converted binary to intel hex

Continue reading

Tutorial: CRC32 Checksum with the KBOOT Bootloader

In “Flash-Resident USB-HID Bootloader with the NXP Kinetis K22 Microcontroller” I presented how I’m using the tinyK22 (or FRDM-K22F) with a flash resident USB HID bootloader. To make sure that the loaded application is not corrupted somehow, it is important to verify it with a Cyclic redundancy Checksum (CRC). The NXP KBOOT Bootloader can verify such a CRC, but how to generate one and how to use it is not really obvious (at least to me), so this article explains how to generate that CRC.

CRC Values for KBOOT

CRC Values for KBOOT

Continue reading

Performance and Runtime Analysis with FreeRTOS

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:

FreeRTOS Runtime Information in Eclipse

FreeRTOS Runtime Information in Eclipse

Continue reading

Faster FreeRTOS Percepio Tracealyzer Streaming with Segger RTT

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:

RTT Streamnig affects target performance

RTT streaming affects target performance?

Continue reading

Debugging the Teensy 3.6 with Eclipse MCUXpresso IDE and CMSIS-DAP LPC-Link2

The Teensy boards are great, but as they are they are not really useful for real development, as they lack proper SWD debugging. In “Modifying the Teensy 3.5 and 3.6 for ARM SWD Debugging” I have found a way to get SWD debugging working, at that time with Kinetis Design Studio and the Segger J-Link. This article is about how debug the Teensy with free MCUXpresso IDE and the $20 NXP LPC-Link2 debug probe:

Teensy 3.6 with NXP LPC-Link2

Teensy 3.6 with NXP LPC-Link2

Continue reading

McuOnEclipse Components: 26-Dec-2017 Release

I’m pleased to announce that a new release of the McuOnEclipse components is available in SourceForge., which is supposed to be the last release for 2017 :-). This release features several smaller bug fixes, the new FreeRTOS V10.0.0 and extended device support.

SourceForge

SourceForge

Continue reading

New Concept for 2018 Mini Sumo Roboter

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:

Sumo Robot with Bluetooth module

Sumo Robot with Bluetooth module

Continue reading

MCUXpresso IDE V10.1.0 with i.MX RT1052 Crossover Processor

In “Eclipse MCUXpresso IDE 10.1 with integrated MCUXpresso Configuration Tools” I mentioned that I wanted to try the i.MX RT1050 processor. Well, finally my ordered board from Mouser arrived, right on time for the week-end, so I had a chance to use that ARM Cortex-M7 running at 600 MHz :-).

i.MX RT1050 EVK

i.MX RT1050 EVK

Continue reading

Exploring a Microcontroller and Software and Tools for the next Project

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?

Microcontroller Boards

Microcontroller Boards

Continue reading