mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 19:32:36 +08:00
Fixed romfs building.
This commit is contained in:
@@ -2,8 +2,6 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <nuttx/binfmt/builtin.h>
|
#include <nuttx/binfmt/builtin.h>
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
uint8_t romfs_img_len = 0;
|
|
||||||
uint8_t romfs_img[] = {};
|
|
||||||
${builtin_apps_decl_string}
|
${builtin_apps_decl_string}
|
||||||
const struct builtin_s g_builtins[] = {
|
const struct builtin_s g_builtins[] = {
|
||||||
${builtin_apps_string}
|
${builtin_apps_string}
|
||||||
|
|||||||
@@ -262,14 +262,15 @@ function(px4_bin_to_obj)
|
|||||||
REQUIRED BIN OBJ VAR
|
REQUIRED BIN OBJ VAR
|
||||||
ARGN ${ARGN})
|
ARGN ${ARGN})
|
||||||
|
|
||||||
string(REPLACE "/" " " _tmp ${BIN})
|
string(REPLACE "/" "_" _tmp ${BIN})
|
||||||
string(REPLACE "/" " " sym ${_tmp})
|
string(REPLACE "." "_" _tmp ${_tmp})
|
||||||
message(STATUS "sym: ${sym}")
|
string(REPLACE "-" "_" sym "_binary_${_tmp}")
|
||||||
|
#message(STATUS "sym: ${sym}")
|
||||||
|
|
||||||
separate_arguments(CMAKE_C_FLAGS)
|
separate_arguments(CMAKE_C_FLAGS)
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${OBJ}
|
add_custom_command(OUTPUT ${OBJ}
|
||||||
COMMAND ${TOUCH} ${OBJ}.c
|
COMMAND ${ECHO} > ${OBJ}.c
|
||||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -c ${OBJ}.c -o ${OBJ}.c.o
|
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -c ${OBJ}.c -o ${OBJ}.c.o
|
||||||
COMMAND ${LD} -r -o ${OBJ}.bin.o ${OBJ}.c.o -b binary ${BIN}
|
COMMAND ${LD} -r -o ${OBJ}.bin.o ${OBJ}.c.o -b binary ${BIN}
|
||||||
COMMAND ${NM} -p --radix=x ${OBJ}.bin.o
|
COMMAND ${NM} -p --radix=x ${OBJ}.bin.o
|
||||||
@@ -283,6 +284,7 @@ function(px4_bin_to_obj)
|
|||||||
--strip-symbol ${sym}_size
|
--strip-symbol ${sym}_size
|
||||||
--strip-symbol ${sym}_end
|
--strip-symbol ${sym}_end
|
||||||
--rename-section .data=.rodata
|
--rename-section .data=.rodata
|
||||||
|
# useful to comment remove statement when debugging
|
||||||
COMMAND ${RM} ${OBJ}.c ${OBJ}.c.o ${OBJ}.bin.o
|
COMMAND ${RM} ${OBJ}.c ${OBJ}.c.o ${OBJ}.bin.o
|
||||||
DEPENDS ${BIN}
|
DEPENDS ${BIN}
|
||||||
VERBATIM
|
VERBATIM
|
||||||
@@ -334,7 +336,7 @@ function(px4_nuttx_generate_romfs)
|
|||||||
|
|
||||||
px4_bin_to_obj(OBJ ${OUT}
|
px4_bin_to_obj(OBJ ${OUT}
|
||||||
BIN ${CMAKE_CURRENT_BINARY_DIR}/romfs.bin
|
BIN ${CMAKE_CURRENT_BINARY_DIR}/romfs.bin
|
||||||
VAR romfs)
|
VAR romfs_img)
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|||||||
@@ -70,9 +70,6 @@ if (${OS} STREQUAL "nuttx")
|
|||||||
px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD}
|
px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD}
|
||||||
BUNDLE ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4)
|
BUNDLE ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4)
|
||||||
|
|
||||||
px4_nuttx_generate_romfs(OUT ${CMAKE_CURRENT_BINARY_DIR}/romfs.img
|
|
||||||
ROOT ${CMAKE_SOURCE_DIR}/ROMFS/px4fmu_common)
|
|
||||||
|
|
||||||
elseif(${OS} STREQUAL "qurt")
|
elseif(${OS} STREQUAL "qurt")
|
||||||
set(module_list)
|
set(module_list)
|
||||||
px4_qurt_add_modules(module_list ${BOARD})
|
px4_qurt_add_modules(module_list ${BOARD})
|
||||||
|
|||||||
Reference in New Issue
Block a user