Skip to content

Commit

Permalink
Generate DFU file for OrgPal3 board (#1533)
Browse files Browse the repository at this point in the history
* Add GetTargetCapabilities for OrgPal3
* Add DFU package to CMakeLists for OrgPal3 board
  • Loading branch information
networkfusion authored and josesimoes committed Feb 28, 2020
1 parent a6d4b48 commit e6d8859
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
24 changes: 24 additions & 0 deletions targets/CMSIS-OS/ChibiOS/ORGPAL_PALTHREE/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,27 @@ set_property(TARGET ${NANOCLR_PROJECT_NAME}.elf APPEND_STRING PROPERTY LINK_FLAG
# generate output files
nf_generate_build_output_files(${NANOBOOTER_PROJECT_NAME}.elf)
nf_generate_build_output_files(${NANOCLR_PROJECT_NAME}.elf)

# if HEX2DFU tool is available pack the binaries into a DFU package
if(HEX2DFU_TOOL_AVAILABLE)

####################################################################################################
## when changing the linker file make sure to update the new addresses for the image files below ##
## DO NOT use the leading 0x notation, just the address in plain hexadecimal formating ##
####################################################################################################

if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
NF_GENERATE_DFU_PACKAGE(
${PROJECT_SOURCE_DIR}/build/${NANOBOOTER_PROJECT_NAME}.bin 08000000
${PROJECT_SOURCE_DIR}/build/${NANOCLR_PROJECT_NAME}.bin 08010000
${PROJECT_SOURCE_DIR}/build/nanobooter-nanoclr.dfu
)
else()
NF_GENERATE_DFU_PACKAGE(
${PROJECT_SOURCE_DIR}/build/${NANOBOOTER_PROJECT_NAME}.bin 08000000
${PROJECT_SOURCE_DIR}/build/${NANOCLR_PROJECT_NAME}.bin 08010000
${PROJECT_SOURCE_DIR}/build/nanobooter-nanoclr.dfu
)
endif()

endif()
6 changes: 6 additions & 0 deletions targets/CMSIS-OS/ChibiOS/ORGPAL_PALTHREE/target_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ HAL_SYSTEM_CONFIG HalSystemConfig =
};

HAL_TARGET_CONFIGURATION g_TargetConfiguration;

// this target use DFU for updates
uint32_t GetTargetCapabilities()
{
return TargetCapabilities_DfuUpdate;
};

0 comments on commit e6d8859

Please sign in to comment.