Compare commits

...

144 Commits

Author SHA1 Message Date
Daniel Agar a88c6434b6 control_allocator: add parameter based ActuatorEffectivenessCustom
- this allows creating a custom actuator effectiveness entirely from
parameters of the form CA_ACTn_TRQ_{R,P,Y} and CA_ACTn_THR_{X,Y,Z}
2021-10-27 14:25:03 -04:00
Daniel Agar 43d7d83a4b control_allocator: push VTOL flight phase into ActuatorEffectiveness 2021-10-27 13:42:22 -04:00
Daniel Agar eb362f2f63 control_allocator: replace ModuleParams with generated parameter strings as needed 2021-10-27 12:48:42 -04:00
Peter van der Perk 51abb804ac UAVCANv1 Fix NodeClient header and Kconfig merge logic 2021-10-27 10:07:01 -04:00
Beat Küng 0decdb1c7b github action: run ./Tools/generate_board_targets_json.py in container
As it requires kconfiglib
2021-10-27 15:23:23 +02:00
Silvan Fuhrer e715e6c245 Fixed-wing position control: set yaw_sp to yaw_current instead of nav_bearing when not controlled
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-27 14:35:00 +03:00
Silvan Fuhrer b53808d11b fixed-wing: set yaw_sp to yaw_current instead of 0 when not controlled
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-27 14:35:00 +03:00
Silvan Fuhrer da4d6dc657 L1: increase the max allowed tangential velocity in the opposite direction to 2m/s
There is logic in L1 that prevents the vehicle from trying to achieve
an impossible loiter entry (e.g. due to wind). That check makes the
vehicle track the loiter center if the tangential velocity is in the wrong
direction while loitering. After the vehicle flies through the center, it can
then turn the other way around to join the loiter.
This check is though too sensitive if it purely checks for the wrong direction,
and it can end in delayed loiter entry for no reason.
This commit increases the threshold to 2m/s of tangential velocity
in the wrong direction to trigger the check.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-27 12:32:58 +03:00
RomanBapst eee5f501cd navigator: fix flyaway when altitude change is commanded without a valid
triplet

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-10-27 11:01:13 +03:00
RomanBapst bf6a47ba6a navigator: cleanup of set_loiter_item
Unwraps the set_loiter_item() to solve the issue where the altitdue setpoint
in a MC takeoff wasn't correctly used.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-10-27 11:01:13 +03:00
Silvan Fuhrer cb78ba34d7 Mission: for tangential loiter exit, set current position setpoint typ to position
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-27 11:01:13 +03:00
Silvan Fuhrer 4b21c0c49e Fw Pos C: always reset pos_sp type from LOITER to POSITION if far away
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-27 11:01:13 +03:00
RomanBapst d678e792cc mission_block: don't require an exiting heading when loitering if the next
waypoint is within the loiter radius of the current waypoint

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-10-27 11:01:13 +03:00
Michael Schaeuble 5e1f62e9d0 Add option to warn the pilot in case of strong magnetic interference but still allow arming.
This PR changes the COM_ARM_MAG_STR parameter to accept values. If the parameter is set to 2, the check is performed and a warning is logged but the vehicle can still arm.
2021-10-27 09:59:18 +02:00
ponomarevda 2b6bd452df fix hardpoint hardfault by checking argc before std::strcmp 2021-10-27 08:11:23 +02:00
Beat Küng de488f0f40 omnibus/f4sd: add topic listener & change timer order
So it matches the usage in the channel definition order
2021-10-27 08:03:55 +02:00
Beat Küng 8476875b4d Kconfig: add missing serial ports 2021-10-27 08:03:55 +02:00
Beat Küng 48344c6e2a state_machine_helper: add missing 'break' (no behavior change) 2021-10-27 08:03:55 +02:00
Daniel Agar 6d0c6bb6ce lib/world_magnetic_model: cmake remove helper target BYPRODUCTS
- otherwise ninja will try to rebuild these
2021-10-26 18:52:12 -04:00
dagar a2801bab80 [AUTO COMMIT] update change indication 2021-10-26 14:39:58 -04:00
Daniel Agar 88a979cf1d lib/world_magnetic_model: add cmake helpers for updating tables
- `world_magnetic_model_update` to fetch latest geo_magnetic_tables.hpp
 - `world_magnetic_model_tests_update` to fetch latest test_geo_lookup.cpp
2021-10-26 14:39:58 -04:00
Peter van der Perk 24ab430466 Tools/generate_board_targets_json.py: fix json board targets regression from #17100 2021-10-26 16:15:39 +02:00
bresch d0f89f7fff ekf2: refactor wind reset functions 2021-10-26 10:18:56 +02:00
bresch 456dfcb4b9 ekf2: update getter for true airspeed 2021-10-26 10:18:56 +02:00
bresch 3927c183de ekf2_test: adjust airspeed unit test
an airpseed of > 2m/s is required to start the fusion (set by param)
fw mode is also required

Given the larger estimated windspeed after those changes, the change of
static pressure is larger and the height estimate takes more time to
reach the final value
2021-10-26 10:18:56 +02:00
bresch 6e8f0e92ff ekf2: refactor airspeed fusion control logic 2021-10-26 10:18:56 +02:00
bresch 8873e92c7c ekf: force fallback to baro if GPS is stopped while in GPS height mode
Otherwise, no height aiding source is used
2021-10-26 10:05:28 +02:00
bresch 0a140ec59a ekf2_test: add GPS height to baro fallback 2021-10-26 10:05:28 +02:00
bresch f4c21cedd9 ekf2_test: use motion_planning for dynamic yaw emergency test 2021-10-25 18:06:38 -04:00
bresch 340a2caa8e ekf2_test: use motion_planning library
The VelocitySmoothing class from the motion_planning library is used to
generate trajectories in order to test the EKF convergence during motion
2021-10-25 18:06:38 -04:00
David Sidrane 38e2e6a01f Use NuttX MPU Reset (#18283)
* NuttX with MPU reset backports

* Use NuttX MPU reset
2021-10-25 18:05:31 -04:00
alexklimaj 8088c82b6a Add CANNODE_FLOW_ROT 2021-10-25 16:31:00 -04:00
Jaeyoung-Lim 5dcaadf492 Fix px4vision defaults 2021-10-25 16:29:52 -04:00
Landon Haugh 24cd0c6fa3 Enablement of PX4 SPI driver for UCANS32K146 2021-10-25 08:36:54 -07:00
Daniel Agar a548c94230 boards: holybro_durandal-v1_default disable modules to save flash 2021-10-25 13:41:31 +02:00
bresch 6ec9ab11f2 add fw auto-tune module to board configs 2021-10-25 13:41:31 +02:00
bresch 95e2941b17 fw att: inject system identification signal to controller 2021-10-25 13:41:31 +02:00
bresch 6af0856558 add FF to FW rate controllers 2021-10-25 13:41:31 +02:00
bresch 55f0860c31 fw atune: add fixed-wing auto-tuning module 2021-10-25 13:41:31 +02:00
bresch 8dfdb1e3db compute and publish fixed-wing control power 2021-10-25 13:41:31 +02:00
RomanBapst d84b0296d2 support orbit command in fixed wing mode
Signed-off-by: RomanBapst <bapstroman@gmail.com>

commander: support orbit mode for fixed wings

Signed-off-by: RomanBapst <bapstroman@gmail.com>

FwPositionControl: publish orbit status

Signed-off-by: RomanBapst <bapstroman@gmail.com>

commander:reject orbit mode while doing a vtol transition

Signed-off-by: RomanBapst <bapstroman@gmail.com>

FixedWingPositionControl: explicitly cast waypoint for Orbit status

FixedwingPositionControl: fill missing orbit_status fields

navigator_main: handle reposition/orbit corner cases

- set orbit rotation direction correctly
- send mavlink message when orbit is rejected

FixedWingPositionControl: correctly report rotation direction in orbit_status

navigator: hack to not break orbit while doing altitude changes

Signed-off-by: RomanBapst <bapstroman@gmail.com>

navigator: set cruise throttle for orbit command

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-10-25 09:48:27 +02:00
Daniel Agar 93eb0162e5 drivers/uavcan_v1: fix Kconfig trailing whitespace 2021-10-25 08:15:46 +02:00
Silvan Fuhrer f9cfcc5cfa AirspeedSelector: add bitmask to enable checks seperately in ASPD_DO_CHECKS
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer 73fe300c00 WindEstimator: remove option to disable scale estimation
The situation where this would be desired is unclear, plus it's basically
the same as setting ASPD_SC_P_NOISE to a very small value.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer b38bf23d6e WindEstimator: avoid division by 0
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer c0754cf324 AirspeedValidator: pass vI as reference
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer f9682b86d1 AirspeedSelector: some clean up
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer 7537fa36c8 AirspeedValidator: fix airspeed scale validation (feed raw TAS)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer a2faac148f AirspeedValidator: check_airspeed_innovation() check absolute innovations
Do no longer use tas_innovation from wind estimator and test ratio, but calculate
the innovation  based on wind estimate, TAS measurement (including currently applied scale)
and ground velocity. Use innovations directly to trigger failure.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer f6d37ecacf AirspeedSelector: make sure we don't try to access a negative array index
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer ccab93e68b AirspeedSelector: use Vector3f
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer 259b851ba7 WindEstimator: remove filter reset due to airspeed measurement rejection
As the purpose of this wind estimator is to (mainly) catch airspeed failures,
we don't value estimator stability as much as the reliability to catch
actual sensor issues, and thus do not reset the filter (as this may hide
a real issue with the sensor)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer 3ad901e51d Wind Estimator: use time_literals
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer cad7851774 AirspeedSelector: add _CAS_scale_validated to airspeed_wind for logging
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
Silvan Fuhrer 625f556b0e AirspeedSelector: airspeed scale estimation improvements and robustification
- run airspeed scale estimation always, not in dedicated mode
- add option to apply scale automatically, with extra feasibility check
- add airspeed scale for all 3 possible airspeed instances
- clean up parameters
- add check for data stuck (non-changing airspeed data)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-22 17:00:35 +02:00
RomanBapst 8e8c6efd66 Mission block: do not care for altitdue acceptance when approaching backtransition point
Not accepting the waypoint causes the vehicle to perform a sharp turn after passing
the land waypoint and this causes worse unexected behavior.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-10-22 15:37:10 +02:00
Matthias Grob 3d50adc5fe astyle: restore backwards compatibility with old pre-commit hook
I removed the filtering logic from the shell script in #18482 because
the new pre-commit hook already takes care of it.

The problem is if you don't update the .git/hooks/pre-commit file and
use the new shell script there's no filtering
of files done and it checks all files for every file.

This commit restores backwards compatibility because it does not hurt
until I have an automatic way to update the pre-commit hook file.
2021-10-22 12:56:21 +02:00
bresch 78fe6e2152 VelocitySmoothing: fix issue when delta vel is the same on all axes
When the change in velocity is exactly the same on several axes, the T1
of the recumputed trajectories after time sync was set to 0 because it
was skipping both if and else if.
2021-10-22 10:54:36 +02:00
mcsauder 9301288d1f Add parameter and logic to set RTL heading mode. 2021-10-22 09:28:30 +02:00
Matthias Grob 6938d24ec7 pre-commit hook: show all style issues, not just the ones from the first file 2021-10-21 19:07:13 -04:00
Matthias Grob 2716ce7a56 pre-commit hook: clear output with error, file name, diff, instructions 2021-10-21 19:07:13 -04:00
Matthias Grob 4454fe9770 pre-commit hook: don't unstage the entire file containing a style issue 2021-10-21 19:07:13 -04:00
Daniel Agar 19952768fb boards: try to keep test boards in sync 2021-10-21 15:59:15 -04:00
Daniel Agar 6fb1c79ef0 mixer_module: reject mixer load and reset when dynamic mixing is enabled 2021-10-21 11:27:33 -07:00
Daniel Agar f1016dc32c boards: add systemcmds/topic_listener to CAN nodes 2021-10-21 14:06:11 -04:00
Daniel Agar 17328bef69 Jenkins attach GDB and print back trace on failure 2021-10-21 14:04:33 -04:00
David Sidrane 258cde668c nxp_fmurt1062-v1:Pared down boardconfig 2021-10-21 11:04:34 -04:00
David Sidrane 0e29cb31e6 nxp_fmurt1062-v1:Pull more code into XIP Flash 2021-10-21 11:04:34 -04:00
David Sidrane ff3a76d918 nxp_fmurt1062-v1:Needs to usne ocram Linker script 2021-10-21 11:04:34 -04:00
Daniel Agar ea9c64dcd9 drivers/uavcan: add new UAVCAN_SUB_* parameters to enable subscriptions
- only GPS and mag are enabled by default
2021-10-21 09:55:04 -04:00
Silvan Fuhrer fd96bbf9b9 Mavlink: bump MAX_REMOTE_COMPONENTS to 16
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-21 07:48:50 +02:00
Daniel Agar 4247e1320b px4io: allow switching to rate ctrl wq 2021-10-20 09:56:42 -04:00
Beat Küng c0f75b1c79 dshot: add missing '#pragma GCC diagnostic push' 2021-10-20 08:11:07 +02:00
Daniel Agar 757424c2c0 clang-tidy ignore modernize-raw-string-literal for now 2021-10-20 08:10:05 +02:00
Beat Küng 8a2b310b83 topic_listener: avoid code generation, use existing metadata at runtime
This reduces flash size for v5 by ~110KB, the topic listener now only adds
about 1.2KB.
2021-10-20 08:10:05 +02:00
Beat Küng a0e72b35a4 replay: ignore ULogMessageType::PARAMETER_DEFAULT messages 2021-10-20 08:10:05 +02:00
Beat Küng 4c73ac3805 uorb: use single byte for internal types in o_fields metadata
Reduces flash usage by ~9KB.
2021-10-20 08:10:05 +02:00
Landon Haugh 9aaf6e3f3e [NXP_UCANS32K146] Increase usermain stack size to prevent init overrun 2021-10-19 20:17:11 -04:00
Thomas Debrunner f4a85fa951 rcS: Allow startup files to be located on SD card 2021-10-19 14:08:38 -04:00
alexklimaj 6daa579e46 Add ARK RTK GPS Debug, turn on UART RX DMA 2021-10-19 13:30:46 -04:00
mcsauder 21163d859e Whitespace cleanup. 2021-10-19 13:29:26 -04:00
Daniel Agar 4cf8eb8226 ekf2: EKF vehicle_at_rest always require some rotation in addition to vibration metrics 2021-10-18 21:39:40 -04:00
Daniel Agar 33954a904f lib/tunes: never play tunes if circuit breaker is set 2021-10-18 21:37:09 -04:00
Daniel Agar b08f20806b ROMFS: rcS don't play startup tune until after UAVCAN and px4io
- fixes potential duplicate startup tune
2021-10-18 21:37:09 -04:00
Tia 6e3e6846f4 Fix srf05 driver. 2021-10-18 21:00:59 -04:00
bazooka joe b35dd86d04 mc_pos_control: remove unused var 2021-10-18 20:37:18 -04:00
bazooka joe c8d6f8f5e5 remove proto for unused function limit_thrust_during_landing() 2021-10-18 20:37:18 -04:00
Daniel Agar 9d7c4596f7 navigator: increase stack 1800 -> 1864 bytes 2021-10-18 20:31:35 -04:00
Daniel Agar b20d8207a7 Jenkins: compile delete obsolete px4_fmu-v5_ctrlalloc 2021-10-18 20:11:58 -04:00
Beat Küng 3e9c88e48e px4/fmu-v5 test, uavcanv0periph: disable modules to reduce flash 2021-10-18 18:45:19 -04:00
Beat Küng da1df5352c fix pwm: only update oneshot timers owned by the current pwm_out instance
This fixes the case where oneshot was enabled with multi-instance pwm_out,
triggering oneshot updates too close to each other and as a result could
lead to spinning motors while disarmed.
2021-10-18 18:45:19 -04:00
Daniel Agar 2ed623c8ae boards: px4_fmu-v6x_default disable modules to save flash 2021-10-18 18:45:19 -04:00
Daniel Agar be868aae92 boards: px4_fmu-v5_uavcanv0periph disable modules to save flash 2021-10-18 18:45:19 -04:00
Daniel Agar a7a2aa3b74 boards: px4_fmu-v3_test disable modules to save flash 2021-10-18 18:45:19 -04:00
Beat Küng cc1d24a5fe ci compile_nuttx: disable fail-fast
So that all failures can be evaluated.
2021-10-18 18:45:19 -04:00
Beat Küng d01f2b1d40 cubepilot/cubeorange test: disable uavcan to reduce flash usage 2021-10-18 18:45:19 -04:00
Beat Küng dbd4426271 nxp/fmurt1062-v1: set CONSTRAINED_FLASH 2021-10-18 18:45:19 -04:00
Beat Küng e36a8f3765 ROMFS: disable vtol airframes for kakutef7 2021-10-18 18:45:19 -04:00
Beat Küng f1686b1abf px4io: add dynamic mixing support 2021-10-18 18:45:19 -04:00
Beat Küng 837a1066e0 px4io, pwm_out: update pwm default checking
The defaults changed in the previous commit for per-channel params,
so we make sure that the overall params are still used as long as the
per-channel params are default.
2021-10-18 18:45:19 -04:00
Beat Küng ab1d76ae7d params: use PWM_MAIN_* instead of PWM_FMU_* 2021-10-18 18:45:19 -04:00
Beat Küng ba4a1ec6c4 boards/px4/io-v2: swap timer definitions
So that the ordering of the generated params make more sense.
TIM1 is now for channels 2-4 instead of 5-8.
2021-10-18 18:45:19 -04:00
Beat Küng 319e90961b output_groups_from_timer_config.py: fix timer index
The implementation assumed timers are defined in the same order as used
in the channels. This could lead to a mismatch between TIMx param and
actual timer config.
Now we use the actual array index, same as in the code.
2021-10-18 18:45:19 -04:00
Beat Küng 183ab8bbe7 control_allocator: avoid default argument for virtual method getEffectivenessMatrix
clang tidy error:
/__w/PX4-Autopilot/PX4-Autopilot/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessMultirotor.cpp:50:34: error: default arguments on virtual or override methods are prohibited [google-default-arguments,-warnings-as-errors]
ActuatorEffectivenessMultirotor::getEffectivenessMatrix(matrix::Matrix<float, NUM_AXES, NUM_ACTUATORS> &matrix,
2021-10-18 18:45:19 -04:00
Beat Küng 563cf61126 module_schema.yaml: add actuator_output section
The parameter additions are only used internally for the pwm generator.
2021-10-18 18:45:19 -04:00
Beat Küng 8b3ab7e36d fix pwm_out: ensure up_pwm_servo_arm() is never continuously called
This happened with multi-instance, when the second instance did not load
a mixer. Then the first instance would always return false in
update_pwm_out_state, and continuously call up_pwm_servo_arm.
This led to irregular pulses, e.g. with an output set to fixed 1500us, I
saw pulses of e.g. 1800us occationally (they were in a range of
[1500-2100]).
2021-10-18 18:45:19 -04:00
Beat Küng 838ec5d485 airframes: set output function params for ctrlalloc airframes 2021-10-18 18:45:19 -04:00
Beat Küng 44bbe87165 pwm_out_sim: use PWM_FMU for sitl and HIL_ACT for hitl
We might want to change this later, but for now it allows to use the same
airframe configs for sitl/real, and independent hitl configuration.
2021-10-18 18:45:19 -04:00
Beat Küng 2b039b2af8 px4/fmu-v6x: add capture pins to list of pwm pins 2021-10-18 18:45:19 -04:00
Beat Küng 4e0e2dec57 fmu-v6u: add capture pins to list of pwm pins 2021-10-18 18:45:19 -04:00
Beat Küng 4a4acf7ead px4/fmu-v5x: add capture pins to list of pwm pins 2021-10-18 18:45:19 -04:00
Beat Küng faf481df31 modalai/fc-v2: remove unused DIRECT_PWM_CAPTURE_CHANNELS define 2021-10-18 18:45:19 -04:00
Beat Küng d28dd5cc14 holybro/pix32v5: add capture pins to list of pwm pins 2021-10-18 18:45:19 -04:00
Beat Küng d9bf03b2dc holybro/durandal-v1: add capture pins to list of pwm pins 2021-10-18 18:45:19 -04:00
Beat Küng 0ab4a24de8 px4/fmu-v5: add capture pins to list of pwm pins 2021-10-18 18:45:19 -04:00
Beat Küng a01cf2efc0 rc.mc_apps: allow to set COM_PREARM_MODE with control allocation
This is safe now.
2021-10-18 18:45:19 -04:00
Beat Küng 21c1671693 pwm_out_sim: add dynamic mixing support 2021-10-18 18:45:19 -04:00
Beat Küng 0871b7974d uavcan_v1: add dynamic mixing support 2021-10-18 18:45:19 -04:00
Beat Küng ae15ad14a8 tap_esc: add dynamic mixing support 2021-10-18 18:45:19 -04:00
Beat Küng 35ce6d1b73 pca9685_pwm_out: add dynamic mixing support 2021-10-18 18:45:19 -04:00
Beat Küng 955179e992 linux_pwm_out: add dynamic mixing support 2021-10-18 18:45:19 -04:00
Beat Küng c1e5e666f0 pwm_out, dshot: add dynamic mixing support 2021-10-18 18:45:19 -04:00
Beat Küng 3ff6014a3c uavcan: implement servo outputs 2021-10-18 18:45:19 -04:00
Beat Küng 07fa8c5295 uavcan: reduce sensor status output verbosity 2021-10-18 18:45:19 -04:00
Beat Küng 49f8131f82 uavcan: add dynamic mixing support 2021-10-18 18:45:19 -04:00
Beat Küng 5f0781b6e9 output modules: add param prefix argument to MixingOutput 2021-10-18 18:45:19 -04:00
Beat Küng f5fbcb0770 dshot: handle telemetry index correctly when dynamic mixer is used 2021-10-18 18:45:19 -04:00
Beat Küng d951c74a7d spracing/h7extreme: use single-line comments instead of multi-lines
Required for output_groups_from_timer_config.py parser
2021-10-18 18:45:19 -04:00
Beat Küng 916447e804 params: add script to parse timer_config.cpp for timer group info
This allows to generate pwm params in the form of:
module_name: PWM Output
actuator_output:
  output_groups:
    - generator: pwm
      param_prefix: PWM_FMU
      channel_labels: ['PWM Main', 'PWM Capture']
      standard_params:
        disarmed: { min: 800, max: 2200, default: 900 }
        min: { min: 800, max: 1400, default: 1000 }
        max: { min: 1600, max: 2200, default: 2000 }
        failsafe: { min: 800, max: 2200 }
      extra_function_groups: [ pwm_fmu ]
      pwm_timer_param:
        description:
            short: Output Protocol Configuration for ${label}
            long: |
                Select which Output Protocol to use for outputs ${label}.

                Custom PWM rates can be used by directly setting any value >0.
        type: enum
        default: 400
        values:
            -5: DShot150
            -4: DShot300
            -3: DShot600
            -2: DShot1200
            -1: OneShot
            50: PWM50
            100: PWM100
            200: PWM200
            400: PWM400
        reboot_required: true
2021-10-18 18:45:19 -04:00
Beat Küng db28ea9cfa generate_params.py: extend params 'definitions' section to support a list
allows to add multiple entries for a multi-instance param with different
instance_start
2021-10-18 18:45:19 -04:00
Beat Küng 6f01b69f49 mixer_module: add param generation for disarmed, min, max, failsafe 2021-10-18 18:45:19 -04:00
Beat Küng 6424faccb1 generate_params.py: fix parse_yaml_parameters_config
Correctly handle multiple parameter sections
2021-10-18 18:45:19 -04:00
Beat Küng 15daded6b0 refactor output_limit: split output_limit_calc_single into separate function 2021-10-18 18:45:19 -04:00
Beat Küng c55626d2d6 refactor Tools/serial: move non-serial param generation into separate script 2021-10-18 18:45:19 -04:00
Beat Küng a65533b469 mixer_module: add output functions for servos, landing gear, parachute, RC passthrough & gimbal 2021-10-18 18:45:19 -04:00
Beat Küng 4b37a3d017 mixer_module: generate output_functions header from yaml file 2021-10-18 18:45:19 -04:00
Beat Küng fd76e5488e mixer_module: add output functions 2021-10-18 18:45:19 -04:00
Beat Küng ab3fe77f46 mavlink_receiver: publish MAV_CMD_DO_SET_ACTUATOR command 2021-10-18 18:45:19 -04:00
Beat Küng 5103f00de3 vehicle_command.msg: add VEHICLE_CMD_DO_SET_ACTUATOR 2021-10-18 18:45:19 -04:00
Beat Küng 38fa65a47e control_allocator: remove direct mixer, add actuator_{motors,servos} instead 2021-10-18 18:45:19 -04:00
Beat Küng a51c465b54 control allocation: introduce parameter SYS_CTRL_ALLOC & unify build targets 2021-10-18 18:45:19 -04:00
Beat Küng 0c5a79d84d fix mixer_module: use PRIx32 for debug printf 2021-10-18 18:45:19 -04:00
Beat Küng ad1bcfd77c commander: correct lockdown CLI description 2021-10-18 18:45:19 -04:00
AuroraRAS 62dd38fe35 Prepare for Android NDK build
Modify CMakeList.txt prepare for Android NDK build

Signed-off-by: AuroraRAS <chplee@gmail.com>
2021-10-18 14:55:56 -04:00
399 changed files with 13288 additions and 8824 deletions
-1
View File
@@ -86,7 +86,6 @@ pipeline {
"px4_fmu-v3_default",
"px4_fmu-v4_default",
"px4_fmu-v4pro_default",
"px4_fmu-v5_ctrlalloc",
"px4_fmu-v5_debug",
"px4_fmu-v5_default",
"px4_fmu-v5_rtps",
+18 -76
View File
@@ -21,7 +21,7 @@ pipeline {
sh 'make cubepilot_cubeorange_test'
sh 'make cubepilot_cubeorange_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'cubepilot_cubeorange_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'cubepilot_cubeorange_test'
}
post {
always {
@@ -70,6 +70,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/cubepilot_cubeorange_test/cubepilot_cubeorange_test.elf || true'
resetBoard()
}
}
@@ -91,7 +92,7 @@ pipeline {
sh 'make cuav_x7pro_test'
sh 'make cuav_x7pro_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'cuav_x7pro_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'cuav_x7pro_test'
}
post {
always {
@@ -138,6 +139,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/cuav_x7pro_test/cuav_x7pro_test.elf || true'
resetBoard()
}
}
@@ -159,7 +161,7 @@ pipeline {
sh 'make px4_fmu-v3_test'
sh 'make px4_fmu-v3_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v3_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v3_test'
}
post {
always {
@@ -206,6 +208,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v3_test/px4_fmu-v3_test.elf || true'
resetBoard()
}
}
@@ -227,7 +230,7 @@ pipeline {
sh 'make px4_fmu-v4_test'
sh 'make px4_fmu-v4_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v4_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v4_test'
}
post {
always {
@@ -273,6 +276,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v4_test/px4_fmu-v4_test.elf || true'
resetBoard()
}
}
@@ -294,7 +298,7 @@ pipeline {
sh 'make px4_fmu-v4pro_test'
sh 'make px4_fmu-v4pro_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v4pro_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v4pro_test'
}
post {
always {
@@ -341,6 +345,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v4pro_test/px4_fmu-v4pro_test.elf || true'
resetBoard()
}
}
@@ -362,7 +367,7 @@ pipeline {
sh 'make px4_fmu-v5_debug'
sh 'make px4_fmu-v5_debug bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v5_debug'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v5_debug'
}
post {
always {
@@ -420,6 +425,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v5_debug/px4_fmu-v5_debug.elf || true'
resetBoard()
}
}
@@ -441,7 +447,7 @@ pipeline {
sh 'make px4_fmu-v5_stackcheck'
sh 'make px4_fmu-v5_stackcheck bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v5_stackcheck'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v5_stackcheck'
}
post {
always {
@@ -498,6 +504,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v5_stackcheck/px4_fmu-v5_stackcheck.elf || true'
resetBoard()
}
}
@@ -519,7 +526,7 @@ pipeline {
sh 'make px4_fmu-v5_test'
sh 'make px4_fmu-v5_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'px4_fmu-v5_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'px4_fmu-v5_test'
}
post {
always {
@@ -566,6 +573,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/px4_fmu-v5_test/px4_fmu-v5_test.elf || true'
resetBoard()
}
}
@@ -573,73 +581,6 @@ pipeline {
}
}
// stage("modalai_fc-v1_test") {
// stages {
// stage("build modalai_fc-v1_test") {
// agent {
// docker {
// image 'px4io/px4-dev-nuttx-focal:2021-09-08'
// args '--cpu-shares 512 -e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
// }
// }
// steps {
// checkout scm
// sh 'export'
// sh 'make distclean'
// sh 'ccache -s'
// sh 'git fetch --tags'
// sh 'make modalai_fc-v1_test'
// sh 'make modalai_fc-v1_test bootloader_elf'
// sh 'ccache -s'
// stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'modalai_fc-v1_test'
// }
// post {
// always {
// sh 'make distclean'
// }
// }
// } // stage build
// stage("hardware") {
// agent {
// label 'modalai_fc-v1'
// }
// stages {
// stage("flash") {
// steps {
// sh 'export'
// sh 'find /dev/serial'
// unstash 'modalai_fc-v1_test'
// sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/modalai_fc-v1_test/modalai_fc-v1_bootloader.elf'
// // flash board and watch bootup
// sh './platforms/nuttx/Debug/upload_jlink_gdb.sh build/modalai_fc-v1_test/modalai_fc-v1_test.elf && ./Tools/HIL/monitor_firmware_upload.py --device `find /dev/serial -name *usb-*` --baudrate 57600'
// }
// }
// stage("tests") {
// steps {
// runTests()
// }
// }
// stage("status") {
// steps {
// // configure
// resetParameters()
// sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_AUTOSTART" --value "4001"' // generic quadcopter
// sh './Tools/HIL/nsh_param_set.py --device `find /dev/serial -name *usb-*` --name "SYS_BL_UPDATE" --value "1"' // update bootloader
// checkStatus()
// quickCalibrate()
// }
// }
// stage("print topics") {
// steps {
// printTopics()
// }
// }
// }
// } // stage test
// }
// }
stage("nxp_fmuk66-v3_test") {
stages {
stage("build nxp_fmuk66-v3_test") {
@@ -654,7 +595,7 @@ pipeline {
sh 'make nxp_fmuk66-v3_test'
//sh 'make nxp_fmuk66-v3_test bootloader_elf'
sh 'ccache -s'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/upload_jlink_gdb.sh, Tools/HIL/*.py', name: 'nxp_fmuk66-v3_test'
stash includes: 'build/*/*.elf, platforms/nuttx/Debug/*, Tools/HIL/*.py', name: 'nxp_fmuk66-v3_test'
}
post {
always {
@@ -701,6 +642,7 @@ pipeline {
}
post {
always {
sh './platforms/nuttx/Debug/jlink_gdb_backtrace.sh build/nxp_fmuk66-v3_test/nxp_fmuk66-v3_test.elf || true'
resetBoard()
}
}
+2 -1
View File
@@ -74,6 +74,7 @@ Checks: '*,
-modernize-deprecated-headers,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-raw-string-literal,
-modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-bool-literals,
@@ -81,8 +82,8 @@ Checks: '*,
-modernize-use-equals-default,
-modernize-use-equals-delete,
-modernize-use-override,
-modernize-use-using,
-modernize-use-trailing-return-type,
-modernize-use-using,
-performance-inefficient-string-concatenation,
-readability-avoid-const-params-in-decls,
-readability-container-size-empty,
+1
View File
@@ -13,6 +13,7 @@ jobs:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-09-08
strategy:
fail-fast: false
matrix:
config: [
airmind_mindpx-v2,
+1
View File
@@ -10,6 +10,7 @@ on:
jobs:
enumerate_targets:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-09-08
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
+5
View File
@@ -106,6 +106,11 @@ CONFIG:
buildType: MinSizeRel
settings:
CONFIG: ark_can-rtk-gps_default
ark_can-rtk-gps_debug:
short: ark_can-rtk-gps_debug
buildType: MinSizeRel
settings:
CONFIG: ark_can-rtk-gps_debug
ark_can-rtk-gps_canbootloader:
short: ark_can-rtk-gps_canbootloader
buildType: MinSizeRel
+9
View File
@@ -128,6 +128,9 @@ config BOARD_KEYSTORE
menu "Serial ports"
config BOARD_SERIAL_URT6
string "URT6 tty port"
config BOARD_SERIAL_GPS1
string "GPS1 tty port"
@@ -158,8 +161,14 @@ menu "Serial ports"
config BOARD_SERIAL_TEL5
string "TEL5 tty port"
config BOARD_SERIAL_RC
string "RC tty port"
config BOARD_SERIAL_WIFI
string "WIFI tty port"
config BOARD_SERIAL_PPB
string "PPB (Pixhawk Payload Bus) tty port"
endmenu
menu "drivers"
+1 -1
View File
@@ -464,7 +464,7 @@ shellcheck_all:
@make px4_fmu-v5_default shellcheck
validate_module_configs:
@find "$(SRC_DIR)"/src/modules "$(SRC_DIR)"/src/drivers "$(SRC_DIR)"/src/lib -name *.yaml -type f -print0 | xargs -0 "$(SRC_DIR)"/Tools/validate_yaml.py --schema-file "$(SRC_DIR)"/validation/module_schema.yaml
@find "$(SRC_DIR)"/src/modules "$(SRC_DIR)"/src/drivers "$(SRC_DIR)"/src/lib -name *.yaml -type f -not -path "$(SRC_DIR)/src/lib/mixer_module/*" -print0 | xargs -0 "$(SRC_DIR)"/Tools/validate_yaml.py --schema-file "$(SRC_DIR)"/validation/module_schema.yaml
# Cleanup
# --------------------------------------------------------------------
@@ -8,7 +8,8 @@
#
. ${R}etc/init.d/rc.mc_defaults
. ${R}etc/init.d/rc.ctrlalloc
param set-default SYS_CTRL_ALLOC 1
param set-default MPC_USE_HTE 0
@@ -45,4 +46,10 @@ param set-default CA_MC_R3_PY 0.1875
param set-default CA_MC_R3_CT 6.5
param set-default CA_MC_R3_KM -0.05
set MIXER direct
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
set MIXER skip
set MIXER_AUX none
@@ -7,4 +7,3 @@
param set-default FW_THR_CRUISE 0.0
param set-default RWTO_TKOFF 0
@@ -6,7 +6,8 @@
#
. ${R}etc/init.d/rc.mc_defaults
. ${R}etc/init.d/rc.ctrlalloc
param set-default SYS_CTRL_ALLOC 1
param set-default MC_PITCHRATE_P 0.0800
param set-default MC_PITCHRATE_I 0.0400
@@ -75,7 +76,14 @@ param set-default CA_MC_R5_PY -0.5
param set-default CA_MC_R5_CT 9.5
param set-default CA_MC_R5_KM -0.05
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
param set-default PWM_MAIN_FUNC5 105
param set-default PWM_MAIN_FUNC6 106
set MAV_TYPE 13
# set MIXER hexa_x
set MIXER direct
set MIXER skip
set MIXER_AUX none
@@ -55,5 +55,4 @@ px4_add_romfs_files(
rc.vehicle_setup
rc.vtol_apps
rc.vtol_defaults
rc.ctrlalloc
)
@@ -9,6 +9,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -19,6 +19,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -14,6 +14,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -19,6 +19,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -17,6 +17,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -9,6 +9,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -9,6 +9,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -18,6 +18,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -22,6 +22,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -21,6 +21,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -14,6 +14,7 @@
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
#
. ${R}etc/init.d/rc.vtol_defaults
@@ -84,6 +84,8 @@ param set-default MPC_Z_VEL_P_ACC 5
param set-default MPC_Z_VEL_I_ACC 3
param set-default MPC_LAND_ALT1 3
param set-default MPC_LAND_ALT2 1
param set-default MPC_POS_MODE 3
param set-default CP_GO_NO_DATA 1
# Navigator Parameters
param set-default NAV_ACC_RAD 2
@@ -11,9 +11,11 @@
#
. ${R}etc/init.d/rc.mc_defaults
. ${R}etc/init.d/rc.ctrlalloc
set MIXER none
set MIXER skip
set MIXER_AUX none
param set-default SYS_CTRL_ALLOC 1
param set-default MPC_USE_HTE 0
@@ -50,6 +52,7 @@ param set-default CA_MC_R3_PY 0.177
param set-default CA_MC_R3_CT 6.5
param set-default CA_MC_R3_KM -0.05
set MIXER direct
set MIXER_AUX direct_aux
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
@@ -77,4 +77,3 @@ param set-default IMU_DGYRO_CUTOFF 100
# enable to use high-rate logging for better rate tracking analysis
param set-default SDLOG_PROFILE 27
@@ -11,8 +11,8 @@
#
. ${R}etc/init.d/rc.mc_defaults
. ${R}etc/init.d/rc.ctrlalloc
param set-default SYS_CTRL_ALLOC 1
param set-default MPC_USE_HTE 0
param set-default VM_MASS 1.5
@@ -66,8 +66,12 @@ param set-default CA_MC_R5_PY -0.1375
param set-default CA_MC_R5_CT 6.5
param set-default CA_MC_R5_KM -0.05
set MIXER direct
set PWM_OUT 123456
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
param set-default PWM_MAIN_FUNC5 105
param set-default PWM_MAIN_FUNC6 106
set MIXER_AUX direct_aux
set PWM_AUX_OUT 123456
set MIXER skip
set MIXER_AUX none
@@ -0,0 +1,12 @@
#!/bin/sh
#
# External airframe startup script (on SD card)
#
set SDCARD_MIXERS_PATH ${SDCARD_EXT_PATH}/mixers
if [ -e ${SDCARD_EXT_PATH}/rc.autostart ]
then
. ${SDCARD_EXT_PATH}/rc.autostart
else
echo "Error: ${SDCARD_EXT_PATH}/rc.autostart does not exist"
fi
-26
View File
@@ -1,26 +0,0 @@
#!/bin/sh
#
# Standard apps for new control allocation and controllers
#
# NOTE: Script variables are declared/initialized/unset in the rcS script.
#
#
# Start angular velocity controller
#
# angular_velocity_controller start
# mc_rate_control stop
#
# Start Control Allocator
#
control_allocator start
#
# Disable hover thrust estimator and prearming
# These features are currently incompatible with control allocation
#
# TODO: fix
#
param set MPC_USE_HTE 0
param set COM_PREARM_MODE 0
+6
View File
@@ -16,6 +16,12 @@ ekf2 start &
fw_att_control start
fw_pos_control_l1 start
airspeed_selector start
#
# Start attitude control auto-tuner
#
fw_autotune_attitude_control start
#
# Start Land Detector.
#
+11 -5
View File
@@ -96,10 +96,16 @@ then
if [ $OUTPUT_MODE = $OUTPUT_CMD -o $OUTPUT_MODE = io ]
then
if ! $OUTPUT_CMD start
if param compare SYS_CTRL_ALLOC 1
then
echo "$OUTPUT_CMD start failed"
tune_control play error
pwm_out start
dshot start
else
if ! $OUTPUT_CMD start
then
echo "$OUTPUT_CMD start failed"
tune_control play error
fi
fi
fi
fi
@@ -214,10 +220,10 @@ fi
if [ $OUTPUT_MODE = pwm_out -o $OUTPUT_MODE = io ]
then
if [ $PWM_OUT != none ]
if [ $PWM_OUT != none -a $PWM_MAIN_RATE != none ]
then
# Set PWM output frequency.
if [ $PWM_MAIN_RATE != none ]
if ! param compare SYS_CTRL_ALLOC 1
then
pwm rate -c ${PWM_OUT} -r ${PWM_MAIN_RATE}
fi
+16
View File
@@ -48,6 +48,22 @@ fi
# End Estimator Group Selection #
###############################################################################
if param compare SYS_CTRL_ALLOC 1
then
#
# Start Control Allocator
#
control_allocator start
#
# Disable hover thrust estimator and prearming
# These features are currently incompatible with control allocation
#
# TODO: fix
#
param set MPC_USE_HTE 0
fi
#
# Start Multicopter Rate Controller.
#
+2
View File
@@ -24,9 +24,11 @@ mc_att_control start vtol
flight_mode_manager start
mc_pos_control start vtol
mc_hover_thrust_estimator start
mc_autotune_attitude_control start
fw_att_control start vtol
fw_pos_control_l1 start vtol
fw_autotune_attitude_control start vtol
# Start Land Detector
# Multicopter for now until we have something for VTOL
+31 -16
View File
@@ -44,6 +44,8 @@ set PWM_EXTRA_OUT none
set PWM_EXTRA_RATE p:PWM_EXTRA_RATE
set EXTRA_MIXER_MODE none
set RC_INPUT_ARGS ""
set SDCARD_AVAILABLE no
set SDCARD_EXT_PATH /fs/microsd/ext_autostart
set SDCARD_MIXERS_PATH /fs/microsd/etc/mixers
set STARTUP_TUNE 1
set USE_IO no
@@ -57,7 +59,6 @@ ver all
#
# Try to mount the microSD card.
#
set SDCARD_AVAILABLE no
# REBOOTWORK this needs to start after the flight control loop.
if mount -t vfat /dev/mmcsd0 /fs/microsd
then
@@ -97,15 +98,13 @@ if [ $SDCARD_AVAILABLE = yes ]
then
if hardfault_log check
then
# Error tune.
set STARTUP_TUNE 2
set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE
if hardfault_log commit
then
hardfault_log reset
fi
fi
fi
unset SDCARD_AVAILABLE
#
# Look for an init script on the microSD card.
@@ -182,15 +181,6 @@ else
#
tone_alarm start
#
# Play the startup tune (if not disabled or there is an error)
#
param compare CBRK_BUZZER 782090
if [ $? != 0 -o $STARTUP_TUNE != 1 ]
then
tune_control play -t $STARTUP_TUNE
fi
#
# Waypoint storage.
# REBOOTWORK this needs to start in parallel.
@@ -216,10 +206,22 @@ else
#
# Set parameters and env variables for selected AUTOSTART.
#
set AUTOSTART_PATH etc/init.d/rc.autostart
if ! param compare SYS_AUTOSTART 0
then
. ${R}etc/init.d/rc.autostart
if param greater SYS_AUTOSTART 1000000
then
# Use external startup file
if [ $SDCARD_AVAILABLE = yes ]
then
set AUTOSTART_PATH etc/init.d/rc.autostart_ext
else
echo "ERROR [init] SD card not mounted - trying to load airframe from ROMFS"
fi
fi
. ${R}$AUTOSTART_PATH
fi
unset AUTOSTART_PATH
#
# Override parameters from user configuration file.
@@ -250,7 +252,7 @@ else
then
# Start UAVCAN firmware update server and dynamic node ID allocation server.
uavcan start fw
tune_control play -t 1
if param greater UAVCAN_ENABLE 2
then
set OUTPUT_MODE uavcan_esc
@@ -315,7 +317,7 @@ else
if [ $USE_IO = yes -a $IO_PRESENT = no ]
then
echo "PX4IO not found"
tune_control play error
set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE
fi
#
@@ -369,6 +371,17 @@ else
commander start
fi
#
# Play the startup tune (if not disabled or there is an error)
#
param compare CBRK_BUZZER 782090
if [ $? != 0 -o $STARTUP_TUNE != 1 ]
then
tune_control play -t $STARTUP_TUNE
fi
# Pre-takeoff continuous magnetometer calibration
if param compare -s MBE_ENABLE 1
then
@@ -539,6 +552,8 @@ unset PWM_OUT
unset PWM_EXTRA_OUT
unset PWM_EXTRA_RATE
unset RC_INPUT_ARGS
unset SDCARD_AVAILABLE
unset SDCARD_EXT_PATH
unset SDCARD_MIXERS_PATH
unset STARTUP_TUNE
unset USE_IO
@@ -44,5 +44,4 @@ px4_add_romfs_files(
tiltrotor_sitl.main.mix
uuv_x_sitl.main.mix
vectored6dof_sitl.main.mix
tiltrotor_sitl_direct.main.mix
)
@@ -1,14 +0,0 @@
Mixer for quad tiltrotor (x motor configuration)
================================================
A: 0
A: 1
A: 2
A: 3
A: 4
A: 5
A: 6
A: 7
A: 8
A: 9
A: 10
@@ -46,7 +46,6 @@ px4_add_romfs_files(
coax.main.mix
delta.main.mix
deltaquad.main.mix
direct.main.mix
dodeca_bottom_cox.aux.mix
dodeca_top_cox.main.mix
firefly6.aux.mix
@@ -1,11 +0,0 @@
# Direct mixer
# @board px4_fmu-v2 exclude
A: 0
A: 1
A: 2
A: 3
A: 4
A: 5
A: 6
A: 7
+3 -5
View File
@@ -8,18 +8,16 @@ if [ -f "$FILE" ]; then
if [ -n "$CHECK_FAILED" ]; then
${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty
echo -e 'Formatting issue found in' $FILE
echo
git --no-pager diff --no-index --minimal --histogram --color=always $FILE $FILE.pretty
git --no-pager diff --no-index --minimal --histogram --color=always $FILE $FILE.pretty | grep -vE -e "^.{,4}diff.*\.pretty.{,3}$" -e "^.{,4}--- a/.*$" -e "^.{,4}\+\+\+ b/.*$" -e "^.{,5}@@ .* @@.*$" -e "^.{,4}index .{10}\.\."
rm -f $FILE.pretty
echo
if [[ $PX4_ASTYLE_FIX -eq 1 ]]; then
${DIR}/fix_code_style.sh $FILE
else
# Make sure this file is not staged for comitting
git reset $FILE
# Provide instructions
echo $FILE 'bad formatting, please run "make format" or "./Tools/astyle/fix_code_style.sh' $FILE'"'
echo 'to fix automatically run "make format" or "./Tools/astyle/fix_code_style.sh' $FILE'"'
exit 1
fi
fi
+6 -9
View File
@@ -54,12 +54,9 @@ if [ $? -ne 0 ]; then
fi
# Check for code style, only in changed files
for i in `git diff --cached --name-only --diff-filter=ACM`
do
./Tools/astyle/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/astyle/check_code_style.sh %
if [ $? -ne 0 ]
then
echo "Pre-commit style error: Bad formatting according to astyle rules"
exit 1
fi
done
bash -c "comm -12 <(./Tools/astyle/files_to_check_code_style.sh | sort) <(git diff --cached --name-only --diff-filter=ACM) | xargs -P 8 -I % ./Tools/astyle/check_code_style.sh %"
if [ $? -ne 0 ]
then
echo "Pre-commit style error: Bad formatting according to astyle rules"
exit 1
fi
-1
View File
@@ -17,4 +17,3 @@ def save_compressed(filename):
f.write(content_file.read())
save_compressed(filename)
+39 -30
View File
@@ -6,6 +6,14 @@ import os
import sys
import json
import re
from kconfiglib import Kconfig
kconf = Kconfig()
# Supress warning output
kconf.warn_assign_undef = False
kconf.warn_assign_override = False
kconf.warn_assign_redun = False
source_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
@@ -28,42 +36,43 @@ excluded_labels = [
'uavcanv1' # TODO: fix and enable
]
def process_target(cmake_file, target_name):
def process_target(px4board_file, target_name):
ret = None
is_board_def = False
platform = None
toolchain = None
for line in open(cmake_file, 'r'):
if 'px4_add_board' in line:
is_board_def = True
if not is_board_def:
continue
re_platform = re.search('PLATFORM\s+([^\s]+)', line)
if re_platform: platform = re_platform.group(1)
if px4board_file.endswith("default.px4board"):
kconf.load_config(px4board_file, replace=True)
else: # Merge config with default.px4board
default_kconfig = re.sub(r'[a-zA-Z\d_]+\.px4board', 'default.px4board', px4board_file)
kconf.load_config(default_kconfig, replace=True)
kconf.load_config(px4board_file, replace=False)
re_toolchain = re.search('TOOLCHAIN\s+([^\s]+)', line)
if re_toolchain: toolchain = re_toolchain.group(1)
if "BOARD_TOOLCHAIN" in kconf.syms:
toolchain = kconf.syms["BOARD_TOOLCHAIN"].str_value
if is_board_def:
assert platform, f"PLATFORM not found in {cmake_file}"
if "BOARD_PLATFORM" in kconf.syms:
platform = kconf.syms["BOARD_PLATFORM"].str_value
if platform not in excluded_platforms:
# get the container based on the platform and toolchain
container = platform
if platform == 'posix':
container = 'base-focal'
if toolchain:
if toolchain.startswith('aarch64'):
container = 'aarch64'
elif toolchain == 'arm-linux-gnueabihf':
container = 'armhf'
else:
if verbose: print(f'possibly unmatched toolchain: {toolchain}')
elif platform == 'nuttx':
container = 'nuttx-focal'
assert platform, f"PLATFORM not found in {px4board_file}"
if platform not in excluded_platforms:
# get the container based on the platform and toolchain
container = platform
if platform == 'posix':
container = 'base-focal'
if toolchain:
if toolchain.startswith('aarch64'):
container = 'aarch64'
elif toolchain == 'arm-linux-gnueabihf':
container = 'armhf'
else:
if verbose: print(f'possibly unmatched toolchain: {toolchain}')
elif platform == 'nuttx':
container = 'nuttx-focal'
ret = {'target': target_name, 'container': container}
ret = {'target': target_name, 'container': container}
return ret
for manufacturer in os.scandir(os.path.join(source_dir, 'boards')):
@@ -77,8 +86,8 @@ for manufacturer in os.scandir(os.path.join(source_dir, 'boards')):
if not board.is_dir():
continue
for files in os.scandir(board.path):
if files.is_file() and files.name.endswith('.cmake'):
label = files.name[:-6]
if files.is_file() and files.name.endswith('.px4board'):
label = files.name[:-9]
target_name = manufacturer.name + '_' + board.name + '_' + label
if label in excluded_labels:
if verbose: print(f'excluding label {label} ({target_name})')
+7 -1
View File
@@ -110,10 +110,16 @@ def main(kconfig_file, config1, config2):
for line in f:
match = unset_match(line)
#pprint.pprint(match)
#pprint.pprint(line)
if match is not None:
sym_name = match.group(1)
kconf.syms[sym_name].unset_value()
for default, cond in kconf.syms[sym_name].orig_defaults:
if(cond.str_value == 'y'):
# Default is y, our diff is unset thus we've set it to no
kconf.syms[sym_name].set_value(0)
f.close()
# Print warnings for symbols whose actual value doesn't match the assigned
+344
View File
@@ -0,0 +1,344 @@
#!/usr/bin/env python3
""" Script to params from module.yaml config file(s)
Note: serial params are handled in Tools/serial/generate_config.py
"""
import argparse
import os
import sys
from output_groups_from_timer_config import get_timer_groups, get_output_groups
try:
import yaml
except ImportError as e:
print("Failed to import yaml: " + str(e))
print("")
print("You may need to install it using:")
print(" pip3 install --user pyyaml")
print("")
sys.exit(1)
parser = argparse.ArgumentParser(description='Generate params from module.yaml file(s)')
parser.add_argument('--config-files', type=str, nargs='*', default=[],
help='YAML module config file(s)')
parser.add_argument('--params-file', type=str, action='store',
help='Parameter output file')
parser.add_argument('--timer-config', type=str, action='store',
help='board-specific timer_config.cpp file')
parser.add_argument('--ethernet', action='store_true',
help='Ethernet support')
parser.add_argument('--board', type=str, action='store',
help='board name, e.g. ')
parser.add_argument('--board-with-io', dest='board_with_io', action='store_true',
help='Indicate that the board as an IO for extra PWM',
default=False)
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
help='Verbose Output')
args = parser.parse_args()
verbose = args.verbose
params_output_file = args.params_file
timer_config_file = args.timer_config
ethernet_supported = args.ethernet
board_with_io = args.board_with_io
board = args.board
root_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../..")
output_functions_file = os.path.join(root_dir,"src/lib/mixer_module/output_functions.yaml")
def process_param_prefix(param_prefix):
if param_prefix == '${PWM_MAIN_OR_HIL}':
if board == 'px4_sitl': return 'PWM_MAIN'
return 'HIL_ACT'
if param_prefix == '${PWM_MAIN_OR_AUX}':
if board_with_io: return 'PWM_AUX'
return 'PWM_MAIN'
if '${' in param_prefix:
raise Exception('unhandled variable in {:}'.format(param_prefix))
return param_prefix
def process_channel_label(channel_label):
if channel_label == '${PWM_MAIN_OR_HIL}':
if board == 'px4_sitl': return 'PWM Sim'
return 'HIL actuator'
if channel_label == '${PWM_MAIN_OR_AUX}':
if board_with_io: return 'PWM Aux'
return 'PWM Main'
if '${' in channel_label:
raise Exception('unhandled variable in {:}'.format(channel_label))
return channel_label
def parse_yaml_parameters_config(yaml_config, ethernet_supported):
""" parse the parameters section from the yaml config file """
if 'parameters' not in yaml_config:
return ''
parameters_section_list = yaml_config['parameters']
ret = ''
for parameters_section in parameters_section_list:
if 'definitions' not in parameters_section:
continue
definitions = parameters_section['definitions']
param_group = parameters_section.get('group', None)
for param_name in definitions:
# 'definitions' either contains the param definition directly (dict),
# or a list of definitions with that name (multiple entries for a
# multi-instance param with different instance_start)
param_list = definitions[param_name]
if not isinstance(param_list, list):
param_list = [param_list]
for param in param_list:
if param.get('requires_ethernet', False) and not ethernet_supported:
continue
num_instances = param.get('num_instances', 1)
instance_start = param.get('instance_start', 0) # offset
instance_start_label = param.get('instance_start_label', instance_start)
# get the type and extract all tags
tags = '@group {:}'.format(param_group)
if param['type'] == 'enum':
param_type = 'INT32'
for key in param['values']:
tags += '\n * @value {:} {:}'.format(key, param['values'][key])
elif param['type'] == 'boolean':
param_type = 'INT32'
tags += '\n * @boolean'
elif param['type'] == 'int32':
param_type = 'INT32'
elif param['type'] == 'float':
param_type = 'FLOAT'
else:
raise Exception("unknown param type {:}".format(param['type']))
for tag in ['decimal', 'increment', 'category', 'volatile', 'bit',
'min', 'max', 'unit', 'reboot_required']:
if tag in param:
tags += '\n * @{:} {:}'.format(tag, param[tag])
for i in range(num_instances):
# default value
default_value = 0
if 'default' in param:
# default can be a list of num_instances or a single value
if type(param['default']) == list:
assert len(param['default']) == num_instances
default_value = param['default'][i]
else:
default_value = param['default']
if type(default_value) == bool:
default_value = int(default_value)
# output the existing C-style format
ret += '''
/**
* {short_descr}
*
* {long_descr}
*
* {tags}
*/
PARAM_DEFINE_{param_type}({name}, {default_value});
'''.format(short_descr=param['description']['short'].replace("\n", "\n * "),
long_descr=param['description']['long'].replace("\n", "\n * "),
tags=tags,
param_type=param_type,
name=param_name.replace('${i}', str(i+instance_start)),
default_value=default_value,
).replace('${i}', str(i+instance_start_label))
return ret
def get_actuator_output_params(yaml_config, output_functions,
timer_config_file, verbose):
""" parse the actuator_output section from the yaml config file
:return: dict of param definitions
"""
if not 'actuator_output' in yaml_config:
return {}
output_groups = yaml_config['actuator_output']['output_groups']
all_params = {}
group_idx = 0
def add_local_param(param_name, param_def):
nonlocal all_params
# add as a list, as there can be multiple entries with the same param_name
if not param_name in all_params:
all_params[param_name] = []
all_params[param_name].append(param_def)
while group_idx < len(output_groups):
group = output_groups[group_idx]
group_idx += 1
if verbose: print("processing group: {:}".format(group))
# Check for generator and generate additional data.
# We do this by extending the output_groups list and parse in a later iteration
if 'generator' in group:
if group['generator'] == 'pwm':
param_prefix = process_param_prefix(group['param_prefix'])
channel_labels = [process_channel_label(label) for label in group['channel_labels']]
standard_params = group.get('standard_params', [])
extra_function_groups = group.get('extra_function_groups', [])
pwm_timer_param = group.get('pwm_timer_param', None)
if 'timer_config_file' in group:
timer_config_file = os.path.join(root_dir, group['timer_config_file'])
if timer_config_file is None:
raise Exception('trying to generate pwm outputs, but --timer-config not set')
timer_groups = get_timer_groups(timer_config_file, verbose)
timer_output_groups, timer_params = get_output_groups(timer_groups,
param_prefix, channel_labels,
standard_params, extra_function_groups, pwm_timer_param,
verbose=verbose)
all_params.update(timer_params)
output_groups.extend(timer_output_groups)
else:
raise Exception('unknown generator {:}'.format(group['generator']))
continue
num_channels = group['num_channels']
param_prefix = process_param_prefix(group['param_prefix'])
channel_label = process_channel_label(group['channel_label'])
standard_params = group.get('standard_params', {})
instance_start = group.get('instance_start', 1)
instance_start_label = group.get('instance_start_label', instance_start)
if len(param_prefix) > 9: # 16 - len('_FAIL') - 2 (2 digits for index)
raise Exception("param prefix {:} too long (max length=10)".format(param_prefix))
# collect the functions
function_groups = ['common']
function_groups.extend(group.get('extra_function_groups', []))
output_function_values = {}
for function_group in function_groups:
group = output_functions[function_group]
for function_name in group:
function_name_label = function_name.replace('_', ' ')
if isinstance(group[function_name], int):
output_function_values[group[function_name]] = function_name_label
else:
start = group[function_name]['start']
count = group[function_name]['count']
for i in range(count):
output_function_values[start+i] = function_name_label+' '+str(i+1)
# function param
param = {
'description': {
'short': channel_label+' ${i} Output Function',
'long':
'''Select what should be output on {:} ${{i}}.
The default failsafe value is set according to the selected function:
- 'Min' for ConstantMin
- 'Max' for ConstantMax
- 'Max' for Parachute
- ('Max'+'Min')/2 for Servos
- 'Disarmed' for the rest
'''.format(channel_label),
},
'type': 'enum',
'instance_start': instance_start,
'instance_start_label': instance_start_label,
'num_instances': num_channels,
'default': 0,
'values': output_function_values
}
add_local_param(param_prefix+'_FUNC${i}', param)
# handle standard_params
disarmed_description = \
'''This is the output value that is set when not armed.
Note that non-motor outputs might already be active in prearm state if COM_PREARM_MODE is set.
'''
minimum_description = \
'''Minimum output value (when not disarmed).
The output range can be reversed by setting Min > Max.
'''
maximum_description = \
'''Maxmimum output value (when not disarmed).
The output range can be reversed by setting Min > Max.
'''
failsafe_description = \
'''This is the output value that is set when in failsafe mode.
When set to -1 (default), the value depends on the function (see {:}).
'''.format(param_prefix+'_FUNC${i}')
standard_params_array = [
( 'disarmed', 'Disarmed', 'DIS', disarmed_description ),
( 'min', 'Minimum', 'MIN', minimum_description ),
( 'max', 'Maximum', 'MAX', maximum_description ),
( 'failsafe', 'Failsafe', 'FAIL', failsafe_description ),
]
for key, label, param_suffix, description in standard_params_array:
if key in standard_params:
# values must be in range of an uint16_t
if standard_params[key]['min'] < 0:
raise Exception('minimum value for {:} expected >= 0 (got {:})'.format(key, standard_params[key]['min']))
if standard_params[key]['max'] >= 1<<16:
raise Exception('maximum value for {:} expected <= {:} (got {:})'.format(key, 1<<16, standard_params[key]['max']))
if key == 'failsafe':
standard_params[key]['default'] = -1
standard_params[key]['min'] = -1
param = {
'description': {
'short': channel_label+' ${i} '+label+' Value',
'long': description
},
'type': 'int32',
'instance_start': instance_start,
'instance_start_label': instance_start_label,
'num_instances': num_channels,
'min': standard_params[key]['min'],
'max': standard_params[key]['max'],
'default': standard_params[key]['default'],
}
add_local_param(param_prefix+'_'+param_suffix+'${i}', param)
if verbose: print('adding actuator params: {:}'.format(all_params))
return all_params
def load_yaml_file(file_name):
with open(file_name, 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
raise
output_functions_yaml = load_yaml_file(output_functions_file)
output_functions = output_functions_yaml['functions']
all_params = ""
for yaml_file in args.config_files:
yaml_config = load_yaml_file(yaml_file)
# convert 'output_groups' section into additional params
try:
actuator_output_params = get_actuator_output_params(yaml_config,
output_functions, timer_config_file, verbose)
except Exception as e:
print('Exception while parsing {:}:'.format(yaml_file))
raise e
# now add them to the yaml config
if not 'parameters' in yaml_config:
yaml_config['parameters'] = []
group_name = 'Actuator Outputs'
yaml_config['parameters'].append({'group': group_name, 'definitions': actuator_output_params})
all_params += parse_yaml_parameters_config(yaml_config, ethernet_supported)
if verbose: print("Generating {:}".format(params_output_file))
with open(params_output_file, 'w') as fid:
fid.write(all_params)
+201
View File
@@ -0,0 +1,201 @@
#!/usr/bin/env python3
""" Script to parse board-specific timer_config.cpp and print the output groups
and timer config params to stdout
"""
import argparse
import os
import sys
import re
from itertools import groupby
from copy import deepcopy
def find_matching_brackets(brackets, s, verbose):
idx = 0
opening = 0
first_open = -1
while idx < len(s):
if s[idx] == brackets[0]:
opening += 1
if first_open == -1:
first_open = idx
if s[idx] == brackets[1]:
opening -= 1
if opening == 0:
if verbose: print(first_open, idx, s[first_open:idx+1])
return first_open+1, idx
idx += 1
raise Exception('Failed to find opening/closing brackets in {:}'.format(s))
def extract_timer(line):
# Try format: initIOTimer(Timer::Timer5, DMA{DMA::Index1, DMA::Stream0, DMA::Channel6}),
search = re.search('Timer::([0-9a-zA-Z_]+)[,\)]', line, re.IGNORECASE)
if search:
return search.group(1)
# nxp rt1062 format: initIOPWM(PWM::FlexPWM2),
search = re.search('PWM::Flex([0-9a-zA-Z_]+)[,\)]', line, re.IGNORECASE)
if search:
return search.group(1)
return None
def extract_timer_from_channel(line):
# Try format: initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}),
search = re.search('Timer::([0-9a-zA-Z_]+), ', line, re.IGNORECASE)
if search:
return search.group(1)
# nxp rt1062 format: initIOTimerChannel(io_timers, {PWM::PWM2_PWM_A, PWM::Submodule0}, IOMUX::Pad::GPIO_B0_06),
search = re.search('PWM::(PWM[0-9]+)[_,\)]', line, re.IGNORECASE)
if search:
return search.group(1)
return None
def get_timer_groups(timer_config_file, verbose=False):
with open(timer_config_file, 'r') as f:
timer_config = f.read()
# timers
dshot_support = {} # key: timer
timers_start_marker = 'io_timers_t io_timers'
timers_start = timer_config.find(timers_start_marker)
if timers_start == -1:
raise Exception('"{:}" not found in {:}'.format(timers_start_marker, timer_config_file))
timer_config = timer_config[timers_start:]
open_idx, close_idx = find_matching_brackets(('{', '}'), timer_config, verbose)
timers_str = timer_config[open_idx:close_idx]
timers = []
for line in timers_str.splitlines():
line = line.strip()
if len(line) == 0 or line.startswith('//'):
continue
timer = extract_timer(line)
if timer:
if verbose: print('found timer def: {:}'.format(timer))
dshot_support[timer] = 'DMA' in line
timers.append(timer)
else:
# Make sure we don't miss anything (e.g. for different syntax) or misparse (e.g. multi-line comments)
raise Exception('Unparsed timer in line: {:}'.format(line))
# channels
channels_start_marker = 'timer_io_channels_t timer_io_channels'
channels_start = timer_config.find(channels_start_marker)
if channels_start == -1:
raise Exception('"{:}" not found in {:}'.format(channels_start_marker, timer_config_file))
timer_config = timer_config[channels_start:]
open_idx, close_idx = find_matching_brackets(('{', '}'), timer_config, verbose)
channels = timer_config[open_idx:close_idx]
channel_timers = []
channel_types = []
for line in channels.splitlines():
line = line.strip()
if len(line) == 0 or line.startswith('//'):
continue
if verbose: print('--'+line+'--')
timer = extract_timer_from_channel(line)
if timer:
if verbose: print('Found timer: {:} in channel line {:}'.format(timer, line))
channel_types.append('cap' if 'capture' in line.lower() else 'pwm')
channel_timers.append(timer)
else:
# Make sure we don't miss anything (e.g. for different syntax) or misparse (e.g. multi-line comments)
raise Exception('Unparsed channel in line: {:}'.format(line))
if len(channel_timers) == 0:
raise Exception('No channels found in "{:}"'.format(channels))
groups = [(timers.index(k), len(list(g)), dshot_support[k]) for k, g in groupby(channel_timers)]
outputs = {
'types': channel_types,
'groups': groups
}
return outputs
def get_output_groups(timer_groups, param_prefix="PWM_MAIN",
channel_labels=["PWM Main", "PWM Capture"],
standard_params=[],
extra_function_groups=[], pwm_timer_param=None,
verbose=False):
""" convert the timer groups into an output_groups section of module.yaml
and extra timer params
"""
instance_start = 1
output_groups = []
timer_params = {}
instance_start_label = [ 1, 1 ]
for timer_index, group_count, dshot_support in timer_groups['groups']:
# check for capture vs normal pins for the label
types = timer_groups['types'][instance_start-1:instance_start+group_count-1]
if not all(types[0] == t for t in types):
# Should this ever be needed, we can extend this script to handle that
raise Exception('Implementation requires all channel types for a timer to be equal (types: {:})'.format(types))
if types[0] == 'pwm':
channel_type_idx = 0
elif types[0] == 'cap':
channel_type_idx = 1
else:
raise Exception('unsupported channel type: {:}'.format(types[0]))
channel_label = channel_labels[channel_type_idx]
channel_type_instance = instance_start_label[channel_type_idx]
group = {
'param_prefix': param_prefix,
'channel_label': channel_label,
'instance_start': instance_start,
'instance_start_label': channel_type_instance,
'extra_function_groups': deepcopy(extra_function_groups),
'num_channels': group_count,
'standard_params': deepcopy(standard_params),
}
output_groups.append(group)
if pwm_timer_param is not None:
timer_channels_label = channel_label + ' ' + str(channel_type_instance)
if group_count > 1:
timer_channels_label += '-' + str(channel_type_instance+group_count-1)
pwm_timer_param_cp = deepcopy(pwm_timer_param)
if not dshot_support:
# remove dshot entries if no dshot support
values = pwm_timer_param_cp['values']
for key in list(values.keys()):
if 'dshot' in values[key].lower():
del values[key]
for descr_type in ['short', 'long']:
descr = pwm_timer_param_cp['description'][descr_type]
pwm_timer_param_cp['description'][descr_type] = \
descr.replace('${label}', timer_channels_label)
timer_params[param_prefix+'_TIM'+str(timer_index)] = pwm_timer_param_cp
instance_start += group_count
instance_start_label[channel_type_idx] += group_count
return (output_groups, timer_params)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Extract output groups from timer_config.cpp')
parser.add_argument('--timer-config', type=str, action='store',
help='timer_config.cpp file', required=True)
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
help='Verbose Output')
args = parser.parse_args()
verbose = args.verbose
timer_groups = get_timer_groups(args.timer_config, verbose)
print('timer groups: {:}'.format(timer_groups))
output_groups, timer_params = get_output_groups(timer_groups, verbose=verbose)
print('output groups: {:}'.format(output_groups))
print('timer params: {:}'.format(timer_params))
+1 -1
View File
@@ -25,7 +25,7 @@ div.frame_common table, div.frame_common table {
}
div.frame_common table {
float: right;
float: right;
width: 70%;
}
-1
View File
@@ -55,4 +55,3 @@ class JsonOutput():
if need_to_write:
with codecs.open(filename, 'w', 'utf-8') as f:
f.write(json.dumps(self.json,indent=2))
+1 -81
View File
@@ -1,8 +1,6 @@
#!/usr/bin/env python3
""" Script to generate Serial (UART) parameters and the ROMFS startup script """
from __future__ import print_function
import argparse
import os
import sys
@@ -195,7 +193,6 @@ if rc_serial_output_dir is None and serial_params_output_file is None:
# parse the YAML files
serial_commands = []
ethernet_configuration = []
additional_params = ""
if ethernet_supported:
ethernet_configuration.append({
@@ -216,88 +213,12 @@ def parse_yaml_serial_config(yaml_config):
ret.append(serial_config)
return ret
def parse_yaml_parameters_config(yaml_config, ethernet_supported):
""" parse the parameters section from the yaml config file """
if 'parameters' not in yaml_config:
return ''
parameters_section_list = yaml_config['parameters']
for parameters_section in parameters_section_list:
if 'definitions' not in parameters_section:
return ''
definitions = parameters_section['definitions']
ret = ''
param_group = parameters_section.get('group', None)
for param_name in definitions:
param = definitions[param_name]
if param.get('requires_ethernet', False) and not ethernet_supported:
continue
num_instances = param.get('num_instances', 1)
instance_start = param.get('instance_start', 0) # offset
# get the type and extract all tags
tags = '@group {:}'.format(param_group)
if param['type'] == 'enum':
param_type = 'INT32'
for key in param['values']:
tags += '\n * @value {:} {:}'.format(key, param['values'][key])
elif param['type'] == 'boolean':
param_type = 'INT32'
tags += '\n * @boolean'
elif param['type'] == 'int32':
param_type = 'INT32'
elif param['type'] == 'float':
param_type = 'FLOAT'
else:
raise Exception("unknown param type {:}".format(param['type']))
for tag in ['decimal', 'increment', 'category', 'volatile', 'bit',
'min', 'max', 'unit', 'reboot_required']:
if tag in param:
tags += '\n * @{:} {:}'.format(tag, param[tag])
for i in range(num_instances):
# default value
default_value = 0
if 'default' in param:
# default can be a list of num_instances or a single value
if type(param['default']) == list:
assert len(param['default']) == num_instances
default_value = param['default'][i]
else:
default_value = param['default']
if type(default_value) == bool:
default_value = int(default_value)
# output the existing C-style format
ret += '''
/**
* {short_descr}
*
* {long_descr}
*
* {tags}
*/
PARAM_DEFINE_{param_type}({name}, {default_value});
'''.format(short_descr=param['description']['short'].replace("\n", "\n * "),
long_descr=param['description']['long'].replace("\n", "\n * "),
tags=tags,
param_type=param_type,
name=param_name,
default_value=default_value,
).replace('${i}', str(i+instance_start))
return ret
for yaml_file in args.config_files:
with open(yaml_file, 'r') as stream:
try:
yaml_config = yaml.load(stream, Loader=yaml.Loader)
serial_commands.extend(parse_yaml_serial_config(yaml_config))
# TODO: additional params should be parsed in a separate script
additional_params += parse_yaml_parameters_config(
yaml_config, ethernet_supported)
except yaml.YAMLError as exc:
print(exc)
raise
@@ -404,6 +325,5 @@ if serial_params_output_file is not None:
with open(serial_params_output_file, 'w') as fid:
fid.write(template.render(serial_devices=serial_devices,
ethernet_configuration=ethernet_configuration,
commands=commands, serial_ports=serial_ports,
additional_definitions=additional_params))
commands=commands, serial_ports=serial_ports))
-2
View File
@@ -71,5 +71,3 @@ PARAM_DEFINE_INT32({{ command.port_param_name }}, {{ command.default_port }});
{% endfor -%}
{% endif %}
{{ additional_definitions }}
+4 -4
View File
@@ -1,5 +1,5 @@
//Public key to verify signed binaries
0x4d, 0xb0, 0xc2, 0x1, 0x5, 0x55, 0x2a, 0x3c,
0xd7, 0xfb, 0xaf, 0x5c, 0xba, 0x7a, 0xb0, 0x81,
0x1b, 0x36, 0x63, 0xdb, 0x28, 0x52, 0x5e, 0xdb,
0x14, 0x36, 0xf2, 0x57, 0x8d, 0x2, 0xb7, 0xfd,
0x4d, 0xb0, 0xc2, 0x1, 0x5, 0x55, 0x2a, 0x3c,
0xd7, 0xfb, 0xaf, 0x5c, 0xba, 0x7a, 0xb0, 0x81,
0x1b, 0x36, 0x63, 0xdb, 0x28, 0x52, 0x5e, 0xdb,
0x14, 0x36, 0xf2, 0x57, 0x8d, 0x2, 0xb7, 0xfd,
+37 -37
View File
@@ -1,38 +1,38 @@
0x30, 0x82, 0x1, 0x22, 0x30, 0xd, 0x6, 0x9,
0x2a, 0x86, 0x48, 0x86, 0xf7, 0xd, 0x1, 0x1,
0x1, 0x5, 0x0, 0x3, 0x82, 0x1, 0xf, 0x0,
0x30, 0x82, 0x1, 0xa, 0x2, 0x82, 0x1, 0x1,
0x0, 0xcf, 0xa3, 0xb8, 0xec, 0x4f, 0xac, 0x37,
0xe6, 0x1b, 0xfa, 0x1e, 0xb3, 0x92, 0xe9, 0x1a,
0x83, 0x36, 0x2d, 0x27, 0xa6, 0x4a, 0xab, 0x7e,
0x38, 0x6f, 0x93, 0x7a, 0x1f, 0x60, 0x83, 0x83,
0xac, 0xfd, 0x2e, 0x61, 0xbf, 0x19, 0x10, 0x1f,
0x39, 0xe3, 0x6c, 0xb6, 0xcc, 0xf5, 0x85, 0x7c,
0xb2, 0x38, 0x27, 0x14, 0x43, 0xd7, 0xfe, 0xbc,
0xa1, 0xe8, 0x7d, 0x33, 0x74, 0x93, 0xe7, 0xd6,
0x2b, 0x2f, 0x79, 0x87, 0x59, 0xb0, 0x63, 0x95,
0x5c, 0xe7, 0x4f, 0x60, 0x46, 0xc9, 0xa9, 0xf,
0xde, 0xa9, 0x36, 0x9e, 0x3e, 0x34, 0xba, 0x77,
0x18, 0x50, 0xe3, 0x6b, 0x3, 0x93, 0xaa, 0xc7,
0xf2, 0x2d, 0xe, 0xf3, 0x2b, 0x5, 0x34, 0x60,
0xa4, 0xf7, 0xa9, 0xe2, 0x37, 0xa3, 0x6d, 0x27,
0xd8, 0xa3, 0x71, 0x9c, 0x6b, 0xb2, 0x5e, 0xdd,
0x12, 0x2b, 0x73, 0xe1, 0xdb, 0x9d, 0xf4, 0xc3,
0xc, 0xd6, 0x5, 0x1d, 0xac, 0xa4, 0xdc, 0x69,
0x2a, 0xf5, 0x7c, 0x30, 0x24, 0x7b, 0x2b, 0x80,
0x1b, 0x7a, 0xec, 0x68, 0x77, 0x12, 0x97, 0x2a,
0xb2, 0xe5, 0xd2, 0xff, 0x41, 0x1d, 0xf5, 0x6,
0xa4, 0xb6, 0x47, 0xa5, 0xfa, 0x5, 0x7e, 0xf0,
0xa1, 0xb8, 0xad, 0xde, 0x5c, 0xae, 0x2c, 0x8b,
0x4e, 0xad, 0xaf, 0xac, 0x6d, 0x46, 0x62, 0xe1,
0xe9, 0xfe, 0xa1, 0xc5, 0xc9, 0xf4, 0x48, 0xd2,
0x80, 0x2b, 0xe5, 0xa9, 0x3e, 0xc1, 0xfc, 0x98,
0xde, 0x3, 0xa9, 0xac, 0x86, 0xb7, 0xb5, 0x19,
0xe5, 0x75, 0x6a, 0x63, 0x83, 0x3f, 0x27, 0x7a,
0x5e, 0xf8, 0xf1, 0x6d, 0xb2, 0xd2, 0x36, 0xa1,
0xc0, 0xd2, 0x5f, 0x93, 0x9c, 0x90, 0xe8, 0x3e,
0xca, 0x89, 0xd7, 0xca, 0xd0, 0xc7, 0xe8, 0x8f,
0x4b, 0xb7, 0x60, 0x92, 0x5e, 0x36, 0x43, 0x70,
0x23, 0x36, 0xfb, 0xb5, 0xa5, 0x6, 0x9a, 0xc0,
0xcb, 0x2, 0x3, 0x1, 0x0, 0x1,
0x30, 0x82, 0x1, 0x22, 0x30, 0xd, 0x6, 0x9,
0x2a, 0x86, 0x48, 0x86, 0xf7, 0xd, 0x1, 0x1,
0x1, 0x5, 0x0, 0x3, 0x82, 0x1, 0xf, 0x0,
0x30, 0x82, 0x1, 0xa, 0x2, 0x82, 0x1, 0x1,
0x0, 0xcf, 0xa3, 0xb8, 0xec, 0x4f, 0xac, 0x37,
0xe6, 0x1b, 0xfa, 0x1e, 0xb3, 0x92, 0xe9, 0x1a,
0x83, 0x36, 0x2d, 0x27, 0xa6, 0x4a, 0xab, 0x7e,
0x38, 0x6f, 0x93, 0x7a, 0x1f, 0x60, 0x83, 0x83,
0xac, 0xfd, 0x2e, 0x61, 0xbf, 0x19, 0x10, 0x1f,
0x39, 0xe3, 0x6c, 0xb6, 0xcc, 0xf5, 0x85, 0x7c,
0xb2, 0x38, 0x27, 0x14, 0x43, 0xd7, 0xfe, 0xbc,
0xa1, 0xe8, 0x7d, 0x33, 0x74, 0x93, 0xe7, 0xd6,
0x2b, 0x2f, 0x79, 0x87, 0x59, 0xb0, 0x63, 0x95,
0x5c, 0xe7, 0x4f, 0x60, 0x46, 0xc9, 0xa9, 0xf,
0xde, 0xa9, 0x36, 0x9e, 0x3e, 0x34, 0xba, 0x77,
0x18, 0x50, 0xe3, 0x6b, 0x3, 0x93, 0xaa, 0xc7,
0xf2, 0x2d, 0xe, 0xf3, 0x2b, 0x5, 0x34, 0x60,
0xa4, 0xf7, 0xa9, 0xe2, 0x37, 0xa3, 0x6d, 0x27,
0xd8, 0xa3, 0x71, 0x9c, 0x6b, 0xb2, 0x5e, 0xdd,
0x12, 0x2b, 0x73, 0xe1, 0xdb, 0x9d, 0xf4, 0xc3,
0xc, 0xd6, 0x5, 0x1d, 0xac, 0xa4, 0xdc, 0x69,
0x2a, 0xf5, 0x7c, 0x30, 0x24, 0x7b, 0x2b, 0x80,
0x1b, 0x7a, 0xec, 0x68, 0x77, 0x12, 0x97, 0x2a,
0xb2, 0xe5, 0xd2, 0xff, 0x41, 0x1d, 0xf5, 0x6,
0xa4, 0xb6, 0x47, 0xa5, 0xfa, 0x5, 0x7e, 0xf0,
0xa1, 0xb8, 0xad, 0xde, 0x5c, 0xae, 0x2c, 0x8b,
0x4e, 0xad, 0xaf, 0xac, 0x6d, 0x46, 0x62, 0xe1,
0xe9, 0xfe, 0xa1, 0xc5, 0xc9, 0xf4, 0x48, 0xd2,
0x80, 0x2b, 0xe5, 0xa9, 0x3e, 0xc1, 0xfc, 0x98,
0xde, 0x3, 0xa9, 0xac, 0x86, 0xb7, 0xb5, 0x19,
0xe5, 0x75, 0x6a, 0x63, 0x83, 0x3f, 0x27, 0x7a,
0x5e, 0xf8, 0xf1, 0x6d, 0xb2, 0xd2, 0x36, 0xa1,
0xc0, 0xd2, 0x5f, 0x93, 0x9c, 0x90, 0xe8, 0x3e,
0xca, 0x89, 0xd7, 0xca, 0xd0, 0xc7, 0xe8, 0x8f,
0x4b, 0xb7, 0x60, 0x92, 0x5e, 0x36, 0x43, 0x70,
0x23, 0x36, 0xfb, 0xb5, 0xa5, 0x6, 0x9a, 0xc0,
0xcb, 0x2, 0x3, 0x1, 0x0, 0x1,
@@ -48,6 +48,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
+1
View File
@@ -13,3 +13,4 @@ CONFIG_DRIVERS_UAVCANNODE=y
CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_SYSTEMCMDS_PERF=y
CONFIG_SYSTEMCMDS_TOP=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
+1
View File
@@ -15,3 +15,4 @@ CONFIG_DRIVERS_TONE_ALARM=y
CONFIG_BOARD_UAVCAN_INTERFACES=1
CONFIG_DRIVERS_UAVCANNODE=y
CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
+6
View File
@@ -0,0 +1,6 @@
CONFIG_BOARD_CONSTRAINED_FLASH=n
CONFIG_BOARD_NO_HELP=n
CONFIG_BOARD_CONSTRAINED_MEMORY=y
CONFIG_SYSTEMCMDS_TOP=y
CONFIG_SYSTEMCMDS_REBOOT=y
CONFIG_SYSTEMCMDS_UORB=y
+1
View File
@@ -15,3 +15,4 @@ CONFIG_DRIVERS_TONE_ALARM=y
CONFIG_BOARD_UAVCAN_INTERFACES=1
CONFIG_DRIVERS_UAVCANNODE=y
CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
@@ -39,5 +39,8 @@
// DMA2 Channel/Stream Selections
//--------------------------------------------//---------------------------//----------------
#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3
#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 5, Channel 3
#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3
#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3
#define DMACHAN_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4
#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1
//#define DMACHAN_USART1_TX DMAMAP_USART1_TX // DMA2, Stream 7, Channel 4
@@ -150,8 +150,9 @@ CONFIG_STM32_WWDG=y
CONFIG_SYSTEM_NSH=y
CONFIG_TASK_NAME_SIZE=24
CONFIG_USART1_BAUD=57600
CONFIG_USART1_RXBUFSIZE=600
CONFIG_USART1_TXBUFSIZE=1100
CONFIG_USART1_RXBUFSIZE=2000
CONFIG_USART1_RXDMA=y
CONFIG_USART1_TXBUFSIZE=2000
CONFIG_USART2_BAUD=57600
CONFIG_USART2_RXBUFSIZE=600
CONFIG_USART2_SERIAL_CONSOLE=y
+6
View File
@@ -139,6 +139,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
{
px4_platform_init();
#if defined(SERIAL_HAVE_RXDMA)
// set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event.
static struct hrt_call serial_dma_call;
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
#endif
#if defined(FLASH_BASED_PARAMS)
static sector_descriptor_t params_sector_map[] = {
{2, 16 * 1024, 0x08008000},
+1
View File
@@ -44,6 +44,7 @@ CONFIG_MODULES_EKF2=y
CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
+1
View File
@@ -29,6 +29,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
+1
View File
@@ -13,3 +13,4 @@ CONFIG_DRIVERS_TONE_ALARM=y
CONFIG_BOARD_UAVCAN_INTERFACES=1
CONFIG_DRIVERS_UAVCANNODE=y
CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
+1
View File
@@ -53,6 +53,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
+2 -1
View File
@@ -38,6 +38,7 @@ CONFIG_ARMV7M_DTCM=y
CONFIG_ARMV7M_ICACHE=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_ARM_MPU_EARLY_RESET=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=95150
@@ -71,6 +72,7 @@ CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_ROMFS=y
CONFIG_GRAN=y
@@ -83,7 +85,6 @@ CONFIG_IDLETHREAD_STACKSIZE=750
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LONG_LONG=y
CONFIG_LIBC_STRERROR=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MMCSD=y
-10
View File
@@ -129,16 +129,6 @@ __EXPORT void board_on_reset(int status)
************************************************************************************/
__EXPORT void stm32_boardinitialize(void)
{
// clear all existing MPU configuration from bootloader
for (int region = 0; region < CONFIG_ARM_MPU_NREGIONS; region++) {
putreg32(region, MPU_RNR);
putreg32(0, MPU_RBAR);
putreg32(0, MPU_RASR);
// save
putreg32(0, MPU_CTRL);
}
/* Reset PWM first thing */
board_on_reset(-1);
+1
View File
@@ -54,6 +54,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
+2 -1
View File
@@ -38,6 +38,7 @@ CONFIG_ARMV7M_DTCM=y
CONFIG_ARMV7M_ICACHE=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_ARM_MPU_EARLY_RESET=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=95150
@@ -71,6 +72,7 @@ CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_ROMFS=y
CONFIG_GRAN=y
@@ -83,7 +85,6 @@ CONFIG_IDLETHREAD_STACKSIZE=750
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LONG_LONG=y
CONFIG_LIBC_STRERROR=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MMCSD=y
-10
View File
@@ -129,16 +129,6 @@ __EXPORT void board_on_reset(int status)
************************************************************************************/
__EXPORT void stm32_boardinitialize(void)
{
// clear all existing MPU configuration from bootloader
for (int region = 0; region < CONFIG_ARM_MPU_NREGIONS; region++) {
putreg32(region, MPU_RNR);
putreg32(0, MPU_RBAR);
putreg32(0, MPU_RASR);
// save
putreg32(0, MPU_CTRL);
}
/* Reset PWM first thing */
board_on_reset(-1);
-5
View File
@@ -1,14 +1,9 @@
CONFIG_COMMON_OPTICAL_FLOW=n
CONFIG_DRIVERS_ADC_ADS1115=n
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=n
CONFIG_DRIVERS_IRLOCK=n
CONFIG_DRIVERS_OSD=n
CONFIG_DRIVERS_PCA9685=n
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
CONFIG_DRIVERS_ROBOCLAW=n
CONFIG_DRIVERS_RPM=n
CONFIG_DRIVERS_SMART_BATTERY_BATMON=n
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
CONFIG_MODULES_ROVER_POS_CONTROL=n
@@ -49,6 +49,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
@@ -39,6 +39,7 @@ CONFIG_ARMV7M_DTCM=y
CONFIG_ARMV7M_ICACHE=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_ARM_MPU_EARLY_RESET=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=95150
@@ -38,6 +38,7 @@ CONFIG_ARMV7M_DTCM=y
CONFIG_ARMV7M_ICACHE=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_ARM_MPU_EARLY_RESET=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=95150
-10
View File
@@ -120,16 +120,6 @@ __EXPORT void board_on_reset(int status)
************************************************************************************/
__EXPORT void stm32_boardinitialize(void)
{
// clear all existing MPU configuration from bootloader
for (int region = 0; region < CONFIG_ARM_MPU_NREGIONS; region++) {
putreg32(region, MPU_RNR);
putreg32(0, MPU_RBAR);
putreg32(0, MPU_RASR);
// save
putreg32(0, MPU_CTRL);
}
/* Reset PWM first thing */
board_on_reset(-1);
+3 -6
View File
@@ -1,16 +1,13 @@
CONFIG_DRIVERS_ADC_ADS1115=n
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
CONFIG_DRIVERS_IRLOCK=n
CONFIG_DRIVERS_PCA9685=n
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
CONFIG_DRIVERS_ROBOCLAW=n
CONFIG_DRIVERS_SMART_BATTERY_BATMON=n
CONFIG_DRIVERS_RPM=n
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
CONFIG_MODULES_ROVER_POS_CONTROL=n
CONFIG_MODULES_SIH=n
CONFIG_MODULES_TEMPERATURE_COMPENSATION=n
CONFIG_SYSTEMCMDS_MOTOR_RAMP=n
CONFIG_SYSTEMCMDS_REFLECT=n
CONFIG_SYSTEMCMDS_SYSTEM_TIME=n
CONFIG_BOARD_TESTING=y
CONFIG_DRIVERS_TEST_PPM=y
CONFIG_SYSTEMCMDS_MICROBENCH=y
@@ -48,6 +48,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
+1 -1
View File
@@ -35,8 +35,8 @@
constexpr io_timers_t io_timers[MAX_IO_TIMERS] = {
initIOTimer(Timer::Timer2),
initIOTimer(Timer::Timer3),
initIOTimer(Timer::Timer4),
initIOTimer(Timer::Timer3),
};
constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
+1
View File
@@ -30,6 +30,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
@@ -14,3 +14,4 @@ CONFIG_BOARD_UAVCAN_INTERFACES=1
CONFIG_DRIVERS_UAVCANNODE=y
CONFIG_MODULES_SENSORS=y
CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
+1 -3
View File
@@ -38,7 +38,6 @@ CONFIG_COMMON_TELEMETRY=y
CONFIG_DRIVERS_TONE_ALARM=y
CONFIG_DRIVERS_UAVCAN=y
CONFIG_MODULES_AIRSPEED_SELECTOR=y
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
CONFIG_MODULES_BATTERY_STATUS=y
CONFIG_MODULES_CAMERA_FEEDBACK=y
CONFIG_MODULES_COMMANDER=y
@@ -48,13 +47,13 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
CONFIG_MODULES_LAND_DETECTOR=y
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
CONFIG_MODULES_LOAD_MON=y
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y
CONFIG_MODULES_LOGGER=y
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
CONFIG_MODULES_MAVLINK=y
@@ -99,4 +98,3 @@ CONFIG_SYSTEMCMDS_UORB=y
CONFIG_SYSTEMCMDS_USB_CONNECTED=y
CONFIG_SYSTEMCMDS_VER=y
CONFIG_SYSTEMCMDS_WORK_QUEUE=y
CONFIG_EXAMPLES_FAKE_GPS=y
@@ -38,6 +38,7 @@ CONFIG_ARMV7M_DTCM=y
CONFIG_ARMV7M_ICACHE=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_ARM_MPU_EARLY_RESET=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=95150
@@ -72,6 +73,7 @@ CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_ROMFS=y
CONFIG_GRAN=y
@@ -84,7 +86,6 @@ CONFIG_IDLETHREAD_STACKSIZE=750
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LONG_LONG=y
CONFIG_LIBC_STRERROR=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MMCSD=y
+4 -51
View File
@@ -176,34 +176,13 @@
#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM Capture
*
* 6 PWM Capture inputs are configured.
*
* Pins:
*
* FMU_CAP1 : PB11 : TIM2_CH4
* FMU_CAP2 : PB3 : TIM2_CH2
* FMU_CAP3 : PA5 : TIM2_CH1
* FMU_CAP4 : PH9 : TIM12_CH2
* FMU_CAP5 : PH6 : TIM12_CH1
* FMU_CAP6 : PD14 : TIM4_CH3
*/
#define GPIO_TIM2_CH4_IN /* PB11 FMU_CAP3 */ GPIO_TIM2_CH4IN_2
#define GPIO_TIM2_CH2_IN /* PB3 FMU_CAP2 */ GPIO_TIM2_CH2IN_2
#define GPIO_TIM2_CH1_IN /* PA5 FMU_CAP1 */ GPIO_TIM2_CH1IN_3
#define GPIO_TIM12_CH2_IN /* PH9 FMU_CAP4 */ GPIO_TIM12_CH2IN_2
#define GPIO_TIM12_CH1_IN /* PH6 FMU_CAP5 */ GPIO_TIM12_CH1IN_2
#define GPIO_TIM4_CH3_IN /* PD14 FMU_CAP6 */ GPIO_TIM4_CH3IN_2
#define DIRECT_PWM_CAPTURE_CHANNELS 6
/* PWM
*/
#define DIRECT_PWM_OUTPUT_CHANNELS 5
#define DIRECT_PWM_OUTPUT_CHANNELS 10
#define BOARD_DSHOT_MOTOR_ASSIGNMENT {3, 2, 1, 0, 4};
#define BOARD_NUM_IO_TIMERS 4
#define BOARD_DSHOT_MOTOR_ASSIGNMENT {3, 2, 1, 0, 4, 5, 6, 7, 9, 8};
/* Power supply control and monitoring GPIOs */
@@ -254,32 +233,6 @@
/* RC Serial port */
/* Input Capture Channels. */
#define INPUT_CAP1_TIMER 2
#define INPUT_CAP1_CHANNEL /* T2C4 */ 4
#define GPIO_INPUT_CAP1 /* PB11 */ GPIO_TIM2_CH4_IN
#define INPUT_CAP2_TIMER 2
#define INPUT_CAP2_CHANNEL /* T2C2 */ 2
#define GPIO_INPUT_CAP2 /* PB3 */ GPIO_TIM2_CH2_IN
#define INPUT_CAP3_TIMER 2
#define INPUT_CAP3_CHANNEL /* T2C1 */ 1
#define GPIO_INPU3_CAP1 /* PA5 */ GPIO_TIM2_CH1_IN
#define INPUT_CAP4_TIMER 12
#define INPUT_CAP4_CHANNEL /* T12C2*/ 2
#define GPIO_INPUT_CAP4 /* PH9 */ GPIO_TIM12_CH2_IN
#define INPUT_CAP5_TIMER 12
#define INPUT_CAP5_CHANNEL /* T12C1*/ 1
#define GPIO_INPUT_CAP5 /* PH6 */ GPIO_TIM12_CH1_IN
#define INPUT_CAP6_TIMER 4
#define INPUT_CAP6_CHANNEL /* T4C3 */ 3
#define GPIO_INPUT_CAP6 /* PD14 */ GPIO_TIM4_CH3_IN
/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */
#define PWMIN_TIMER 4
-10
View File
@@ -162,16 +162,6 @@ __EXPORT void board_on_reset(int status)
__EXPORT void
stm32_boardinitialize(void)
{
// clear all existing MPU configuration from bootloader
for (int region = 0; region < CONFIG_ARM_MPU_NREGIONS; region++) {
putreg32(region, MPU_RNR);
putreg32(0, MPU_RBAR);
putreg32(0, MPU_RASR);
// save
putreg32(0, MPU_CTRL);
}
board_on_reset(-1); /* Reset PWM first thing */
/* configure LEDs */
@@ -36,6 +36,8 @@
constexpr io_timers_t io_timers[MAX_IO_TIMERS] = {
initIOTimer(Timer::Timer1, DMA{DMA::Index1}),
initIOTimer(Timer::Timer4, DMA{DMA::Index1}),
initIOTimer(Timer::Timer2),
initIOTimer(Timer::Timer12),
};
constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
@@ -44,6 +46,12 @@ constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}),
initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}),
initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}),
initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortB, GPIO::Pin11}),
initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortB, GPIO::Pin3}),
initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin5}),
initIOTimerChannelCapture(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}),
initIOTimerChannelCapture(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}),
//initIOTimerChannelCapture(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}),
};
constexpr io_timers_channel_mapping_t io_timers_channel_mapping =
+1
View File
@@ -5,6 +5,7 @@ CONFIG_BOARD_EXTERNAL_METADATA=y
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3"
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0"
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1"
CONFIG_BOARD_SERIAL_RC="/dev/ttyS4"
CONFIG_DRIVERS_ADC_BOARD_ADC=y
CONFIG_DRIVERS_BAROMETER_BMP280=y
CONFIG_DRIVERS_DSHOT=y
+1
View File
@@ -53,6 +53,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
+2 -31
View File
@@ -211,22 +211,6 @@
#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true))
/* PWM Capture
*
* 3 PWM Capture inputs are configured.
*
* Pins:
*
* FMU_CAP1 : PA5 : TIM2_CH1
* FMU_CAP2 : PB3 : TIM2_CH2
* FMU_CAP3 : PB11 : TIM2_CH4
*/
#define GPIO_TIM2_CH1_IN /* PA5 T22C1 FMU_CAP1 */ GPIO_TIM2_CH1IN_3
#define GPIO_TIM2_CH2_IN /* PB3 T22C2 FMU_CAP2 */ GPIO_TIM2_CH2IN_2
#define GPIO_TIM2_CH4_IN /* PB11 T22C4 FMU_CAP3 */ GPIO_TIM2_CH4IN_2
#define DIRECT_PWM_CAPTURE_CHANNELS 3
/* PI0 is nARMED
* The GPIO will be set as input while not armed HW will have external HW Pull UP.
* While armed it shall be configured at a GPIO OUT set LOW
@@ -238,7 +222,7 @@
/* PWM
*/
#define DIRECT_PWM_OUTPUT_CHANNELS 8
#define DIRECT_PWM_OUTPUT_CHANNELS 11
#define BOARD_HAS_LED_PWM 1
#define BOARD_LED_PWM_DRIVE_ACTIVE_LOW 1
@@ -307,19 +291,6 @@
#define RC_SERIAL_PORT "/dev/ttyS4"
#define RC_SERIAL_SINGLEWIRE
/* Input Capture Channels. */
#define INPUT_CAP1_TIMER 2
#define INPUT_CAP1_CHANNEL /* T4C1 */ 1
#define GPIO_INPUT_CAP1 /* PA5 */ GPIO_TIM2_CH1_IN
#define INPUT_CAP2_TIMER 2
#define INPUT_CAP2_CHANNEL /* T4C2 */ 2
#define GPIO_INPUT_CAP2 /* PB3 */ GPIO_TIM2_CH2_IN
#define INPUT_CAP3_TIMER 2
#define INPUT_CAP3_CHANNEL /* T4C4 */ 4
#define GPIO_INPUT_CAP3 /* PB11 */ GPIO_TIM2_CH4_IN
/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */
#define PWMIN_TIMER 4
#define PWMIN_TIMER_CHANNEL /* T4C2 */ 2
@@ -465,7 +436,7 @@
#define BOARD_NUM_IO_TIMERS 5
#define BOARD_DSHOT_MOTOR_ASSIGNMENT {3, 2, 1, 0, 4, 5, 6, 7};
#define BOARD_DSHOT_MOTOR_ASSIGNMENT {3, 2, 1, 0, 4, 5, 6, 7, 8, 9, 10};
__BEGIN_DECLS
@@ -50,6 +50,9 @@ 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}),
initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin5}),
initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortB, GPIO::Pin3}),
initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortB, GPIO::Pin11}),
};
constexpr io_timers_channel_mapping_t io_timers_channel_mapping =
+1
View File
@@ -48,6 +48,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
+1
View File
@@ -47,6 +47,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
@@ -2,4 +2,3 @@
#
# ModalAI FC-v2 specific board defaults
#------------------------------------------------------------------------------
-5
View File
@@ -192,11 +192,6 @@
#define HW_INFO_INIT_VER 3 /* Offset in above string of the VER */
#define HW_INFO_INIT_REV 4 /* Offset in above string of the REV */
/* PWM Capture - not routed
*/
#define DIRECT_PWM_CAPTURE_CHANNELS 0
/* PE6 is nARMED --> FCv2 this goes to TP13
* The GPIO will be set as input while not armed HW will have external HW Pull UP.
* While armed it shall be configured at a GPIO OUT set LOW
@@ -46,6 +46,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
+1
View File
@@ -46,6 +46,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
@@ -46,6 +46,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
@@ -38,6 +38,7 @@ CONFIG_ARMV7M_DTCM=y
CONFIG_ARMV7M_ICACHE=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_ARM_MPU_EARLY_RESET=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=95150
@@ -73,6 +74,7 @@ CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_ROMFS=y
CONFIG_GRAN=y
@@ -85,7 +87,6 @@ CONFIG_IDLETHREAD_STACKSIZE=750
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LONG_LONG=y
CONFIG_LIBC_STRERROR=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MMCSD=y
-10
View File
@@ -123,16 +123,6 @@ __EXPORT void board_on_reset(int status)
************************************************************************************/
__EXPORT void stm32_boardinitialize(void)
{
// clear all existing MPU configuration from bootloader
for (int region = 0; region < CONFIG_ARM_MPU_NREGIONS; region++) {
putreg32(region, MPU_RNR);
putreg32(0, MPU_RBAR);
putreg32(0, MPU_RASR);
// save
putreg32(0, MPU_CTRL);
}
/* Reset PWM first thing */
board_on_reset(-1);
+1
View File
@@ -47,6 +47,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
@@ -38,6 +38,7 @@ CONFIG_ARMV7M_DTCM=y
CONFIG_ARMV7M_ICACHE=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_ARM_MPU_EARLY_RESET=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=95150
@@ -73,6 +74,7 @@ CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_ROMFS=y
CONFIG_GRAN=y
@@ -85,7 +87,6 @@ CONFIG_IDLETHREAD_STACKSIZE=750
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LONG_LONG=y
CONFIG_LIBC_STRERROR=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MMCSD=y
-10
View File
@@ -123,16 +123,6 @@ __EXPORT void board_on_reset(int status)
************************************************************************************/
__EXPORT void stm32_boardinitialize(void)
{
// clear all existing MPU configuration from bootloader
for (int region = 0; region < CONFIG_ARM_MPU_NREGIONS; region++) {
putreg32(region, MPU_RNR);
putreg32(0, MPU_RBAR);
putreg32(0, MPU_RASR);
// save
putreg32(0, MPU_CTRL);
}
/* Reset PWM first thing */
board_on_reset(-1);
+1
View File
@@ -45,6 +45,7 @@ CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y

Some files were not shown because too many files have changed in this diff Show More