Skip to content
Snippets Groups Projects
Commit b7850fc3 authored by James Goppert's avatar James Goppert
Browse files

Fixed romfs building.

parent 13b5c89c
No related branches found
No related tags found
No related merge requests found
......@@ -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}
......
......@@ -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)
--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)
px4_bin_to_obj(OBJ ${OUT}
BIN ${CMAKE_CURRENT_BINARY_DIR}/romfs.bin
VAR romfs)
VAR romfs_img)
endfunction()
......
......@@ -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})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment