-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Closed
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d96d37b
Refactor of platform rearchitecture
mcharleb e1a69bb
Updated platforms/qurt/cmake/cmake_hexagon
mcharleb 1140454
Fixed qurt build
mcharleb c7882c7
Removed duplicate files from merge
mcharleb 2c4f5da
Sync NuttX with PX4 upstream
mcharleb 185a70d
More Nuttx refactoring
mcharleb bb75ee5
Fixed build for nuttx_crazyflie_default
mcharleb 3563245
Fixed paths to common/board_common.h
mcharleb d1926fd
Merge branch 'core-rearchitecture4' into core-rearchitecture5
mcharleb 21731ef
Updated Nuttx versions
mcharleb 0437453
Fixed firmware_px4fmu-v3 build
mcharleb daad395
Fixed more nuttx targets
mcharleb 811b4cc
Unit test and SITL fixes
mcharleb 5db43bb
Moved RPi drivers back where they belong
mcharleb 768e9b0
Fixed bootloader builds
mcharleb 45709d8
Moved ROMFS back to the top dir
mcharleb da3e8f6
Fixed posix symlink creation
mcharleb b5e536c
Added vendor/ATLFlight for eagle and excelsior boards
mcharleb ba769d2
Fixed formatting
mcharleb 9cf85f6
Moved nuttx and posix targets to new layout
mcharleb 4b3adfa
Updated PORTING.md
mcharleb 9b84ed7
px4board to px4-board renaming
mcharleb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule cmake_hexagon
deleted from
07168b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Porting | ||
|
||
The variables ${PX4_SOURCE_DIR}, ${OS} and ${BOARD} are passed by the build system. | ||
|
||
## Adding a New Board Config | ||
|
||
If the OS is currently supported, but you want to add a new board file, add the file to: | ||
${PX4_SOURCE_DIR}/platforms/${OS}/cmake/configs/${OS}\_${BOARD}_CONFIG | ||
|
||
You can create multiple config files for the same board (e.g test vs default). | ||
|
||
If you have a SoC platform that has a single board but multiple builds of PX4 for different processors, and there are shared board files, the ${BOARD_FILE_DIRS} should be set to point to the locations of the board files. If you use src/drivers/boards/common/board_config.h you should add ${PX4_SOURCE_DIR}/src/drivers/boards to ${BOARD_FILE_DIRS} and include "common/board_config.h" in your custom board_config.h. | ||
|
||
If not specified in the config file, ${BOARD_FILE_DIRS} defaults to: | ||
|
||
``` | ||
set(BOARD_FILE_DIRS ${PX4_SOURCE_DIR}platforms/${OS}/src/drivers/boards/${BOARD} \ | ||
${PX4_SOURCE_DIR}/src/drivers/boards) | ||
``` | ||
## Overriding a Driver or Module | ||
|
||
Drivers specified in the config file ${PX4_SOURCE_DIR}/platforms/${OS}/cmake/configs/${OS}\_${BOARD}_CONFIG will use an instance found in ${PX4_SOURCE_DIR}/platforms/${OS}/src/ before looking in src/. For instance, to override the src/drivers/rgbled driver for a new platform, you could create a ${PX4_SOURCE_DIR}/platforms/${OS}/src/drivers/rgbled directory with the modfified CMakeLists.txt and src code to implement the driver. | ||
|
||
## Adding New OS Platforms | ||
|
||
Platforms must provide the following | ||
|
||
* ${PX4_SOURCE_DIR}/platforms/${OS}/ | ||
- cmake/${OS}/px4_impl_${OS}.cmake | ||
- src/firmware/${OS}/CMakeLists.txt | ||
|
||
and one or more supported boards: | ||
|
||
* ${PX4_SOURCE_DIR}/platforms/${OS}/ | ||
- cmake/configs/${OS}\_${BOARD}_CONFIG | ||
- src/drivers/${BOARD}/board_config.h | ||
|
||
and an implementation for the OS: | ||
|
||
* ${PX4_SOURCE_DIR}/platforms/${OS}/ | ||
- src/platforms/${OS} | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule NuttX
updated
from 000000 to 44ad7e
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function | ||
|
||
import sys | ||
import subprocess | ||
import re | ||
|
||
filename = sys.argv[1] | ||
px4_source_dir = sys.argv[2] | ||
|
||
try: | ||
fp_header = open(filename, 'r') | ||
old_header = fp_header.read() | ||
except: | ||
old_header = '' | ||
|
||
nuttx_git_tag = subprocess.check_output('git describe --always --tags --match nuttx-* --dirty'.split(), | ||
cwd=px4_source_dir+'/platforms/nuttx/NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip().replace("nuttx-","v") | ||
nuttx_git_tag = re.sub('-.*','.0',nuttx_git_tag) | ||
nuttx_git_version = subprocess.check_output('git rev-parse --verify HEAD'.split(), | ||
cwd=px4_source_dir+'/platforms/nuttx/NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip() | ||
nuttx_git_version_short = nuttx_git_version[0:16] | ||
|
||
# Generate the header file content | ||
header = """ | ||
/* Auto Magically Generated file */ | ||
/* Do not edit! */ | ||
#pragma once | ||
#define NUTTX_GIT_VERSION_STR "{nuttx_git_version}" | ||
#define NUTTX_GIT_VERSION_BINARY 0x{nuttx_git_version_short} | ||
#define NUTTX_GIT_TAG_STR "{nuttx_git_tag}" | ||
""".format(nuttx_git_version=nuttx_git_version, | ||
nuttx_git_version_short=nuttx_git_version_short, | ||
nuttx_git_tag=nuttx_git_tag) | ||
|
||
if old_header != header: | ||
print('Updating header {}'.format(sys.argv[1])) | ||
fp_header = open(filename, 'w') | ||
fp_header.write(header) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.