+ All Categories
Home > Business > AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Date post: 29-Jan-2018
Category:
Upload: jamieayre
View: 150 times
Download: 0 times
Share this document with a friend
61
Jérôme Lambourg Cross & BareBoard team Inside Out GNAT Pro team co-lead
Transcript
Page 1: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Jérôme Lambourg

Cross & BareBoard team Inside Out

GNAT Pro team co-lead

Page 2: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

I can hear you think…

Theyshouldsaybarebored.

Ohmy…

Bareboard??

Page 3: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Ah!Aperfecttimeforagoodnap…

Hey,Iwokeupearlytoattendthismeeting!

I can hear you snor…

Page 4: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Even from outer space…

DammitJim!Thisisnotlogical.

Notanelectricalengineer!

I’m aprogrammer

Page 5: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

ANYWAY, LET’S GIVE IT A TRYThislooksboring indeed…

Page 6: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Agenda

•What'snewinVxWorks 6533.x (Doug)• Binutils internals(Tristan)• GCC:configuration tipsandtricks(OlivierH)• Qemu:howtoimplementanewboard(Fabien)• GprBuild:howtoaddanewtoolchain (Joel)• CompletehistoryoftherelationshipbetweenAdaCore andWindRiver (EdF)

Page 7: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

This is really about

OurDailyactivities

What makes us wake up in the morning

Page 8: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

GNAT Pro for Cross & BB

DebuggingEmulatorsSimulatorsBoards

TestSuites

Production

GprBuild, tools

BinutilsIDEs

GCC/GNATRuntimes

Page 9: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

GNAT Pro for Cross & BB

BinutilsCompilerRun-timeQemu

gprbuild

production

Debugger

GPSGnatBench

CPUscoprocessorsBoards ABI

certification

Real-time

OS(crossonly)

Page 10: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Making it work together

Sales

Strategy

Marketing

Roadmap

Certification

Page 11: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

CROSS DEVELOPMENTPARTI

Page 12: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Example: Investigating Cross issues

"A Cross never, ever marks the spot"Indiana Jones

Page 13: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Thecrime

Page 14: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

An aCATs test FAILS on e500v2-vx7

Blargh, I is DED on e500v2

Page 15: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Usercode

AdaRun-time+compiler

OS

Context

Board

Signal raised

Translated into exception

Exception handler

Theissue:exceptionhandlerisnever

calledToomuchmemory

used

Page 16: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

JeromeL* WhyisitworkingonPPCandnotone500v2?Joel* Goodluck!CrossingfingersEdF* Thisremindsmeofsomegoodoldbug.Thosewerethe

days.Doug* SimilarissueherewithZCXonvx6forx86,willkeepyou

postedJeromeG* Guys,IneedtotakemyThursdayoffnextweek.

*Allcharactersappearinginthispresentationarefictional.Anyresemblancetorealpeopleispurelycoincidental.

Page 17: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Usercode

AdaRun-time+compiler

OS

Board

Signal raised

Translated into exception

Exception handler

Toomuchmemoryused

Wow!Thislooks

complex

Investigate the crime scene

Page 18: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Need help

• AfteracompleteexplanationfromOlivierH oftheexpectedmechanism,Icanresumethedebug.• Whenallocating theexceptionoccurrence,Itlookslikesomethingweirdhappensaroundafunctioncalled"AbortDefer"

Let'scheckthe(CRM)

Page 19: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

A guess!

Someoldcase(e.g.TN)referstoissues aboutcallstoAbortDeferfromasignalhandler

Theruntimeistheculprit!!!!!!

Page 20: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Transmit to court (e.g. send an email)

Arno should never happen, allocating exception blah blah blah certification blah blah

OlivierH not an issue blah blah ZCX-specific blah blah

Arno what about BE SJLJ? blah blah

OlivierH indeed blah blahArno in case of tasking blah blah

JeromeL Ah! No tasking involved in this case

Arno then not the issue here, case dismissed, and transferred to the certification court

Page 21: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

So let's continue the investigation!

Page 22: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

More debugging

…Let’sdigfurtherandstepintoassembler instructions

Page 23: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Debugger log

ØAnunexpectednewsignalisraised (Ah!Ah!Recursivesignals!)

*Allinstructionsappearing inthispresentationarefictional.Anyresemblance torealinstructionsispurelycoincidental.

(gdb) disassemble $pcevaddsmiaaw* … …(gdb) siComputer says No: boom

(Show me the code)(Some code)(Execute it)(or any similar output)

Ø It's an E500v2-specific instruction (YES!)

Page 24: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Second guess

Somee500v2instructionisnotproperlyexecutedbyQEmu?

Qemu istheculprit!!!!!!

Page 25: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Transmit to court (Fabien, Qemu expert)

• DiscussingwithFabien,itturnsoutthatSPEsupportisOKinQemu…socasedismissed(again)

• However,duringthediscussion,headvisesmetocheckthe« MSR »

Page 26: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

:MachineStateRegister. Ah!

: SPE instructions are available only when a specific bit is set on the MSR. Else a sigill signal is raised. Ah! Ah!

Google is my friend

:answersmanythings,abouttents,videogames,guns,etc.

MSR

MSRPowerPC

MSRe500v2SPE

Page 27: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Third guess

MaybeVxWorks isnotproperlysettingthebitwhencallingasignalhandler?

VxWorks istheculprit!!!!!!

Page 28: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Transmit to court: send a TSR to WindRiver

• WriteasmallCreproducerthatchecksthespecifiedbitintheregister.=>bitnotset wheninthehandler,setotherwise (youhou!Foundit,foundit!Youcannowsafelybragaboutitwithyourcolleagues)

• TransmitcasetoWindRiver• SolutiondiscussedwithWindRiver

I is OK now!

Thankz!

Page 29: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

BARE METAL DEVELOPMENTPARTII

Page 30: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Bare metal* ?

• AboutrunningsoftwarewithoutanyOperatingSystem

• Thisgivesyoufullcontroloverwhatisrunning

* SameasBareBoard,butit’scool

Page 31: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Pros

Realtimeproperties

• Does notmean FAST…• Means ontime!

• Execution timeis predictable• Keyword:« Ravenscar »

Page 32: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Pros

Reliability,certification– Everything that is onboard is under control– Very small footprint– Nobugsfrom theOS

Page 33: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Cons

Softwaree.g.alotofmanual work

DIY

Page 34: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

OK, YOU CONVINCED ME:

I BOUGHT THE BOARD XYZ FROMVENDOR ABC.

I WANT TO RUN ADA.

HOW DO I DO THAT?

Page 35: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Well, you can ask usHaveyoucheckedwithSalesfirst?

PatR. Fabien Tristan PatB. Jerome L.

Page 36: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

You can also try it by yourself…

First,you need aboard:

Silicium PCB:fiber glass+copper Ceramics

Soldering Plastic Gold, silver, copper…USBportonyour

host

Page 37: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

may come pre-assembled in variousshapes and colors

Page 38: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

You’ll also need:

• Youwill need docs(such astheARMARM).• Andmoredocs(such astheMCUrefmanual)• Peopletohelpyou finding thedocsyou’remissing (such astheboard schematics)• Some updated docs• Internet&asearch engine (ifyou don’tknowone,letmegoogle that foryou…)

Page 39: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Major steps to move forward

1. Power-uptheboard2. Connect toit3. Create anAdaruntime fortheboard4. Create anexample5. Load theexample into theboard

Page 40: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

I. Power up the board

Plugtheboard• See that it’s powered (at leastaLEDshould lightup)

• Ifnot, read thedoconhowtoplug andpoweruptheboard

Page 41: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

II. Connect to the board

e.g.find away tocommunicate with thetargeted board

Page 42: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

II. Connect to the board

Lookforaway toconnect toit• Lookat thedocthat comes with theboard• Youcan also search theinternet• Youmay ask Tristan*• OrFabien**• OrAnthony*** tocreate aGPSpluginforyou

* Maybe busy,orplaying fussball**Mayalso be busy,butdoes notplay fussball***plays fussball alot

Page 43: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

III. Create an Ada runtime

Well,here’s atough one• Ifwe already haveasimilar board supported,theruntime may only needminor adjustments:• Memorymapping (e.g.read thedoc),interrupts (c.f.doc),clock speed(RTFM)• Ifyou’re interested,gosee:blog.adacore.com/porting-the-ada-runtime-to-a-new-arm-board

• Else,you can [email protected] ;)

Page 44: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

At this point

• What you haveis:1. Aboard that is powered on(e.g.red led on)2. Some tool claiming itmay controltheboard3. Aruntime that you haven’t tried yet (e.g.aschrodinger runtime:it both works

anddoesn’t)

Iiz and iznota

runtime

Butpliz don’topenthebox

Page 45: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

IV. So now is the time…

1. Turn aLEDON2. Wait abit3. Turn theLEDOFF4. Wait abit5. Goto1

…Forthefamousbaremetalhelloworld:“TheblinkingLED”

Scenariois very complex:

Page 46: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

IV. The LED example

This« simple »example implies many readings• MCUreferencemanual (ordatasheet):initialization ofthe« GPIO »,theGeneralPurpose I/Osystem.• Board schematics,tofind outonwhich pinoftheGPIOtheled isconnected to.

Thisone?

Page 47: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

V. Run all this on the board

Onceyou seem tohaveeverything setup:• Crossyour fingers• Load theexample onboard

Iiz bored.Pliz try again

– Either you endupwith what lookslike abrick

– Oryou can celebrate with ablinking LED(HEY!Comeonandlookatmy LED!Howfun!)

Page 48: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

From there, fancy stuff coming!

You’re now ready tocreate aninfinity ofvery fancy stuff …

Page 49: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Fancy stuff (1)

Demos

Page 50: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Fancy stuff (2)

Candydispenser*

*Eat 5fruitsandvegetables aday tokeep healthy

Page 51: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Fancy stuff (3)Flightcontrollers fordrones

Ibelieve Icanfly…

… andlandsafely!

Page 52: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Fancy stuff (4)

Space stuff

Hey!Theauto-landingoftheCrazyflie

doesn’t work here!

Page 53: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Fancy stuff (5)

Ultimate LEDdemo*

*Children:don’t try this at home

Page 54: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

WHAT’S NEW?

Page 55: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Some figures: cross & BB products

supported products

new products

Page 56: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Bare Metal: Improvements

• ExtendedRavenscar tasking• Better than state-of-the-art

• MoreCPUs supported• Inparticular Cortex-A

• Multicore (SMPsupport):• Leon,Cortex-A,PPC

Page 57: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Widening the Ada audience

LeverageonthebuzzaroundARMbaremetaldevelopment

Page 58: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Widening the Ada audience

Atwo stagesstrategy

1. Making GNATready-to-use forthose bare metal enthusiasts

2. Making sureeveryone knows aboutthis effort

Page 59: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Widening the Ada audience

Make GNATready-to-use onmany boards• Runtimes:moreboards supported (GPL+github)• SVD2Ada• AdaDriversLibrary

Thisis also meant tohelpyou,notjust newcomers!

Page 60: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

Widening the Ada audience

Advertising GNATforARM• Make with Adablogposts• Howtoadapt theruntime blogpost• community.arm.com blogpostonAdaforBB• Make with Adacontest

Page 61: AdaCore Paris Tech Day 2016: Jerome Lambourg - Cross and BareBoard Team Inside Out

That’s it!

Thank you foryour attention!

At leasthe didn’tmentioned IOT.

Fine…


Recommended