Linux build targets

How do I define a new type of Linux bard target?

There is comprehensive documentation on porting AP to new STM32 boards (https://ardupilot.org/dev/docs/porting.html). Much of the configuration there happens through hwdef.dat files. It appears that Linux builds use a different mechanism. Tools/ardupilotwaf/boards.py has classes that correspond to different Linux targets (blue, bbbmini, etc.). These classes define different values for CONFIG_HAL_BOARD_SUBTYPE for each build variant, and some of the .cpp sources contain conditional compilation around these values. Is this it? Is there more? Is there anything that spells out which sensors are present on each board, what busses they connect to, which IOs have what functions?

The context is trying to port AP to a custom BBB cape.

@khancyr is looking at simplifying Linux ports. He might be able to assist

Have you looked at this ?

There is some development & support here:
https://gitter.im/mirkix/BBBMINI

Oh, that’s very cool! Did you ever go into production with this?

My context is working with a cape that’s already built and deployed.

If I didn’t know better, I’d assume that #ifs handle everything, as in this snippet from AP_HAL_Linux/GPIO.h:

Hi @iter

I develop a board for pocket with almost same design of PocketPilot we validate the board and planning to buy some boards.

The definition of linux is under libraries/AP_HAL/boards/linux.h
Inside the libraries/AP_HAL_Linux you have several files with all related lower level stuffs( spi, i2c, pwm, rc in and rc out).

Thank you, @juvinski! Reading through libraries/AP_HAL/board/linux.h now. I see where it uses PROBE macros to specify which I2C and SPI devices to look for, e.g., for the BBBlue. I don’t see where it says what to use for RC IN and RC OUT (I think blue uses PRU for both–AP_HAL_Linux/RCInput_PRU.cpp and AP_HAL_Linux/RCOutput_PRU.cpp)

AP_HAL_Linux/RCOutput_PRU.cpp wraps its entire body in this…


…suggesting that the build system compiles this file for every target but the object is empty except for these two targets. But AP_HAL_Linux/RCInput.cpp has no such wrapper.

Hi @iter

Look at:

Thanks! This is very helpful.

We did some prototypes with beaglebone.org but no official release.
@juvinski is certainly the most active build/support reference at the moment on this platform.

1 Like

I’m justing following the briliant @ppoirier and @mirkix.
As told Patrick I recommend you the gitter channel there a lot of others sharing things.

2 Likes

This place or is there something specific to Linux?

As we pointed:

1 Like

I missed the second link in the previous post, thank you!