Hi. I’m trying to get BDSHOT EDT working in Ardusub. In Arducopter or -plane it’s working great - motors spin, telemetry is returned - but not when compiled for Sub.
Here’s the setup:
Version: master
Flight controller: MatekH743-SLIM
hwdef.dat: MatekH743-bdshot
ESC: AM32
Protocol: DShot300 or DShot600
This is what the S1 channel on the Matek looks like when its working (in copter or plane):
In sub:
The same, zoomed out:
If I turn the ESC off and on again, the Matek and the ESC seem to re-synchronise as follows:
To me, this looks like the output pin config setting (input, output, pull-up etc) is not synchronised with the BDSHOT pulse train. So the ESC is trying to pull the line low, but its still being driven high by the MATEK.
When hardware debugging, execution is clearly reaching the BDSHOT code as it should, but the DMA callback is not being called, so not data is being returned. MOTOR1 is not spinning either even though it’s being sent dshot pulses, so there may be a problem with how the motors are being initialised, and the BDSHOT failure may be a red herring.
There seem to be a lot of differences between the copter and sub objects, so there may be an elusive #define that’s not being set somewhere higher up during the waf configure step.
I’ve compared the respective params files for copter and sub in search of mystery parameters, also compared the TIM3 and GPIOA and B registers. TIM3 seems to updated dynamically (by DMA?) to generate the pulse trains, but I haven’t found any difference vs copter and sub.
I could dig further into the interrupt and DMA registers, but it might just be simple param or #define problem after all
DSHOT is working fine for me in sub, btw, but not BDSHOT.
Anyone any ideas? Thanks in advance