mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 01:53:35 +08:00
bl_update: Allow booting from SD card (without forced BL copy to ROMFS)
This commit is contained in:
@@ -208,12 +208,12 @@ set(OPTIONAL_BOARD_EXTRAS)
|
||||
file(GLOB OPTIONAL_BOARD_EXTRAS ${PX4_BOARD_DIR}/extras/*)
|
||||
|
||||
# bootloader (optional)
|
||||
# - if systemcmds/bl_update included and board bootloader available then generate rc.board_bootloader_upgrade and copy bootloader binary
|
||||
# - if systemcmds/bl_update included (with romfs copy) and board bootloader available then generate rc.board_bootloader_upgrade and copy bootloader binary
|
||||
# - otherwise remove bootloader binary from extras in final ROMFS
|
||||
foreach(board_extra_file ${OPTIONAL_BOARD_EXTRAS})
|
||||
file(RELATIVE_PATH extra_file_base_name ${PX4_BOARD_DIR}/extras/ ${board_extra_file})
|
||||
if(${extra_file_base_name} MATCHES "${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_bootloader.bin")
|
||||
if(CONFIG_SYSTEMCMDS_BL_UPDATE)
|
||||
if(CONFIG_SYSTEMCMDS_BL_UPDATE AND CONFIG_BL_UPDATE_BL_ROMFS)
|
||||
# generate rc.board_bootloader_upgrade
|
||||
set(BOARD_FIRMWARE_BIN "${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_bootloader.bin")
|
||||
message(STATUS "ROMFS: Adding platforms/nuttx/init/rc.board_bootloader_upgrade -> /etc/init.d/rc.board_bootloader_upgrade")
|
||||
|
||||
@@ -613,7 +613,9 @@ else
|
||||
. ${R}etc/init.d/rc.autostart.post
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Bootloader upgrade (ROMFS)
|
||||
#
|
||||
set BOARD_BOOTLOADER_UPGRADE ${R}etc/init.d/rc.board_bootloader_upgrade
|
||||
if [ -f $BOARD_BOOTLOADER_UPGRADE ]
|
||||
then
|
||||
@@ -621,6 +623,22 @@ else
|
||||
fi
|
||||
unset BOARD_BOOTLOADER_UPGRADE
|
||||
|
||||
#
|
||||
# Bootloader upgrade (SD card)
|
||||
#
|
||||
if param compare -s SYS_BL_UPDATE 2
|
||||
then
|
||||
if [ -f "/fs/microsd/bl/bl.bin" ]
|
||||
then
|
||||
param set SYS_BL_UPDATE 0
|
||||
param save
|
||||
echo "bootloader update..."
|
||||
bl_update "/fs/microsd/bl/bl.bin"
|
||||
echo "bootloader update done, rebooting"
|
||||
reboot
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Check if UAVCAN is enabled, default to it for ESCs.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user