The bootloader can often get stuck parsing random MAVLink traffic,
thinking it had seen a GET_SYNC.
Therefore, this commits adds a two step check which requires a GET_SYNC
followed by a GET_DEVICE to make sure it's really an uploader script
talking to it, and not just random data.
Calling serial::write() in quick succession was blowing away the previous buffer, fsync does not guarantee that data is transmitted on serial lines. On the other hand tcdrain waits until the output buffer is empty.
* Update pab_manifest.c
I have rebased on main and squash my commits into 1.
* Update pab_manifest.c
I have updated pab_manifest.c:
// BASE ID 0x150 ZeroOne Pixhawk Baseboard Alaised to ID 0
{HW_BASE_ID(0x150), base_configuration_0, arraySize(base_configuration_0)}, // ZeroOne Pixhawk Baseboard ver 0x150
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.
* gnss: update supported baud rates
The Septentrio GNSS driver requires certain baud rates to test all the
supported baud rates of the receiver. Without these changes, certain
"non-standard" ones would print an error to the MAVLink console when the
driver was started through the console.
* platforms: add missing baudrate defines
---------
Co-authored-by: Thomas Frans <franske2000@gmail.com>
Co-authored-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>
* usb: Added parameter to enable always starting mavlink on USB.
Refactored cdcacm_init into a module and added a paramter to allow always starting mavlink on
USB, also added a paramter to choose the mode. The current default behavior is to wait and listen
for data on USB and auto-detect the protocol (mavlink, nsh, ublox). This results in the mavlink
stream not starting until something else on the mavlink network sends a packet first. The new
default behavior is to always start mavlink.
Added parameters
MAV_USB_ENABLE -- default 1 (always start mavlink on USB)
MAV_USE_MODE -- default 3 (onboard)
* added 3 retries for opening serial port in mavlink, removed sleep before sercon
* added DRIVERS_CDCACM_AUTOSTART to ark-v6x default.px4board
* added CONFIG_DRIVERS_CDCACM_AUTOSTART=y to default.px4board for boards with CONFIG_CDCACM in their nsh/defconfig
* format
* remove PGA460 from COMMON_DISTANCE_SENSOR to save flash
* remove LIS2MDL from COMMON_MAGNETOMETER to save flash
* disable CONFIG_DRIVERS_CDCACM_AUTOSTART for fmu-v5 protected.px4board
* moved and renamed parameters, removed mode logic in mavlink
* changed parameter names, added mode none
* remove parameters from mavlink