fmu-v2: add bootloader binary and SYS_BL_UPDATE param for BL updates

This allows a simple-to-use bootloader update mechanism to switch from
fmu-v2 to fmu-v3 target that has more flash.
This commit is contained in:
Beat Küng
2018-09-14 17:06:19 +02:00
committed by Lorenz Meier
parent 5847ab4607
commit 84c6b5ac6b
6 changed files with 60 additions and 1 deletions
+9
View File
@@ -103,6 +103,15 @@ if (config_io_board)
)
endif()
if (config_bl_file)
file(MAKE_DIRECTORY ${PX4_BINARY_DIR}/romfs_extras)
configure_file(${config_bl_file} ${PX4_BINARY_DIR}/romfs_extras COPYONLY)
list(APPEND extras_dependencies
${config_bl_file}
)
endif()
add_custom_command(OUTPUT romfs_extras.stamp
COMMAND ${CMAKE_COMMAND} -E make_directory ${romfs_gen_root_dir}/extras/
COMMAND ${CMAKE_COMMAND} -E make_directory ${PX4_BINARY_DIR}/romfs_extras/
+5
View File
@@ -0,0 +1,5 @@
px4fmuv3_bl.bin: Bootloader binary of the PX4 Bootloader
(https://github.com/PX4/Bootloader)
based on commit 184b813699a9cfd6f43a5a21556a06b4372baf5f
for the target px4fmuv3_bl
Binary file not shown.
+21
View File
@@ -211,6 +211,27 @@ else
param reset
fi
#
# Bootloader upgrade
#
if ver hwcmp PX4FMU_V2
then
set BL_FILE /etc/extras/px4fmuv3_bl.bin
if [ -f $BL_FILE ]
then
if param compare SYS_BL_UPDATE 1
then
param set SYS_BL_UPDATE 0
param save
echo "BL update..." >> $LOG_FILE
bl_update $BL_FILE
echo "BL update done" >> $LOG_FILE
reboot
fi
fi
unset BL_FILE
fi
#
# Start system state indicator.
#