buildroot eclipse bundle : a powerful ide for embedded ... · what is embedded linux ? linux kernel...

34
Buildroot Eclipse Bundle : A powerful IDE for Embedded Linux developers Mélanie Bats www.flickr.com/photos/playdogil/3408511286/

Upload: others

Post on 23-Jun-2020

57 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Buildroot Eclipse Bundle : A powerful IDE for Embedded Linux

developers

Mélanie Bats

www.flickr.com/photos/playdogil/3408511286/

Page 2: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Who Am I ?

http://www.flickr.com/photos/anotherashia/5319361416

Page 3: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

What is embedded Linux ?

Linux kernel

Open source components

Specific applications

(cc)

htt

p://w

ww

.flic

kr.c

om/p

hoto

s/ka

fka4

prez

/57

2932

10

Page 4: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Building an embedded Linux system

Building tools

PTXdistOpenWRT● Automate system

reconstruction from source code

● Support many more CPU architectures

● High flexibility on components configuration

● Most used solution

Binary distributions

● Heavyweight systems

● Not all CPU architectures supported

● Not flexible to choose the configuration for each components

(cc) http://www.flickr.com/photos/rpenalozan/5431731224

Page 5: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

What is Buildroot  ?

● Simple build system - http://buildroot.org :– automate the cross compilation process – generate kernel images, file system and bootloader

● Developped by :– an open source community– vendor neutral– under GPLv2

● Actively developped and used for many products● Written in make language ● Choice of options in configuration interface (c

c) h

ttp:

//ww

w.f

lickr

.com

/pho

tos/

die

rksc

hae

fer/

3455

4239

00

Page 6: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Demo hardware platform

● Fairly typical ARM evaluation platform

● Many devices: Screen, Network, SD card, USB ...

● Used to develop prototypes

● Reference to design specific board Atmel AT91SAM9G45 (ARMv5) processor

(cc) http://www.flickr.com/photos/zainx/5630952655

Page 7: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Buildroot Demo

http://www.flickr.com/photos/dierkschaefer/3454606933

Page 8: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Host (PC)

Buildroot

Buildroot generates

Target (ARM)Toolchain

DirectFB headers & lib

Openssh headers & lib

BusyBoxsource

DirectFB source

Opensshsource

Specific Library source

Target File System

Kernel Image

Applications

BusyBox

DirectFB

Openssh

Specific Library

Libc

Pre compiled Toolchain

gcc

gdb

binutils

Libc

gcc

gdb

binutils

Libc

Specific lib headers & lib

Various host utilities : Pkg-

config...

Kernelsource

Inpu

tsOutpu

ts

(cc)

http

://w

ww

.flic

kr.c

om/p

hoto

s/di

erks

chae

fer/

345

5423

900

Page 9: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Why Integrating Buildroot in Eclipse ?

System developers Application developers

http://www.flickr.com/photos/sontranphotos/6305201837

Page 10: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Why Integrating Buildroot in Eclipse ?

● Open source IDE for Application developers– Preconfigured with the

cross compilation toolchain

– Easy access to the libraries available on the target

– Transfer / Execute remote application

– Remote Debug

htt p

: //w

ww

. flic

kr.c

o m/p

hoto

s/ca

tcris

pi/ 3

0 95 9

95 8

8 8

Page 11: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Buildroot toolchain Eclipse plugin

● Integrate the toolchains to Eclipse CDT– Read the toolchain description file (/home/<user>/.buildroot-

eclipse.toolchains)– Register dynamically the toolchains in CDT for :

● Managed build projects : executable, static library, shared library● Autotools projects● Makefile projects

http://www.flickr.com/photos/anotherashia/2573601237

Page 12: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Integration with CDT

● Inspired by the Eclipse Blackfin plugin and the GNU ARM Eclipse plugin

● Use CDT extension point : org.eclipse.cdt.managedbuilder.core.buildDefinitions

– according to the Buildroot configuration file:● declare toolchains ● register ProjectTypes

(cc) http://www.flickr.com/photos/jendris/6960151583

Page 13: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Managed build Integration

● Add the Buildroot toolchains available for:– Executable project– Static library project– Shared library project

● Contribute to plugin.xml :<projectType buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" ...>

Page 14: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Buildroot Launch configurations

● Provide Remote configurations :– Launch configuration :

execute the application on target

– Remote Debug configuration : which point automatically on the correct cross-debugger (cc) http://www.flickr.com/photos/ejk/3255860779

Page 15: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Buildroot Eclipse plugin demonstration

(cc) http://www.flickr.com/photos/buetts/1615300533

Page 16: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Pkg-config ?

● Applications need other libraries than just the standard C/C++ library– Graphical, network, crypto libraries …

● Manually adding compiler and linker flags is annoying● Pkg-config is a standard Linux tool to query the

compiler and linker flags for a given library$ pkg-config --cflags directfb-D_REENTRANT -I<...>/sysroot/usr/include/directfb

$ pkg-config --libs directfb-ldirectfb -lfusion -ldirect -lpthread

(cc) http://www.flickr.com/photos/adamfranco/5116575890

Page 17: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Managed build Integration : pkg-config plugin

● Contribute to existing pkg-config plugin :

http://code.google.com/p/pkg-config-support-for-eclipse-cdt/

– Fix bugs on PKG_CONFIG_PATH and pkg-config binary path – Use the pkg-config environment variables directly on

command– Move the pkg-config configuration to project-level– Improve the UI– Allow a per-toolchain specified pkg-config binary

(cc) http://www.flickr.com/photos/rpenalozan/5240901575

Page 18: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Managed build Integration : pkg-config plugin

● Contribute to existing pkg-config plugin :

http://code.google.com/p/pkg-config-support-for-eclipse-cdt/

– Fix bugs on PKG_CONFIG_PATH and pkg-config binary path – Use the pkg-config environment variables directly on

command– Move the pkg-config configuration to project-level– Improve the UI– Allow a per-toolchain specified pkg-config binary

(cc) http://www.flickr.com/photos/rpenalozan/5240901575

Page 19: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Managed build Integration : pkg-config plugin

● Contribute to existing pkg-config plugin :

http://code.google.com/p/pkg-config-support-for-eclipse-cdt/

– Fix bugs on PKG_CONFIG_PATH and pkg-config binary path – Use the pkg-config environment variables directly on

command– Move the pkg-config configuration to project-level– Improve the UI– Allow a per-toolchain specified pkg-config binary

(cc) http://www.flickr.com/photos/rpenalozan/5240901575

Page 20: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Managed build Integration : pkg-config plugin

● Contribute to existing pkg-config plugin :

http://code.google.com/p/pkg-config-support-for-eclipse-cdt/

– Fix bugs on PKG_CONFIG_PATH and pkg-config binary path – Use the pkg-config environment variables directly on

command– Move the pkg-config configuration to project-level– Improve the UI– Allow a per-toolchain specified pkg-config binary

(cc) http://www.flickr.com/photos/rpenalozan/5240901575

Page 21: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Buildroot pkg-config plugin demonstration

(cc) http://www.flickr.com/photos/rpenalozan/5821522384

Page 22: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Autotools ?● The most common

configuration and build system for Linux software components

● Composed of autoconf, automake and libtool

● Developers write :– Configure.ac– Makefile.am

● Final makefiles generated by those tools

(cc)

http

://w

ww

.flic

kr.c

om/p

hoto

s/ro

tia/8

082

6502

55

Page 23: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Autotools Integration

● Autotools plugin already exists in CDT● Contribute the cross compiled Buildroot toolchains to

the Autotools in CDT– Modify autotools.ui :

● Update the Autotools project creation wizard● Update the Autotools specific menus

– Modify autotools.core :● Provide a way for toolchains to set a default value for the --host

configure option

(cc) http://www.flickr.com/photos/nukamari/3325435178

Page 24: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Autotools Integration

● Autotools plugin already exists in CDT● Contribute the cross compiled Buildroot toolchains to

the Autotools in CDT– Modify autotools.ui :

● Update the Autotools project creation wizard● Update the Autotools specific menus

– Modify autotools.core :● Provide a way for toolchains to set a default value for the --host

configure option

(cc) http://www.flickr.com/photos/nukamari/3325435178

Page 25: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Buildroot Autotools integration demonstration

(cc) http://www.flickr.com/photos/dierkschaefer/3454601339

Page 26: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Integration with Makefile

● Add Buildroot toolchain to Makefile projects– Add some environment

variables :● PATH● CC● CXX

Those are typically used in standard makefiles

(cc) http://www.flickr.com/photos/22425840@N00/2648507349

Page 27: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Buildroot Makefile integration demonstration

Page 28: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Integration with CDT : Issues

● V1.0 uses dynamicElementProvider – Method returning a hierarchy of objects

implementing IManagedConfigElement– Contributing environment variables through

configurationEnvironmentSupplier requires a DefaultManagedConfigElement

● Consequently for V2.0 build dynamically the plugin.xml– Use startup extension point ;(– Missing dynamic extension points in CDT ?

● scanner configuration discovery profile● launch configuration

Page 29: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Integration with CDT

Page 30: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Buildroot Eclipse Update-site

● Update-site integrating embedded Linux tools :– Buildroot Toolchain Eclipse Plugin– Pkg-config– CDT – Linux tools– Autotools …

● Make a Ready-to-Use development platform for embedded Linux

● Use Tycho to create update-site

(cc) http://www.flickr.com/photos/kafka4prez/56978610

Page 31: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Availability● Buildroot 2013.02 :

http://buildroot.org

● Buildroot Eclipse plugin sources (EPL licence):https://github.com/mbats/eclipse-buildroot-toolchain-plugin

● Buildroot Eclipse bundle sources : https://github.com/mbats/eclipse-buildroot-bundle

● Pkg-config Eclipse plugin :http://code.google.com/p/pkg-config-support-for-eclipse-cdt/

● Buildroot Eclipse bundle update-site (based on Eclipse 4.2)

(cc) http://www.flickr.com/photos/kaptainkobold/4249636579

Page 32: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Getting started

● On Github : https://github.com/mbats/eclipse-buildroot-bundle/wiki/

– Installation details – Tutorials– Bug tracker

● Give us feedback !

(cc) http://www.flickr.com/photos/emeeelea/2425295021

Page 33: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Future work

● Contribute Autotools updates to CDT● Integrate :

– RX-TX– LTTNG– CMake– Other relevant Eclipse plugins for embedded Linux

development● Bug fixes● What do you need ?

(cc) http://www.flickr.com/photos/21649179@N00/335649202

Page 34: Buildroot Eclipse Bundle : A powerful IDE for Embedded ... · What is embedded Linux ? Linux kernel Open source components Specific applications (c c) h t t p: / / w w w. f l i c

Questions ?

Contact :

[email protected](cc) http://www.flickr.com/photos/blanc-pluvial/5614289320