Problem: undefined reference to ‘__end__’ if using Semihosting

In case you are running into the following GNU linker error about a missing __end__:

'Building target: MyProject.elf'
'Invoking: Cross ARM C++ Linker'
...
toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/armv6-m/rdimon-crt0.o: In function `_start':
(.text+0xdc): undefined reference to `__end__'
collect2.exe: error: ld returned 1 exit status
make: *** [MyProject.elf] Error 1
Failed link because missing __end__

Failed link because missing __end__

The GNU linker complains that rdimon-crt0.o needs the symbol __end__.  This symbol marks the end of the user data/RAM section, and is needed by the rdimon library specs which is used with semihosting.

Continue reading

Semihosting for Kinetis Design Studio V3.0.0 and GNU ARM Embedded (launchpad)

Freescale has released the v3.0.0 version of the Kinetis Design Studio: this one comes with a great positive change: instead of a custom toolchain, it is coming with the standard GNU ARM Embedded (launchpad) toolchain from ARM. Beside of better code density and less RAM needed, there is one change which affects semihosting. Previously, semihosting was enabled by default in the V2.0.0 libraries. Now semihosting needs to be turned on. This post is how to do this.

Semihosting Console with Output in Eclipse

Semihosting Console with Output in Eclipse

Continue reading

GDB Client and Server: Unlocking GDB

In case you face problems with launching GDB: Then I have a quick solution (well: workaround): kill the GDB server and or client process. The problem can show up in many way, but in general gdb is stuck or does not respond:

GDB stuck?

GDB stuck?

But it could be an error message like this too:

Error in services launch sequence
Starting J-Link GDB Server timed out.

Continue reading

Editing Compiler Include (or other) Settings in Eclipse

So now I have carefully set up my compiler include paths in Eclipse to tell the GNU compiler where to find my header files:

Include Paths

Include Paths

The question is: how can I apply these settings to another project?

Continue reading

CRC Checksum Generation with ‘SRecord’ Tools for GNU and Eclipse

One of the things missing for Embedded in the GNU linker is that it cannot generate a CRC checksum. Luckily, there is the solution of using SRecord:

SRecord 1.64 Web Page
SRecord 1.64 Web Page
Continue reading

Semihosting with GNU ARM Embedded (Launchpad) and Kinetis Design Studio

A while back I wrote two articles about Semihosting: “Semihosting with GNU ARM Embedded (LaunchPad) and GNU ARM Eclipse Debug Plugins” and Semihosting with Kinetis Design Studio. With using the GNU ARM Embedded (lauchpad) in my Kinetis Design Studio, time for a ‘summary’ post :-).

Semihosting Output in Console

Semihosting Output in Console

Continue reading

UART with the FRDM-KL02Z Board

In my classes I’m mainly using the Freescale FRDM-KL25Z board, as it provides the best value for the money, and 128 kByte FLASH with 16 kByte of RAM is enough for many smaller projects. I do have as well the FRDM-KL02Z Board (32 KByte FLASH, 4 KByte of RAM) which is an inexpensive board to evaluate the smaller KL02Z microcontroller. Because someone reported a problem not being able to use the UART over OpenSDA/USB-to-CDC bridge, I have created a demo project which communicates with a console on the host.

FRDM-KL02Z Board

FRDM-KL02Z Board

Continue reading

Poor Man’s Trace: Free-of-Charge Function Entry/Exit Trace with GNU Tools

There are cases where my application runs find for days, weeks or even months, but then from time to time there is an application crash. Yes, the watchdog will recover it, but still it would be good to know what happened? One solution would be to hook up a trace probe (like the one I have described in this post: “First Steps with the P&E Tracelink“). But having such a trace probe attached all the time is first not cheap and second not always possible. So what if the application would leave ‘breadcrumbs’ behind which would tell me the flow of the program leading to the problem? I have found a functionality in the GNU tools which seems not be widely known or use, but is incredibly helpful in such cases.

So what if I could get a log like this telling me which functions get called by whom?

{ 00000E88->00000DA0 ???->DEMO_Init
} 00000E88<-00000DA0 ???<-DEMO_Init
{ 00000E8C->00000D40 ???->DEMO_Run
 { 00000D62->00000CE8  DEMO_Run:0x0022->decide
  { 00000D0E->00000C60  decide:0x0026->calcValue
  } 00000D0E<-00000C60  decide:0x0026<-calcValue
  { 00000D16->00000CA0  decide:0x002E->getValue
   { 00000CC6->00000C60  getValue:0x0026->calcValue
   } 00000CC6<-00000C60  getValue:0x0026<-calcValue
  } 00000D16<-00000CA0  decide:0x002E<-getValue
 } 00000D62<-00000CE8  DEMO_Run:0x0022<-decide
 { 00000D62->00000CE8  DEMO_Run:0x0022->decide

Continue reading

Using the DHT11/DHT22 Temperature/Humidity Sensor with a FRDM Board

For a home automation project I need to know the room temperature and humidity percentage of the room air. Adafruit has an inexpensive DHT11 sensor from http://www.aosong.com which I decided to use for that project.

Test Setup for DHT11 Sensor

Test Setup for DHT11 Sensor

Continue reading

Command Line Programming and Debugging with GDB

Eclipse with GDB is great: it comes with a graphical front end for debugging. But sometimes it is all about to download a program. Is it really necessary to launch an IDE like Eclipse to program or quickly debug a board? With the GNU Debugger (GDB), the answer is ‘no’: GDB comes with a command line debugger which is designed exactly for this: providing a command line interface for programming/downloading and debugging, bypassing any GUI (Graphical User Interface).

Combination of GDB Debugging Probes and Boards

Combination of GDB Debugging Probes and Boards (P&E, Segger and FRDM-KL25Z)

Continue reading