mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-24 04:27:35 +08:00
Compare commits
332 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c7aae96cd2 | |||
| 52308735a7 | |||
| b1c2820d69 | |||
| 1df5e62cc3 | |||
| 2ad25570ee | |||
| b8577c753f | |||
| c9e3118fea | |||
| 55e0810d8d | |||
| 4ac7853479 | |||
| 06db25c078 | |||
| 5635d639fe | |||
| bbce142129 | |||
| 475715818b | |||
| 02103b9100 | |||
| 25de111a4a | |||
| 9169f9cd44 | |||
| 273766a4ea | |||
| f98fdbc452 | |||
| edc2536bdd | |||
| e90f8b500f | |||
| fbdc31b60c | |||
| 392002f671 | |||
| c0c7f6ec40 | |||
| 8c5c4a0504 | |||
| 0da6efa52d | |||
| 9de10d672c | |||
| 0fa5a83409 | |||
| aed175451a | |||
| df42ef84f1 | |||
| fe30ef7f16 | |||
| 0b834dd0e7 | |||
| 8e658a6e2d | |||
| db2c6b2abe | |||
| 95b8328162 | |||
| 6de6abfb64 | |||
| e371c4edd9 | |||
| 473ef5fd06 | |||
| 46d9b14ba0 | |||
| 66e21497a6 | |||
| de49edc428 | |||
| b5846fd8c2 | |||
| ec6dd286fc | |||
| cf50ecf41b | |||
| 9fe69d4f33 | |||
| f4247aee58 | |||
| ec8f34325e | |||
| 0e615816b3 | |||
| 4cf4f82233 | |||
| 5f83c186ee | |||
| e761297003 | |||
| 27181619fc | |||
| 210239324d | |||
| c71e2d41d6 | |||
| 7c318a3296 | |||
| 0375f1a6f0 | |||
| 0ef4f1b7bd | |||
| 598066653a | |||
| 86e1356e0a | |||
| 450cf79fc8 | |||
| 1ff36422c9 | |||
| 38b6a9abf3 | |||
| 819c783b6c | |||
| 14558e9304 | |||
| 6bc24c8cd1 | |||
| d8220d4948 | |||
| 435040f2d5 | |||
| dad58f31a6 | |||
| 6ecbfb2262 | |||
| 9563f4c8c6 | |||
| cea6c10864 | |||
| 1e34c80115 | |||
| 076b673977 | |||
| 00f2c149d1 | |||
| e370d15c72 | |||
| aa850d5c1c | |||
| 1e618a7eb0 | |||
| f46fd89057 | |||
| 33c7eed5f1 | |||
| 96f428b683 | |||
| 722133f79a | |||
| 66c5644f1b | |||
| 3ef13da044 | |||
| 161b530247 | |||
| b5c0867101 | |||
| ca6d257ed8 | |||
| c51502781f | |||
| 339a0b40af | |||
| d2aa1b801c | |||
| 26d847e6e7 | |||
| 1cf2dc8791 | |||
| 209a9935e7 | |||
| 0fa667fd92 | |||
| bbf32a537e | |||
| 3e425210e0 | |||
| f25997a15b | |||
| e132568430 | |||
| 6195629373 | |||
| 2c044b327e | |||
| b7ffd6ea2c | |||
| b26db22c1a | |||
| 6f18ff8ff9 | |||
| f224b81eec | |||
| b537601b7a | |||
| e01c4b0692 | |||
| ca43fc8f5a | |||
| 11cac778ba | |||
| 441892b33f | |||
| 1d5a8531e4 | |||
| e71348967d | |||
| fbe49db571 | |||
| 4b36cfccfc | |||
| 699ec30c9c | |||
| e6c49edd20 | |||
| cb6bdee4c2 | |||
| 3438d593a1 | |||
| 38f89a8b69 | |||
| 3e290695ef | |||
| 11bf3cffde | |||
| ba4437ae60 | |||
| b64860f9f8 | |||
| e51d09612f | |||
| eb1c0322e3 | |||
| e822da74b2 | |||
| ccaad82f61 | |||
| 4e5c1140b7 | |||
| 4acb8ec799 | |||
| 89d43185c7 | |||
| df0a197050 | |||
| c726c7e4f4 | |||
| 24d06047bd | |||
| cb682006fe | |||
| 5632728467 | |||
| 778ad160f2 | |||
| 8393f46100 | |||
| 1345b3500a | |||
| 8604604a5b | |||
| d62f112017 | |||
| 14186cf74f | |||
| 5fe82aa485 | |||
| b92d21bd31 | |||
| 12745baf6c | |||
| c25fcabcc6 | |||
| 67d62cb371 | |||
| 0704580a30 | |||
| 38eaa8b1d3 | |||
| 16eac303de | |||
| aadb83a220 | |||
| 3a2ce0925d | |||
| 29ba83109c | |||
| 7919959f5a | |||
| 703d66e605 | |||
| 73a8fc8fb0 | |||
| 9b106f71a0 | |||
| b06094c737 | |||
| 96e5862d88 | |||
| 98d8090458 | |||
| 3ebb47d53f | |||
| b0008e99ff | |||
| c962c6a2c1 | |||
| 18477554e0 | |||
| bcd67b7bad | |||
| fcddea4410 | |||
| ca83b8330d | |||
| a7de5d176f | |||
| 3e1c499d5d | |||
| 1d00e4e8aa | |||
| f90b1b375c | |||
| 73e71feb47 | |||
| 45f9fb45c1 | |||
| e3f05f1bbe | |||
| c0e0d9a080 | |||
| 87c05c9181 | |||
| c41aab6ddf | |||
| 45cad9f85c | |||
| 00509d540d | |||
| 789babae8e | |||
| 1de6001163 | |||
| a2b1795236 | |||
| f7679dc576 | |||
| 817951b86b | |||
| e7be62a342 | |||
| 8c2a25edf8 | |||
| c83d8e807f | |||
| 07f1ac682c | |||
| 204d82a5c1 | |||
| ac2f2cf2c8 | |||
| 5df20b8e9b | |||
| 980956496b | |||
| 0985c22701 | |||
| 0618b0b529 | |||
| 4fbff2cdd9 | |||
| 3646032296 | |||
| f6de211a27 | |||
| 85916b8946 | |||
| 8e8fd485b9 | |||
| 78ff7469ec | |||
| 7d034d6087 | |||
| ad38dba167 | |||
| 8874d533bb | |||
| f29aa182a8 | |||
| c8286d4bba | |||
| 575fa0850b | |||
| 6caf4f0942 | |||
| 0ce60fd528 | |||
| 93d767ab51 | |||
| d97a8d7d3b | |||
| a2299b02c8 | |||
| 276cab8d3c | |||
| a6d5c78d10 | |||
| 7bb12b15b5 | |||
| 526c64aab7 | |||
| 6eb2251ee5 | |||
| d9a66b11ac | |||
| a8c5df90ce | |||
| 8dd88e036d | |||
| c4a459838e | |||
| 932abfd558 | |||
| bd3b3d647f | |||
| 14b38f2eba | |||
| bb72088ff6 | |||
| 1904838043 | |||
| 7a9b04c67c | |||
| a514560169 | |||
| 6901bc6a01 | |||
| a6d9e114be | |||
| 5f7e395609 | |||
| 921e91863a | |||
| 585a615e64 | |||
| 45e8712d60 | |||
| 0cefd74fee | |||
| 7d8e79c49d | |||
| faedf252b3 | |||
| 7f8d2b5067 | |||
| 4498475515 | |||
| b8974cb77b | |||
| 042a251542 | |||
| ff06a206d1 | |||
| 46ed71fa5b | |||
| 2ef2580388 | |||
| c89667d911 | |||
| fa7ffa423c | |||
| 8f3442b358 | |||
| 17f3db9231 | |||
| 25138d0a12 | |||
| 70f32f4631 | |||
| e74e1bb32a | |||
| 5c469a36b8 | |||
| efbc9e64a4 | |||
| 229b53d25d | |||
| e0137fe7a7 | |||
| 072eeb4617 | |||
| 9c850b1594 | |||
| ad2279adb5 | |||
| e54d1fd114 | |||
| d0009c2af8 | |||
| 06d73b3758 | |||
| 8fe24d8884 | |||
| ffc184fcf7 | |||
| 8a2239f3e8 | |||
| f7269c9c22 | |||
| a3694c84f4 | |||
| 49febef5ca | |||
| 7cf9be6e10 | |||
| 676fa8a883 | |||
| 67ace35182 | |||
| f1a68b7450 | |||
| 9248238f9e | |||
| 82d8813987 | |||
| 7b05a00db1 | |||
| b83f21ec6f | |||
| 05c79e23d5 | |||
| 363242972c | |||
| 6bca640cac | |||
| acef86cb4d | |||
| 0e7f980c76 | |||
| 5eab16c17c | |||
| 98d3a2141a | |||
| 3d9905251d | |||
| f80b05e4f9 | |||
| 6d0e27222c | |||
| aaf6632a22 | |||
| 24572cf358 | |||
| e30a30d768 | |||
| 38847b1cf3 | |||
| 5483d901f9 | |||
| ddb98abf1d | |||
| b5c3c11622 | |||
| 90f82dabcf | |||
| a94ee4382b | |||
| 561a83cf6c | |||
| 517f04259c | |||
| 644b483d7e | |||
| 2bfa2f8b5f | |||
| 311b3cfb67 | |||
| cbbdc20bd3 | |||
| 1250563ed1 | |||
| 5f0d222e1b | |||
| 84b5ce9010 | |||
| ab1c880aad | |||
| e7609ad5b5 | |||
| fb13b880ce | |||
| 8cb1c31f46 | |||
| fa5599976f | |||
| b010fe904c | |||
| ae03630570 | |||
| c44e0be18a | |||
| 9702a2a899 | |||
| cfe4cc82ea | |||
| f3ee45b173 | |||
| d5eea0dd92 | |||
| 0c9ebc4321 | |||
| be9fa620fd | |||
| b320ace4d1 | |||
| 6ec106a0ed | |||
| f9595319b8 | |||
| 05c5293596 | |||
| ddc173249a | |||
| 7d509d832a | |||
| 6846af119d | |||
| 37398248aa | |||
| a1e5a959b5 | |||
| 99965337f1 | |||
| c536120e3d | |||
| 73ee098a25 | |||
| 482683d156 | |||
| 97c16352a5 | |||
| fe35f1a34b | |||
| 7323075527 | |||
| 17e96554ec | |||
| 8f38a2ddbc | |||
| 6f4605dd04 | |||
| 1c821cf83d |
@@ -3,92 +3,45 @@ description: Create a report to help us improve
|
||||
title: "[Bug] "
|
||||
labels: ["bug-report"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Tips for a great bug report:**
|
||||
- Describe what went wrong and what you expected
|
||||
- Include a flight log link from [logs.px4.io](http://logs.px4.io/) if possible
|
||||
- Mention your PX4 version, flight controller, and vehicle type if relevant
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: A clear and concise description of the bug.
|
||||
description: A clear description of the bug and what you expected to happen.
|
||||
placeholder: |
|
||||
What happened and what did you expect instead?
|
||||
|
||||
Steps to reproduce (if applicable):
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: To Reproduce
|
||||
label: Flight Log / Additional Information
|
||||
description: |
|
||||
Steps to reproduce the behavior.
|
||||
1. Drone switched on '...'
|
||||
2. Uploaded mission '....' (attach QGC mission file)
|
||||
3. Took off '....'
|
||||
4. See error
|
||||
validations:
|
||||
required: false
|
||||
**Flight log** (highly recommended for flight-related issues):
|
||||
- Upload to [PX4 Flight Review](http://logs.px4.io/) and paste the link
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected behavior
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Screenshot / Media
|
||||
description: Add screenshot / media if you have them
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Flight Log
|
||||
description: |
|
||||
*Always* provide a link to the flight log file:
|
||||
- Download the flight log file from the vehicle ([tutorial](https://docs.px4.io/main/en/getting_started/flight_reporting.html)).
|
||||
- Upload the log to the [PX4 Flight Review](http://logs.px4.io/)
|
||||
- Share the link to the log (Copy and paste the URL of the log)
|
||||
**Additional details** (if relevant):
|
||||
- PX4 version (output of `ver all` in MAVLink Shell)
|
||||
- Flight controller model
|
||||
- Vehicle type (multicopter, fixed-wing, VTOL, etc.)
|
||||
- Screenshots or media
|
||||
placeholder: |
|
||||
# PASTE HERE THE LINK TO THE LOG
|
||||
Flight log link:
|
||||
|
||||
Version:
|
||||
|
||||
Hardware:
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
## Setup
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Software Version
|
||||
description: |
|
||||
Which version of PX4 are you using?
|
||||
placeholder: |
|
||||
# If you don't know the version, paste the output of `ver all` in the MAVLink Shell of QGC
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Flight controller
|
||||
description: Specify your flight controller model (what type is it, where was it bought from, ...).
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Vehicle type
|
||||
options:
|
||||
- Multicopter
|
||||
- Helicopter
|
||||
- Fixed Wing
|
||||
- Hybrid VTOL
|
||||
- Airship/Balloon
|
||||
- Rover
|
||||
- Boat
|
||||
- Submarine
|
||||
- Other
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: How are the different components wired up (including port information)
|
||||
description: Details about how all is wired.
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: Add any other context about the problem here.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
blank_issues_enabled: false
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Support Question
|
||||
url: https://docs.px4.io/main/en/contribute/support.html#forums-and-chat
|
||||
|
||||
@@ -1,22 +1,9 @@
|
||||
<!--
|
||||
|
||||
Thank you for your contribution!
|
||||
|
||||
Get early feedback through
|
||||
- Dronecode Discord: https://discord.gg/dronecode
|
||||
- PX4 Discuss: http://discuss.px4.io/
|
||||
- opening a draft pr and sharing the link
|
||||
|
||||
-->
|
||||
|
||||
### Solved Problem
|
||||
When ... I found that ...
|
||||
|
||||
Fixes #{Github issue ID}
|
||||
|
||||
### Solution
|
||||
- Add ... for ...
|
||||
- Refactor ...
|
||||
|
||||
### Changelog Entry
|
||||
For release notes:
|
||||
@@ -27,11 +14,10 @@ Documentation: Need to clarify page ... / done, read docs.px4.io/...
|
||||
```
|
||||
|
||||
### Alternatives
|
||||
We could also ...
|
||||
|
||||
### Test coverage
|
||||
- Unit/integration test: ...
|
||||
- Simulation/hardware testing logs: https://review.px4.io/
|
||||
|
||||
### Context
|
||||
Related links, screenshot before/after, video
|
||||
|
||||
-->
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
applyTo: "docs/en/**"
|
||||
---
|
||||
|
||||
# Review Guidelines docs/en Tree
|
||||
|
||||
## File System & Structure
|
||||
|
||||
- **Naming:** Use `lowercase_with_underscores` for all filenames. No spaces.
|
||||
- **Hierarchy:** Markdown files must reside exactly in a first-level category folder.
|
||||
- Valid: `docs/en/category/file.md`
|
||||
- Invalid: `docs/en/category/subcategory/file.md`
|
||||
- **Text Files:** Any `.txt` or `.text` files must start with an underscore (e.g., `_notes.txt`).
|
||||
- **Assets:** All images/non-docs must be in `/docs/assets/`. Deep nesting is permitted here.
|
||||
- **Formats:** Prefer **SVG** for diagrams and **PNG** for screenshots. Flag JPG files.
|
||||
|
||||
## Markdown & Style
|
||||
|
||||
- **Headings:** Use Title Case ("First Letter Capitalisation").
|
||||
- The Page Title must be the only H1 (`#`). All others must be `##` or lower.
|
||||
- Do not apply bold or italic styling inside a heading.
|
||||
- **Formatting:**
|
||||
- **Bold:** Only for UI elements (buttons, menu items).
|
||||
- **Italics (Emphasis):** For tool names (e.g., *QGroundControl*).
|
||||
- **Inline Code:** Use backticks for file paths, parameters, and CLI commands (e.g., `prettier`).
|
||||
- **Structure:** End every line at the end of a sentence (Semantic Line Breaks).
|
||||
|
||||
## Linking & Navigation
|
||||
|
||||
- **Standard Links:** Use standard inline syntax: `[link text](../category/filename.md)`.
|
||||
Note relative link.
|
||||
- **Table Links:** To keep tables readable, use reference-style links.
|
||||
- Definition: `[Link Name]: https://example.com` (placed below the table).
|
||||
- Usage: `[Link Name]` within the table cell.
|
||||
- **Images:** All image links must include a descriptive, accessible alt-text in the brackets: ``.
|
||||
Note that all images should be relative references to images stored in the assets folder, which should be two folders below the any markdown file (as they are stored in a "category" subfolder)
|
||||
|
||||
- **Standard Links:** Use standard inline syntax: `[link text](../category/filename.md)`. Note the use of relative links.
|
||||
- **Table Links:** To keep tables easier to edit, prefer reference-style links.
|
||||
- Definition: `[Link Name]: https://example.com` (placed below the table).
|
||||
- Usage: `[Link Name]` within the table cell.
|
||||
- **Images:** All image links must include a descriptive, accessible alt-text: ``.
|
||||
- **Note:** All images must be relative references to the `/docs/assets/` folder. Since documents are nested in a category folder, this is usually two levels up (`../../assets/`).
|
||||
|
||||
## Quality Control
|
||||
|
||||
- **Prettier Check:** Ensure Prettier rules have been applied. If there is evidence of inconsistent indentation or spacing, request the author run `npx prettier --write .` before merging.
|
||||
- **Language:** Enforce **UK English** spelling and grammar.
|
||||
@@ -130,8 +130,8 @@ jobs:
|
||||
load: false
|
||||
push: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_to_registry) }}
|
||||
provenance: false
|
||||
cache-from: type=gha,version=1
|
||||
cache-to: type=gha,version=1,mode=max
|
||||
cache-from: type=gha,version=1,scope=${{ matrix.arch }}
|
||||
cache-to: type=gha,version=1,mode=max,scope=${{ matrix.arch }}
|
||||
|
||||
deploy:
|
||||
name: Deploy To Registry
|
||||
|
||||
@@ -54,6 +54,7 @@ jobs:
|
||||
run: |
|
||||
make clean
|
||||
make distclean
|
||||
make submodulesclean
|
||||
|
||||
- name: If it's a PR checkout the base branch
|
||||
if: ${{ github.event.pull_request }}
|
||||
|
||||
@@ -41,6 +41,10 @@ jobs:
|
||||
scripts: >
|
||||
boards/nxp/tropic-community/nuttx-config/scripts/itcm_functions_includes.ld
|
||||
boards/nxp/tropic-community/nuttx-config/scripts/itcm_static_functions.ld
|
||||
- target: nxp_mr-tropic
|
||||
scripts: >
|
||||
boards/nxp/mr-tropic/nuttx-config/scripts/itcm_functions_includes.ld
|
||||
boards/nxp/mr-tropic/nuttx-config/scripts/itcm_static_functions.ld
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
PX4_HOME_LON: ${{matrix.config.longitude}}
|
||||
PX4_HOME_ALT: ${{matrix.config.altitude}}
|
||||
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
|
||||
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 10 --abort-early --model ${{matrix.config.model}} --upload test/mavsdk_tests/configs/sitl.json --verbose --force-color
|
||||
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 10 --abort-early --model ${{matrix.config.model}} test/mavsdk_tests/configs/sitl.json --verbose --force-color
|
||||
timeout-minutes: 45
|
||||
|
||||
- name: Upload failed logs
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
stale-issue-label: 'stale'
|
||||
stale-pr-label: 'stale'
|
||||
remove-stale-when-updated: true
|
||||
stale-issue-message: 'This issue has been marked as stale due to 90 days of inactivity. If no further activity occurs, it will be automatically closed in 30 days. Please leave a comment, add a reaction, make an update, or remove the stale label if you’d like to keep it open.'
|
||||
close-issue-message: 'This issue has been closed due to prolonged inactivity after being marked as stale. If you believe this was closed in error or the topic is still relevant, please feel free to reopen it or create a new issue.'
|
||||
stale-pr-message: 'This PR was identified as stale and it will be closed in 30 days unless any activity is detected.'
|
||||
close-pr-message: 'This pull request has been closed after being marked as stale with no further activity. Thank you for the time and effort you put into this contribution. If you’d like to continue the discussion or update the work, please feel free to reopen it or submit a new PR.'
|
||||
stale-issue-message: ''
|
||||
close-issue-message: 'This issue has been automatically closed due to 120 days of inactivity. If you believe this is still relevant, please feel free to reopen it or create a new issue.'
|
||||
stale-pr-message: ''
|
||||
close-pr-message: 'This pull request has been automatically closed due to 120 days of inactivity. If you would like to continue, please feel free to reopen it or submit a new PR.'
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
name: Sync ROS 2 messages to px4_msgs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'stable'
|
||||
- 'beta'
|
||||
- 'release/**'
|
||||
paths:
|
||||
- 'msg/**'
|
||||
- 'srv/**'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
sync_to_px4_msgs:
|
||||
if: github.repository == 'PX4/PX4-Autopilot'
|
||||
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu22-full-x64,"run-id=${{ github.run_id }}",spot=false]
|
||||
steps:
|
||||
- name: Checkout PX4 repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup git credentials
|
||||
run: |
|
||||
git config --global user.name "${{ secrets.PX4BUILDBOT_USER }}"
|
||||
git config --global user.email "${{ secrets.PX4BUILDBOT_EMAIL }}"
|
||||
|
||||
- name: Clone PX4_msgs repo
|
||||
run: |
|
||||
git clone https://${{ secrets.PX4BUILTBOT_PERSONAL_ACCESS_TOKEN }}@github.com/PX4/px4_msgs.git
|
||||
|
||||
- name: Check out the same branch as the PX4 repo
|
||||
run: |
|
||||
cd px4_msgs
|
||||
if git checkout ${{ github.ref_name }}; then
|
||||
echo "Checked out existing branch"
|
||||
else
|
||||
git checkout -b ${{ github.ref_name }}
|
||||
fi
|
||||
|
||||
- name: Copy ROS 2 messages
|
||||
run: |
|
||||
rm -f px4_msgs/msg/*.msg
|
||||
rm -f px4_msgs/msg/versioned/*.msg
|
||||
rm -f px4_msgs/srv/*.srv
|
||||
rm -f px4_msgs/srv/versioned/*.srv
|
||||
cp msg/*.msg px4_msgs/msg/
|
||||
cp msg/versioned/*.msg px4_msgs/msg/ || true
|
||||
cp srv/*.srv px4_msgs/srv/
|
||||
cp srv/versioned/*.srv px4_msgs/srv/ || true
|
||||
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
cd px4_msgs
|
||||
git status
|
||||
git add .
|
||||
git commit -a -m "Update to PX4 ${{ github.sha }}" || true
|
||||
git push origin ${{ github.ref_name }} || true
|
||||
cd ..
|
||||
rm -rf px4_msgs
|
||||
@@ -103,3 +103,9 @@
|
||||
[submodule "src/drivers/ins/sbgecom/sbgECom"]
|
||||
path = src/drivers/ins/sbgecom/sbgECom
|
||||
url = https://github.com/PX4/sbgECom.git
|
||||
[submodule "src/modules/mc_raptor/blob"]
|
||||
path = src/modules/mc_raptor/blob
|
||||
url = https://github.com/rl-tools/px4-blob
|
||||
[submodule "src/lib/rl_tools/rl_tools"]
|
||||
path = src/lib/rl_tools/rl_tools
|
||||
url = https://github.com/rl-tools/rl-tools.git
|
||||
|
||||
Vendored
+50
@@ -6,6 +6,16 @@ CONFIG:
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_default
|
||||
px4_sitl_raptor:
|
||||
short: px4_sitl_raptor
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_raptor
|
||||
px4_sitl_raptor_debug:
|
||||
short: px4_sitl_raptor_debug
|
||||
buildType: Debug
|
||||
settings:
|
||||
CONFIG: px4_sitl_raptor
|
||||
px4_sitl_spacecraft:
|
||||
short: px4_sitl_spacecraft
|
||||
buildType: RelWithDebInfo
|
||||
@@ -241,6 +251,16 @@ CONFIG:
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: ark_fpv_default
|
||||
ark_mag_canbootloader:
|
||||
short: ark_mag_canbootloader
|
||||
buildType: MiniSizeRel
|
||||
settings:
|
||||
CONFIG: ark_mag_canbootloader
|
||||
ark_mag_default:
|
||||
short: ark_mag_default
|
||||
buildType: MiniSizeRel
|
||||
settings:
|
||||
CONFIG: ark_mag_default
|
||||
ark_pi6x_bootloader:
|
||||
short: ark_pi6x_bootloader
|
||||
buildType: MinSizeRel
|
||||
@@ -411,6 +431,16 @@ CONFIG:
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: micoair_h743-v2_default
|
||||
micoair_h743-lite_bootloader:
|
||||
short: micoair_h743-lite_bootloader
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: micoair_h743-lite_bootloader
|
||||
micoair_h743-lite_default:
|
||||
short: micoair_h743-lite
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: micoair_h743-lite_default
|
||||
modalai_fc-v1_default:
|
||||
short: modalai_fc-v1
|
||||
buildType: MinSizeRel
|
||||
@@ -461,6 +491,16 @@ CONFIG:
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: nxp_mr-canhubk3_fmu
|
||||
nxp_mr-tropic_default:
|
||||
short: nxp_mr-tropic_default
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: nxp_mr-tropic_default
|
||||
nxp_mr-tropic_bootloader:
|
||||
short: nxp_mr-tropic_bootloader
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: nxp_mr-tropic_bootloader
|
||||
nxp_tropic-community_default:
|
||||
short: nxp_tropic-community_default
|
||||
buildType: MinSizeRel
|
||||
@@ -501,3 +541,13 @@ CONFIG:
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: svehicle_e2_default
|
||||
x-mav_ap-h743r1_bootloader:
|
||||
short: x-mav_ap-h743r1-boot
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: x-mav_ap-h743r1_bootloader
|
||||
x-mav_ap-h743r1_default:
|
||||
short: x-mav_ap-h743r1
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: x-mav_ap-h743r1_default
|
||||
|
||||
+1
-1
@@ -267,7 +267,7 @@ endif()
|
||||
|
||||
set(package-contact "px4users@googlegroups.com")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
|
||||
Vendored
-30
@@ -220,36 +220,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('PX4 ROS msgs') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
|
||||
}
|
||||
steps {
|
||||
sh('export')
|
||||
sh('make distclean; git clean -ff -x -d .')
|
||||
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||
sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/px4_msgs.git")
|
||||
// 'main' branch
|
||||
sh('rm -f px4_msgs/msg/*.msg')
|
||||
sh('rm -f px4_msgs/msg/versioned/*.msg')
|
||||
sh('rm -f px4_msgs/srv/*.srv')
|
||||
sh('rm -f px4_msgs/srv/versioned/*.srv')
|
||||
sh('cp msg/*.msg px4_msgs/msg/')
|
||||
sh('cp msg/versioned/*.msg px4_msgs/msg/ || true')
|
||||
sh('cp srv/*.srv px4_msgs/srv/')
|
||||
sh('cp srv/versioned/*.srv px4_msgs/srv/ || true')
|
||||
sh('cd px4_msgs; git status; git add .; git commit -a -m "Update message definitions `date`" || true')
|
||||
sh('cd px4_msgs; git push origin main || true')
|
||||
sh('rm -rf px4_msgs')
|
||||
}
|
||||
}
|
||||
when {
|
||||
anyOf {
|
||||
branch 'main'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('S3') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
|
||||
|
||||
@@ -346,6 +346,7 @@ bootloaders_update: \
|
||||
micoair_h743_bootloader \
|
||||
micoair_h743-aio_bootloader \
|
||||
micoair_h743-v2_bootloader \
|
||||
micoair_h743-lite_bootloader \
|
||||
modalai_fc-v2_bootloader \
|
||||
mro_ctrl-zero-classic_bootloader \
|
||||
mro_ctrl-zero-h7_bootloader \
|
||||
|
||||
@@ -146,6 +146,11 @@ add_custom_command(
|
||||
${romfs_copy_stamp}
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${romfs_gen_root_dir}/*
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xf ${romfs_tar_file}
|
||||
# Preprocess ROMFS files with KConfig definitions
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_romfs_preprocess.py
|
||||
--romfs-dir ${romfs_gen_root_dir}
|
||||
--kconfig-header ${PX4_BINARY_DIR}/px4_boardconfig.h
|
||||
--cpp ${CMAKE_C_COMPILER}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_process_airframes.py
|
||||
--airframes-path ${romfs_gen_root_dir}/init.d
|
||||
--start-script ${romfs_gen_root_dir}/init.d/rc.autostart
|
||||
@@ -159,8 +164,10 @@ add_custom_command(
|
||||
--params-file ${CONFIG_BOARD_PARAM_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${romfs_copy_stamp}
|
||||
WORKING_DIRECTORY ${romfs_gen_root_dir}
|
||||
DEPENDS ${romfs_tar_file}
|
||||
COMMENT "ROMFS: copying, generating airframes"
|
||||
DEPENDS
|
||||
${romfs_tar_file}
|
||||
${PX4_BINARY_DIR}/px4_boardconfig.h
|
||||
COMMENT "ROMFS: copying, preprocessing, generating airframes"
|
||||
)
|
||||
|
||||
# copy extras into ROMFS
|
||||
|
||||
@@ -27,7 +27,6 @@ param set-default SIH_KDV 0.2
|
||||
param set-default SIH_VEHICLE_TYPE 1 # sih as fixed wing
|
||||
param set-default RWTO_TKOFF 1 # enable takeoff from runway (as opposed to launched)
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -44,8 +44,6 @@ param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -46,8 +46,6 @@ param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -46,8 +46,6 @@ param set-default MIS_TAKEOFF_ALT 30
|
||||
param set-default NAV_ACC_RAD 15
|
||||
param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@ param set-default NAV_DLL_ACT 2
|
||||
param set-default RWTO_TKOFF 1
|
||||
param set-default RWTO_PSP 8
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@ param set-default NAV_DLL_ACT 2
|
||||
param set-default RWTO_TKOFF 1
|
||||
param set-default RWTO_PSP 8
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -30,8 +30,6 @@ param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@ param set-default NAV_DLL_ACT 2
|
||||
param set-default RWTO_TKOFF 1
|
||||
param set-default RWTO_PSP 8
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@ param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -44,8 +44,6 @@ param set-default MIS_TAKEOFF_ALT 30
|
||||
param set-default NAV_ACC_RAD 15
|
||||
param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@ param set-default RWTO_MAX_PITCH 20
|
||||
param set-default RWTO_PSP 8
|
||||
param set-default RWTO_AIRSPD_SCL 1.8
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@ param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -46,8 +46,6 @@ param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -43,8 +43,6 @@ param set-default FW_THR_TRIM 0.8
|
||||
param set-default FW_THR_IDLE 0
|
||||
param set-default COM_DISARM_PRFLT 0
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -48,8 +48,6 @@ param set-default FW_THR_TRIM 0.8
|
||||
param set-default FW_THR_IDLE 0
|
||||
param set-default COM_DISARM_PRFLT 0
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -53,8 +53,6 @@ param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default COM_PREARM_MODE 2
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
|
||||
@@ -11,8 +11,6 @@ PX4_SIM_MODEL=${PX4_SIM_MODEL:=advanced_plane}
|
||||
|
||||
param set-default SIM_GZ_EN 1
|
||||
|
||||
param set-default SENS_EN_ARSPDSIM 1
|
||||
|
||||
param set-default FW_LND_ANG 8
|
||||
|
||||
param set-default FW_PR_FF 0.08
|
||||
@@ -48,8 +46,6 @@ param set-default NAV_DLL_ACT 2
|
||||
|
||||
param set-default RWTO_TKOFF 1
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
|
||||
param set-default CA_SV_CS_COUNT 6
|
||||
|
||||
@@ -19,5 +19,6 @@ param set-default MNT_MAN_PITCH 2
|
||||
param set-default MNT_MAN_YAW 3
|
||||
|
||||
param set-default MNT_RANGE_ROLL 180
|
||||
param set-default MNT_RANGE_PITCH 180
|
||||
param set-default MNT_MAX_PITCH 45
|
||||
param set-default MNT_MIN_PITCH -135
|
||||
param set-default MNT_RANGE_YAW 720
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name KTH-ATMOS
|
||||
#
|
||||
# @type Free-Flyer
|
||||
# @class Spacecraft
|
||||
#
|
||||
# @output Motor1 back left thruster, +x thrust
|
||||
# @output Motor2 front left thruster, -x thrust
|
||||
# @output Motor3 back right thruster, +x thrust
|
||||
# @output Motor4 front right thruster, -x thrust
|
||||
# @output Motor5 front left thruster, +y thrust
|
||||
# @output Motor6 front right thruster, -y thrust
|
||||
# @output Motor7 back left thruster, +y thrust
|
||||
# @output Motor8 back right thruster, -y thrust
|
||||
#
|
||||
# @maintainer discower-io
|
||||
# @url https://atmos.discower.io
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.sc_defaults
|
||||
|
||||
PX4_SIMULATOR=${PX4_SIMULATOR:=gz}
|
||||
PX4_GZ_WORLD=${PX4_GZ_WORLD:=default}
|
||||
PX4_SIM_MODEL=${PX4_SIM_MODEL:=atmos_dual}
|
||||
|
||||
param set-default SIM_GZ_EN 1
|
||||
|
||||
param set-default SENS_EN_MAGSIM 1
|
||||
param set-default COM_ARM_CHK_ESCS 0 # We don't have ESCs
|
||||
param set-default FD_ESCS_EN 0
|
||||
|
||||
param set-default CA_AIRFRAME 14
|
||||
param set-default MAV_TYPE 45
|
||||
|
||||
param set-default CA_ROTOR_COUNT 8
|
||||
param set-default CA_R_REV 0
|
||||
|
||||
# Auto to be provided by Custom Airframe
|
||||
param set-default CA_METHOD 0
|
||||
|
||||
# Set proper failsafes
|
||||
param set-default COM_ACT_FAIL_ACT 0
|
||||
param set-default COM_LOW_BAT_ACT 0
|
||||
param set-default NAV_DLL_ACT 0
|
||||
param set-default GF_ACTION 1
|
||||
param set-default NAV_RCL_ACT 1
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
|
||||
param set-default CA_ROTOR0_PX -0.12
|
||||
param set-default CA_ROTOR0_PY -0.12
|
||||
param set-default CA_ROTOR0_PZ 0.0
|
||||
param set-default CA_ROTOR0_CT 1.4
|
||||
param set-default CA_ROTOR0_AX 1.0
|
||||
param set-default CA_ROTOR0_AY 0.0
|
||||
param set-default CA_ROTOR0_AZ 0.0
|
||||
|
||||
param set-default CA_ROTOR1_PX 0.12
|
||||
param set-default CA_ROTOR1_PY -0.12
|
||||
param set-default CA_ROTOR1_PZ 0.0
|
||||
param set-default CA_ROTOR1_CT 1.4
|
||||
param set-default CA_ROTOR1_AX -1.0
|
||||
param set-default CA_ROTOR1_AY 0.0
|
||||
param set-default CA_ROTOR1_AZ 0.0
|
||||
|
||||
param set-default CA_ROTOR2_PX -0.12
|
||||
param set-default CA_ROTOR2_PY 0.12
|
||||
param set-default CA_ROTOR2_PZ 0.0
|
||||
param set-default CA_ROTOR2_CT 1.4
|
||||
param set-default CA_ROTOR2_AX 1.0
|
||||
param set-default CA_ROTOR2_AY 0.0
|
||||
param set-default CA_ROTOR2_AZ 0.0
|
||||
|
||||
param set-default CA_ROTOR3_PX 0.12
|
||||
param set-default CA_ROTOR3_PY 0.12
|
||||
param set-default CA_ROTOR3_PZ 0.0
|
||||
param set-default CA_ROTOR3_CT 1.4
|
||||
param set-default CA_ROTOR3_AX -1.0
|
||||
param set-default CA_ROTOR3_AY 0.0
|
||||
param set-default CA_ROTOR3_AZ 0.0
|
||||
|
||||
param set-default CA_ROTOR4_PX 0.12
|
||||
param set-default CA_ROTOR4_PY -0.12
|
||||
param set-default CA_ROTOR4_PZ 0.0
|
||||
param set-default CA_ROTOR4_CT 1.4
|
||||
param set-default CA_ROTOR4_AX 0.0
|
||||
param set-default CA_ROTOR4_AY 1.0
|
||||
param set-default CA_ROTOR4_AZ 0.0
|
||||
|
||||
param set-default CA_ROTOR5_PX 0.12
|
||||
param set-default CA_ROTOR5_PY 0.12
|
||||
param set-default CA_ROTOR5_PZ 0.0
|
||||
param set-default CA_ROTOR5_CT 1.4
|
||||
param set-default CA_ROTOR5_AX 0.0
|
||||
param set-default CA_ROTOR5_AY -1.0
|
||||
param set-default CA_ROTOR5_AZ 0.0
|
||||
|
||||
param set-default CA_ROTOR6_PX -0.12
|
||||
param set-default CA_ROTOR6_PY -0.12
|
||||
param set-default CA_ROTOR6_PZ 0.0
|
||||
param set-default CA_ROTOR6_CT 1.4
|
||||
param set-default CA_ROTOR6_AX 0.0
|
||||
param set-default CA_ROTOR6_AY 1.0
|
||||
param set-default CA_ROTOR6_AZ 0.0
|
||||
|
||||
param set-default CA_ROTOR7_PX -0.12
|
||||
param set-default CA_ROTOR7_PY 0.12
|
||||
param set-default CA_ROTOR7_PZ 0.0
|
||||
param set-default CA_ROTOR7_CT 1.4
|
||||
param set-default CA_ROTOR7_AX 0.0
|
||||
param set-default CA_ROTOR7_AY -1.0
|
||||
param set-default CA_ROTOR7_AZ 0.0
|
||||
|
||||
param set-default SIM_GZ_EC_FUNC1 101
|
||||
param set-default SIM_GZ_EC_FUNC2 102
|
||||
param set-default SIM_GZ_EC_FUNC3 103
|
||||
param set-default SIM_GZ_EC_FUNC4 104
|
||||
param set-default SIM_GZ_EC_FUNC5 105
|
||||
param set-default SIM_GZ_EC_FUNC6 106
|
||||
param set-default SIM_GZ_EC_FUNC7 107
|
||||
param set-default SIM_GZ_EC_FUNC8 108
|
||||
param set-default SIM_GZ_EC_FUNC9 301
|
||||
param set-default SIM_GZ_EC_FUNC10 302
|
||||
param set-default SIM_GZ_EC_FUNC11 303
|
||||
param set-default SIM_GZ_EC_FUNC12 304
|
||||
|
||||
param set-default SIM_GZ_EC_MIN1 0
|
||||
param set-default SIM_GZ_EC_MIN2 0
|
||||
param set-default SIM_GZ_EC_MIN3 0
|
||||
param set-default SIM_GZ_EC_MIN4 0
|
||||
param set-default SIM_GZ_EC_MIN5 0
|
||||
param set-default SIM_GZ_EC_MIN6 0
|
||||
param set-default SIM_GZ_EC_MIN7 0
|
||||
param set-default SIM_GZ_EC_MIN8 0
|
||||
param set-default SIM_GZ_EC_MIN9 1100
|
||||
param set-default SIM_GZ_EC_MIN10 1100
|
||||
param set-default SIM_GZ_EC_MIN11 1100
|
||||
param set-default SIM_GZ_EC_MIN12 1100
|
||||
|
||||
param set-default SIM_GZ_EC_MAX1 10000
|
||||
param set-default SIM_GZ_EC_MAX2 10000
|
||||
param set-default SIM_GZ_EC_MAX3 10000
|
||||
param set-default SIM_GZ_EC_MAX4 10000
|
||||
param set-default SIM_GZ_EC_MAX5 10000
|
||||
param set-default SIM_GZ_EC_MAX6 10000
|
||||
param set-default SIM_GZ_EC_MAX7 10000
|
||||
param set-default SIM_GZ_EC_MAX8 10000
|
||||
param set-default SIM_GZ_EC_MAX9 1900
|
||||
param set-default SIM_GZ_EC_MAX10 1900
|
||||
param set-default SIM_GZ_EC_MAX11 1900
|
||||
param set-default SIM_GZ_EC_MAX12 1900
|
||||
|
||||
# Controller Tunings
|
||||
param set SC_YAWRATE_P 3.335
|
||||
param set SC_YAWRATE_I 0.87
|
||||
param set SC_YAWRATE_D 0.15
|
||||
param set SC_YR_INT_LIM 0.2
|
||||
param set SC_YAW_P 3.0
|
||||
|
||||
param set SPC_POS_P 0.20
|
||||
param set SPC_VEL_P 6.55
|
||||
param set SPC_VEL_I 0.0
|
||||
param set SPC_VEL_D 0.0
|
||||
param set SPC_VEL_MAX 12.0
|
||||
@@ -118,6 +118,7 @@ px4_add_romfs_files(
|
||||
60002_gz_uuv_bluerov2_heavy
|
||||
|
||||
70000_gz_atmos
|
||||
70001_gz_atmos_dual
|
||||
|
||||
# [22000, 22999] Reserve for custom models
|
||||
)
|
||||
|
||||
@@ -159,24 +159,19 @@ if [ -n "${PX4_SIM_MODEL#*gz_}" ] && [ -z "${PX4_GZ_MODEL_NAME}" ]; then
|
||||
fi
|
||||
|
||||
# Set up camera to follow the model if requested
|
||||
if [ -n "${PX4_GZ_FOLLOW}" ]; then
|
||||
if [ -z "${PX4_GZ_NO_FOLLOW}" ]; then
|
||||
|
||||
echo "INFO [init] Setting camera to follow ${MODEL_NAME_INSTANCE}"
|
||||
|
||||
# Set camera to follow the model
|
||||
${gz_command} service -s "/gui/follow" --reqtype gz.msgs.StringMsg \
|
||||
--reptype gz.msgs.Boolean --timeout 5000 \
|
||||
--req "data: \"${MODEL_NAME_INSTANCE}\"" > /dev/null 2>&1
|
||||
|
||||
# Set default camera offset if not specified
|
||||
follow_x=${PX4_GZ_FOLLOW_OFFSET_X:--2.0}
|
||||
follow_y=${PX4_GZ_FOLLOW_OFFSET_Y:--2.0}
|
||||
follow_z=${PX4_GZ_FOLLOW_OFFSET_Z:-2.0}
|
||||
|
||||
# Set camera offset
|
||||
${gz_command} service -s "/gui/follow/offset" --reqtype gz.msgs.Vector3d \
|
||||
--reptype gz.msgs.Boolean --timeout 5000 \
|
||||
--req "x: ${follow_x}, y: ${follow_y}, z: ${follow_z}" > /dev/null 2>&1
|
||||
${gz_command} topic -t /gui/track -m gz.msgs.CameraTrack \
|
||||
-p "track_mode: FOLLOW, follow_target: {name: '${MODEL_NAME_INSTANCE}'},\
|
||||
follow_offset: {x: ${follow_x}, y: ${follow_y}, z: ${follow_z}}, follow_pgain: 1.0, track_pgain: 1.0"
|
||||
|
||||
echo "INFO [init] Camera follow offset set to ${follow_x}, ${follow_y}, ${follow_z}"
|
||||
fi
|
||||
|
||||
@@ -126,15 +126,6 @@ then
|
||||
set AUTOCNF yes
|
||||
fi
|
||||
|
||||
# Allow overriding parameters via env variables: export PX4_PARAM_{name}={value}
|
||||
env | while IFS='=' read -r line; do
|
||||
value=${line#*=}
|
||||
name=${line%%=*}
|
||||
case $name in
|
||||
"PX4_PARAM_"*) param set "${name#PX4_PARAM_}" "$value" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# multi-instance setup
|
||||
# shellcheck disable=SC2154
|
||||
param set MAV_SYS_ID $((px4_instance+1))
|
||||
@@ -238,6 +229,15 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Allow overriding parameters via env variables: export PX4_PARAM_{name}={value}
|
||||
env | while IFS='=' read -r line; do
|
||||
value=${line#*=}
|
||||
name=${line%%=*}
|
||||
case $name in
|
||||
"PX4_PARAM_"*) param set "${name#PX4_PARAM_}" "$value" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
dataman start
|
||||
|
||||
# only start the simulator if not in replay mode, as both control the lockstep time
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
param set UAVCAN_ENABLE 0
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#
|
||||
# @board px4_fmu-v2 exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
# @board px4_fmu-v6x exclude
|
||||
# @board ark_fmu-v6x exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
@@ -40,8 +42,6 @@ param set-default FW_P_LIM_MAX 25
|
||||
param set-default FW_P_LIM_MIN -5
|
||||
param set-default FW_P_RMAX_NEG 20
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#
|
||||
# @board px4_fmu-v2 exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
# @board px4_fmu-v6x exclude
|
||||
# @board ark_fmu-v6x exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
@@ -37,8 +39,6 @@ param set-default FW_P_LIM_MAX 25
|
||||
param set-default FW_P_LIM_MIN -5
|
||||
param set-default FW_P_RMAX_NEG 20
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.3
|
||||
param set-default CA_SV_CS_COUNT 4
|
||||
|
||||
@@ -32,7 +32,6 @@ param set-default FW_WR_IMAX 0.8
|
||||
param set-default FW_WR_P 1
|
||||
param set-default FW_W_RMAX 0
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_SV_CS_COUNT 7
|
||||
param set-default CA_SV_CS0_TRQ_R -0.5
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
|
||||
. ${R}etc/init.d/rc.fw_defaults
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 1
|
||||
param set-default CA_ROTOR0_PX 0.15
|
||||
param set-default CA_SV_CS_COUNT 2
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#
|
||||
# @board px4_fmu-v2 exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
# @board px4_fmu-v6x exclude
|
||||
# @board ark_fmu-v6x exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
@@ -75,9 +77,6 @@ param set-default NAV_ACC_RAD 2
|
||||
param set-default RTL_DESCEND_ALT 5
|
||||
param set-default RTL_RETURN_ALT 5
|
||||
|
||||
# Logging Parameters
|
||||
param set-default SDLOG_PROFILE 131
|
||||
|
||||
# Sensors Parameters
|
||||
param set-default SENS_CM8JL65_CFG 104
|
||||
param set-default SENS_FLOW_MAXHGT 25
|
||||
|
||||
@@ -78,9 +78,6 @@ param set-default NAV_ACC_RAD 2
|
||||
param set-default RTL_DESCEND_ALT 5
|
||||
param set-default RTL_RETURN_ALT 5
|
||||
|
||||
# Logging Parameters
|
||||
param set-default SDLOG_PROFILE 131
|
||||
|
||||
# Sensors Parameters
|
||||
param set-default SENS_CM8JL65_CFG 202
|
||||
param set-default SENS_FLOW_MAXHGT 25
|
||||
|
||||
@@ -29,9 +29,6 @@ param set-default MPC_MAN_TILT_MAX 60
|
||||
|
||||
param set-default THR_MDL_FAC 0.3
|
||||
|
||||
# enable high-rate logging profile (helps with tuning)
|
||||
param set-default SDLOG_PROFILE 19
|
||||
|
||||
param set-default IMU_DGYRO_CUTOFF 50
|
||||
param set-default IMU_GYRO_CUTOFF 90
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#
|
||||
# @board px4_fmu-v2 exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
# @board px4_fmu-v6x exclude
|
||||
# @board ark_fmu-v6x exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#
|
||||
# @board px4_fmu-v2 exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
# @board px4_fmu-v6x exclude
|
||||
# @board ark_fmu-v6x exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
# @board px4_fmu-v4pro exclude
|
||||
# @board px4_fmu-v5 exclude
|
||||
# @board px4_fmu-v5x exclude
|
||||
# @board px4_fmu-v6x exclude
|
||||
# @board bitcraze_crazyflie exclude
|
||||
# @board ark_fmu-v6x exclude
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
|
||||
. ${R}etc/init.d/rc.sc_defaults
|
||||
|
||||
# Overwrite DDS AG IP to `192.168.0.1`
|
||||
param set-default UXRCE_DDS_AG_IP -1062731775
|
||||
|
||||
param set-default CA_AIRFRAME 14
|
||||
param set-default MAV_TYPE 45
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ set VEHICLE_TYPE fw
|
||||
# MAV_TYPE_FIXED_WING 1
|
||||
param set-default MAV_TYPE 1
|
||||
|
||||
param set-default CA_AIRFRAME 1
|
||||
|
||||
#
|
||||
# Default parameters for fixed wing UAVs.
|
||||
#
|
||||
|
||||
@@ -41,3 +41,9 @@ if param compare -s MC_NN_EN 1
|
||||
then
|
||||
mc_nn_control start
|
||||
fi
|
||||
|
||||
|
||||
if param compare -s MC_RAPTOR_ENABLE 1
|
||||
then
|
||||
mc_raptor start
|
||||
fi
|
||||
|
||||
@@ -8,9 +8,6 @@ set VEHICLE_TYPE spacecraft
|
||||
# MAV_TYPE_SPACECRAFT_ORBITTER
|
||||
param set-default MAV_TYPE 45
|
||||
|
||||
# Set micro-dds-client to use ethernet and IP-address 192.168.0.1
|
||||
param set-default UXRCE_DDS_AG_IP -1062731775
|
||||
|
||||
# Disable preflight disarm to not interfere with external launching
|
||||
param set-default COM_DISARM_PRFLT -1
|
||||
param set-default CBRK_SUPPLY_CHK 894281
|
||||
|
||||
@@ -8,17 +8,24 @@
|
||||
# Begin Optional drivers #
|
||||
###############################################################################
|
||||
|
||||
%ifdef CONFIG_DRIVERS_BATT_SMBUS
|
||||
if param compare -s SENS_EN_BATT 1
|
||||
then
|
||||
batt_smbus start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_SMART_BATTERY_BATMON
|
||||
# Start batmon driver if enabled using BATMON_DRIVER_EN
|
||||
if param compare -s BATMON_DRIVER_EN 1
|
||||
then
|
||||
batmon start -X #start on external bus
|
||||
fi
|
||||
%endif
|
||||
|
||||
|
||||
%ifdef CONFIG_DRIVERS_PWM_INPUT
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_LL40LS
|
||||
# Sensors on the PWM interface bank
|
||||
if param compare -s SENS_EN_LL40LS 1
|
||||
then
|
||||
@@ -27,92 +34,121 @@ then
|
||||
ll40ls_pwm start
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
# External automatic trigger system
|
||||
if param compare FD_EXT_ATS_EN 1
|
||||
then
|
||||
pwm_input start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_LL40LS
|
||||
# Lidar-Lite on I2C
|
||||
if param compare -s SENS_EN_LL40LS 2
|
||||
then
|
||||
ll40ls start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_MAPPYDOT
|
||||
# mappydot lidar sensor
|
||||
if param compare -s SENS_EN_MPDT 1
|
||||
then
|
||||
mappydot start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_MB12XX
|
||||
# mb12xx sonar sensor
|
||||
if param greater -s SENS_EN_MB12XX 0
|
||||
then
|
||||
mb12xx start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_PGA460
|
||||
# pga460 sonar sensor
|
||||
if param greater -s SENS_EN_PGA460 0
|
||||
then
|
||||
pga460 start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_LASER_I2C
|
||||
# Lightware i2c lidar sensor
|
||||
if param greater -s SENS_EN_SF1XX 0
|
||||
then
|
||||
lightware_laser_i2c start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_SRF05
|
||||
# Sensor HY-SRF05 or HC-SR05 ultrasonic sensor
|
||||
if param compare -s SENS_EN_SR05 1
|
||||
then
|
||||
srf05 start
|
||||
fi
|
||||
%endif
|
||||
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_TERARANGER
|
||||
# Teraranger one tof sensor
|
||||
if param greater -s SENS_EN_TRANGER 0
|
||||
then
|
||||
teraranger start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_OPTICAL_FLOW_PAA3905
|
||||
# paa3905 optical flow sensor (external SPI)
|
||||
if param greater -s SENS_EN_PAA3905 0
|
||||
then
|
||||
paa3905 -S start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_OPTICAL_FLOW_PAW3902
|
||||
# paw3902 optical flow sensor (external SPI)
|
||||
if param greater -s SENS_EN_PAW3902 0
|
||||
then
|
||||
paw3902 -S start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_OPTICAL_FLOW_PMW3901
|
||||
# pmw3901 optical flow sensor (external SPI)
|
||||
if param greater -s SENS_EN_PMW3901 0
|
||||
then
|
||||
pmw3901 -S start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L0X
|
||||
# vl53l0x i2c distance sensor
|
||||
if param compare -s SENS_EN_VL53L0X 1
|
||||
then
|
||||
vl53l0x start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L1X
|
||||
# vl53l1x i2c distance sensor
|
||||
if param compare -s SENS_EN_VL53L1X 1
|
||||
then
|
||||
vl53l1x start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DISTANCE_SENSOR_TF02PRO
|
||||
# tf02 pro i2c distance sensor
|
||||
if param compare -s SENS_EN_TF02PRO 1
|
||||
then
|
||||
tf02pro start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448
|
||||
# ADIS16448 spi external IMU
|
||||
if param compare -s SENS_EN_ADIS164X 1
|
||||
then
|
||||
@@ -125,25 +161,33 @@ then
|
||||
adis16448 -S start -R 4
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16507
|
||||
# ADIS16507 spi external IMU
|
||||
if param greater -s SENS_EN_ADIS165X 0
|
||||
then
|
||||
adis16507 -S start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_IMU_MURATA_SCH16T
|
||||
# SCH16T spi external IMU
|
||||
if param compare -s SENS_EN_SCH16T 1
|
||||
then
|
||||
sch16t -S start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_ETS
|
||||
# Eagle Tree airspeed sensor external I2C
|
||||
if param compare -s SENS_EN_ETSASPD 1
|
||||
then
|
||||
ets_airspeed start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_SDP3X
|
||||
# Sensirion SDP3X differential pressure sensor external I2C
|
||||
if param compare -s SENS_EN_SDP3X 1
|
||||
then
|
||||
@@ -153,98 +197,171 @@ then
|
||||
sdp3x start -X -a 0x22
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_TEMPERATURE_SENSOR_MCP9808
|
||||
# Microchip MCP9808 temperature sensor external I2C
|
||||
if param compare -s SENS_EN_MCP9808 1
|
||||
then
|
||||
mcp9808 start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_MS4515
|
||||
# TE MS4515 differential pressure sensor external I2C
|
||||
if param compare -s SENS_EN_MS4515 1
|
||||
then
|
||||
ms4515 start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_MS4525DO
|
||||
# TE MS4525DO differential pressure sensor external I2C
|
||||
if param compare -s SENS_EN_MS4525DO 1
|
||||
then
|
||||
ms4525do start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_MS5525DSO
|
||||
# TE MS5525DSO differential pressure sensor external I2C
|
||||
if param compare -s SENS_EN_MS5525DS 1
|
||||
then
|
||||
ms5525dso start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_ASP5033
|
||||
# TE ASP5033 differential pressure sensor external I2C
|
||||
if param compare -s SENS_EN_ASP5033 1
|
||||
then
|
||||
asp5033 start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_AUAV
|
||||
# AUAV absolute/differential pressure sensor external I2C
|
||||
if param greater -s SENS_EN_AUAVX 0
|
||||
then
|
||||
auav start -D -X
|
||||
auav start -A -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_HYGROMETER_SHT3X
|
||||
# SHT3x temperature and hygrometer sensor, external I2C
|
||||
if param compare -s SENS_EN_SHT3X 1
|
||||
then
|
||||
sht3x start -X
|
||||
sht3x start -X -a 0x45
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_IRLOCK
|
||||
# IR-LOCK sensor external I2C
|
||||
if param compare -s SENS_EN_IRLOCK 1
|
||||
then
|
||||
irlock start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_BAROMETER_GOERTEK_SPL06
|
||||
# SPL06 sensor external I2C
|
||||
if param compare -s SENS_EN_SPL06 1
|
||||
then
|
||||
spl06 -X start
|
||||
spl06 -X -a 0x77 start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_BAROMETER_GOERTEK_SPA06
|
||||
# SPA06 sensor external I2C
|
||||
if param compare -s SENS_EN_SPA06 1
|
||||
then
|
||||
spa06 -X start
|
||||
spa06 -X -a 0x77 start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_RPM_PCF8583
|
||||
# PCF8583 counter (RPM sensor)
|
||||
if param compare -s SENS_EN_PCF8583 1
|
||||
then
|
||||
pcf8583 start -X
|
||||
pcf8583 start -X -a 0x51
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_ADC_ADS7953
|
||||
# ADC sensor ADS7953 external SPI
|
||||
if param compare -s ADC_ADS7953_EN 1
|
||||
then
|
||||
ads7953 start -S
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_ADC_TLA2528
|
||||
# ADC sensor tla2528 external I2C
|
||||
if param compare -s ADC_TLA2528_EN 1
|
||||
then
|
||||
tla2528 start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_TEMPERATURE_SENSOR_TMP102
|
||||
# Start TMP102 temperature sensor
|
||||
if param compare -s SENS_EN_TMP102 1
|
||||
then
|
||||
tmp102 start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef COMMON_MAGNETOMETER
|
||||
# probe for optional external I2C devices
|
||||
if param compare SENS_EXT_I2C_PRB 1
|
||||
then
|
||||
%ifdef CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948
|
||||
icm20948_i2c_passthrough -X -q start
|
||||
%endif
|
||||
|
||||
# compasses
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_HMC5883
|
||||
hmc5883 -T -X -q start
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_ST_IIS2MDC
|
||||
iis2mdc -X -q start
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8308
|
||||
ist8308 -X -q start
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310
|
||||
ist8310 -X -q start
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_LIS3MDL
|
||||
if ! lis3mdl -X -q start
|
||||
then
|
||||
lis3mdl -X -q -a 0x1c start
|
||||
fi
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_QMC5883L
|
||||
qmc5883l -X -q start
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_QMC5883P
|
||||
qmc5883p -X -q start
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_RM3100
|
||||
rm3100 -X -q start
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_BOSCH_BMM350
|
||||
bmm350 -X -q start
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_ST_IIS2MDC
|
||||
iis2mdc -X -q start
|
||||
%endif
|
||||
|
||||
# start last (wait for possible icm20948 passthrough mode)
|
||||
%ifdef CONFIG_DRIVERS_MAGNETOMETER_AKM_AK09916
|
||||
ak09916 -X -q start
|
||||
%endif
|
||||
fi
|
||||
%endif
|
||||
|
||||
+104
-13
@@ -265,12 +265,15 @@ else
|
||||
# Start the tone_alarm driver.
|
||||
# Needs to be started after the parameters are loaded (for CBRK_BUZZER).
|
||||
#
|
||||
%ifdef CONFIG_DRIVERS_TONE_ALARM
|
||||
tone_alarm start
|
||||
%endif
|
||||
|
||||
#
|
||||
# Waypoint storage.
|
||||
# REBOOTWORK this needs to start in parallel.
|
||||
#
|
||||
%ifdef CONFIG_MODULES_DATAMAN
|
||||
if param compare -s SYS_DM_BACKEND 1
|
||||
then
|
||||
dataman start -r
|
||||
@@ -281,11 +284,14 @@ else
|
||||
dataman start
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
#
|
||||
# Start the socket communication send_event handler.
|
||||
#
|
||||
%ifdef CONFIG_MODULES_SEND_EVENT
|
||||
send_event start
|
||||
%endif
|
||||
|
||||
#
|
||||
# Start the hardfault streamer.
|
||||
@@ -298,15 +304,25 @@ else
|
||||
#
|
||||
# Start the resource load monitor.
|
||||
#
|
||||
%ifdef CONFIG_MODULES_LOAD_MON
|
||||
load_mon start
|
||||
%endif
|
||||
|
||||
#
|
||||
# Start system state indicator.
|
||||
#
|
||||
%ifdef CONFIG_DRIVERS_LIGHTS_RGBLED
|
||||
rgbled start -X -q
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C
|
||||
rgbled_ncp5623c start -X -q
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_LIGHTS_RGBLED_LP5562
|
||||
rgbled_lp5562 start -X -q
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_LIGHTS_RGBLED_IS31FL3195
|
||||
rgbled_is31fl3195 start -X -q
|
||||
%endif
|
||||
|
||||
#
|
||||
# Override parameters from user configuration file.
|
||||
@@ -331,11 +347,21 @@ else
|
||||
# start the simulator in hardware if needed
|
||||
if param compare SYS_HITL 2
|
||||
then
|
||||
%ifdef CONFIG_MODULES_SIMULATION_SIMULATOR_SIH
|
||||
simulator_sih start
|
||||
%endif
|
||||
%ifdef CONFIG_MODULES_SIMULATION_SENSOR_BARO_SIM
|
||||
sensor_baro_sim start
|
||||
%endif
|
||||
%ifdef CONFIG_MODULES_SIMULATION_SENSOR_MAG_SIM
|
||||
sensor_mag_sim start
|
||||
%endif
|
||||
%ifdef CONFIG_MODULES_SIMULATION_SENSOR_GPS_SIM
|
||||
sensor_gps_sim start
|
||||
%endif
|
||||
%ifdef CONFIG_MODULES_SIMULATION_SENSOR_AGP_SIM
|
||||
sensor_agp_sim start
|
||||
%endif
|
||||
fi
|
||||
|
||||
else
|
||||
@@ -352,43 +378,58 @@ else
|
||||
|
||||
. ${R}etc/init.d/rc.sensors
|
||||
|
||||
%ifdef CONFIG_MODULES_SENSORS
|
||||
%ifdef CONFIG_MODULES_ESC_BATTERY
|
||||
if param compare -s BAT1_SOURCE 2
|
||||
then
|
||||
esc_battery start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_MODULES_BATTERY_STATUS
|
||||
if ! param compare BAT1_SOURCE 1
|
||||
then
|
||||
battery_status start
|
||||
fi
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_MODULES_SENSORS
|
||||
sensors start
|
||||
%endif
|
||||
fi
|
||||
|
||||
#
|
||||
# state estimator selection
|
||||
#
|
||||
%ifdef CONFIG_MODULES_EKF2
|
||||
if param compare -s EKF2_EN 1
|
||||
then
|
||||
ekf2 start &
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR
|
||||
if param compare -s LPE_EN 1
|
||||
then
|
||||
local_position_estimator start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q
|
||||
if param compare -s ATT_EN 1
|
||||
then
|
||||
attitude_estimator_q start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_DRIVERS_PX4IO
|
||||
#
|
||||
# px4io
|
||||
#
|
||||
if px4io supported
|
||||
then
|
||||
# Check if PX4IO present and update firmware if needed.
|
||||
# Check if PX4IO present and update firmware if needed.
|
||||
if [ -f $IOFW ]
|
||||
then
|
||||
if ! px4io checkcrc ${IOFW}
|
||||
@@ -418,40 +459,56 @@ else
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Heater driver for temperature regulated IMUs.
|
||||
# The heater needs to start after px4io.
|
||||
%ifdef CONFIG_DRIVERS_HEATER
|
||||
if param compare -s SENS_EN_THERMAL 1
|
||||
then
|
||||
heater start
|
||||
fi
|
||||
%endif
|
||||
|
||||
|
||||
#
|
||||
# RC update (map raw RC input to calibrate manual control)
|
||||
# start before commander
|
||||
#
|
||||
%ifdef CONFIG_MODULES_RC_UPDATE
|
||||
rc_update start
|
||||
%endif
|
||||
%ifdef CONFIG_MODULES_MANUAL_CONTROL
|
||||
manual_control start
|
||||
%endif
|
||||
|
||||
# Start camera trigger, capture and PPS before pwm_out as they might access
|
||||
# pwm pins
|
||||
%ifdef CONFIG_DRIVERS_CAMERA_TRIGGER
|
||||
if param greater -s TRIG_MODE 0
|
||||
then
|
||||
camera_trigger start
|
||||
%ifdef CONFIG_MODULES_CAMERA_FEEDBACK
|
||||
camera_feedback start
|
||||
%endif
|
||||
fi
|
||||
%endif
|
||||
# PPS capture driver
|
||||
%ifdef CONFIG_DRIVERS_PPS_CAPTURE
|
||||
if param greater -s PPS_CAP_ENABLE 0
|
||||
then
|
||||
pps_capture start
|
||||
fi
|
||||
%endif
|
||||
# RPM capture driver
|
||||
%ifdef CONFIG_DRIVERS_RPM_CAPTURE
|
||||
if param greater -s RPM_CAP_ENABLE 0
|
||||
then
|
||||
rpm_capture start
|
||||
fi
|
||||
%endif
|
||||
# Camera capture driver
|
||||
%ifdef CONFIG_DRIVERS_CAMERA_CAPTURE
|
||||
if param greater -s CAM_CAP_FBACK 0
|
||||
then
|
||||
if camera_capture start
|
||||
@@ -459,25 +516,34 @@ else
|
||||
camera_capture on
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
#
|
||||
# Commander
|
||||
#
|
||||
%ifdef CONFIG_MODULES_COMMANDER
|
||||
if param greater SYS_HITL 0
|
||||
then
|
||||
commander start -h
|
||||
|
||||
%ifdef CONFIG_MODULES_SIMULATION_PWM_OUT_SIM
|
||||
if ! pwm_out_sim start -m hil
|
||||
then
|
||||
tune_control play error
|
||||
fi
|
||||
%endif
|
||||
|
||||
else
|
||||
commander start
|
||||
|
||||
%ifdef CONFIG_DRIVERS_DSHOT
|
||||
dshot start
|
||||
%endif
|
||||
%ifdef CONFIG_DRIVERS_PWM_OUT
|
||||
pwm_out start
|
||||
%endif
|
||||
fi
|
||||
%endif
|
||||
|
||||
#
|
||||
# Configure vehicle type specific parameters.
|
||||
@@ -485,10 +551,12 @@ else
|
||||
. ${R}etc/init.d/rc.vehicle_setup
|
||||
|
||||
# Pre-takeoff continuous magnetometer calibration
|
||||
%ifdef CONFIG_MODULES_MAG_BIAS_ESTIMATOR
|
||||
if param compare -s MBE_ENABLE 1
|
||||
then
|
||||
mag_bias_estimator start
|
||||
fi
|
||||
%endif
|
||||
|
||||
#
|
||||
# Optional board mavlink streams: rc.board_mavlink
|
||||
@@ -533,54 +601,67 @@ else
|
||||
#
|
||||
# Start the navigator.
|
||||
#
|
||||
%ifdef CONFIG_MODULES_NAVIGATOR
|
||||
navigator start
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_MODULES_TEMPERATURE_COMPENSATION
|
||||
#
|
||||
# Start a thermal calibration if required.
|
||||
#
|
||||
set RC_THERMAL_CAL ${R}etc/init.d/rc.thermal_cal
|
||||
if [ -f ${RC_THERMAL_CAL} ]
|
||||
then
|
||||
. ${RC_THERMAL_CAL}
|
||||
fi
|
||||
unset RC_THERMAL_CAL
|
||||
. ${R}etc/init.d/rc.thermal_cal
|
||||
%endif
|
||||
|
||||
#
|
||||
# Start gimbal to control mounts such as gimbals, disabled by default.
|
||||
#
|
||||
%ifdef CONFIG_MODULES_GIMBAL
|
||||
if param greater -s MNT_MODE_IN -1
|
||||
then
|
||||
gimbal start
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Blacksheep telemetry
|
||||
%ifdef CONFIG_DRIVERS_TELEMETRY_BST
|
||||
if param compare -s TEL_BST_EN 1
|
||||
then
|
||||
bst start -X
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_MODULES_GYRO_FFT
|
||||
if param compare -s IMU_GYRO_FFT_EN 1
|
||||
then
|
||||
gyro_fft start
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_MODULES_GYRO_CALIBRATION
|
||||
if param compare -s IMU_GYRO_CAL_EN 1
|
||||
then
|
||||
gyro_calibration start
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Check for px4flow sensor
|
||||
%ifdef CONFIG_DRIVERS_OPTICAL_FLOW_PX4FLOW
|
||||
if param compare -s SENS_EN_PX4FLOW 1
|
||||
then
|
||||
px4flow start -X &
|
||||
fi
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_MODULES_PAYLOAD_DELIVERER
|
||||
payload_deliverer start
|
||||
%endif
|
||||
|
||||
%ifdef CONFIG_MODULES_INTERNAL_COMBUSTION_ENGINE_CONTROL
|
||||
if param compare -s ICE_EN 1
|
||||
then
|
||||
internal_combustion_engine_control start
|
||||
fi
|
||||
%endif
|
||||
|
||||
#
|
||||
# Optional board supplied extras: rc.board_extras
|
||||
@@ -602,15 +683,12 @@ else
|
||||
. $FEXTRAS
|
||||
fi
|
||||
|
||||
%ifdef CONFIG_MODULES_LOGGER
|
||||
#
|
||||
# Start the logger.
|
||||
#
|
||||
set RC_LOGGING ${R}etc/init.d/rc.logging
|
||||
if [ -f ${RC_LOGGING} ]
|
||||
then
|
||||
. ${RC_LOGGING}
|
||||
fi
|
||||
unset RC_LOGGING
|
||||
. ${R}etc/init.d/rc.logging
|
||||
%endif
|
||||
|
||||
#
|
||||
# Set additional parameters and env variables for selected AUTOSTART.
|
||||
@@ -631,6 +709,7 @@ else
|
||||
#
|
||||
# Check if UAVCAN is enabled, default to it for ESCs.
|
||||
#
|
||||
%ifdef CONFIG_DRIVERS_UAVCAN
|
||||
if param greater -s UAVCAN_ENABLE 0
|
||||
then
|
||||
# Start core UAVCAN module.
|
||||
@@ -639,15 +718,27 @@ else
|
||||
tune_control play error
|
||||
fi
|
||||
else
|
||||
%ifdef CONFIG_DRIVERS_CYPHAL
|
||||
if param greater -s CYPHAL_ENABLE 0
|
||||
then
|
||||
cyphal start
|
||||
fi
|
||||
%endif
|
||||
fi
|
||||
%else
|
||||
%ifdef CONFIG_DRIVERS_CYPHAL
|
||||
if param greater -s CYPHAL_ENABLE 0
|
||||
then
|
||||
cyphal start
|
||||
fi
|
||||
%endif
|
||||
%endif
|
||||
%ifdef CONFIG_MODULES_ZENOH
|
||||
if param greater -s ZENOH_ENABLE 0
|
||||
then
|
||||
zenoh start
|
||||
fi
|
||||
%endif
|
||||
|
||||
#
|
||||
# End of autostart.
|
||||
|
||||
@@ -21,11 +21,13 @@ exec find boards msg src platforms test \
|
||||
-path src/lib/crypto/monocypher -prune -o \
|
||||
-path src/lib/events/libevents -prune -o \
|
||||
-path src/lib/parameters/uthash -prune -o \
|
||||
-path src/lib/rl_tools/rl_tools -prune -o \
|
||||
-path src/lib/wind_estimator/python/generated -prune -o \
|
||||
-path src/modules/ekf2/EKF/python/ekf_derivation/generated -prune -o \
|
||||
-path src/modules/ekf2/EKF/yaw_estimator/derivation/generated -prune -o \
|
||||
-path src/modules/gyro_fft/CMSIS_5 -prune -o \
|
||||
-path src/modules/mavlink/mavlink -prune -o \
|
||||
-path src/modules/mc_raptor/blob -prune -o \
|
||||
-path test/fuzztest -prune -o \
|
||||
-path test/mavsdk_tests/catch2 -prune -o \
|
||||
-path src/lib/crypto/monocypher -prune -o \
|
||||
|
||||
@@ -17,37 +17,12 @@ if [[ -f $1"/.git" || -d $1"/.git" ]]; then
|
||||
SUBMODULE_STATUS=$(git submodule summary "$1")
|
||||
STATUSRETVAL=$(echo $SUBMODULE_STATUS | grep -A20 -i "$1")
|
||||
if ! [[ -z "$STATUSRETVAL" ]]; then
|
||||
echo -e "\033[31mChecked $1 submodule, ACTION REQUIRED:\033[0m"
|
||||
echo ""
|
||||
echo -e "Different commits:"
|
||||
echo -e "\033[33mWarning: $1 submodule has uncommitted changes:\033[0m"
|
||||
echo -e "$SUBMODULE_STATUS"
|
||||
echo ""
|
||||
echo -e "To update submodules to the expected version, run:"
|
||||
echo -e " \033[94mgit submodule sync --recursive && git submodule update --init --recursive\033[0m"
|
||||
echo ""
|
||||
echo -e " *******************************************************************************"
|
||||
echo -e " * \033[31mIF YOU DID NOT CHANGE THIS FILE (OR YOU DON'T KNOW WHAT A SUBMODULE IS):\033[0m *"
|
||||
echo -e " * \033[31mHit 'u' and <ENTER> to update ALL submodules and resolve this.\033[0m *"
|
||||
echo -e " * (performs \033[94mgit submodule sync --recursive\033[0m *"
|
||||
echo -e " * and \033[94mgit submodule update --init --recursive\033[0m ) *"
|
||||
echo -e " *******************************************************************************"
|
||||
echo ""
|
||||
echo ""
|
||||
echo -e " Only for EXPERTS:"
|
||||
echo -e " $1 submodule is not in the recommended version."
|
||||
echo -e " Hit 'y' and <ENTER> to continue the build with this version. Hit <ENTER> to resolve manually."
|
||||
echo -e " Use \033[94mgit add $1 && git commit -m 'Updated $1'\033[0m to choose this version (careful!)"
|
||||
echo ""
|
||||
read user_cmd
|
||||
if [ "$user_cmd" == "y" ]; then
|
||||
echo "Continuing build with manually overridden submodule.."
|
||||
elif [ "$user_cmd" == "u" ]; then
|
||||
git submodule sync --recursive -- $1
|
||||
git submodule update --init --recursive -- $1 || true
|
||||
git submodule update --init --recursive --force -- $1
|
||||
echo "Submodule fixed, continuing build.."
|
||||
else
|
||||
echo "Build aborted."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
git submodule --quiet sync --recursive --quiet -- $1
|
||||
|
||||
@@ -25,15 +25,15 @@ parser.add_argument('-p', '--pretty', dest='pretty', action='store_true',
|
||||
help='Pretty output instead of a single line')
|
||||
parser.add_argument('-g', '--groups', dest='group', action='store_true',
|
||||
help='Groups targets')
|
||||
parser.add_argument('-f', '--filter', dest='filter', help='comma separated list of board names to use instead of all')
|
||||
parser.add_argument('-f', '--filter', dest='filter', help='comma separated list of build target name prefixes to include instead of all e.g. "px4_fmu-v5_"')
|
||||
|
||||
args = parser.parse_args()
|
||||
verbose = args.verbose
|
||||
|
||||
board_filter = []
|
||||
target_filter = []
|
||||
if args.filter:
|
||||
for board in args.filter.split(','):
|
||||
board_filter.append(board)
|
||||
for target in args.filter.split(','):
|
||||
target_filter.append(target)
|
||||
|
||||
default_container = 'ghcr.io/px4/px4-dev:v1.16.0-rc1-258-g0369abd556'
|
||||
build_configs = []
|
||||
@@ -144,7 +144,7 @@ for manufacturer in os.scandir(os.path.join(source_dir, '../boards')):
|
||||
label = files.name[:-9]
|
||||
target_name = manufacturer.name + '_' + board.name + '_' + label
|
||||
|
||||
if board_filter and not board_name in board_filter:
|
||||
if target_filter and not any(target_name.startswith(f) for f in target_filter):
|
||||
if verbose: print(f'excluding board {board_name} ({target_name})')
|
||||
continue
|
||||
|
||||
|
||||
@@ -238,6 +238,7 @@ def get_actuator_output(yaml_config, output_functions, timer_config_file, verbos
|
||||
( 'disarmed', 'Disarmed', 'DIS', False ),
|
||||
( 'min', 'Minimum', 'MIN', False ),
|
||||
( 'max', 'Maximum', 'MAX', False ),
|
||||
( 'center', 'Center\n(for Servos)', 'CENT', False ),
|
||||
( 'failsafe', 'Failsafe', 'FAIL', True ),
|
||||
]
|
||||
for key, label, param_suffix, advanced in standard_params_array:
|
||||
|
||||
@@ -284,6 +284,9 @@ Note that non-motor outputs might already be active in prearm state if COM_PREAR
|
||||
'''
|
||||
minimum_description = \
|
||||
'''Minimum output value (when not disarmed).
|
||||
'''
|
||||
center_description = \
|
||||
'''Servo Center output value (when not disarmed).
|
||||
'''
|
||||
maximum_description = \
|
||||
'''Maxmimum output value (when not disarmed).
|
||||
@@ -296,6 +299,7 @@ When set to -1 (default), the value depends on the function (see {:}).
|
||||
standard_params_array = [
|
||||
( 'disarmed', 'Disarmed', 'DIS', disarmed_description ),
|
||||
( 'min', 'Minimum', 'MIN', minimum_description ),
|
||||
( 'center', 'Center', 'CENT', center_description ),
|
||||
( 'max', 'Maximum', 'MAX', maximum_description ),
|
||||
( 'failsafe', 'Failsafe', 'FAIL', failsafe_description ),
|
||||
]
|
||||
@@ -312,6 +316,10 @@ When set to -1 (default), the value depends on the function (see {:}).
|
||||
standard_params[key]['default'] = -1
|
||||
standard_params[key]['min'] = -1
|
||||
|
||||
if key == 'center':
|
||||
standard_params[key]['default'] = -1
|
||||
standard_params[key]['min'] = -1
|
||||
|
||||
param = {
|
||||
'description': {
|
||||
'short': channel_label+' ${i} '+label+' Value',
|
||||
|
||||
@@ -1656,9 +1656,9 @@ sensor_baro_0['pressure'] = median_filter(sensor_baro_0['pressure'])
|
||||
# fit data
|
||||
median_pressure = np.median(sensor_baro_0['pressure'])
|
||||
if noResample:
|
||||
coef_baro_0_x = np.polyfit(temp_rel,100*(sensor_baro_0['pressure']-median_pressure),5) # convert from hPa to Pa
|
||||
coef_baro_0_x = np.polyfit(temp_rel,(sensor_baro_0['pressure']-median_pressure),5) # pressure in Pascal
|
||||
else:
|
||||
temperature, baro = resampleWithDeltaX(temp_rel,100*(sensor_baro_0['pressure']-median_pressure)) # convert from hPa to Pa
|
||||
temperature, baro = resampleWithDeltaX(temp_rel,(sensor_baro_0['pressure']-median_pressure)) # pressure in Pascal
|
||||
coef_baro_0_x = np.polyfit(temperature,baro,5)
|
||||
|
||||
baro_0_params['TC_B0_X5'] = coef_baro_0_x[0]
|
||||
@@ -1675,7 +1675,7 @@ baro_0_x_resample = fit_coef_baro_0_x(temp_rel_resample)
|
||||
plt.figure(13,figsize=(20,13))
|
||||
|
||||
# draw plots
|
||||
plt.plot(sensor_baro_0['temperature'],100*sensor_baro_0['pressure']-100*median_pressure,'b')
|
||||
plt.plot(sensor_baro_0['temperature'],sensor_baro_0['pressure']-median_pressure,'b')
|
||||
plt.plot(temp_resample,baro_0_x_resample,'r')
|
||||
plt.title('Baro 0 ({}) Bias vs Temperature'.format(baro_0_params['TC_B0_ID']))
|
||||
plt.ylabel('Z bias (Pa)')
|
||||
@@ -1717,9 +1717,9 @@ if num_baros >= 2:
|
||||
# fit data
|
||||
median_pressure = np.median(sensor_baro_1['pressure'])
|
||||
if noResample:
|
||||
coef_baro_1_x = np.polyfit(temp_rel,100*(sensor_baro_1['pressure']-median_pressure),5) # convert from hPa to Pa
|
||||
coef_baro_1_x = np.polyfit(temp_rel,(sensor_baro_1['pressure']-median_pressure),5) # pressure in Pascal
|
||||
else:
|
||||
temperature, baro = resampleWithDeltaX(temp_rel,100*(sensor_baro_1['pressure']-median_pressure)) # convert from hPa to Pa
|
||||
temperature, baro = resampleWithDeltaX(temp_rel,(sensor_baro_1['pressure']-median_pressure)) # pressure in Pascal
|
||||
coef_baro_1_x = np.polyfit(temperature,baro,5)
|
||||
|
||||
baro_1_params['TC_B1_X5'] = coef_baro_1_x[0]
|
||||
@@ -1736,7 +1736,7 @@ if num_baros >= 2:
|
||||
plt.figure(14,figsize=(20,13))
|
||||
|
||||
# draw plots
|
||||
plt.plot(sensor_baro_1['temperature'],100*sensor_baro_1['pressure']-100*median_pressure,'b')
|
||||
plt.plot(sensor_baro_1['temperature'],sensor_baro_1['pressure']-median_pressure,'b')
|
||||
plt.plot(temp_resample,baro_1_x_resample,'r')
|
||||
plt.title('Baro 1 ({}) Bias vs Temperature'.format(baro_1_params['TC_B1_ID']))
|
||||
plt.ylabel('Z bias (Pa)')
|
||||
@@ -1778,9 +1778,9 @@ if num_baros >= 3:
|
||||
# fit data
|
||||
median_pressure = np.median(sensor_baro_2['pressure'])
|
||||
if noResample:
|
||||
coef_baro_2_x = np.polyfit(temp_rel,100*(sensor_baro_2['pressure']-median_pressure),5) # convert from hPa to Pa
|
||||
coef_baro_2_x = np.polyfit(temp_rel,(sensor_baro_2['pressure']-median_pressure),5) # pressure in Pascal
|
||||
else:
|
||||
temperature, baro = resampleWithDeltaX(temp_rel,100*(sensor_baro_2['pressure']-median_pressure)) # convert from hPa to Pa
|
||||
temperature, baro = resampleWithDeltaX(temp_rel,(sensor_baro_2['pressure']-median_pressure)) # pressure in Pascal
|
||||
coef_baro_2_x = np.polyfit(temperature,baro,5)
|
||||
|
||||
baro_2_params['TC_B2_X5'] = coef_baro_2_x[0]
|
||||
@@ -1797,7 +1797,7 @@ if num_baros >= 3:
|
||||
plt.figure(15,figsize=(20,13))
|
||||
|
||||
# draw plots
|
||||
plt.plot(sensor_baro_2['temperature'],100*sensor_baro_2['pressure']-100*median_pressure,'b')
|
||||
plt.plot(sensor_baro_2['temperature'],sensor_baro_2['pressure']-median_pressure,'b')
|
||||
plt.plot(temp_resample,baro_2_x_resample,'r')
|
||||
plt.title('Baro 2 ({}) Bias vs Temperature'.format(baro_2_params['TC_B2_ID']))
|
||||
plt.ylabel('Z bias (Pa)')
|
||||
@@ -1838,7 +1838,7 @@ if num_baros >= 4:
|
||||
|
||||
# fit data
|
||||
median_pressure = np.median(sensor_baro_3['pressure'])
|
||||
coef_baro_3_x = np.polyfit(temp_rel,100*(sensor_baro_3['pressure']-median_pressure),5) # convert from hPa to Pa
|
||||
coef_baro_3_x = np.polyfit(temp_rel,(sensor_baro_3['pressure']-median_pressure),5) # pressure in Pascal
|
||||
baro_3_params['TC_B3_X5'] = coef_baro_3_x[0]
|
||||
baro_3_params['TC_B3_X4'] = coef_baro_3_x[1]
|
||||
baro_3_params['TC_B3_X3'] = coef_baro_3_x[2]
|
||||
@@ -1853,7 +1853,7 @@ if num_baros >= 4:
|
||||
plt.figure(16,figsize=(20,13))
|
||||
|
||||
# draw plots
|
||||
plt.plot(sensor_baro_3['temperature'],100*sensor_baro_3['pressure']-100*median_pressure,'b')
|
||||
plt.plot(sensor_baro_3['temperature'],sensor_baro_3['pressure']-median_pressure,'b')
|
||||
plt.plot(temp_resample,baro_3_x_resample,'r')
|
||||
plt.title('Baro 3 ({}) Bias vs Temperature'.format(baro_3_params['TC_B3_ID']))
|
||||
plt.ylabel('Z bias (Pa)')
|
||||
|
||||
@@ -15,7 +15,7 @@ class ModuleDocumentation(object):
|
||||
# TOC in https://github.com/PX4/PX4-Autopilot/blob/main/docs/en/SUMMARY.md
|
||||
valid_categories = ['driver', 'estimator', 'controller', 'system',
|
||||
'communication', 'command', 'template', 'simulation', 'autotune']
|
||||
valid_subcategories = ['', 'camera', 'distance_sensor', 'imu', 'ins', 'airspeed_sensor',
|
||||
valid_subcategories = ['', 'adc', 'camera', 'distance_sensor', 'imu', 'ins', 'airspeed_sensor',
|
||||
'magnetometer', 'baro', 'optical_flow', 'radio_control','rpm_sensor', 'transponder']
|
||||
|
||||
max_line_length = 80 # wrap lines that are longer than this
|
||||
|
||||
Executable
+188
@@ -0,0 +1,188 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Preprocesses ROMFS files with C preprocessor to enable KConfig support.
|
||||
|
||||
This script processes all rc* files in the ROMFS directory through the C preprocessor,
|
||||
allowing use of #ifdef, #ifndef, #if, #else, #endif directives with KConfig definitions.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def preprocess_file(file_path, kconfig_header, cpp_command):
|
||||
"""
|
||||
Preprocess a single file through the C preprocessor.
|
||||
|
||||
Uses % as the preprocessor directive symbol (instead of #) to avoid conflicts
|
||||
with shell comments. Converts %ifdef, %ifndef, %if, %else, %endif to
|
||||
#ifdef, #ifndef, #if, #else, #endif before preprocessing.
|
||||
|
||||
Args:
|
||||
file_path: Path to the file to preprocess
|
||||
kconfig_header: Path to the px4_boardconfig.h header
|
||||
cpp_command: C preprocessor command (usually the C compiler)
|
||||
"""
|
||||
# Read original file
|
||||
with open(file_path, 'r') as f:
|
||||
original_content = f.read()
|
||||
|
||||
# Process the file line by line:
|
||||
# 1. Remove shell comment lines (to avoid conflicts with CPP)
|
||||
# 2. Convert % preprocessor directives to # directives
|
||||
lines = original_content.split('\n')
|
||||
converted_lines = []
|
||||
|
||||
for line in lines:
|
||||
stripped = line.lstrip()
|
||||
|
||||
# Check if line starts with % followed by a preprocessor keyword
|
||||
if stripped.startswith('%ifdef ') or stripped.startswith('%ifdef\t'):
|
||||
# Preserve leading whitespace, convert %ifdef to #ifdef
|
||||
converted_lines.append(line.replace('%ifdef', '#ifdef', 1))
|
||||
elif stripped.startswith('%ifndef ') or stripped.startswith('%ifndef\t'):
|
||||
converted_lines.append(line.replace('%ifndef', '#ifndef', 1))
|
||||
elif stripped.startswith('%if '):
|
||||
converted_lines.append(line.replace('%if', '#if', 1))
|
||||
elif stripped.startswith('%elif '):
|
||||
converted_lines.append(line.replace('%elif', '#elif', 1))
|
||||
elif stripped.startswith('%else'):
|
||||
converted_lines.append(line.replace('%else', '#else', 1))
|
||||
elif stripped.startswith('%endif'):
|
||||
converted_lines.append(line.replace('%endif', '#endif', 1))
|
||||
elif stripped.startswith('#') and not stripped.startswith('#!'):
|
||||
# Remove shell comment lines (but keep shebang)
|
||||
# This prevents "# if ..." comments from being interpreted as "#if" by CPP
|
||||
continue
|
||||
else:
|
||||
converted_lines.append(line)
|
||||
converted_content = '\n'.join(converted_lines)
|
||||
|
||||
# Create temporary file with include directive and converted content
|
||||
with tempfile.NamedTemporaryFile(mode='w', suffix='.in', delete=False) as tmp:
|
||||
tmp.write(f'#include "{kconfig_header}"\n')
|
||||
tmp.write(converted_content)
|
||||
tmp_path = tmp.name
|
||||
|
||||
try:
|
||||
# Run C preprocessor
|
||||
# -P: don't generate #line directives
|
||||
# -E: preprocess only
|
||||
# -undef: don't predefine any non-standard macros
|
||||
# -nostdinc: don't search standard include directories
|
||||
# -x assembler-with-cpp: treat input as assembly (allows # comments to pass through)
|
||||
result = subprocess.run(
|
||||
[cpp_command, '-P', '-E', '-undef', '-nostdinc', '-x', 'assembler-with-cpp', tmp_path],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=True
|
||||
)
|
||||
|
||||
preprocessed = result.stdout
|
||||
|
||||
# Clean up the output:
|
||||
# 1. Remove empty lines at the beginning
|
||||
# 2. Remove lines that are just whitespace
|
||||
lines = preprocessed.split('\n')
|
||||
cleaned_lines = []
|
||||
started = False
|
||||
|
||||
for line in lines:
|
||||
# Skip empty lines at the beginning
|
||||
if not started and not line.strip():
|
||||
continue
|
||||
started = True
|
||||
cleaned_lines.append(line)
|
||||
|
||||
# Remove trailing empty lines
|
||||
while cleaned_lines and not cleaned_lines[-1].strip():
|
||||
cleaned_lines.pop()
|
||||
|
||||
# Write preprocessed content back
|
||||
with open(file_path, 'w') as f:
|
||||
f.write('\n'.join(cleaned_lines))
|
||||
if cleaned_lines: # Add final newline if file is not empty
|
||||
f.write('\n')
|
||||
|
||||
return True
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Error preprocessing {file_path}: {e}")
|
||||
print(f"stderr: {e.stderr}")
|
||||
return False
|
||||
finally:
|
||||
# Clean up temporary file
|
||||
try:
|
||||
os.unlink(tmp_path)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Preprocess ROMFS files with KConfig definitions')
|
||||
parser.add_argument('--romfs-dir', required=True, help='ROMFS root directory')
|
||||
parser.add_argument('--kconfig-header', required=True, help='Path to px4_boardconfig.h')
|
||||
parser.add_argument('--cpp', required=True, help='C preprocessor command')
|
||||
parser.add_argument('--pattern', default='rc*', help='File pattern to preprocess (default: rc*)')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Verify inputs
|
||||
romfs_dir = Path(args.romfs_dir)
|
||||
kconfig_header = Path(args.kconfig_header)
|
||||
|
||||
if not romfs_dir.exists():
|
||||
print(f"Error: ROMFS directory not found: {romfs_dir}")
|
||||
return 1
|
||||
|
||||
if not kconfig_header.exists():
|
||||
print(f"Error: KConfig header not found: {kconfig_header}")
|
||||
return 1
|
||||
|
||||
# Find all files to preprocess in init.d directory
|
||||
init_d_dir = romfs_dir / 'init.d'
|
||||
if not init_d_dir.exists():
|
||||
print(f"Warning: init.d directory not found in {romfs_dir}")
|
||||
return 0
|
||||
|
||||
# Find all rc* files (shell scripts)
|
||||
files_to_process = []
|
||||
for pattern in ['rc*', 'rcS']:
|
||||
files_to_process.extend(init_d_dir.glob(pattern))
|
||||
|
||||
# Also check subdirectories like airframes
|
||||
for subdir in init_d_dir.iterdir():
|
||||
if subdir.is_dir():
|
||||
for pattern in ['rc*']:
|
||||
files_to_process.extend(subdir.glob(pattern))
|
||||
|
||||
# Remove duplicates and filter only files
|
||||
files_to_process = list(set([f for f in files_to_process if f.is_file()]))
|
||||
|
||||
if not files_to_process:
|
||||
print(f"Warning: No files matching pattern '{args.pattern}' found in {init_d_dir}")
|
||||
return 0
|
||||
|
||||
print(f"Preprocessing {len(files_to_process)} ROMFS files with KConfig definitions...")
|
||||
|
||||
# Process each file
|
||||
success_count = 0
|
||||
for file_path in sorted(files_to_process):
|
||||
rel_path = file_path.relative_to(romfs_dir)
|
||||
print(f" Processing: {rel_path}")
|
||||
if preprocess_file(file_path, kconfig_header.absolute(), args.cpp):
|
||||
success_count += 1
|
||||
else:
|
||||
print(f" Warning: Failed to preprocess {rel_path}")
|
||||
|
||||
print(f"Successfully preprocessed {success_count}/{len(files_to_process)} files")
|
||||
|
||||
return 0 if success_count == len(files_to_process) else 1
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
+8
-44
@@ -98,40 +98,6 @@ class firmware(object):
|
||||
|
||||
desc = {}
|
||||
image = bytes()
|
||||
crctab = array.array('I', [
|
||||
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
|
||||
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
|
||||
0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
|
||||
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
|
||||
0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
|
||||
0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
|
||||
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
|
||||
0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
|
||||
0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
|
||||
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
|
||||
0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
|
||||
0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
|
||||
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
|
||||
0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
|
||||
0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
|
||||
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
|
||||
0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
|
||||
0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
|
||||
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
|
||||
0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
|
||||
0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
|
||||
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
|
||||
0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
|
||||
0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
|
||||
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
|
||||
0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
|
||||
0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
|
||||
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
|
||||
0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
|
||||
0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
||||
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
|
||||
0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d])
|
||||
crcpad = bytearray(b'\xff\xff\xff\xff')
|
||||
|
||||
def __init__(self, path):
|
||||
|
||||
@@ -149,17 +115,15 @@ class firmware(object):
|
||||
def property(self, propname):
|
||||
return self.desc[propname]
|
||||
|
||||
def __crc32(self, bytes, state):
|
||||
for byte in bytes:
|
||||
index = (state ^ byte) & 0xff
|
||||
state = self.crctab[index] ^ (state >> 8)
|
||||
return state
|
||||
|
||||
def crc(self, padlen):
|
||||
state = self.__crc32(self.image, int(0))
|
||||
for _ in range(len(self.image), (padlen - 1), 4):
|
||||
state = self.__crc32(self.crcpad, state)
|
||||
return state
|
||||
state = 0xFFFFFFFF
|
||||
state = zlib.crc32(self.image, state)
|
||||
padding_length = padlen - len(self.image)
|
||||
if padding_length > 0:
|
||||
padding = b'\xff' * padding_length
|
||||
state = zlib.crc32(padding, state)
|
||||
|
||||
return (state ^ 0xFFFFFFFF) & 0xFFFFFFFF
|
||||
|
||||
|
||||
class uploader:
|
||||
|
||||
Submodule Tools/simulation/gazebo-classic/sitl_gazebo-classic updated: 6697ab169c...ac718b6fb2
+1
-1
Submodule Tools/simulation/gz updated: ee3835184c...fe3fe236e3
@@ -21,7 +21,6 @@ CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y
|
||||
CONFIG_DRIVERS_IRLOCK=y
|
||||
CONFIG_COMMON_LIGHT=y
|
||||
CONFIG_COMMON_MAGNETOMETER=y
|
||||
CONFIG_COMMON_OPTICAL_FLOW=y
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=y
|
||||
CONFIG_DRIVERS_POWER_MONITOR_INA226=y
|
||||
CONFIG_DRIVERS_PWM_OUT=y
|
||||
|
||||
@@ -132,7 +132,6 @@ ENTRY(_stext)
|
||||
*/
|
||||
EXTERN(abort)
|
||||
EXTERN(_bootdelay_signature)
|
||||
EXTERN(board_get_manifest)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
@@ -48,7 +48,6 @@ else()
|
||||
i2c.cpp
|
||||
init.c
|
||||
led.c
|
||||
mtd.cpp
|
||||
spi.cpp
|
||||
timer_config.cpp
|
||||
usb.c
|
||||
|
||||
@@ -34,7 +34,6 @@ CONFIG_DRIVERS_OSD_MSP_OSD=y
|
||||
CONFIG_DRIVERS_POWER_MONITOR_INA226=y
|
||||
CONFIG_DRIVERS_POWER_MONITOR_INA228=y
|
||||
CONFIG_DRIVERS_POWER_MONITOR_INA238=y
|
||||
CONFIG_DRIVERS_POWER_MONITOR_PM_SELECTOR_AUTERION=y
|
||||
CONFIG_DRIVERS_PWM_OUT=y
|
||||
CONFIG_DRIVERS_PX4IO=y
|
||||
CONFIG_DRIVERS_RC_INPUT=y
|
||||
@@ -67,7 +66,6 @@ CONFIG_MODULES_LOGGER=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_MANUAL_CONTROL=y
|
||||
CONFIG_MODULES_MAVLINK=y
|
||||
CONFIG_MAVLINK_DIALECT="development"
|
||||
CONFIG_MODULES_MC_ATT_CONTROL=y
|
||||
CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
|
||||
|
||||
@@ -3,19 +3,13 @@
|
||||
# board specific defaults
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# By disabling all 3 INA modules, we use the
|
||||
# i2c_launcher instead.
|
||||
param set - default SENS_EN_INA238 0
|
||||
param set - default SENS_EN_INA228 0
|
||||
param set - default SENS_EN_INA226 0
|
||||
|
||||
# Mavlink ethernet (CFG 1000)
|
||||
param set - default MAV_2_CONFIG 1000
|
||||
param set - default MAV_2_BROADCAST 1
|
||||
param set - default MAV_2_MODE 0
|
||||
param set - default MAV_2_RADIO_CTL 0
|
||||
param set - default MAV_2_RATE 100000
|
||||
param set - default MAV_2_REMOTE_PRT 14550
|
||||
param set - default MAV_2_UDP_PRT 14550
|
||||
param set-default MAV_2_CONFIG 1000
|
||||
param set-default MAV_2_BROADCAST 1
|
||||
param set-default MAV_2_MODE 0
|
||||
param set-default MAV_2_RADIO_CTL 0
|
||||
param set-default MAV_2_RATE 100000
|
||||
param set-default MAV_2_REMOTE_PRT 14550
|
||||
param set-default MAV_2_UDP_PRT 14550
|
||||
|
||||
safety_button start
|
||||
|
||||
@@ -71,6 +71,5 @@ else()
|
||||
nuttx_arch # sdio
|
||||
nuttx_drivers # sdio
|
||||
px4_layer
|
||||
platform_gpio_mcp23009
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
#include <px4_platform/gpio.h>
|
||||
#include <px4_platform/board_determine_hw_info.h>
|
||||
#include <px4_platform/board_dma_alloc.h>
|
||||
#include <px4_platform/gpio/mcp23009.hpp>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
@@ -286,13 +285,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
# endif /* CONFIG_MMCSD */
|
||||
|
||||
ret = mcp23009_register_gpios(3, 0x25);
|
||||
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* !defined(BOOTLOADER) */
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -22,7 +22,6 @@ CONFIG_DRIVERS_IMU_ST_LSM303D=y
|
||||
CONFIG_DRIVERS_IRLOCK=y
|
||||
CONFIG_COMMON_LIGHT=y
|
||||
CONFIG_COMMON_MAGNETOMETER=y
|
||||
CONFIG_COMMON_OPTICAL_FLOW=y
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=y
|
||||
CONFIG_DRIVERS_POWER_MONITOR_INA226=y
|
||||
CONFIG_DRIVERS_PWM_INPUT=y
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#define GPIO_BTN_SAFETY /* PB15 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTB|GPIO_PIN15)
|
||||
|
||||
/* Safety LED */
|
||||
#define GPIO_LED_SAFETY /* PA1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN1)
|
||||
#define GPIO_LED_SAFETY /* PA1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN1)
|
||||
|
||||
/* Tone alarm output. */
|
||||
#define TONE_ALARM_TIMER 2 /* timer 2 */
|
||||
|
||||
@@ -19,6 +19,7 @@ CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_AUAV=y
|
||||
CONFIG_COMMON_DISTANCE_SENSOR=y
|
||||
CONFIG_DRIVERS_DSHOT=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_PPS_CAPTURE=y
|
||||
CONFIG_DRIVERS_HEATER=y
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16507=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
|
||||
@@ -34,11 +35,11 @@ CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_LIS3MDL=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_LSM303AGR=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_RM3100=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_MEMSIC_MMC5983MA=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_ST_IIS2MDC=y
|
||||
CONFIG_DRIVERS_POWER_MONITOR_INA226=y
|
||||
CONFIG_DRIVERS_POWER_MONITOR_INA228=y
|
||||
CONFIG_DRIVERS_POWER_MONITOR_INA238=y
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=y
|
||||
CONFIG_DRIVERS_PWM_OUT=y
|
||||
CONFIG_DRIVERS_PX4IO=y
|
||||
CONFIG_COMMON_RC=y
|
||||
@@ -71,7 +72,6 @@ CONFIG_MODULES_LOGGER=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_MANUAL_CONTROL=y
|
||||
CONFIG_MODULES_MAVLINK=y
|
||||
CONFIG_MAVLINK_DIALECT="development"
|
||||
CONFIG_MODULES_MC_ATT_CONTROL=y
|
||||
CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
|
||||
|
||||
@@ -14,10 +14,7 @@ param set-default MAV_2_RATE 100000
|
||||
param set-default MAV_2_REMOTE_PRT 14550
|
||||
param set-default MAV_2_UDP_PRT 14550
|
||||
|
||||
param set-default SENS_EN_INA238 0
|
||||
param set-default SENS_EN_INA228 0
|
||||
param set-default SENS_EN_INA226 1
|
||||
|
||||
param set-default SENS_EN_THERMAL 1
|
||||
param set-default SENS_IMU_MODE 1
|
||||
param set-default SENS_IMU_TEMP 10.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ARK FMUARKV6X specific board sensors init
|
||||
# ARK FMU V6X specific board sensors init
|
||||
#------------------------------------------------------------------------------
|
||||
set HAVE_PM2 yes
|
||||
set HAVE_PM3 yes
|
||||
@@ -69,28 +69,25 @@ fi
|
||||
|
||||
if ver hwtypecmp ARKV6X000
|
||||
then
|
||||
# Internal SPI bus IIM42652 with SPIX measured frequency of 32.051kHz
|
||||
iim42652 -R 3 -s -b 1 -C 32051 start
|
||||
# Internal SPI bus IIM42652
|
||||
iim42652 -R 3 -s -b 1 start
|
||||
|
||||
# Internal SPI bus ICM42688p with SPIX measured frequency of 32.051kHz
|
||||
icm42688p -R 9 -s -b 2 -C 32051 start
|
||||
# Internal SPI bus ICM42688p
|
||||
icm42688p -R 9 -s -b 2 start
|
||||
|
||||
# Internal SPI bus ICM42688p with SPIX measured frequency of 32.051kHz
|
||||
icm42688p -R 6 -s -b 3 -C 32051 start
|
||||
# Internal SPI bus ICM42688p
|
||||
icm42688p -R 6 -s -b 3 start
|
||||
fi
|
||||
|
||||
if ver hwtypecmp ARKV6X001
|
||||
then
|
||||
# Internal SPI bus IIM42653 with SPIX measured frequency of 32.051kHz
|
||||
#iim42653 -R 3 -s -b 1 -C 32051 start
|
||||
# Internal SPI bus IIM42653
|
||||
iim42653 -R 3 -s -b 1 start
|
||||
|
||||
# Internal SPI bus IIM42653 with SPIX measured frequency of 32.051kHz
|
||||
#iim42653 -R 9 -s -b 2 -C 32051 start
|
||||
# Internal SPI bus IIM42653
|
||||
iim42653 -R 9 -s -b 2 start
|
||||
|
||||
# Internal SPI bus IIM42653 with SPIX measured frequency of 32.051kHz
|
||||
#iim42653 -R 6 -s -b 3 -C 32051 start
|
||||
# Internal SPI bus IIM42653
|
||||
iim42653 -R 6 -s -b 3 start
|
||||
fi
|
||||
|
||||
@@ -100,5 +97,11 @@ bmm150 -I start
|
||||
# Internal Baro on I2C
|
||||
bmp388 -I start
|
||||
|
||||
# Start an external PWM generator
|
||||
if param greater PCA9685_EN_BUS 0
|
||||
then
|
||||
pca9685_pwm_out start
|
||||
fi
|
||||
|
||||
unset HAVE_PM2
|
||||
unset HAVE_PM3
|
||||
|
||||
@@ -57,8 +57,6 @@ else()
|
||||
mtd.cpp
|
||||
sdio.c
|
||||
spi.cpp
|
||||
spix_sync.c
|
||||
spix_sync.h
|
||||
timer_config.cpp
|
||||
usb.c
|
||||
)
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
|
||||
/* PWM
|
||||
*/
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 9
|
||||
|
||||
#define GPIO_FMU_CH1 /* PI0 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTI|GPIO_PIN0)
|
||||
#define GPIO_FMU_CH2 /* PH12 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN12)
|
||||
@@ -482,7 +482,7 @@
|
||||
#define PX4_I2C_BUS_MTD 4,5
|
||||
|
||||
|
||||
#define BOARD_NUM_IO_TIMERS 3
|
||||
#define BOARD_NUM_IO_TIMERS 4
|
||||
#define BOARD_SPIX_SYNC_FREQ 32000
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "board_config.h"
|
||||
#include "spix_sync.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
@@ -290,9 +289,5 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
#endif /* CONFIG_MMCSD */
|
||||
|
||||
/* Configure the SPIX_SYNC output */
|
||||
spix_sync_servo_init(BOARD_SPIX_SYNC_FREQ);
|
||||
spix_sync_servo_set(0, 150);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1,309 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2023 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name Airmind nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file spix_sync.c
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
|
||||
#include <board_config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
#include <perf/perf_counter.h>
|
||||
#include <systemlib/err.h>
|
||||
#include <systemlib/px4_macros.h>
|
||||
|
||||
#include <px4_arch/io_timer.h>
|
||||
|
||||
#include "spix_sync.h"
|
||||
|
||||
#define REG(_tmr, _reg) (*(volatile uint32_t *)(spix_sync_timers[_tmr].base + _reg))
|
||||
|
||||
#define rCR1(_tmr) REG(_tmr, STM32_GTIM_CR1_OFFSET)
|
||||
#define rCR2(_tmr) REG(_tmr, STM32_GTIM_CR2_OFFSET)
|
||||
#define rSMCR(_tmr) REG(_tmr, STM32_GTIM_SMCR_OFFSET)
|
||||
#define rDIER(_tmr) REG(_tmr, STM32_GTIM_DIER_OFFSET)
|
||||
#define rSR(_tmr) REG(_tmr, STM32_GTIM_SR_OFFSET)
|
||||
#define rEGR(_tmr) REG(_tmr, STM32_GTIM_EGR_OFFSET)
|
||||
#define rCCMR1(_tmr) REG(_tmr, STM32_GTIM_CCMR1_OFFSET)
|
||||
#define rCCMR2(_tmr) REG(_tmr, STM32_GTIM_CCMR2_OFFSET)
|
||||
#define rCCER(_tmr) REG(_tmr, STM32_GTIM_CCER_OFFSET)
|
||||
#define rCNT(_tmr) REG(_tmr, STM32_GTIM_CNT_OFFSET)
|
||||
#define rPSC(_tmr) REG(_tmr, STM32_GTIM_PSC_OFFSET)
|
||||
#define rARR(_tmr) REG(_tmr, STM32_GTIM_ARR_OFFSET)
|
||||
#define rCCR1(_tmr) REG(_tmr, STM32_GTIM_CCR1_OFFSET)
|
||||
#define rCCR2(_tmr) REG(_tmr, STM32_GTIM_CCR2_OFFSET)
|
||||
#define rCCR3(_tmr) REG(_tmr, STM32_GTIM_CCR3_OFFSET)
|
||||
#define rCCR4(_tmr) REG(_tmr, STM32_GTIM_CCR4_OFFSET)
|
||||
#define rDCR(_tmr) REG(_tmr, STM32_GTIM_DCR_OFFSET)
|
||||
#define rDMAR(_tmr) REG(_tmr, STM32_GTIM_DMAR_OFFSET)
|
||||
#define rBDTR(_tmr) REG(_tmr, STM32_ATIM_BDTR_OFFSET)
|
||||
|
||||
#define BOARD_SPIX_SYNC_PWM_FREQ 1024000
|
||||
|
||||
unsigned
|
||||
spix_sync_timer_get_period(unsigned timer)
|
||||
{
|
||||
return (rARR(timer));
|
||||
}
|
||||
|
||||
static void spix_sync_timer_init_timer(unsigned timer, unsigned rate)
|
||||
{
|
||||
if (spix_sync_timers[timer].base) {
|
||||
|
||||
irqstate_t flags = px4_enter_critical_section();
|
||||
|
||||
/* enable the timer clock before we try to talk to it */
|
||||
|
||||
modifyreg32(spix_sync_timers[timer].clock_register, 0, spix_sync_timers[timer].clock_bit);
|
||||
|
||||
/* disable and configure the timer */
|
||||
rCR1(timer) = 0;
|
||||
rCR2(timer) = 0;
|
||||
rSMCR(timer) = 0;
|
||||
rDIER(timer) = 0;
|
||||
rCCER(timer) = 0;
|
||||
rCCMR1(timer) = 0;
|
||||
rCCMR2(timer) = 0;
|
||||
rCCR1(timer) = 0;
|
||||
rCCR2(timer) = 0;
|
||||
rCCR3(timer) = 0;
|
||||
rCCR4(timer) = 0;
|
||||
rCCER(timer) = 0;
|
||||
rDCR(timer) = 0;
|
||||
|
||||
if ((spix_sync_timers[timer].base == STM32_TIM1_BASE) || (spix_sync_timers[timer].base == STM32_TIM8_BASE)) {
|
||||
|
||||
/* master output enable = on */
|
||||
|
||||
rBDTR(timer) = ATIM_BDTR_MOE;
|
||||
}
|
||||
|
||||
/* If the timer clock source provided as clock_freq is the STM32_APBx_TIMx_CLKIN
|
||||
* then configure the timer to free-run at 1MHz.
|
||||
* Otherwise, other frequencies are attainable by adjusting .clock_freq accordingly.
|
||||
*/
|
||||
|
||||
rPSC(timer) = (spix_sync_timers[timer].clock_freq / BOARD_SPIX_SYNC_PWM_FREQ) - 1;
|
||||
|
||||
/* configure the timer to update at the desired rate */
|
||||
|
||||
rARR(timer) = (BOARD_SPIX_SYNC_PWM_FREQ / rate) - 1;
|
||||
|
||||
/* generate an update event; reloads the counter and all registers */
|
||||
rEGR(timer) = GTIM_EGR_UG;
|
||||
|
||||
px4_leave_critical_section(flags);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void spix_sync_channel_init(unsigned channel)
|
||||
{
|
||||
/* Only initialize used channels */
|
||||
|
||||
if (spix_sync_channels[channel].timer_channel) {
|
||||
|
||||
unsigned timer = spix_sync_channels[channel].timer_index;
|
||||
|
||||
/* configure the GPIO first */
|
||||
px4_arch_configgpio(spix_sync_channels[channel].gpio_out);
|
||||
|
||||
uint16_t polarity = spix_sync_channels[channel].masks;
|
||||
|
||||
/* configure the channel */
|
||||
switch (spix_sync_channels[channel].timer_channel) {
|
||||
case 1:
|
||||
rCCMR1(timer) |= (GTIM_CCMR_MODE_PWM1 << GTIM_CCMR1_OC1M_SHIFT) | GTIM_CCMR1_OC1PE;
|
||||
rCCER(timer) |= polarity | GTIM_CCER_CC1E;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
rCCMR1(timer) |= (GTIM_CCMR_MODE_PWM1 << GTIM_CCMR1_OC2M_SHIFT) | GTIM_CCMR1_OC2PE;
|
||||
rCCER(timer) |= polarity | GTIM_CCER_CC2E;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
rCCMR2(timer) |= (GTIM_CCMR_MODE_PWM1 << GTIM_CCMR2_OC3M_SHIFT) | GTIM_CCMR2_OC3PE;
|
||||
rCCER(timer) |= polarity | GTIM_CCER_CC3E;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
rCCMR2(timer) |= (GTIM_CCMR_MODE_PWM1 << GTIM_CCMR2_OC4M_SHIFT) | GTIM_CCMR2_OC4PE;
|
||||
rCCER(timer) |= polarity | GTIM_CCER_CC4E;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
spix_sync_servo_set(unsigned channel, uint8_t cvalue)
|
||||
{
|
||||
if (channel >= arraySize(spix_sync_channels)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned timer = spix_sync_channels[channel].timer_index;
|
||||
|
||||
/* test timer for validity */
|
||||
if ((spix_sync_timers[timer].base == 0) ||
|
||||
(spix_sync_channels[channel].gpio_out == 0)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned period = spix_sync_timer_get_period(timer);
|
||||
|
||||
unsigned value = (unsigned)cvalue * period / 255;
|
||||
|
||||
/* configure the channel */
|
||||
if (value > 0) {
|
||||
value--;
|
||||
}
|
||||
|
||||
|
||||
switch (spix_sync_channels[channel].timer_channel) {
|
||||
case 1:
|
||||
rCCR1(timer) = value;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
rCCR2(timer) = value;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
rCCR3(timer) = value;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
rCCR4(timer) = value;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned spix_sync_servo_get(unsigned channel)
|
||||
{
|
||||
if (channel >= 3) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned timer = spix_sync_channels[channel].timer_index;
|
||||
uint16_t value = 0;
|
||||
|
||||
/* test timer for validity */
|
||||
if ((spix_sync_timers[timer].base == 0) ||
|
||||
(spix_sync_channels[channel].timer_channel == 0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* configure the channel */
|
||||
switch (spix_sync_channels[channel].timer_channel) {
|
||||
case 1:
|
||||
value = rCCR1(timer);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
value = rCCR2(timer);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
value = rCCR3(timer);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
value = rCCR4(timer);
|
||||
break;
|
||||
}
|
||||
|
||||
unsigned period = spix_sync_timer_get_period(timer);
|
||||
return ((value + 1) * 255 / period);
|
||||
}
|
||||
|
||||
int spix_sync_servo_init(unsigned rate)
|
||||
{
|
||||
/* do basic timer initialisation first */
|
||||
for (unsigned i = 0; i < arraySize(spix_sync_timers); i++) {
|
||||
spix_sync_timer_init_timer(i, rate);
|
||||
}
|
||||
|
||||
/* now init channels */
|
||||
for (unsigned i = 0; i < arraySize(spix_sync_channels); i++) {
|
||||
spix_sync_channel_init(i);
|
||||
}
|
||||
|
||||
spix_sync_servo_arm(true);
|
||||
return OK;
|
||||
}
|
||||
|
||||
void
|
||||
spix_sync_servo_deinit(void)
|
||||
{
|
||||
/* disable the timers */
|
||||
spix_sync_servo_arm(false);
|
||||
}
|
||||
void
|
||||
spix_sync_servo_arm(bool armed)
|
||||
{
|
||||
/* iterate timers and arm/disarm appropriately */
|
||||
for (unsigned i = 0; i < arraySize(spix_sync_timers); i++) {
|
||||
if (spix_sync_timers[i].base != 0) {
|
||||
if (armed) {
|
||||
/* force an update to preload all registers */
|
||||
rEGR(i) = GTIM_EGR_UG;
|
||||
|
||||
/* arm requires the timer be enabled */
|
||||
rCR1(i) |= GTIM_CR1_CEN | GTIM_CR1_ARPE;
|
||||
|
||||
} else {
|
||||
rCR1(i) = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,8 +60,7 @@ constexpr io_timers_t io_timers[MAX_IO_TIMERS] = {
|
||||
initIOTimer(Timer::Timer5, DMA{DMA::Index1}),
|
||||
initIOTimer(Timer::Timer4, DMA{DMA::Index1}),
|
||||
initIOTimer(Timer::Timer12),
|
||||
//initIOTimer(Timer::Timer1),
|
||||
//initIOTimer(Timer::Timer2),
|
||||
initIOTimer(Timer::Timer1),
|
||||
};
|
||||
|
||||
constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
@@ -73,18 +72,8 @@ constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}),
|
||||
initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}),
|
||||
initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}),
|
||||
//initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}),
|
||||
//initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}),
|
||||
initIOTimerChannelCapture(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}),
|
||||
};
|
||||
|
||||
constexpr io_timers_channel_mapping_t io_timers_channel_mapping =
|
||||
initIOTimerChannelMapping(io_timers, timer_io_channels);
|
||||
|
||||
|
||||
constexpr io_timers_t spix_sync_timers[MAX_SPIX_SYNC_TIMERS] = {
|
||||
initIOTimer(Timer::Timer1),
|
||||
};
|
||||
|
||||
constexpr timer_io_channels_t spix_sync_channels[MAX_SPIX_SYNC_TIMERS] = {
|
||||
initIOTimerChannel(spix_sync_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}),
|
||||
};
|
||||
|
||||
@@ -19,8 +19,17 @@ CONFIG_DRIVERS_HEATER=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_IIM42653=y
|
||||
CONFIG_DRIVERS_IMU_MURATA_SCH16T=y
|
||||
CONFIG_COMMON_LIGHT=y
|
||||
CONFIG_COMMON_MAGNETOMETER=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_BOSCH_BMM150=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8308=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_LIS3MDL=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_LSM303AGR=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_RM3100=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_ST_IIS2MDC=y
|
||||
CONFIG_DRIVERS_OSD_MSP_OSD=y
|
||||
CONFIG_DRIVERS_PCA9685_PWM_OUT=y
|
||||
CONFIG_DRIVERS_PWM_OUT=y
|
||||
CONFIG_COMMON_RC=y
|
||||
CONFIG_DRIVERS_UAVCAN=y
|
||||
@@ -50,7 +59,6 @@ CONFIG_MODULES_LOGGER=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_MANUAL_CONTROL=y
|
||||
CONFIG_MODULES_MAVLINK=y
|
||||
CONFIG_MAVLINK_DIALECT="development"
|
||||
CONFIG_MODULES_MC_ATT_CONTROL=y
|
||||
CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
|
||||
|
||||
@@ -16,3 +16,9 @@ iis2mdc -R 0 -I -b 4 start
|
||||
|
||||
# Internal Baro on I2C
|
||||
bmp388 -I -b 2 start
|
||||
|
||||
# Start an external PWM generator
|
||||
if param greater PCA9685_EN_BUS 0
|
||||
then
|
||||
pca9685_pwm_out start
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
|
||||
CONFIG_BOARD_ARCHITECTURE="cortex-m4"
|
||||
CONFIG_BOARD_ROMFSROOT=""
|
||||
CONFIG_BOARD_CONSTRAINED_MEMORY=y
|
||||
CONFIG_DRIVERS_BOOTLOADERS=y
|
||||
@@ -0,0 +1,22 @@
|
||||
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
|
||||
CONFIG_BOARD_ARCHITECTURE="cortex-m4"
|
||||
CONFIG_BOARD_ROMFSROOT="cannode"
|
||||
CONFIG_BOARD_CONSTRAINED_MEMORY=y
|
||||
CONFIG_DRIVERS_BOOTLOADERS=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_RM3100=y
|
||||
CONFIG_BOARD_UAVCAN_INTERFACES=1
|
||||
CONFIG_DRIVERS_UAVCANNODE=y
|
||||
CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set
|
||||
# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set
|
||||
# CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set
|
||||
CONFIG_SYSTEMCMDS_PARAM=y
|
||||
CONFIG_SYSTEMCMDS_PERF=y
|
||||
CONFIG_SYSTEMCMDS_REBOOT=y
|
||||
CONFIG_SYSTEMCMDS_SYSTEM_TIME=y
|
||||
CONFIG_SYSTEMCMDS_TOP=y
|
||||
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
|
||||
CONFIG_SYSTEMCMDS_UORB=y
|
||||
CONFIG_SYSTEMCMDS_VER=y
|
||||
CONFIG_SYSTEMCMDS_WORK_QUEUE=y
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"board_id": 93,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the ARK MAG board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "ARKMAG",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"image_maxsize": 2080768,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# board sensors init
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
rm3100 -s -b 2 start
|
||||
@@ -0,0 +1,57 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD_CUSTOM=y
|
||||
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/mag/nuttx-config"
|
||||
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
|
||||
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
|
||||
CONFIG_ARCH_CHIP="stm32"
|
||||
CONFIG_ARCH_CHIP_STM32=y
|
||||
CONFIG_ARCH_CHIP_STM32F412CE=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=4096
|
||||
CONFIG_ARMV7M_MEMCPY=y
|
||||
CONFIG_ARMV7M_USEBASEPRI=y
|
||||
CONFIG_BINFMT_DISABLE=y
|
||||
CONFIG_BOARDCTL=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_DEBUG_TCBINFO=y
|
||||
CONFIG_DEFAULT_SMALL=y
|
||||
CONFIG_DISABLE_MOUNTPOINT=y
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_FDCLONE_DISABLE=y
|
||||
CONFIG_FDCLONE_STDIO=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=4096
|
||||
CONFIG_INIT_STACKSIZE=4096
|
||||
CONFIG_LIBC_FLOATINGPOINT=y
|
||||
CONFIG_LIBC_LONG_LONG=y
|
||||
CONFIG_LIBC_STRERROR=y
|
||||
CONFIG_MM_REGIONS=2
|
||||
CONFIG_NAME_MAX=0
|
||||
CONFIG_NUNGET_CHARS=0
|
||||
CONFIG_PREALLOC_TIMERS=0
|
||||
CONFIG_PTHREAD_STACK_MIN=512
|
||||
CONFIG_RAM_SIZE=262144
|
||||
CONFIG_RAM_START=0x20010000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_SIG_DEFAULT=y
|
||||
CONFIG_SIG_SIGALRM_ACTION=y
|
||||
CONFIG_SIG_SIGUSR1_ACTION=y
|
||||
CONFIG_SIG_SIGUSR2_ACTION=y
|
||||
CONFIG_STACK_COLORATION=y
|
||||
CONFIG_START_DAY=30
|
||||
CONFIG_START_MONTH=11
|
||||
CONFIG_STDIO_DISABLE_BUFFERING=y
|
||||
CONFIG_STM32_FLASH_CONFIG_G=y
|
||||
CONFIG_STM32_NOEXT_VECTORS=y
|
||||
CONFIG_STM32_TIM8=y
|
||||
CONFIG_TASK_NAME_SIZE=0
|
||||
CONFIG_USEC_PER_TICK=1000
|
||||
@@ -0,0 +1,132 @@
|
||||
/************************************************************************************
|
||||
* configs/px4fmu/include/board.h
|
||||
* include/arch/board/board.h
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
#include "board_dma_map.h"
|
||||
|
||||
#ifndef __ARCH_BOARD_BOARD_H
|
||||
#define __ARCH_BOARD_BOARD_H
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include <stm32.h>
|
||||
|
||||
/* HSI - 8 MHz RC factory-trimmed
|
||||
* LSI - 32 KHz RC
|
||||
* HSE - 8 MHz Crystal
|
||||
* LSE - not installed
|
||||
*/
|
||||
#define STM32_BOARD_USEHSE 1
|
||||
#define STM32_BOARD_XTAL 8000000
|
||||
#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL
|
||||
|
||||
#define STM32_HSI_FREQUENCY 16000000ul
|
||||
#define STM32_LSI_FREQUENCY 32000
|
||||
|
||||
/* Main PLL Configuration */
|
||||
#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8)
|
||||
#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(384)
|
||||
#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_4
|
||||
#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(8)
|
||||
#define STM32_PLLCFG_PLLR RCC_PLLCFG_PLLR(2)
|
||||
|
||||
#define STM32_RCC_PLLI2SCFGR_PLLI2SM RCC_PLLI2SCFGR_PLLI2SM(16)
|
||||
#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192)
|
||||
#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2)
|
||||
#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2)
|
||||
#define STM32_RCC_PLLI2SCFGR_PLLI2SSRC RCC_PLLI2SCFGR_PLLI2SSRC(0) /* HSE or HSI depending on PLLSRC of PLLCFGR*/
|
||||
|
||||
#define STM32_RCC_DCKCFGR2_CK48MSEL RCC_DCKCFGR2_CK48MSEL_PLL
|
||||
#define STM32_RCC_DCKCFGR2_FMPI2C1SEL RCC_DCKCFGR2_FMPI2C1SEL_APB
|
||||
#define STM32_RCC_DCKCFGR2_SDIOSEL RCC_DCKCFGR2_SDIOSEL_48MHZ
|
||||
|
||||
#define STM32_SYSCLK_FREQUENCY 96000000ul
|
||||
|
||||
/* AHB clock (HCLK) is SYSCLK (96MHz) */
|
||||
#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */
|
||||
#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY
|
||||
#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* Same as above, to satisfy compiler */
|
||||
|
||||
/* APB1 clock (PCLK1) is HCLK/2 (48MHz) */
|
||||
#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */
|
||||
#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2)
|
||||
|
||||
/* Timers driven from APB1 will be twice PCLK1 (see page 112 of reference manual) */
|
||||
#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
|
||||
/* APB2 clock (PCLK2) is HCLK (96MHz) */
|
||||
#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK /* PCLK2 = HCLK */
|
||||
#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY)
|
||||
|
||||
/* Timers driven from APB2 will be PCLK2 since no prescale division */
|
||||
#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY)
|
||||
#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY)
|
||||
#define STM32_APB2_TIM9_CLKIN (STM32_PCLK2_FREQUENCY)
|
||||
#define STM32_APB2_TIM10_CLKIN (STM32_PCLK2_FREQUENCY)
|
||||
#define STM32_APB2_TIM11_CLKIN (STM32_PCLK2_FREQUENCY)
|
||||
|
||||
/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx otherwise frequency is 2xAPBx. */
|
||||
#define BOARD_TIM2_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
|
||||
#define BOARD_TIM3_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
|
||||
#define BOARD_TIM4_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
|
||||
#define BOARD_TIM5_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
|
||||
#define BOARD_TIM6_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
|
||||
#define BOARD_TIM7_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
|
||||
#define BOARD_TIM8_FREQUENCY (2 * STM32_PCLK2_FREQUENCY)
|
||||
|
||||
/* Alternate function pin selections ************************************************/
|
||||
|
||||
/* UARTs */
|
||||
#define GPIO_USART2_RX GPIO_USART2_RX_1
|
||||
#define GPIO_USART2_TX GPIO_USART2_TX_1
|
||||
|
||||
/* CAN */
|
||||
#define GPIO_CAN1_RX GPIO_CAN1_RX_1
|
||||
#define GPIO_CAN1_TX GPIO_CAN1_TX_1
|
||||
|
||||
/* SPI */
|
||||
#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */
|
||||
#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */
|
||||
#define GPIO_SPI2_SCK GPIO_SPI2_SCK_1 /* PB10 */
|
||||
|
||||
#endif /* __ARCH_BOARD_BOARD_H */
|
||||
@@ -0,0 +1,42 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
// DMA1 Channel/Stream Selections
|
||||
//--------------------------------------------//---------------------------//----------------
|
||||
#define DMACHAN_SPI2_RX DMAMAP_SPI2_RX // DMA1, Stream 3, Channel 0
|
||||
#define DMACHAN_SPI2_TX DMAMAP_SPI2_TX // DMA1, Stream 4, Channel 0
|
||||
|
||||
// DMA2 Channel/Stream Selections
|
||||
//--------------------------------------------//---------------------------//----------------
|
||||
@@ -0,0 +1,149 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_DISABLE_ENVIRON is not set
|
||||
# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
|
||||
# CONFIG_DISABLE_PTHREAD is not set
|
||||
# CONFIG_NSH_DISABLEBG is not set
|
||||
# CONFIG_NSH_DISABLESCRIPT is not set
|
||||
# CONFIG_NSH_DISABLE_CAT is not set
|
||||
# CONFIG_NSH_DISABLE_CD is not set
|
||||
# CONFIG_NSH_DISABLE_CP is not set
|
||||
# CONFIG_NSH_DISABLE_DATE is not set
|
||||
# CONFIG_NSH_DISABLE_DF is not set
|
||||
# CONFIG_NSH_DISABLE_ECHO is not set
|
||||
# CONFIG_NSH_DISABLE_ENV is not set
|
||||
# CONFIG_NSH_DISABLE_EXEC is not set
|
||||
# CONFIG_NSH_DISABLE_EXPORT is not set
|
||||
# CONFIG_NSH_DISABLE_FREE is not set
|
||||
# CONFIG_NSH_DISABLE_GET is not set
|
||||
# CONFIG_NSH_DISABLE_HELP is not set
|
||||
# CONFIG_NSH_DISABLE_ITEF is not set
|
||||
# CONFIG_NSH_DISABLE_KILL is not set
|
||||
# CONFIG_NSH_DISABLE_LOOPS is not set
|
||||
# CONFIG_NSH_DISABLE_LS is not set
|
||||
# CONFIG_NSH_DISABLE_MKDIR is not set
|
||||
# CONFIG_NSH_DISABLE_MOUNT is not set
|
||||
# CONFIG_NSH_DISABLE_MV is not set
|
||||
# CONFIG_NSH_DISABLE_PS is not set
|
||||
# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set
|
||||
# CONFIG_NSH_DISABLE_PWD is not set
|
||||
# CONFIG_NSH_DISABLE_RM is not set
|
||||
# CONFIG_NSH_DISABLE_RMDIR is not set
|
||||
# CONFIG_NSH_DISABLE_SEMICOLON is not set
|
||||
# CONFIG_NSH_DISABLE_SET is not set
|
||||
# CONFIG_NSH_DISABLE_SLEEP is not set
|
||||
# CONFIG_NSH_DISABLE_SOURCE is not set
|
||||
# CONFIG_NSH_DISABLE_TEST is not set
|
||||
# CONFIG_NSH_DISABLE_TIME is not set
|
||||
# CONFIG_NSH_DISABLE_UMOUNT is not set
|
||||
# CONFIG_NSH_DISABLE_UNSET is not set
|
||||
# CONFIG_NSH_DISABLE_USLEEP is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD_CUSTOM=y
|
||||
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/mag/nuttx-config"
|
||||
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
|
||||
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
|
||||
CONFIG_ARCH_CHIP="stm32"
|
||||
CONFIG_ARCH_CHIP_STM32=y
|
||||
CONFIG_ARCH_CHIP_STM32F412CE=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=768
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARMV7M_MEMCPY=y
|
||||
CONFIG_ARMV7M_USEBASEPRI=y
|
||||
CONFIG_BOARDCTL_RESET=y
|
||||
CONFIG_BOARD_ASSERT_RESET_VALUE=0
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BOARD_RESET_ON_ASSERT=2
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_HARDFAULT_ALERT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_DEBUG_TCBINFO=y
|
||||
CONFIG_DEFAULT_SMALL=y
|
||||
CONFIG_DEV_PIPE_MAXSIZE=1024
|
||||
CONFIG_DEV_PIPE_SIZE=70
|
||||
CONFIG_FDCLONE_STDIO=y
|
||||
CONFIG_FS_CROMFS=y
|
||||
CONFIG_FS_ROMFS=y
|
||||
CONFIG_GRAN=y
|
||||
CONFIG_GRAN_INTR=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=750
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
CONFIG_INIT_STACKSIZE=2624
|
||||
CONFIG_LIBC_FLOATINGPOINT=y
|
||||
CONFIG_LIBC_LONG_LONG=y
|
||||
CONFIG_LIBC_MAX_EXITFUNS=1
|
||||
CONFIG_MEMSET_64BIT=y
|
||||
CONFIG_MEMSET_OPTSPEED=y
|
||||
CONFIG_MM_REGIONS=2
|
||||
CONFIG_NAME_MAX=40
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_ARGCAT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_CMDPARMS=y
|
||||
CONFIG_NSH_CROMFSETC=y
|
||||
CONFIG_NSH_LINELEN=128
|
||||
CONFIG_NSH_MAXARGUMENTS=15
|
||||
CONFIG_NSH_NESTDEPTH=8
|
||||
CONFIG_NSH_QUOTE=y
|
||||
CONFIG_NSH_ROMFSETC=y
|
||||
CONFIG_NSH_ROMFSSECTSIZE=128
|
||||
CONFIG_NSH_VARS=y
|
||||
CONFIG_PIPES=y
|
||||
CONFIG_PREALLOC_TIMERS=50
|
||||
CONFIG_PTHREAD_MUTEX_ROBUST=y
|
||||
CONFIG_PTHREAD_STACK_MIN=512
|
||||
CONFIG_RAM_SIZE=262144
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_READLINE_CMD_HISTORY=y
|
||||
CONFIG_READLINE_TABCOMPLETION=y
|
||||
CONFIG_SCHED_HPWORK=y
|
||||
CONFIG_SCHED_HPWORKPRIORITY=254
|
||||
CONFIG_SCHED_HPWORKSTACKSIZE=3000
|
||||
CONFIG_SCHED_INSTRUMENTATION=y
|
||||
CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y
|
||||
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SERIAL_TERMIOS=y
|
||||
CONFIG_SIG_DEFAULT=y
|
||||
CONFIG_SIG_SIGALRM_ACTION=y
|
||||
CONFIG_SIG_SIGUSR1_ACTION=y
|
||||
CONFIG_SIG_SIGUSR2_ACTION=y
|
||||
CONFIG_SIG_SIGWORK=4
|
||||
CONFIG_STACK_COLORATION=y
|
||||
CONFIG_START_DAY=30
|
||||
CONFIG_START_MONTH=11
|
||||
CONFIG_STDIO_BUFFER_SIZE=32
|
||||
CONFIG_STM32_ADC1=y
|
||||
CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
|
||||
CONFIG_STM32_DMA1=y
|
||||
CONFIG_STM32_DMA2=y
|
||||
CONFIG_STM32_FLASH_CONFIG_G=y
|
||||
CONFIG_STM32_FLASH_PREFETCH=y
|
||||
CONFIG_STM32_FLOWCONTROL_BROKEN=y
|
||||
CONFIG_STM32_JTAG_SW_ENABLE=y
|
||||
CONFIG_STM32_PWR=y
|
||||
CONFIG_STM32_SERIALBRK_BSDCOMPAT=y
|
||||
CONFIG_STM32_SERIAL_DISABLE_REORDERING=y
|
||||
CONFIG_STM32_SPI2=y
|
||||
CONFIG_STM32_SPI2_DMA=y
|
||||
CONFIG_STM32_SPI2_DMA_BUFFER=2048
|
||||
CONFIG_STM32_TIM8=y
|
||||
CONFIG_STM32_USART2=y
|
||||
CONFIG_STM32_USART_BREAKS=y
|
||||
CONFIG_STM32_WWDG=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_TASK_NAME_SIZE=24
|
||||
CONFIG_USART2_BAUD=57600
|
||||
CONFIG_USART2_RXBUFSIZE=600
|
||||
CONFIG_USART2_SERIAL_CONSOLE=y
|
||||
CONFIG_USART2_TXBUFSIZE=1100
|
||||
CONFIG_USEC_PER_TICK=1000
|
||||
@@ -0,0 +1,134 @@
|
||||
/****************************************************************************
|
||||
* nuttx-config/scripts/canbootloader_script.ld
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The STM32F412 has 1M of FLASH beginning at address 0x0800:0000 and
|
||||
* 256Kb of SRAM. SRAM is split up into three blocks:
|
||||
*
|
||||
* 1) 112Kb of SRAM beginning at address 0x2000:0000
|
||||
* 2) 16Kb of SRAM beginning at address 0x2001:c000
|
||||
* 3) 64Kb of SRAM beginning at address 0x2002:0000
|
||||
* 4) 64Kb of TCM SRAM beginning at address 0x1000:0000
|
||||
*
|
||||
* When booting from FLASH, FLASH memory is aliased to address 0x0000:0000
|
||||
* where the code expects to begin execution by jumping to the entry point in
|
||||
* the 0x0800:0000 address range.
|
||||
*
|
||||
* The first 0x10000 of flash is reserved for the bootloader.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K
|
||||
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
|
||||
ENTRY(__start) /* treat __start as the anchor for dead code stripping */
|
||||
EXTERN(_vectors) /* force the vectors to be included in the output */
|
||||
|
||||
/*
|
||||
* Ensure that abort() is present in the final object. The exception handling
|
||||
* code pulled in by libgcc.a requires it (and that code cannot be easily avoided).
|
||||
*/
|
||||
EXTERN(abort)
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
_stext = ABSOLUTE(.);
|
||||
*(.vectors)
|
||||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.got)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.r.*)
|
||||
_etext = ABSOLUTE(.);
|
||||
} > flash
|
||||
|
||||
/*
|
||||
* Init functions (static constructors and the like)
|
||||
*/
|
||||
.init_section : {
|
||||
_sinit = ABSOLUTE(.);
|
||||
KEEP(*(.init_array .init_array.*))
|
||||
_einit = ABSOLUTE(.);
|
||||
} > flash
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} > flash
|
||||
|
||||
__exidx_start = ABSOLUTE(.);
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx*)
|
||||
} > flash
|
||||
__exidx_end = ABSOLUTE(.);
|
||||
|
||||
_eronly = ABSOLUTE(.);
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > sram AT > flash
|
||||
|
||||
.bss : {
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > sram
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
/****************************************************************************
|
||||
* scripts/ld.script
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The STM32F412 has 1M of FLASH beginning at address 0x0800:0000 and
|
||||
* 256Kb of SRAM. SRAM is split up into three blocks:
|
||||
*
|
||||
* 1) 112Kb of SRAM beginning at address 0x2000:0000
|
||||
* 2) 16Kb of SRAM beginning at address 0x2001:c000
|
||||
* 3) 64Kb of SRAM beginning at address 0x2002:0000
|
||||
* 4) 64Kb of TCM SRAM beginning at address 0x1000:0000
|
||||
*
|
||||
* When booting from FLASH, FLASH memory is aliased to address 0x0000:0000
|
||||
* where the code expects to begin execution by jumping to the entry point in
|
||||
* the 0x0800:0000 address range.
|
||||
*
|
||||
* The first 0x10000 of flash is reserved for the bootloader.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash (rx) : ORIGIN = 0x08010000, LENGTH = 928K
|
||||
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
|
||||
ENTRY(__start) /* treat __start as the anchor for dead code stripping */
|
||||
EXTERN(_vectors) /* force the vectors to be included in the output */
|
||||
|
||||
/*
|
||||
* Ensure that abort() is present in the final object. The exception handling
|
||||
* code pulled in by libgcc.a requires it (and that code cannot be easily avoided).
|
||||
*/
|
||||
EXTERN(abort)
|
||||
EXTERN(_bootdelay_signature)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
_stext = ABSOLUTE(.);
|
||||
*(.vectors)
|
||||
. = ALIGN(8);
|
||||
/*
|
||||
* This section positions the app_descriptor_t used
|
||||
* by the make_can_boot_descriptor.py tool to set
|
||||
* the application image's descriptor so that the
|
||||
* uavcan bootloader has the ability to validate the
|
||||
* image crc, size etc
|
||||
*/
|
||||
KEEP(*(.app_descriptor))
|
||||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.got)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.r.*)
|
||||
_etext = ABSOLUTE(.);
|
||||
} > flash
|
||||
|
||||
/*
|
||||
* Init functions (static constructors and the like)
|
||||
*/
|
||||
.init_section : {
|
||||
_sinit = ABSOLUTE(.);
|
||||
KEEP(*(.init_array .init_array.*))
|
||||
_einit = ABSOLUTE(.);
|
||||
} > flash
|
||||
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} > flash
|
||||
|
||||
__exidx_start = ABSOLUTE(.);
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx*)
|
||||
} > flash
|
||||
__exidx_end = ABSOLUTE(.);
|
||||
|
||||
_eronly = ABSOLUTE(.);
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > sram AT > flash
|
||||
|
||||
.bss : {
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > sram
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2020 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader")
|
||||
|
||||
add_library(drivers_board
|
||||
boot_config.h
|
||||
boot.c
|
||||
led.c
|
||||
)
|
||||
target_link_libraries(drivers_board
|
||||
PRIVATE
|
||||
nuttx_arch
|
||||
nuttx_drivers
|
||||
canbootloader
|
||||
)
|
||||
target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader)
|
||||
|
||||
else()
|
||||
add_library(drivers_board
|
||||
can.c
|
||||
init.c
|
||||
led.c
|
||||
spi.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(drivers_board
|
||||
PRIVATE
|
||||
arch_spi
|
||||
drivers__led # drv_led_start
|
||||
nuttx_arch
|
||||
nuttx_drivers
|
||||
px4_layer
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,88 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file board_config.h
|
||||
*
|
||||
* board internal definitions
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* CAN Silent mode control */
|
||||
#define GPIO_CAN1_SILENT_S0 /* PB11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11)
|
||||
|
||||
/* CAN termination software control */
|
||||
#define GPIO_CAN1_TERMINATION /* PB13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN13)
|
||||
#define GPIO_CAN_TERM GPIO_CAN1_TERMINATION
|
||||
|
||||
/* Boot config */
|
||||
#define GPIO_BOOT_CONFIG /* PC15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN15|GPIO_EXTI)
|
||||
|
||||
/* LEDs are driven with open drain to support Anode to 5V or 3.3V */
|
||||
#define GPIO_TIM1_CH1 /* PA8 */ (GPIO_TIM1_CH1_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz)
|
||||
#define GPIO_TIM1_CH2 /* PA9 */ (GPIO_TIM1_CH2_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz)
|
||||
#define GPIO_TIM1_CH3 /* PA10 */ (GPIO_TIM1_CH3_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz)
|
||||
|
||||
#define FLASH_BASED_PARAMS
|
||||
|
||||
/* High-resolution timer */
|
||||
#define HRT_TIMER 3 /* use timer 3 for the HRT */
|
||||
#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */
|
||||
|
||||
#define PX4_GPIO_INIT_LIST { \
|
||||
GPIO_BOOT_CONFIG, \
|
||||
GPIO_CAN1_TX, \
|
||||
GPIO_CAN1_RX, \
|
||||
GPIO_CAN1_SILENT_S0, \
|
||||
GPIO_CAN1_TERMINATION, \
|
||||
}
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define BOARD_HAS_N_S_RGB_LED 1
|
||||
#define BOARD_MAX_LEDS BOARD_HAS_N_S_RGB_LED
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
extern void stm32_spiinitialize(void);
|
||||
|
||||
#include <px4_platform_common/board_common.h>
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
__END_DECLS
|
||||
@@ -0,0 +1,188 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2021 PX4 Development Team. All rights reserved.
|
||||
* Author: Ben Dyer <ben_dyer@mac.com>
|
||||
* Pavel Kirienko <pavel.kirienko@zubax.com>
|
||||
* David Sidrane <david_s5@nscdg.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_config.h>
|
||||
#include <stdint.h>
|
||||
#include "boot_config.h"
|
||||
#include "board.h"
|
||||
|
||||
#include <debug.h>
|
||||
#include <string.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include "led.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All STM32 architectures must provide the following entry point. This entry point
|
||||
* is called early in the initialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
__EXPORT void stm32_boardinitialize(void)
|
||||
{
|
||||
putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN, STM32_RCC_APB1ENR);
|
||||
stm32_configgpio(GPIO_CAN1_RX);
|
||||
stm32_configgpio(GPIO_CAN1_TX);
|
||||
stm32_configgpio(GPIO_CAN1_SILENT_S0);
|
||||
stm32_configgpio(GPIO_CAN1_TERMINATION);
|
||||
putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR);
|
||||
putreg32(getreg32(STM32_RCC_APB1RSTR) & ~RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR);
|
||||
|
||||
#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO)
|
||||
stm32_configgpio(GPIO_GETNODEINFO_JUMPER);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
* Name: board_deinitialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called by the bootloader code prior to booting
|
||||
* the application. Is should place the HW into an benign initialized state.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void board_deinitialize(void)
|
||||
{
|
||||
putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_get_product_name
|
||||
*
|
||||
* Description:
|
||||
* Called to retrieve the product name. The returned value is a assumed
|
||||
* to be written to a pascal style string that will be length prefixed
|
||||
* and not null terminated
|
||||
*
|
||||
* Input Parameters:
|
||||
* product_name - A pointer to a buffer to write the name.
|
||||
* maxlen - The maximum number of charter that can be written
|
||||
*
|
||||
* Returned Value:
|
||||
* The length of characters written to the buffer.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen)
|
||||
{
|
||||
DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME));
|
||||
memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME));
|
||||
return UAVCAN_STRLEN(HW_UAVCAN_NAME);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_get_hardware_version
|
||||
*
|
||||
* Description:
|
||||
* Called to retrieve the hardware version information. The function
|
||||
* will first initialize the the callers struct to all zeros.
|
||||
*
|
||||
* Input Parameters:
|
||||
* hw_version - A pointer to a uavcan_hardwareversion_t.
|
||||
*
|
||||
* Returned Value:
|
||||
* Length of the unique_id
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version)
|
||||
{
|
||||
memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t));
|
||||
|
||||
hw_version->major = HW_VERSION_MAJOR;
|
||||
hw_version->minor = HW_VERSION_MINOR;
|
||||
|
||||
return board_get_mfguid(*(mfguid_t *) hw_version->unique_id);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_indicate
|
||||
*
|
||||
* Description:
|
||||
* Provides User feedback to indicate the state of the bootloader
|
||||
* on board specific hardware.
|
||||
*
|
||||
* Input Parameters:
|
||||
* indication - A member of the uiindication_t
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)}
|
||||
|
||||
typedef begin_packed_struct struct led_t {
|
||||
uint8_t red;
|
||||
uint8_t green;
|
||||
uint8_t blue;
|
||||
uint8_t hz;
|
||||
} end_packed_struct led_t;
|
||||
|
||||
static const led_t i2l[] = {
|
||||
|
||||
led(0, off, 0, 0, 0, 0),
|
||||
led(1, reset, 128, 128, 128, 30),
|
||||
led(2, autobaud_start, 0, 128, 0, 1),
|
||||
led(3, autobaud_end, 0, 128, 0, 2),
|
||||
led(4, allocation_start, 0, 0, 64, 2),
|
||||
led(5, allocation_end, 0, 128, 64, 3),
|
||||
led(6, fw_update_start, 32, 128, 64, 3),
|
||||
led(7, fw_update_erase_fail, 32, 128, 32, 3),
|
||||
led(8, fw_update_invalid_response, 64, 0, 0, 1),
|
||||
led(9, fw_update_timeout, 64, 0, 0, 2),
|
||||
led(a, fw_update_invalid_crc, 64, 0, 0, 4),
|
||||
led(b, jump_to_app, 0, 128, 0, 10),
|
||||
|
||||
};
|
||||
|
||||
void board_indicate(uiindication_t indication)
|
||||
{
|
||||
rgb_led(i2l[indication].red,
|
||||
i2l[indication].green,
|
||||
i2l[indication].blue,
|
||||
i2l[indication].hz);
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* @file boot_config.h
|
||||
*
|
||||
* bootloader definitions that configures the behavior and options
|
||||
* of the Boot loader
|
||||
* This file is relies on the parent folder's boot_config.h file and defines
|
||||
* different usages of the hardware for bootloading
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
/* Bring in the board_config.h definitions
|
||||
* todo:make this be pulled in from a targed's build
|
||||
* files in nuttx*/
|
||||
|
||||
#include "board_config.h"
|
||||
#include "uavcan.h"
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <stm32_flash.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define OPT_PREFERRED_NODE_ID ANY_NODE_ID
|
||||
|
||||
//todo:wrap OPT_x in in ifdefs for command line definitions
|
||||
#define OPT_TBOOT_MS 3000
|
||||
#define OPT_NODE_STATUS_RATE_MS 800
|
||||
#define OPT_NODE_INFO_RATE_MS 50
|
||||
#define OPT_BL_NUMBER_TIMERS 7
|
||||
|
||||
/*
|
||||
* This Option set is set to 1 ensure a provider of firmware has an
|
||||
* opportunity update the node's firmware.
|
||||
* This Option is the default policy and can be overridden by
|
||||
* a jumper
|
||||
* When this Policy is set, the node will ignore tboot and
|
||||
* wait indefinitely for a GetNodeInfo request before booting.
|
||||
*
|
||||
* OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow
|
||||
* the polarity of the jumper to be True Active
|
||||
*
|
||||
* wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO
|
||||
* Jumper
|
||||
* yes 1 0 x
|
||||
* yes 1 1 Active
|
||||
* no 1 1 Not Active
|
||||
* no 0 0 X
|
||||
* yes 0 1 Active
|
||||
* no 0 1 Not Active
|
||||
*
|
||||
*/
|
||||
#define OPT_WAIT_FOR_GETNODEINFO 0
|
||||
#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1
|
||||
#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 1
|
||||
|
||||
#define OPT_ENABLE_WD 1
|
||||
|
||||
#define OPT_RESTART_TIMEOUT_MS 20000
|
||||
|
||||
/* Reserved for the Booloader */
|
||||
#define OPT_BOOTLOADER_SIZE_IN_K (1024*64)
|
||||
|
||||
/* Reserved for the application out of the total
|
||||
* system flash minus the BOOTLOADER_SIZE_IN_K
|
||||
*/
|
||||
#define OPT_APPLICATION_RESERVER_IN_K 0
|
||||
|
||||
#define OPT_APPLICATION_IMAGE_OFFSET OPT_BOOTLOADER_SIZE_IN_K
|
||||
#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K+OPT_APPLICATION_RESERVER_IN_K))
|
||||
|
||||
|
||||
#define FLASH_BASE STM32_FLASH_BASE
|
||||
#define FLASH_SIZE STM32_FLASH_SIZE
|
||||
|
||||
#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET)
|
||||
#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET)
|
||||
#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t)))
|
||||
#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t)))
|
||||
#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t)))
|
||||
|
||||
/* If this board uses big flash that have large sectors */
|
||||
|
||||
#define OPT_USE_YIELD
|
||||
|
||||
/* Bootloader Option*****************************************************************
|
||||
*
|
||||
*/
|
||||
#define GPIO_GETNODEINFO_JUMPER (GPIO_BOOT_CONFIG & ~GPIO_EXTI)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user