Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure platform support #7799

Closed
wants to merge 22 commits into from
Closed

Restructure platform support #7799

wants to merge 22 commits into from

Conversation

mcharleb
Copy link
Contributor

This work is a prerequisite to factoring out platforms into their own repos. It also addresses many of the issues in #7705

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
@@ -33,9 +33,7 @@

set(srcs
test_adc.c
test_autodeclination.cpp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was complaining that it was missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the .cpp files I added there are incorrect, I can remove them, but they caused unresolved symbols

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
@dagar
Copy link
Member

dagar commented Aug 16, 2017

What do you think about flattening it a bit and further concentrating all pieces of a particular board and config?

${PX4_SOURCE_DIR}/platforms/${OS}/${BOARD}/${CONFIG}.cmake

The full config name (eg nuttx_px4fmu-v2_default) would be an artifact of the layout.

The board_config.h, board driver, sensors init, nuttx-config, etc for each board would live in ${PX4_SOURCE_DIR}/platforms/${OS}/${BOARD}. This would make it very easy for someone to add an entirely new board.

The platform support could flatten (somewhat) to the top level of ${PX4_SOURCE_DIR}/platforms/${OS}/.

  • cmake/${OS}/px4_impl_${OS}.cmake and src/firmware/${OS}/CMakeLists.txt -> CMakeLists.txt.

As a more general side note, one minor hesitation I have with this approach is that it's going to be even easier to let the system further fragment. For example a common airframe configuration across boards/configs would be hugely beneficial.

.gitmodules Outdated
[submodule "src/drivers/gps/devices"]
path = src/drivers/gps/devices
url = https://github.com/PX4/GpsDrivers.git
[submodule "src/lib/micro-CDR"]
path = src/lib/micro-CDR
url = https://github.com/eProsima/micro-CDR.git
[submodule "platforms/nuttx/src/modules/uavcan/libuavcan"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think UAVCAN needs to be nuttx only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its only used by nuttx currently and has nuttx deps

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If something else needs it we can restructure it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LorenzMeier @dagar If we aren't in agreement on merging this, then I'm going to stop because it takes a HUGE amount of time to test all the build targets and get it all working.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dagar WRT flattening proposals, the Makefile rules to allow tab completion of build configs using the ${PX4_SOURCE_DIR}/platforms/${OS}/${BOARD}/${CONFIG}.cmake is much harder. I'd rather tackle that at a later date if possible. It nicer but not blocking the objective of making it modular.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more a part of centralizing a build/config than just a nicer layout, which is a big part of #7705.

The only reason I bring it up now is if it might be preferable to do these huge reorganizations in a single pass rather than another fairly large one shortly after the first settles.

Copy link
Contributor Author

@mcharleb mcharleb Aug 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One problem with the current and proposed config layout is that some boards have multiple OSes (SoC) and use a single board file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those effectively two completely separate boards other than the fact one needs to be grab the other's binary? What's a good example?
If that's the case is it sufficient to orchestrate the two different OS builds from the Makefile or do you see the need for tighter integration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Eagle board has a DSP that runs QuRT and runs PX4 and it has an ARM processor also running PX4 and they communicate through muorb. They are one board and have one board ID.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does board ID mean in this context? Can you point to an example so I can see how it's currently done? My assumption was it's fairly similar to the way a pixhawk (px4fmu-v2 + px4io-v2) is handled. px4fmu-v2 and px4io-v2 are two independent boards/builds, but the px4fmu-v2 build consumes the px4io-v2 binary to load at boot.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
@mcharleb
Copy link
Contributor Author

@LorenzMeier SemaphoreCI failed because the machine was powered off!

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The make eagle_default traget still works with the new structure

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
@mcharleb
Copy link
Contributor Author

@dagar @davids5 Rebased and moved to #7806

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants