paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] how to compile and upload sw/airborne/main_demo#.c


From: antoine . drouin
Subject: Re: [Paparazzi-devel] how to compile and upload sw/airborne/main_demo#.c to a Tiny v2?
Date: Fri, 18 Apr 2008 01:19:15 +0200
User-agent: Internet Messaging Program (IMP) 3.2.8

Hi Miles

Quoting Miles Colman <address@hidden>:

> Hi Antoine,
>
> Thanks for your patience. Could you please send me a Makefile that
> makes 'make demo# .compile' work or just tell me what to do, step by
> step?
>
> I edited conf/airframes/demo.xml as you suggested.
> I'm still using 'make AIRCRAFT=demo demo1.compile' with a fake demo
> airframe section in conf.xml so that compilation finishes. I'm
> guessing that's not right, since the LED still doesn't blink.

that's the correct way and the expected result - demo1 does nothing

you can see that from sw/airborne/main_demo1.c

#include "std.h"


int main( void ) {
  while(1) {

  }
  return 0;
}

and the comment in conf/airframe/demo.xml ( simple emtpy demo )




demo2 is the one that blinks a led ( hardware init ( pll ), system time and LEDs
)

so, change the line
demo2.CFLAGS += -DCONFIG=\"conf_demo.h\"   (in conf/airframe/demo.xml)
to
demo2.CFLAGS += -DCONFIG=\"tiny_2_1.h"

and you should be good



>
> I also tried 'make demo1.compile', after changing the Makefile by
> commenting out
> conf: conf/conf.xml conf/control_panel.xml
> and putting in
> conf: conf/demo.xml
> but that complains about 'No rule to make target `conf/demo.xml',
> needed by `conf'
> I tried pasting in the [ -L $@ ... line from below as a guess at what
> the rule was, but it wasn't a good guess.

Not sure what you are trying to do here...

I agree that our code and Makefile generation system might seem a little
complicated at first but it's not so difficult

when you type
make AIRCRAFT=Foo a_target.compile
the makefile looks for an entry (aka aircraft) named Foo in conf/conf.xml
This entry will contain

-1 a number of files used to generate code, like for example the characteristics
of the rc transmitter you are using, the rate of periodic telemetry messages you
want, the variables you want to be able to adjust and your flight plan. It
"compiles" those files into C code. I will go deeper into this at a later time,
but having static C code generated instead of doing all this configuration at
runtime allows for better effiency and safety

-2 a file called airframe ( conf/airframes/demo.xml ) in your case
This file is also "compiled" to produce both a header ( var/Foo/airframe.h ) and
a Makefile (var/Foo/Makefile.ac )

The header will contain all the parameters specific to your particular airplane
( where did you connect your peripherals, their calibration values, etc... )
Some of those parameters only depends on the specific hardware. For example on
the tiny, the servo driver is soldered on the board, so it will always be
connected to the same IOs of the processor. To avoid repeating that in every
aircraft, a specific header for each supported hardware can be created and
included. This is this -DONFIG="somefile". Those files are stored in
conf/autopilot

This doesn't sound very clear.. I'll attempt a better explanation later

Good luck with the demos

Poine









reply via email to

[Prev in Thread] Current Thread [Next in Thread]