Commit Graph

148 Commits

Author SHA1 Message Date
Andy Piper cabaef6173 AP_HAL_ChibiOS: add BLHeli_S ESC type and use it to control bitwidths 2022-05-25 17:06:08 +10:00
Peter Barker 2913c8d9e9 AP_HAL_ChibiOS: add support for SIM_OH_MASK (sim-on-hardware output enable mask 2022-05-24 10:35:32 +10:00
Andrew Tridgell c8b328c3a1 HAL_ChibiOS: always start with safety enabled
we want it enabled during early boot to prevent incorrect ESC and
servo output
2022-05-22 14:58:12 +10:00
Andrew Tridgell 1d9abefbb1 AP_HAL_ChibiOS: more changes for 32 bit servo mask 2022-05-22 12:07:37 +10:00
Iampete1 7fc691d8d5 AP_HAL_ChibiOS: enable 32 servo outs 2022-05-22 12:07:37 +10:00
Andy Piper 119cde79a7 AP_HAL_ChibiOS: determine presence of disabled channels based on digital channels in a group 2022-04-25 15:55:54 +09:00
Andy Piper df35cb6243 AP_HAL_ChibiOS: move bitwidths to AP_HAL 2022-04-20 17:39:29 +10:00
Andy Piper e0adbb978e AP_HAL_ChibiOS: fix dshot timeout bug where the elapsed pulse is longer than the send time
dshot timeouts should be no longer than the pulse interval
use correct timestamp for dmar send time
2022-04-07 07:21:21 +10:00
Andrew Tridgell 4c977eb7a0 HAL_ChibiOS: prevent long timeouts in DShot
this prevents bad calculated timeouts in DShot. The timeout would
sometimes come out as 0xFFFFFFFF, which led to an assert and could
block the thread

This fix is meant to be minimilistic to allow it to be merged easily
into 4.2. A better fix would fix all the uint32_t wrap handling in
DShot
2022-04-05 17:46:52 +10:00
Andy Piper 23f8a00619 AP_HAL_ChibiOS: use narrower bitwidths for dshot and LEDs to allow more accurate prescaler calculation 2022-03-30 17:11:09 +11:00
Andy Piper 4fa0e275fd AP_HAL_ChibiOS: fix ESCs constantly arming on rover with dshot commands
make sure debug will compile
take into account active channels when configuring bdshot
add channel mask debug output
correct set bdshot telemetry position at startup
make sure all channels in a bdshot group are pulled high to prevent spurious pulses
2022-03-29 10:29:31 +11:00
Randy Mackay 5561a5e82e AP_HAL_ChibiOS: reversible DShot fix
Co-authored-by: Andy Piper <github@andypiper.com>
2022-03-24 08:01:48 +09:00
Peter Barker f7608c22da AP_HAL_ChibiOS: set pwm output values in simstate object 2022-03-17 14:39:55 +11:00
Andy Piper 02219ba3e5 AP_HAL_ChibiOS: ensure chan_offset is initialized before using it 2022-02-23 18:35:43 +11:00
Andy Piper b6022ca5d4 AP_HAL_ChibiOS: add support for alternate alarm PWM group
account for inverted alarms and build on boards without PWM
enable alarm based on pwm
shutdown alarm channel if using a different one
2022-02-23 18:35:43 +11:00
Andrew Tridgell 638e20a0b9 HAL_ChibiOS: bring in hal.h where it is needed 2022-02-22 12:13:19 +11:00
Andy Piper 83ac78e969 AP_HAL_ChibiOS: add support for @SYS/timers.txt
move out prescaler calculation and use closest prescaler everywhere
include timer id in PWM groups
2022-02-16 15:28:04 +11:00
Andy Piper 48c21299f8 AP_HAL_ChibiOS: hwdef for SPRacingH7
hwdef for DevEBoxH7v2
pin definitions for STM32H750
add QSPI to DevEBox bootloader
add external flash to DevEBox
rename EXTERNAL_PROG_FLASH_MB to EXT_FLASH_SIZE_MB
Add support for EXT_FLASH_RESERVE_START_KB and EXT_FLASH_RESERVE_END_KB
Disable HAL_ENABLE_SAVE_PERSISTENT_PARAMS when there is no bootloader flash available
relax storage health status with SD card backend
don't check SD card health unless USE_POSIX
binary sections rearranged on external ram
manage RAMFUNC through ldscript and optimize function placement in external flash
inline timer functions
optimize placement of ChibiOS and functions in ITCM and AXI RAM
fix chibios features on bootloader build with external flash
change H750 memory layout
increase line storage for SD card based parameters
comment external flash linker script
move vtables into DTCM
update ram map for H757
enable crashdump support with external flash
correct bootloader pins and generator on SPRacingH7/DevEBoxH7v2
setup external flash reserve regions
allow different RAM_MAP for external flash on H750 and H757
2022-02-09 12:47:55 +00:00
Andy Piper ab25fc659a AP_HAL_ChibiOS: correct prescaler algorithm
remove redundant PWM reset
2022-02-07 12:56:30 +11:00
Andrew Tridgell d71ec5bb4d HAL_ChibiOS: don't init RCOut twice
this triggered a watchdog if the dshot timer was already active, which caused
the neoled driver to prevent boot of the Matek F405 GPS
2022-01-27 08:26:47 +11:00
Andrew Tridgell e35514b551 HAL_ChibiOS: fixed neopixel control
fixes frequency setup for neopixel, separating out DShot setup. Also
allows for neopixel without other DMA controlled output types for LEDs
in AP_Periph
2022-01-27 08:26:47 +11:00
Michel Pastor 876f478ae1 RCOutput: fix motor stopping with rev thrust and full throttle 2021-10-26 10:53:34 +11:00
Andrew Tridgell 5a68e21435 HAL_ChibiOS: support STM32L431 2021-10-17 20:30:20 +11:00
Iampete1 9751cb5b24 AP_HAL_ChibiOS: move is_dshot_protocol up to AP_HAL 2021-10-06 18:59:57 +11:00
Michel Pastor a9fed2f9bc RCOutput: fix full throttle bug 2021-10-05 11:47:04 +11:00
Andrew Tridgell 6953778b4c HAL_ChibiOS: use micros16() for blheli pass-thru IRQ
saves some IRQ overhead, makes time handling more consistent
2021-10-02 18:26:39 +10:00
Iampete1 53ee7d861d AP_HAL_ChibiOS: remove safe PWM 2021-09-14 09:23:02 +10:00
Iampete1 529a3a9122 AP_HAL_ChibiOS: convert back to full range on IOMCU ONESHOT125 read 2021-09-08 18:01:50 +10:00
Andy Piper 68fd87091c AP_HAL_ChibiOS: output initializing from PWM banner when not available 2021-08-12 19:07:51 +09:00
Andy Piper a51e58022f AP_HAL_ChibiOS: add accessor for reversed mask
allow mask updates to be disabled
send dshot commands even if armed - they will be accepted as long as throttle is at zero
only accept low-priority dshot commands while disarmed
apply reversed and reversible mask as servo channels
2021-08-12 19:00:51 +09:00
Andrew Tridgell 54e53ed71c HAL_ChibiOS: use is_GPIO() instead of BRD_PWM_COUNT 2021-07-22 07:48:12 +10:00
Andy Piper 60b0df0a25 AP_HAL_ChibiOS: only control widest pulse for dshot and oneshot 2021-07-14 17:50:06 +10:00
Andrew Tridgell 7ac895db77 HAL_ChibiOS: always send zero DShot when disarmed
this prevents a misconfigured system (for example SERVOn_REVERSED=1)
from running a motor while disarmed.

See https://discuss.ardupilot.org/t/plane-4-1-0-beta/72434/34?u=tridge
2021-07-03 11:37:28 +10:00
Andy Piper 9e99f724e5 AP_HAL_ChibiOS: add 1Hz update_channel_masks()
Send dshot commands in update function
2021-06-22 09:55:27 +10:00
Dr.-Ing. Amilcar do Carmo Lucas 8593672f4c AP_HAL_ChibiOS: fix compilation when HAL_WITH_ESC_TELEM == 0 2021-06-09 21:42:51 +10:00
Andy Piper a7a9fa93f0 AP_HAL_ChibiOS: correct enabled mask for motor channel output 2021-05-24 07:57:51 +09:00
Andy Piper 6447bd1cdd AP_HAL_ChibiOS: use AP_ESC_Telem to record erpm data and error rate
don't output RPM data if bi-dir dshot is not enabled
2021-05-12 17:01:11 +10:00
Andy Piper dbd9b3a9ae AP_HAL_ChibiOS: ESC telemetry is orthogonal to RPM telemetry 2021-05-05 17:41:24 +10:00
Andy Piper 384ecd4a5b AP_HAL_ChibiOS: check command queue is empty before arming 2021-05-05 17:41:24 +10:00
Andy Piper 66fadf53a1 AP_HAL_ChibiOS: remove dshot calibration step 2021-05-05 17:41:24 +10:00
Andy Piper f3f3056dba AP_HAL_ChibiOS: add support for dshot commands to rcout
add support for dshot beepcodes through tonealarm
add support for dshot reversal and command queue
add support for dshot commands to all channels
correctly manage channel enablement in PWM groups
Correctly send dshot commands when using bi-dir dshot
allow reversible settings to be changed
ChibiOS: allow more than one type of ESC for dshot commands
Only execute reverse/reversible commands on BLHeli
add support for checking active ESCS
mark ESCs active when bdshot telemetry is returned
allow dshot alarm to be disabled
allow priroitized dshot commands
2021-05-05 17:41:24 +10:00
Andrew Tridgell f9866dc27e HAL_ChibiOS: fixed LED_SAFETY attached to FMU with recent DShot updates 2021-04-30 17:26:33 +10:00
Andy Piper 4bb4e2fb22 AP_HAL_ChibiOS: adjust GPIO settings for serial passthru 2021-04-20 10:35:22 +10:00
Iampete1 ec90ab13f4 AP_HAL_ChibiOS: RCOutput: print DMA alocation errors 2021-04-07 17:24:25 +10:00
Iampete1 15509f314c AP_HAL_ChibiOS: RCOuput: LED setup re-work 2021-04-07 17:24:25 +10:00
Andy Piper 721850d00a AP_HAL_ChibiOS: fix dshot150. 2021-04-06 10:24:04 +10:00
Andy Piper cb3b37d181 AP_HAL_ChibiOS: ensure that non-dshot modes get regular 1Khz updates 2021-04-06 10:24:04 +10:00
Andy Piper ea3291520c AP_HAL_ChibiOS: add fast cycle calibration step 2021-04-06 10:24:04 +10:00
Andy Piper 74d4af9ac9 AP_HAL_ChibiOS: reset bdshot IC correctly
don't allow dshot rates below 800Hz.
set pin speed to MID1 to avoid glitching
don't run receive pulses on a timer
2021-04-06 10:24:04 +10:00
Andy Piper 477ff72214 AP_HAL_ChibiOS: allow dshot rate to be set so as to both regularize the output as well as
allow faster rates synchronized to the loop rate
synchronize 1Khz and use Betaflight definition for prescaler
adjust dshot bitrates
don't allocate IC DMA if already allocated
cancel DMA pulses correctly
try really hard to align pulses with push() by making each dshot pulse event driven
2021-04-06 10:24:04 +10:00