Solving Problem with GNU Linker and “referenced in section, defined in discarded section ” Error Message

I have been running recently into an interesting case where the GNU ARM Linker failed to link an application with strange error messages:

referenced in section, defined in discarded section

referenced in section, defined in discarded section

Continue reading

Advertisements

Using the GNU Linker Script to know the FLASH and RAM Areas in the Application

Sometimes it is handy to know in the running application the start address, end address and the size of a linked section, e.g. to know the boundaries of RAM or FLASH areas. This means that from the application code I can get access to knowledge of the GNU linker:

Information about Linker Sections

Information about Linker Sections

Continue reading

How to use Custom Library Names with GNU Linker and Eclipse

By default, the GNU Linker expects a very special naming scheme for the libraries: the library name has to be surrounded by “lib” and the “.a” extension:

lib<NAME>.a

But what if the library I want to use does not conform to that naming standard?

Non-conforming Library Naming

Non-conforming Library Naming

Continue reading

Tutorial: Makefile Projects with Eclipse

The benefit of an IDE like Eclipse is: it makes working with projects very easy, as generates make files and it takes and automatically manages the make file(s). But sometimes this might not be what I want because I need greater flexibility and control, or I want to use the same make files for my continues integration and automated testing system. In that case a hand crafted make file is the way to go.

One thing does not exclude the other: This article explains how to use make files with Eclipse with similar comfort as the managed build system in Eclipse, but with the unlimited power of make files:

Makefile Project with Eclipse

Makefile Project with Eclipse

Continue reading

GNU Code Coverage on Embedded Target with Eclipse Neon and ARM gcc 5

For a research project, we are going to send a satellite with an embedded ARM Cortex microcontroller into space early next year. Naturally, it has to work the first time. As part of all the ESA paperwork, we have to prove that we tested the hardware and software thoroughly. One pice of the that is to collect and give test coverage evidence. And there is no need for expensive tools: Free-of-charge Eclipse and GNU tools can do the job for a space mission 🙂

Eclipse with Coverage Views

Eclipse with Coverage Views

Continue reading

Adding GNU Coverage Tools to Eclipse

The GNU tools include powerful utilities to collect coverage information. With coverage I know which lines of my code have been executed, which is a very useful test metric. The GNU coverage tools are commonly used for Linux applications. But to my surprise not much for embedded application development, mostly because it requires a few extra steps to have it available? Why not using free and powerful tools for improving software quality? This article explains how to install the GNU gcov tools into the Eclipse IDE.

gcov with Embedded Target

gcov with Embedded Target

Continue reading

“No source available”, or how to Debug Multiple Binaries with GDB and Eclipse

When working and debugging a bootloader, debugging can be a challenge: During debugging the bootloader, a new binary gets loaded into the microcontroller address space which is unknown to the debugger. As soon as I step into the newly loaded binary, I only see assembly code, with that ugly “No source available” in Eclipse:

No Source Available, debugging in assembly

No Source Available, debugging in assembly

But wait: GDB is able to do pretty much everything you can imagine, so here is how to debug multiple binaries with GDB and Eclipse, and to turn the above into something which is easy to debug:

Debugging with Symbolics

Debugging with Symbolics

Continue reading

Building the NXP BLE Stack with Open Source GNU and Eclipse Tools

One of the biggest road blocks (beside of closed source) using the BLE (Bluetooth Low Energy) stack from NXP is that it requires expensive tools to compile and build the stack. The good news is that I have now the NXP BLE stack for the Mikroelektronika Hexiwear ported to Eclipse and GNU gcc build tools for ARM 🙂

NXP BLE Stack in Eclipse

NXP BLE Stack in Eclipse

Continue reading

Accessing GNU Linker Script Symbols from C/C++

With the GNU compiler and linker I can place variables into custom sections (see “Defining Variables at Absolute Addresses with gcc“). This article is about how to get the section start and end address so I can for example access that range in my code. Or in general ways: how to use symbols defined in the linker script accessible in the C source code.

Using Linker Script Symbols in Source Code

Using Linker Script Symbols in Source Code

Continue reading

Tutorial: Building FreeRTOS Applications for ARM Cortex-M4 on i.MX7 with Eclipse

Command line tools to build applications are great. But productivity goes up if I can use the standard Eclipse environment with GNU tools. This tutorial is about how to use standard and free GNU and Eclipse tools to build my FreeRTOS application for the ARM Cortex-M4 on i.MX7 🙂 :

Eclipse used to build FreeRTOS applications for M4 on i.MX7

Eclipse used to build FreeRTOS applications for M4 on i.MX7

Continue reading

Eclipse and GDB: Process Properties, Arguments and GDB Traces

To me this was new, and thanks to Liviu I know now how to inspect the command line passed to the GDB server (see “Semihosting (again!) with NXP Kinetis SDK V2.0“) 🙂

Process Properties

Process Properties

Continue reading