This switches from the horribly intertwined ringbuffer implementation to
the new VariableLengthRingbuffer implementation.
By ditching the previous implementation, we fix MAVLink message
forwarding, which didn't work reliably. The reason it didn't work is
that multiple mavlink messages could be added but only one of them was
sent out because the buffer didn't keep track of the messages properly
and only read the first one.
Signed-off-by: Julian Oes <julian@oes.ch>
This adds a reusable class for a FIFO ringbuffer that accepts variable
length packets. It is using the Ringbuffer class internally.
Signed-off-by: Julian Oes <julian@oes.ch>
* mission_base: reset inactivation index when user set a new mission index, or mission is reset.
* mission_base: check Climb required always on current mission item
This prevents accidental misconfiguration via I2C if there are
multiple SPI devices on the same bus. The device may hear it's i2c address
and write some register, while there is data transfer ongoing with another
device.
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
WorkItemSingleShot::_sem is a signaling semaphore, disable PI for it.
Set CONFIG_DEBUG_ASSERTIONS=y and the kernel panics due to the semaphore
having no holder, disabling PI fixes this.
The head/tail semaphores are not used as lock but rather as resource
counters and thus relate more as signaling semaphores. Disable PI for
them.
I run my code with CONFIG_DEBUG_ASSERTIONS=y and the kernel panics due
to the semaphore having no holder, disabling PI fixes this.
This prevents the mavlink transmit loop from waiting on the module mutex
thus not stopping transmissions when the mutex is already taken.
This can happen when calling `mavlink status` from the mavlink shell,
where `Mavlink::get_status_all_instances()` takes the mutex and then
prints the status via pipes to the mavlink transmit buffer.
If that pipe cannot be emptied a deadlock happens.
Since the MavlinkReceiver thread also waits on the module mutex, both
reception and transmission of Mavlink packets are then prevented thus
disabling communications entirely.
IMUs were replaced in V3 with 2x ICM42688P. This configuration should
work with all revisions of Matek F743 Slim board, including V1, V1.5
and interim variant of V3 (ICM42688P + ICM42605).
Signed-off-by: Andrei Korigodskii <akorigod@gmail.com>
In the lightware_parser function, LW_PARSE_STATE2_GOT_DIGIT0 state can be repeated unexpectedly without proper parserbuf_index or state checking. This behavior will trigger a heap buffer overflow vulnerability by allowing to write some data. And the writable size is sizeof(unsigned).
* ekf2_derivation: use single source of state definition
The state is defined as an ordered dictionary of group elements and
everything else is generated using that state definition
* ekf2: generated state sample add const reference getter
---------
Co-authored-by: bresch <[brescianimathieu@gmail.com](mailto:brescianimathieu@gmail.com)>
Co-authored-by: Daniel Agar <daniel@agar.ca>
The length check for unknown packets did not include PACKET_SIZE_TYPE_SIZE
and CRC_SIZE, and hence working_index could overflow CRSF_MAX_PACKET_LEN,
triggering invalid memory access further down in QueueBuffer_PeekBuffer.
Also the working_segment_size was wrong for unknown packets.
Credits for finding this go to @Pwn9uin.
This allows to inject an updated ext_autostart folder with the name
ext_autostart_new, and then PX4 takes care of renaming it to
ext_autostart during bootup.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>