Skip to content

Add support for DShot in IOFirmware #21569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

bugobliterator
Copy link
Member

@bugobliterator bugobliterator commented Aug 29, 2022

To select Dshot IO firmware, set BRD_IO_DSHOT 1 and then reboot. That will load dshot firmware to iomcu.

Supported features:

  • DShot 150 / DShot 300 / OneShot 125
  • DShot telemetry via UART
  • DShot commands, including motor reversing
  • SERVO_DSHOT_ESC types
  • SERVO_DSHOT_RATE

(mask & ((1U<<chan_offset)-1)) &&
AP_BoardConfig::io_enabled()) {
iomcu_mode = mode;
iomcu.set_brushed_mode();
iomcu.set_output_mode(mask, mode);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need some testing of oneshot and brushed output with IOMCU to ensure we do get the right update rate

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oneshot and oneshot125 verified

Copy link
Contributor

@andyp1per andyp1per left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to test on L431 AP_Periph as I am not quite sure the DMA advanced changes are correct

@bugobliterator bugobliterator force-pushed the pr-dshot-iofirmware branch 3 times, most recently from 9823f65 to 6a32bdd Compare October 8, 2022 02:54
Copy link
Contributor

@andyp1per andyp1per left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see that any of my original comments have been addressed

@andyp1per
Copy link
Contributor

Rebased

@andyp1per andyp1per force-pushed the pr-dshot-iofirmware branch 3 times, most recently from c92aada to 39bba9a Compare May 23, 2023 19:35
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label May 27, 2023
@andyp1per andyp1per force-pushed the pr-dshot-iofirmware branch from 2ba5f65 to 1e24ad1 Compare May 30, 2023 20:06
@tridge
Copy link
Contributor

tridge commented May 31, 2023

@andyp1per I will do some testing of this soon, thanks!

@tridge tridge removed the DevCallEU label May 31, 2023
@andyp1per andyp1per requested a review from tridge May 31, 2023 21:35
andyp1per and others added 7 commits May 31, 2023 22:36
add support for selectively disabling serial LEDs and passthrough
provide mutator to allow iomcu to set dshot rate
support HAL_SERIAL_ESC_COMM_ENABLED and DISABLE_SERIAL_ESC_COMM
update dshot docs
make default serial led enablement dependent on dshot
set timer counter size to be a byte wide
use HAL_DSHOT_ENABLED instead of DISABLE_DSHOT
build iomcu-dshot from existing iomcu
correct defines for DMAR size on iomcu
allow iomcu dshot rate to be configured from FMU
correct DMA allocation for dshot on iomcu
allow debug builds on iofirmware
ensure dshot is enabled on iomcu dshot
support proper iomcu dshot output thread triggered by FMU
allow selective disablement of serial LEDs and passthrough
disable serial LEDs and passthrough on iomcu-dshot
propagate ESC telemetry to iomcu
dshot_send_groups() for iomcu
remove use of ICU on iomcu for dshot. only allocate possible DMA channels
rename serial passthrough and dshot defines
update dshot docs
resize dshot iomcu main stack to minimum
correct dshot prescaler usage and bit_width_mul calculation
use ChibiOS in tickless mode on iomcu-dshot so that virtual timers can be used
propagate dshot commands to iomcu
passthrough oneshot125 to iomcu
@andyp1per andyp1per force-pushed the pr-dshot-iofirmware branch from c8ed8a1 to 4a48477 Compare May 31, 2023 21:37
@tridge
Copy link
Contributor

tridge commented Jun 2, 2023

notes from my testing:

  • if DShot600 doesn't work then it should be refused, not generate corrupt output
  • looks like a soft reboot of FMU doesn't change pwm_type in iomcu? It needs to

why the gap? should be 4 channels on timer 3
image
quadplane, standard channels, DShot300 on 5-8, seem to be missing elevator on ch2?
image

@andyp1per
Copy link
Contributor

andyp1per commented Jun 2, 2023

@tridge can you post the config you used?

For the "gap" - I'm not sure what I am looking at - can you expand?

@andyp1per
Copy link
Contributor

Not being able to change dshot mode once set without a power cycle is an existing dshot problem that I would like to address in a separate PR since the DMA enablement code is quite hairy

@andyp1per andyp1per mentioned this pull request Jun 5, 2023
@tridge tridge removed the DevCallEU label Jun 7, 2023
andyp1per and others added 5 commits June 8, 2023 16:43
implement dshot ESC telemetry
add support for channel enablement/disablement
add stack checks and reporting for MSP stack
wait correct timeout in tickless mode
ensure that dshot sees all pwm updates as the occur in order to maintain periodicity
ensure dshot options are propagated on reset
implement dshot commands
ensure oneshot/125 and mode are setup correctly
add instrumentation for process stack
prevent illegal recursive locks
ignore requests for dshot 600
add support for soft reboot of iomcu
@andyp1per andyp1per force-pushed the pr-dshot-iofirmware branch from c6cdcae to 5a0918f Compare June 8, 2023 15:44
@andyp1per
Copy link
Contributor

Tested on cubeblack 1-2,5-6
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants