I need to install arm-none-eabi-binutils

Asked by David

I can't seem to find arm-none-eabi-binutils for my 12.04.3 (precise) and need to program for my STM32F103

I think I have everything else, gcc and gdb

It doesn't seem to be available for apt-get install. I had to add a repository for gcc and gdb, but it doesn't seem to have the binutils

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
David
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#1

Hi David,

The name of the package to install is gc-arm-embedded. It not only provides gcc but also binutils, newlib, libstdc++ and gdb. To be able to install it you need to have added the right PPA to your sources.list. For this, just follow the instruction at:

https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa

Best regards.

Revision history for this message
David (davud) said :
#2

Thomas, merci :)

Looks good. I can't get to my box until later but the answer looks more than reasonable.

 I'll remove what I have till now and reinstall this package

 Thanks again

Revision history for this message
David (davud) said :
#3

This has worked fine, so not re-opening, but a question about the libs.

I'm working with an f103 slowly getting used to the ARM.

I've got basic stuff like GPIO & NVIC and want to get to math and other stuff.

Is the newlib that comes with this package "ready to go", or does it need compiling?

I tried a basic float multiply and it just left blank space in the object module.

I'm using some of the CMSIS libraries that come with ARM, up to now, more than anything, include files, to help with device addressing etc.

In the file that "tries" the math, I have included
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>

Some of those of course are for other stuff...

I´m embarrased to admit though, that I don't really know where the code for stdlib and math is, or any other of basic libs.
I haven't explicitly linked in stdlib libraries, but it doesn't give me warnings or errors.

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#4

Hi David,

Yes newlib is already built in the binary toolchain packages we provide and is ready to go. It is difficult to help you more than this though, you would need to give a code example (that can be compiled and linked on its own), command line you used and what do you mean by "blank space" (ie. the command you ran, output you got and why do you think this is incorrect).

Best regards,

Thomas

Revision history for this message
Andre Vieira (andre-simoesdiasvieira) said :
#5

David,

Wrt to your question about where the libs come from, all C libraries, including the math libraries can be found in their respective multilib directory inside <toolchain dir>/arm-none-eabi/lib,

So for instance for your f103, which I believe is a Cortex-M3, the libraries will be in the armv7-m, that is:
 <toolchain dir>/arm-none-eabi/lib/
    libc.a (for all your standard libc)
    libm.a (for your math library)

You also find other libs there and their newlib-nano variants. For libgcc, the compiler runtime library, you have to look at:
 <toolchain dir>/lib/gcc/arm-none-eabi/<version>/armv7-m/libgcc.a

If you aren't sure whether you are using the right multilib try adding the option '--print-multi-directory' to the command line you usually use to compile, this will print out the directory where it is getting its multilib from. Also if you would like to know how your binary is linked try '-Wl,-Map=log_file', log_file will contain information telling you where functions got linked from.

Hope that gives you a bit more insight!

Revision history for this message
Andre Vieira (andre-simoesdiasvieira) said :
#6

Little typo there, should have been:

<toolchain dir>/arm-none-eabi/lib/armv7-m/
    libc.a (for all your standard libc)
    libm.a (for your math library)

Revision history for this message
David (davud) said :
#7

@Thomas - I don't have an example right now, I put it aside to do other things, and the code is gone now, but I think what might have happened is that the loop was too simple eg:

float val;

int main(void)
{
    while(1)
    {
        val = 12.41*3.4;
    }
}

and since "val" wasn't used the optimizer took it out.

I create object listings, main.o.lst, and the end code was little more than "b ."

I suppose that's why it didn't complain about not having library references.

@Andre

I suppose I'll need to link in those libraries then in the makefile (that's not done automatically right?)
It seems to know where these includes are without specific reference
#include <stdlib.h> etc...

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#8

Hi David,

The math libraries will be linked in automatically if you use GCC for the linking. However you need to specify the right CPU (eg. -mcpu=cortex-m0) or architecture (-march=armv8-m.base) you want to target for GCC to select the right multilib. As Andre said, you can check what multilib gets used by using -print-multi-directory.

Best regards.

Revision history for this message
David (davud) said :
#9

OK thanks. With this informtion I should be fine.

Great support. Hope I can give back at some point.