[Top][All Lists]

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

Re: [Paparazzi-devel] Help needed in paparazzi source code makefiles

From: Gerard Toonstra
Subject: Re: [Paparazzi-devel] Help needed in paparazzi source code makefiles
Date: Wed, 10 Oct 2012 14:03:39 -0300

Hi Autumn,

I'm still researching things myself, but allow me to try to help out.

The sw/airborne directory is full of code and this is conditionally compiled using a set of XML files,
statements that include other xml files and makefile defines ( -D ones ), which all work together to
create the hex file eventually.

To see the code that was selected and the defines that ended up in the build, see the   ' ./var/<your-model-name>/ '
directory. The ap_srcs.list is very instrumental there. Then you'll probably find another number of directories,
those are "targets" in your airframe file. So if you compiled something for "ap", you'll find a directory "ap" there as well.

As soon as the build is completed, the UI isn't actively used, unless you initiate a process there in a session
which receives telemetry data for example. Debugging is explained here, but I'm not sure if this includes the
details for your board:

As you can see, debugging in paparazzi isn't exactly "writing things to the screen", but you can toggle LEDs
or use other pieces of hardware to see what's going on. You'll see quickly enough that gdb + breakpoints
and inspecting values is much better than adding / removing echo statements and reloading the firmware.

With regards to compilation... it's a bit complicated, because it depends on what you're building.
first, check the "conf" directory, which is full of makefiles for different selected subsystems in your airframe file.
There's a makefile for the architecture (processor) with some specific compiler/linker flags for the platform.
If you build or work on a subsystem (defined as such in makefile), you'll find specific makefiles for that type
of subsystem in the subsystem directories as well. In there, you'll see the files that are being selected and their
header files. I must say here I've never so far written a subsystem myself, so I don't know if I'm complete with this info.

If you write a module (specified as <load module="....">) in your airframe file, then instead go into the "conf/modules"
directory. There you'll find other XML files which provide basic configurations where necessary, as well as the implementations
and functions to periodically call or use for initialization.

Other directories are settings, tweaks, radio configurations, settings for use in different tools and definitions for messages for telemetry for example.

You can pretty much assume that implementation files in paparazzi need to be explicitly mentioned in makefiles to
have them into the project.

Hope that helps!



On Wed, Oct 10, 2012 at 12:49 PM, Zhang Qiuchen <address@hidden> wrote:
Hello everyone,

My name is Autumn and I'm working on a paparazzi UAV project. I'm new to the forum and I really appreciate need help from all of you guys (and girls) and love to share experience with you. So there is the problem that I'm facing now.

I'm trying to make a piece of code from a older version of paparazzi (campaign 2010 martin mueller) compatible to the newer version (campaign 2011 martin mueller). So there were lots , of changes of directory to be modified. Right now there are 3 puzzles that I need your help with:

1) when I include a header file in a piece of c code, and the header file and the c file is in the same directory, do I still need to specify in the makefile to link them together when building the o file? I wonder because I used the main_logger.c in sw/airborne, and when it is building, there is an error saying that function mcu_init is undefined. But it is defined in the header file mcu.h, which is also in sw_airborne, and is included in the main.logger.c.

2) How do I know which makefile is responsible for linking which files/making which o files? Is it the one in the same directory as the c file? For example, main_logger.c is in the directory sw_airborne, and there is a Makefile in that directory, then should the information on how main_logger.o be built in that Makefile?  Or otherwise, where can I find the makefile to alter?

3) How do I do debug in the paparazzi  in general, can I print sth to the paparazzi center, for example using the echo command in the makefiles, to perform debugging?

Thank you very much for reading this message and any help will be appreciated !

Autumn Zhang

Paparazzi-devel mailing list

Gerard Toonstra

reply via email to

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