157 Commits

Author SHA1 Message Date
Jukka Laitinen
e1f2bff9be Fix parameters building for nuttx protected/kernel builds
- Don't link to px4_layer
- Don't link to flashparams; flashparams would work only in kernel side
- Add missing link to px4_platform

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-27 12:42:40 -05:00
Daniel Agar
ece09064c4 parameters: perform verification pass twice
- on NuttX with MTD storage this is to ensure we are verifying what's
actually stored on ramtron or eeprom, not just what's cached by bchlib
2022-01-18 09:47:28 -05:00
Daniel Agar
673d4544d1 parameters: verify param backup after export 2022-01-02 10:46:34 -05:00
Daniel Agar
8e26b33009 tinybson: file write error add more detail 2022-01-02 10:46:34 -05:00
Daniel Agar
80ef6e19df tinybson: explicitly append int32 or int64 2022-01-02 10:46:34 -05:00
Daniel Agar
9cbb5c9920 parameters: fix export shutdown locking
- in NuttX bchlib keeps a sector sized buffer that might not be written
out to RAMTRON until the file is closed
2022-01-02 10:46:34 -05:00
Daniel Agar
1b6700592b parameters: require valid BSON document size 2021-12-30 16:36:23 -05:00
Daniel Agar
236794235a parameters: export empty BSON document even if there are no parameters to save
- otherwise a 'param reset_all' won't be saved until a parameter is changed
2021-12-27 09:17:00 -05:00
Daniel Agar
33d7b42040 parameters: import quietly retry if there's no data (as a precuation) 2021-12-27 09:17:00 -05:00
Daniel Agar
20d3e6f4e1 parameters: add simple BSON verification pass after export 2021-12-27 09:17:00 -05:00
Daniel Agar
3f3836afa8 parameters: simplify import mark_unsaved and don't fail bson decode unnecessarily 2021-12-24 14:32:40 -05:00
Daniel Agar
d1cd4904dc parameters: param_value_is_default avoid locking if value unchanged 2021-12-24 14:32:40 -05:00
Daniel Agar
c0b8f2952c parameters: param_get_default_value avoid locking if value is static default 2021-12-24 14:32:40 -05:00
Daniel Agar
27a113ecab parameters: param_get avoid locking if value is static default 2021-12-24 14:32:40 -05:00
Daniel Agar
cd8ce4d01e parameters: remove obsolete perf_end 2021-12-24 14:32:40 -05:00
Daniel Agar
38731662c6 parameters use bitset for mark_unsaved 2021-12-24 14:32:40 -05:00
Daniel Agar
e694fa906b tinybson: add more error output on node name overflow 2021-12-23 17:45:50 -05:00
Silvan Fuhrer
e9b9176ce2 param translation: fix for FW_GPSF_LT and FW_GPSF_R
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-12-14 08:27:04 +01:00
Beat Küng
80300c36b4 parameter units: add 'A' (Ampere) 2021-12-10 09:03:08 -05:00
Daniel Agar
1f6acd0171 parameters: add simple backup and restore mechanism 2021-12-06 09:37:08 -05:00
Daniel Agar
674b92df18 parameters: sleep 10 ms before retrying a failed import/export 2021-12-06 09:37:08 -05:00
Daniel Agar
7bfebf5289 parameters: add param dump to read and decode bson to console 2021-12-06 09:37:08 -05:00
Daniel Agar
7560d45c61 parameters: import tolerate unhanlded BSON types 2021-12-06 09:37:08 -05:00
Daniel Agar
1af068179e parameters: tinybson print errors and count imported types 2021-12-06 09:37:08 -05:00
Beat Küng
312d84ca23 metadata: run json schema validation for actuators + parameter metadata 2021-11-23 12:40:22 -05:00
Daniel Agar
cbb743c64d parameters: param type checking use PX4_ERR and enable in PX4_SITL 2021-11-22 09:08:25 -05:00
Daniel Agar
f5d9b01f5c
NuttX build in place
- cmake NuttX build wrapper compile in place instead of copying source tree to build directory
    - slightly faster skipping necessary copying (depending on system)
    - allows debugging in place
    - easier to work directly in NuttX following official documentation
    - simplifies overall build which should make it easier to resolve any remaining NuttX dependency issues in the build system
 - the downside is switching back and forth between different builds always require rebuilding NuttX, but I think this is worth the improved developer experience
 - also no longer builds px4io and bootloader in every single build, for most users these rarely change and we're wasting a lot of build time
2021-11-15 18:47:38 -05:00
Daniel Agar
eade2915c1 cleanup old parameter translation 2021-11-15 10:01:22 -05:00
Silvan Fuhrer
b77487d69c Fixed-wing Position controller: add modes for auto altitude and auto descend
- bit of clean up
- add GPS failsafe mode auto_altitude, that will keep current altitude with a fixed-bank angle
for some time, then switches to auto_descend that will descend with constant sink rate
of 0.5m/s
- params controlling GPS failsafe are not FW params: NAV_GPSF_R --> FW_GPSF_R and
NAV_GPSF_LT --> FW_GPSF_LT

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-11-05 12:09:39 +03:00
Beat Küng
ab1d76ae7d params: use PWM_MAIN_* instead of PWM_FMU_* 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
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
c55626d2d6 refactor Tools/serial: move non-serial param generation into separate script 2021-10-18 18:45:19 -04:00
Jukka Laitinen
351f679c2f parameters: Use px4::atomic_bool instead of px4::atomic<bool>
This enables us to define the actual atomic bool type in px4_platform

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-10-13 15:01:26 -04:00
Beat Küng
393f59ae71 param jsonout: handle @boolean flag
This got lost when switching from xml to json metadata
2021-10-07 09:20:50 -04:00
Silvan Fuhrer
4e3fa7cf35 VTOL: rework forward actuation assist
-allow positive pitch offsets in hover
-add param for min pitch during LAND

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-06 11:27:19 -04:00
Beat Küng
540c024cbb parameters: avoid printing errors for erased flash devices
Errors:
ERROR [parameters] param import failed (-1) attempt 1, retrying
ERROR [parameters] param import failed (-1) attempt 2, retrying
ERROR [parameters] param import failed (-1) attempt 3, retrying
ERROR [parameters] param import failed (-1) attempt 4, retrying
ERROR [param] importing from '/fs/mtd_caldata' failed (-1)
2021-10-04 10:25:32 -04:00
Daniel Agar
03bd5e0f48 lib/led: move drivers/lights/rgbled LED_RGB_MAXBRT -> SYS_RGB_MAXBRT 2021-09-28 10:09:55 -04:00
Daniel Agar
99d7cf4255 parameters: only warn on invalid parameter import 2021-09-01 15:16:00 -04:00
Daniel Agar
ff39e27e2d sensor calibration: save temperature at calibration time for monitoring 2021-08-15 11:19:24 -04:00
Daniel Agar
65745a3676 purge broken qurt support and atlflight boards 2021-07-16 08:53:36 -04:00
David Sidrane
f50b238c78 lib/parameters:Use inttypes 2021-06-16 17:07:47 +02:00
Hamish Willee
665d2ea74e markdownout for parameters - makes link internal 2021-06-09 11:09:48 +02:00
Silvan Fuhrer
2f73115b54 translate ASPD_STALL to FW_AIRSPD_STALL
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-05-10 13:43:05 +02:00
Daniel Agar
e78a4287f9 parameters: attempt import multiple times 2021-05-02 13:48:16 -04:00
Daniel Agar
c266c3e43a parameters: remove unnecessary param_get_system_default_value() locking 2021-04-26 09:49:15 +02:00
Beat Küng
1730cd1971 param: avoid warning for 'param show -c' or 'param show -a' 2021-04-23 16:44:55 -04:00
Jukka Laitinen
b99e597a73 flashparams: Fix a null-pointer dereference crash
Fix a potential crash caused by calling erase_sector with a null
sector_descriptor (current_sector == 0).

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-04-14 07:55:33 -07:00
Daniel Agar
f44f497e3f parameters: better handle export failures and retry 2021-04-12 21:26:50 -04:00
Daniel Agar
edc445a1b2 parameters: tinybson fill total document length for bson compatibility 2021-04-12 21:26:50 -04:00