mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
Added firmware directories.
This commit is contained in:
@@ -214,7 +214,7 @@ link_directories(${link_dirs})
|
||||
add_definitions(${definitions})
|
||||
|
||||
#=============================================================================
|
||||
# source code generation
|
||||
# source code generation}
|
||||
#
|
||||
file(GLOB_RECURSE msg_files msg/*.msg)
|
||||
px4_generate_messages(TARGET msg_gen
|
||||
@@ -228,6 +228,9 @@ px4_generate_messages(TARGET msg_gen
|
||||
#
|
||||
add_subdirectory(src)
|
||||
|
||||
# set the overall objective of the build
|
||||
add_custom_target(ALL firmware_${OS})
|
||||
|
||||
#=============================================================================
|
||||
# packaging
|
||||
#
|
||||
|
||||
@@ -1,85 +1,9 @@
|
||||
#=============================================================================
|
||||
# executable
|
||||
#
|
||||
|
||||
if (${OS} STREQUAL "nuttx")
|
||||
|
||||
#=============================================================================
|
||||
# module subdirectories, need to include first
|
||||
#
|
||||
add_subdirectory(./lib)
|
||||
add_subdirectory(./drivers)
|
||||
add_subdirectory(./platforms)
|
||||
add_subdirectory(./systemcmds)
|
||||
add_subdirectory(./examples)
|
||||
add_subdirectory(./modules)
|
||||
|
||||
# a list of modules that will be linked to main
|
||||
set(module_list)
|
||||
|
||||
if (${LABEL} STREQUAL "simple")
|
||||
list(APPEND module_list
|
||||
drivers__led
|
||||
drivers__device
|
||||
platforms__common
|
||||
modules__systemlib
|
||||
modules__uORB
|
||||
examples__px4_simple_app
|
||||
lib__mathlib__math__filter
|
||||
lib__conversion
|
||||
)
|
||||
endif()
|
||||
|
||||
if (${LABEL} STREQUAL "simple")
|
||||
list(APPEND module_list ${module_list_simple})
|
||||
endif()
|
||||
|
||||
list(APPEND module_list
|
||||
platforms__nuttx
|
||||
platforms__nuttx__px4_layer
|
||||
drivers__boards__px4fmu-v2
|
||||
drivers__stm32
|
||||
)
|
||||
|
||||
px4_nuttx_generate_builtin_commands(
|
||||
OUT builtin_commands.c
|
||||
MODULE_LIST ${module_list})
|
||||
|
||||
px4_nuttx_generate_romfs(OUT romfs.o
|
||||
ROOT ROMFS/px4fmu_common)
|
||||
|
||||
# add executable
|
||||
add_executable(main builtin_commands.c romfs.o)
|
||||
set(nuttx_export_dir ${CMAKE_BINARY_DIR}/${BOARD}/NuttX/nuttx-export)
|
||||
set(main_link_flags
|
||||
"-T${nuttx_export_dir}/build/ld.script"
|
||||
"-Wl,-Map=${CMAKE_BINARY_DIR}/main.map"
|
||||
)
|
||||
px4_join(OUT main_link_flags LIST ${main_link_flags} GLUE " ")
|
||||
set_target_properties(main PROPERTIES LINK_FLAGS ${main_link_flags})
|
||||
|
||||
target_link_libraries(main
|
||||
-Wl,--start-group
|
||||
${module_list}
|
||||
apps nuttx nosys m gcc
|
||||
-Wl,--end-group)
|
||||
|
||||
px4_nuttx_add_firmware(OUT ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4
|
||||
EXE ${CMAKE_CURRENT_BINARY_DIR}/main)
|
||||
|
||||
px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD}
|
||||
BUNDLE ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4)
|
||||
|
||||
elseif(${OS} STREQUAL "qurt")
|
||||
set(module_list)
|
||||
px4_qurt_add_modules(module_list ${BOARD})
|
||||
message(STATUS "module list: ${module_list}")
|
||||
|
||||
px4_qurt_generate_builtin_commands(
|
||||
OUT builtin_commands.c
|
||||
MODULE_LIST ${module_list})
|
||||
|
||||
add_executable(mainapp builtin_commands.c)
|
||||
endif()
|
||||
add_subdirectory(./firmware)
|
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|
||||
|
||||
3
src/firmware/CMakeLists.txt
Normal file
3
src/firmware/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
add_subdirectory(./nuttx)
|
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|
||||
57
src/firmware/nuttx/CMakeLists.txt
Normal file
57
src/firmware/nuttx/CMakeLists.txt
Normal file
@@ -0,0 +1,57 @@
|
||||
# a list of modules that will be linked to main
|
||||
set(module_list)
|
||||
|
||||
if (${LABEL} STREQUAL "simple")
|
||||
list(APPEND module_list
|
||||
drivers__led
|
||||
drivers__device
|
||||
platforms__common
|
||||
modules__systemlib
|
||||
modules__uORB
|
||||
examples__px4_simple_app
|
||||
lib__mathlib__math__filter
|
||||
lib__conversion
|
||||
)
|
||||
endif()
|
||||
|
||||
if (${LABEL} STREQUAL "simple")
|
||||
list(APPEND module_list ${module_list_simple})
|
||||
endif()
|
||||
|
||||
list(APPEND module_list
|
||||
platforms__nuttx
|
||||
platforms__nuttx__px4_layer
|
||||
drivers__boards__px4fmu-v2
|
||||
drivers__stm32
|
||||
)
|
||||
|
||||
px4_nuttx_generate_builtin_commands(
|
||||
OUT builtin_commands.c
|
||||
MODULE_LIST ${module_list})
|
||||
|
||||
px4_nuttx_generate_romfs(OUT romfs.o
|
||||
ROOT ROMFS/px4fmu_common)
|
||||
|
||||
# add executable
|
||||
add_executable(firmware_nuttx builtin_commands.c romfs.o)
|
||||
set(nuttx_export_dir ${CMAKE_BINARY_DIR}/${BOARD}/NuttX/nuttx-export)
|
||||
set(main_link_flags
|
||||
"-T${nuttx_export_dir}/build/ld.script"
|
||||
"-Wl,-Map=${CMAKE_BINARY_DIR}/main.map"
|
||||
)
|
||||
px4_join(OUT main_link_flags LIST ${main_link_flags} GLUE " ")
|
||||
set_target_properties(firmware_nuttx PROPERTIES LINK_FLAGS ${main_link_flags})
|
||||
|
||||
target_link_libraries(firmware_nuttx
|
||||
-Wl,--start-group
|
||||
${module_list}
|
||||
apps nuttx nosys m gcc
|
||||
-Wl,--end-group)
|
||||
|
||||
px4_nuttx_add_firmware(OUT ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4
|
||||
EXE ${CMAKE_CURRENT_BINARY_DIR}/main)
|
||||
|
||||
px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD}
|
||||
BUNDLE ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4)
|
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|
||||
3
src/firmware/posix/CMakeLists.txt
Normal file
3
src/firmware/posix/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
#TODO
|
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|
||||
11
src/firmware/qurt/CMakeLists.txt
Normal file
11
src/firmware/qurt/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
set(module_list)
|
||||
px4_qurt_add_modules(module_list ${BOARD})
|
||||
message(STATUS "module list: ${module_list}")
|
||||
|
||||
px4_qurt_generate_builtin_commands(
|
||||
OUT builtin_commands.c
|
||||
MODULE_LIST ${module_list})
|
||||
|
||||
add_executable(mainapp builtin_commands.c)
|
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|
||||
Reference in New Issue
Block a user