* feat(bootloader): Add flag BOOTLOADER_SKIP_VERIFY_SIG to skip post-flash signature check
In case the full image is not available in memory after flashing, the signature check
can't be performed. This is the case if flashing image in chunks to e.g. SD card or eMMC.
The image will be anyhow verified before booting, so the check is redundant.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* feat(bootloader/toc): Support separately signed TOC in front of the image
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* feat(bootloader): Add support for loading TOC separately into buffer
This changes the prototype of find_toc to pass the address and maximum length of the
area where TOC is to be searched, instead of just letting find_toc search from the
hard-coded APP_LOAD_ADDRESS.
This allows searching for TOC from a separately allocated buffer, which is useful for
a platform where the mass storage is not XIP, where one can first only load a TOC
separately. To keep it secure, the TOC itself needs to be separately signed though.
In image_toc.h two new flags are introduced by taking the reserved bits into use:
The TOC_FLAG2_RELATIVE_ADDRESSES can be set in case of entry being loaded from non-XIP
media to arbitrary addressed buffer; the address entry in TOC can be specified to be
an offset from the load address start instead of being an absolute address in memory.
The TOC_FLAG2_USE_SBI can be used with risc-v targets, in case the entry needs to be
booted via SBI interface.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* docs(secure bootloader): Add prepended toc documentation
Document the feature to add a separately signed TOC in front of the
image.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
* docs(docs): Release note
* fix(bootloader/fmu-v6xrt): Increase bl stack by 200 bytes
It is on the edge and overflows if crypto functionality is added.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* feat(bootloader/fmu-v6xrt): Add signed boot targets for fmu-v6xrt
This adds these two new targets:
- px4_fmu-v6xrt_secureboot : Signed PX4 image, with prepended TOC, for v6xrt
- px4_fmu-v6xrt_bootloader_secureboot: Bootloader version to verify the signed image
Specifically, the implementation has
- px4board for both targets
- A new linker script for px4_fmu-v6xrt_secureboot, including the script.ld and
overriding the "flash" memory area for start and size to account for prepended
TOC structure
- TOC source and linker script
- Bootloader configurations added in hw_config.h
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
---------
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
bootloader: update main prototype for NuttX 12.12.0
platforms/nuttx: Add wrapper for queue.h
For some reason the queue.h header was moved, add this wrapper so
posix and nuttx builds can both still use #include <queue.h>
Fix print_load to be compatible with upstream NuttX
Also Change tg_filelist -> tg_fdlist as per new NuttX
Co-authored-by: Ville Juven <ville.juven@unikie.com>
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
* feat: track Node updates
* feat: prevent arming while updating
* fix: used make format
* fix: added dedup logic & use dynamic list
* fix: cleaned up arming_blocker
* feat: add circuit breaker for arming_blocker
* chore: used make format
* fix: fix some formating issues
* chore: make format again
* fix: implemented requested changes
* src/drivers/cdcacm_autostart: Include posix.h for px4_close
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* platforms/nuttx/CMakeLists.txt: Fix linking of nuttx libaries for memalign
This fixes memalign not found in linking step for some boards
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* Add "flock" to macos.sh setup script
"flock" is not standard on macOS, and a dependency was missing from the
macOS setup path.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* Fix clang-tidy errors in Bitset.hpp and in src/lib/matrix
Fix the "bugprone-dynamic-static-initializers" linter errors.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* systemlib/hardfault_log: Fix clang-diagnostics error
Fix for
"[error] clang-diagnostic-error [error]
use of undeclared identifier XCPTCONTEXT_REGS".
XCPTCONTEXT_REGS is defined in nuttx irq.h, so include that.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* uORB: Fix clang-tidy error "bugprone-dynamic-static-initializers"
Fix the clang-tidy error appearing on uORBManager _Instance variable by
adding a getter for the reference to the _Instance and using that instead.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* CI: Add default ubuntu mirrors as fallback
In case of specified aws mirror doesn't have the package idicated by the
metadata, a the default ubuntu mirror as a backup.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
---------
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Reduces flash usage by ~16KB.
- compress formats at build-time into a single string with all formats
- then at runtime iteratively decompress using
https://github.com/atomicobject/heatshrink
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.
sem_wait() can be interrupted if the task receives a signal, however
the blockinglist implementation depends on blocking until the semaphore
can be obtained.
- much simpler direct interface using Ignition Transport
- in tree models and worlds
- control allocation output configuration, no more magic actuator mapping to mavlink and back
- currently requires no custom Gazebo plugins (keeping things as lightweight and simple as possible)
Co-authored-by: Jaeyoung-Lim <jalim@ethz.ch>
- apply sensor scaling immediately to keep things simple (FIFO vs regular)
- inline filter helpers (minor performance improvement)
- dynamic notch filtering
- reorder by axis (applied per axis)
- don't remove notch filters immediately if ESC or FFT data times out
- constrain notch filter frequency and bandwidth to safe range (minimum bandwidth for flaot precision, Nyquist, etc)
- add safe constraint on dt
- move systick.c under chip specific sources
- move do_jump into chip specific main.c as arch_do_jump
- wrap flash writes to "arch_flash_write" and implement in chip specific main.c
- add bootloader TOC check
- sync image_toc.h with the version currently in use with old bootloader
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
So that clang 12 does not complain:
loop variable 'child' is always a copy because the range of type 'List<ModuleParams *>' does not return a reference
Co-authored-by: Yashom Dighe <yashom7@gmail.com>
So that clang 12 does not complain:
loop variable 'child' is always a copy because the range of type 'List<ModuleParams *>' does not return a reference
- new intrusive linked list container (c++ template) that sorts on insertion
- primarily for convenience inspecting things in the system like uORB or WorkQueues
- uorb status or top sorted alphabetically
- work_queue status threads sorted by priority, then items sorted alphabetically within each
getLockGuard relies on copy elision to work correctly, which the compiler
is not required to do (only with C++17).
If no copy elision happens, the mutex ends up being unlocked twice, and the
CS is executed with the mutex unlocked.
The patch also ensures that the same pattern cannot be used again.
and remove the px4_ prefix, except for px4_config.h.
command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done
Transitional headers for submodules are added (px4_{defines,log,time}.h)
This tries to make the visibility.h header clearer and better
structured. We don't actually need the ifdef for lockstep enabled or
disabled because that's now handled elsewhere.
visibility.h is included globally in PX4 via cmake compile flags.
It contains poisoning the exit() command which is used by gtest
to close the test application. Removing the flag for gtest compilation
fixes the compile error:
gtest.cc:4757:7: error: attempt to use poisoned "exit"
This integrates the lockstep_scheduler, so that the system time is set
by the mavlink HIL_SENSOR message.
This means that the speed factor is removed and the speed is entirely
given by the simulator.
These contains some rough changes trying to get SITL to speed up by a
SPEED_FACTOR.
This platform time code probably requires some more thought and refactor
but this gets a demo at 4x working.
These leaks are not critical but the address-sanitizer complains.
And it's better programming practice anyway.
Signed-off-by: Lukas Woodtli <woodtli.lukas@gmail.com>