ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

HAL_ChibiOS: add adjustable wdg timeout for hwdefs

Open robertlong13 opened this issue 1 year ago • 3 comments

This allows the watchdog timeout to be adjusted in the hwdef.dat file, so that critical nodes like ESCs can recover more quickly.

I haven't added this to any hwdefs yet. I think that should probably be a separate PR so we can test the specific values that work, and which boards we want to add it to. I think a good contender is the MatekL431-dshot/bdshot/rc, since they don't use a lot of complex features and they are used in pretty time-critical applications. I'm thinking we could probably get away with a 100ms delay on that.

Also, should I add a #if to prevent changing this on anything other than AP_Periph?

robertlong13 avatar Feb 16 '24 19:02 robertlong13

What testing have you done on this?

peterbarker avatar Feb 16 '24 21:02 peterbarker

None yet, as I don't have a periph node to test with. We'll test on the Carbonix CPNs Monday morning.

robertlong13 avatar Feb 16 '24 22:02 robertlong13

@peterbarker, this has been tested on the CarbonixF405 nodes running dshot ESCs with telemetry. Tested at 2048ms, 100ms, and 20ms. The settings seem to correctly change the timeout, and the 20ms timeout does not seem to cause any unintended reboots (though I don't see much benefit in going below 100ms when it takes a couple hundred ms to boot), even when flashing the bootloader.

We could try to push it and see how low we can get away with, but I think 20ms is probably already lower than anyone would realistically need for now.

Only remaining questions are whether we should add this to any hwdefs as part of this PR, and whether we should restrict this to only AP_Periph.

robertlong13 avatar Feb 21 '24 01:02 robertlong13