uavcan_servers:Reworked file naming and use ROM fs as fall back

Supporting direct down loads from ROMFS with preferece give to the
   files fould on the SD card first. This will allow a user to provide
   an updated uavcan firware on the SD card, and there is no overhead
   of coping files from the ROM FS to the SD card.
This commit is contained in:
David Sidrane
2021-02-17 22:47:35 -05:00
committed by Daniel Agar
parent 57195843bf
commit 8c2678bca1
5 changed files with 77 additions and 247 deletions
+9 -5
View File
@@ -1,6 +1,6 @@
############################################################################
#
# Copyright (c) 2017 PX4 Development Team. All rights reserved.
# Copyright (c) 2017, 2021 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -48,7 +48,7 @@ if(NOT "${PX4_BOARD_LABEL}" MATCHES "canbootloader")
set(SW_MAJOR ${uavcanblid_sw_version_major})
set(SW_MINOR ${uavcanblid_sw_version_minor})
string(REPLACE "\"" "" HWNAME ${uavcanblid_name})
math(EXPR HWBOARD_ID "(${HW_MAJOR} << 8) + ${HW_MINOR}")
execute_process(
COMMAND git rev-list HEAD --max-count=1 --abbrev=8 --abbrev-commit
@@ -60,12 +60,16 @@ if(NOT "${PX4_BOARD_LABEL}" MATCHES "canbootloader")
if ("${uavcanbl_git_desc}" STREQUAL "")
set(uavcanbl_git_desc ffffffff)
endif()
set(uavcan_bl_imange_name ${HWNAME}-${HW_MAJOR}.${HW_MINOR}-${SW_MAJOR}.${SW_MINOR}.${uavcanbl_git_desc}.uavcan.bin)
set(uavcan_bl_imange_name ${HWBOARD_ID}-${SW_MAJOR}.${SW_MINOR}.${uavcanbl_git_desc}.uavcan.bin)
message(STATUS "Generating UAVCAN Bootable as ${uavcan_bl_imange_name}")
add_custom_command(OUTPUT ${uavcan_bl_imange_name}
add_custom_command(OUTPUT ${uavcan_bl_imange_name} deploy/${HWBOARD_ID}.bin
COMMAND
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/make_can_boot_descriptor.py
-v --use-git-hash ${PX4_BINARY_DIR}/${PX4_BOARD}.bin ${uavcan_bl_imange_name}
-v --use-git-hash ${PX4_BOARD}.bin ${uavcan_bl_imange_name}
COMMAND
COMMAND ${CMAKE_COMMAND} -E make_directory deploy
COMMAND
${CMAKE_COMMAND} -E copy ${uavcan_bl_imange_name} deploy/${HWBOARD_ID}.bin
DEPENDS
${PX4_BINARY_DIR}/${PX4_BOARD}.bin
${CMAKE_CURRENT_SOURCE_DIR}/make_can_boot_descriptor.py