This can help "unbrick" AeroFC when a bad firmware is loaded
and it keeps rebooting or it spinning in some loop.
No need to request to stay in booloader as it will stay
in bootloader because the pin is set.
- change memory allocation from stack to a malloc'd buffer. This avoids
increasing the stack size. And since FTP is rarely used, the buffers
are only allocated upon use and freed after a time of 2s inactivity.
- adds PX4_ROOTFSDIR as root directory prefix. This does not change
anything on NuttX, but in SITL it will avoid enumerating the whole
disk tree when using QGC (which enumerates all files recursively).
The provided argument payload->offset is in range [0, num_file_entries-1],
but seekdir might use a completely different range. It is not defined
by the API spec. It is only useful in conjunction with telldir().
This can happen for example when a param type is changed from int32 to
float. The type check will then fail if the param is stored and the param
import will be aborted.
Now we just skip the entry and continue loading the rest.
This was only a problem when running as a task not on the work queue.
The problem was that init() opened the RC serial device, which was then
read in the main loop, which is a different context when run as a task.
Both PX4Test and Beat noted if only Brick to was connected
battery_status Intance 0 voltage was 0V for Brick2
The priority selection logic is run prior to the subscription
creation and only updated the priority on a change. Before the
subscriotions were created.
_battery_pub_intance0ndx is suposed track the location in
the _battery_pub array that is instance 0. It is then used
to associate (move) instance 0 with (to) the lowest brick
(highest priority in HW) brick that is selected in HW.
The Bug was that before the subscriptions are created,
_battery_pub_intance0ndx set to 1. And then and never updated.
The fix was to only run the priority selection logic once
the subscriptions are created.
BOARD_HAS_LTC44XX_VALIDS - 0 -> No LTC44xx IC, N is the number of
Power Bricks connected to the LTC44xx
For a LTC4417 this would be 2 as the
third prioriy is used for USB
BOARD_HAS_USB_VALID - If defied as 1 imples that infact
the USB has a priority connection
on the LTC44XX
BOARD_HAS_NBAT_V - the number of battery voltage sensing chennels
on the ADC
BOARD_HAS_NBAT_I - the number of battery current sensing chennels
on the ADC
A super simple (non FMUv5 compliant) board with no LTC44xx and just one battery
that have no current sense:
BOARD_HAS_LTC44XX_VALIDS = 0
BOARD_HAS_USB_VALID = 0
BOARD_HAS_NBAT_V = 1
BOARD_HAS_NBAT_0 = 0
A fully FMUv5 compliant design would use:
BOARD_HAS_LTC44XX_VALIDS = 2
BOARD_HAS_USB_VALID = 1
BOARD_HAS_NBAT_V = 2
BOARD_HAS_NBAT_0 = 2
These setting properly condition the ADC channles and all the Power
module valid sensing logic in the ADC module.