This resets the USARTs' clock source selection to the default, in case
it has been changed by the bootloader.
This is required if booting from the ArduPilot bootloader which happens
to reset the clock selection to PLL.
Without this fix, UARTs (including the console) is garbled, so
presumably at an invalid baudrate.
Backports:
stm32h755II backport
stm32h7: allow Ethernet MAC without PHY
imxrt: imxrt11xx set core clock to 1p15v regardless of ocotp
imxrt: Correctly update PLL, bit has to toggled instead of being set
This fixes various edge cases when input is set to both: RC and
MAVLink gimbal protocol v2.
Specifically:
- We no longer immediately reset primary control if there is no update,
otherwise this will reset immediately after an commands.
- Talking of commands: GIMBAL_MANAGER_CONFIGURE no longer switches
control to MAVLink but only an actual incoming setpoint command does.
- And incoming setpoint command only triggers UpdatedActiveOnce which
means we will check RC again afterwards and if there is big movement
switch back to RC. That's the intuitive thing to do until we have
better reporting about who/what is in control.
- Also, with RC we no longer always set us to be in control but only on
major movement.
Includes:
- Remove some of the outdated Python2 checks and compatibility.
- Try not catch all exceptions but only the expected ones. Otherwise,
this makes it really hard to debug if anything unexpected actually
goes wrong.
- Make use of fstrings.
- Make output slightly prettier.
Signed-off-by: Julian Oes <julian@oes.ch>
This adds a new protocol extension which allows to get the bootloader
version.
The bootloader version is different from the bootloader protocol
revision which has stabilized at 5 and is not easy to update unless a
bootloader is actually breaking the protocol. The reason being that both
the Python script as well as the uploader used in QGC will not attempt
to load firmware if they don't know the bootloader version, so it could
basically be considered a "breaking" protocol revision.
Signed-off-by: Julian Oes <julian@oes.ch>
If the STM32H7 fails to program or erase a full chunk of 256 bytes, the
ECC check will trigger a busfault when trying to read from it.
To speed up erasing and optimize wear, we read before erasing to check
if it actually needs erasing. That's when a busfault happens and the
erase time outs.
The workaround is to add an option to do a full erase without check.
Credit goes to:
https://github.com/ArduPilot/ardupilot/pull/22090
And the protocol option added to the bootloader is the same as for
ArduPilot, so compatible.
Signed-off-by: Julian Oes <julian@oes.ch>
[BACKPORT] imxrt: lpuart singlewire transfer support
These correctly enables mpu_rest on MPU init if CONFIG_ARM_MPU_RESET
is defined.
[BACKPORT] imxrt: 1170 MPU config ensure no lockups can occur
[BACKPORT] armv{7|8}-{m|r}:MPU fix CONFIG naming to include ARM