ARM development environment on Ubuntu

From DiLab
Revision as of 15:02, 30 September 2022 by Leo (talk | contribs) (Created page with "{{TocRight}} Arm development and test environment on Ubuntu can be set up the following way. We will need the cross-chain tools and libraries for compilation and emulation T...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Arm development and test environment on Ubuntu can be set up the following way. We will need the cross-chain tools and libraries for compilation and emulation

This was tested on Ubuntu 22.04

sudo apt-get install gcc-arm-linux-gnueabi linux-libc-dev-armel-cross qemu-user 

For the gdb-multiarch debugger:

sudo apt-get install gdb-multiarch

You may find the following tools useful as well, but the chances are you have them already:

sudo apt-get install build-essential binutils gcc git ddd


Usage

Let us compile a program myprog.c for ARM Xscale processor, like so:

arm-linux-gnueabi-gcc -g -mcpu=xscale -O0 -Wall -o myprog.o -c myprog.c
arm-linux-gnueabi-gcc  -o myprog myprog.o


Now we can run the new ARM program in the qemu emulator

qemu-arm -L /usr/arm-linux-gnueabi myprog

The parameter -L may be required to find the needed libraries for the ARM platform