2015-09-08 15:18:59 -04:00
|
|
|
px4_nuttx_generate_builtin_commands(
|
|
|
|
|
OUT builtin_commands.c
|
2015-09-10 23:43:59 -04:00
|
|
|
MODULE_LIST
|
|
|
|
|
${module_libraries}
|
|
|
|
|
${config_extra_builtins_cmds}
|
2015-09-10 17:44:27 -04:00
|
|
|
)
|
2015-09-08 15:18:59 -04:00
|
|
|
|
|
|
|
|
px4_nuttx_generate_romfs(OUT romfs.o
|
|
|
|
|
ROOT ROMFS/px4fmu_common)
|
|
|
|
|
|
2015-09-11 16:15:48 -07:00
|
|
|
px4_generate_parameters()
|
|
|
|
|
|
2015-09-08 15:18:59 -04:00
|
|
|
# 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})
|
|
|
|
|
|
2015-09-10 13:57:54 -04:00
|
|
|
set(cmsis_lib ${CMAKE_SOURCE_DIR}/src/lib/mathlib/CMSIS/libarm_cortexM4lf_math.a)
|
|
|
|
|
|
2015-09-08 15:18:59 -04:00
|
|
|
target_link_libraries(firmware_nuttx
|
|
|
|
|
-Wl,--start-group
|
2015-09-10 12:40:34 -04:00
|
|
|
${module_libraries}
|
2015-09-10 13:57:54 -04:00
|
|
|
${cmsis_lib}
|
2015-09-08 15:18:59 -04:00
|
|
|
apps nuttx nosys m gcc
|
|
|
|
|
-Wl,--end-group)
|
|
|
|
|
|
2015-09-11 06:38:39 -04:00
|
|
|
set(fw_file ${CMAKE_CURRENT_BINARY_DIR}/${OS}-${BOARD}-${LABEL}.px4)
|
|
|
|
|
|
|
|
|
|
px4_nuttx_add_firmware(OUT ${fw_file}
|
2015-09-10 17:44:27 -04:00
|
|
|
EXE ${CMAKE_CURRENT_BINARY_DIR}/firmware_nuttx
|
2015-09-10 23:43:59 -04:00
|
|
|
${config_firmware_options}
|
2015-09-10 17:44:27 -04:00
|
|
|
)
|
2015-09-08 15:18:59 -04:00
|
|
|
|
|
|
|
|
px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD}
|
2015-09-11 06:38:39 -04:00
|
|
|
BUNDLE ${fw_file})
|
|
|
|
|
|
|
|
|
|
install(FILES ${fw_file} DESTINATION .)
|
2015-09-08 15:18:59 -04:00
|
|
|
|
|
|
|
|
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|