Skip to content
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

AP_HAL_ChibiOS: Pixhawk6X peripheral power on at startup #26753

Merged
merged 6 commits into from
Apr 17, 2024

Conversation

rmackay9
Copy link
Contributor

@rmackay9 rmackay9 commented Apr 10, 2024

This addresses the Hereflow startup issue recorded in the 4.5.0 issues list and discussed here on the forums.

The issue is that the HereFlow sensor connected to a Pixhawk6X does not start successfully with 4.5.0 but does with 4.4.4. The temporary work around is for users to set BRD_BOOT_DELAY to 3000 which slows AP's startup until after the flow sensor has initialised.

This PR includes a better fix by providing power to the Hereflow sensor as soon as the autopilot is powered on. Note that this change affects more than just the CAN port (but I'm not personally sure what other ports are affected). This change affects these boards:

  • Pixhawk5X
  • Pixhawk6C
  • Pixhawk6X
  • Durandal

This has been tested on real hardware including:

  • Confirmed the user's report is correct. E.g. Pixhawk6X with Hereflow with 4.4.4 works, 4.5.0 does not
  • Confirmed that setting BRD_BOOT_DELAY to 3000 allowed 4.5.0 to work
  • Confirmed that changing the nVDD_5V_PERIPH_EN to LOW allowed 4.5.0 to work with BRD_BOOT_DELAY = 0

This PR changes both the "HIPOWER" and "PERIPH" definitions. In fact, only the 2nd definition must be changed to resolve the issue but I suspect they should be consistent.

From a quick search for "nVDD_5V_PERIPH_EN OUTPUT HIGH" these other boards may have similar issues:

  • ARKV6X
  • DrotekP3Pro
  • fmuv5
  • JFB100
  • PixC4-Jetson
  • RadiolinkPIX6

I'm unsure if other boards might have similar problems.

@rmackay9 rmackay9 requested a review from tridge April 10, 2024 10:22
@rmackay9 rmackay9 mentioned this pull request Apr 10, 2024
92 tasks
@amilcarlucas
Copy link
Contributor

What about radios that use RTS for bootloader hold?

@rmackay9
Copy link
Contributor Author

Hi @amilcarlucas,

Indeed, I saw that comment and it is in pretty much every board that delays the power on. Some boards do not delay the power on though so I suspect the comment is out-of-date.

Another alternative is just to power on the CAN bus first (e.g. the 2nd definition only). I've tested that as well successfully.

Maybe @tridge knows.

@tridge
Copy link
Contributor

tridge commented Apr 15, 2024

I think we should at least apply on:

  • Pixhawk6C
  • Pixhawk5X
  • Durandal

@rmackay9 rmackay9 force-pushed the chibios-pixhawk6x-periph-power branch from 6c683d3 to d4b82b9 Compare April 16, 2024 02:53
@rmackay9 rmackay9 force-pushed the chibios-pixhawk6x-periph-power branch from d4b82b9 to c69bc16 Compare April 16, 2024 03:03
@rmackay9
Copy link
Contributor Author

@tridge,

I've updated the hwdef files for the three boards mentioned (Pixhawk6C, Pixhawk5X, Durandal).

As a drive-by change I also correct the comments for two other boards (CUAV-X7, CUAV-Nora) that seemed to be saying the peripherals were OFF at startup when they were actually ON.

@rmackay9 rmackay9 requested a review from tridge April 16, 2024 03:05
@tridge tridge merged commit 6a56b2b into ArduPilot:master Apr 17, 2024
40 checks passed
@rmackay9 rmackay9 deleted the chibios-pixhawk6x-periph-power branch April 17, 2024 08:25
@rmackay9
Copy link
Contributor Author

This is included in 4.5.2-beta1

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

Successfully merging this pull request may close these issues.

5 participants