Browse Source

Fixed romfs building.

sbg
James Goppert 10 years ago
parent
commit
b7850fc319
  1. 2
      cmake/builtin_commands.c.cmake
  2. 12
      cmake/px4_impl_nuttx.cmake
  3. 3
      src/CMakeLists.txt

2
cmake/builtin_commands.c.cmake

@ -2,8 +2,6 @@ @@ -2,8 +2,6 @@
#include <nuttx/config.h>
#include <nuttx/binfmt/builtin.h>
#include <nuttx/config.h>
uint8_t romfs_img_len = 0;
uint8_t romfs_img[] = {};
${builtin_apps_decl_string}
const struct builtin_s g_builtins[] = {
${builtin_apps_string}

12
cmake/px4_impl_nuttx.cmake

@ -262,14 +262,15 @@ function(px4_bin_to_obj) @@ -262,14 +262,15 @@ function(px4_bin_to_obj)
REQUIRED BIN OBJ VAR
ARGN ${ARGN})
string(REPLACE "/" " " _tmp ${BIN})
string(REPLACE "/" " " sym ${_tmp})
message(STATUS "sym: ${sym}")
string(REPLACE "/" "_" _tmp ${BIN})
string(REPLACE "." "_" _tmp ${_tmp})
string(REPLACE "-" "_" sym "_binary_${_tmp}")
#message(STATUS "sym: ${sym}")
separate_arguments(CMAKE_C_FLAGS)
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 ${LD} -r -o ${OBJ}.bin.o ${OBJ}.c.o -b binary ${BIN}
COMMAND ${NM} -p --radix=x ${OBJ}.bin.o
@ -283,6 +284,7 @@ function(px4_bin_to_obj) @@ -283,6 +284,7 @@ function(px4_bin_to_obj)
--strip-symbol ${sym}_size
--strip-symbol ${sym}_end
--rename-section .data=.rodata
# useful to comment remove statement when debugging
COMMAND ${RM} ${OBJ}.c ${OBJ}.c.o ${OBJ}.bin.o
DEPENDS ${BIN}
VERBATIM
@ -334,7 +336,7 @@ function(px4_nuttx_generate_romfs) @@ -334,7 +336,7 @@ function(px4_nuttx_generate_romfs)
px4_bin_to_obj(OBJ ${OUT}
BIN ${CMAKE_CURRENT_BINARY_DIR}/romfs.bin
VAR romfs)
VAR romfs_img)
endfunction()

3
src/CMakeLists.txt

@ -70,9 +70,6 @@ if (${OS} STREQUAL "nuttx") @@ -70,9 +70,6 @@ if (${OS} STREQUAL "nuttx")
px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD}
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")
set(module_list)
px4_qurt_add_modules(module_list ${BOARD})

Loading…
Cancel
Save