mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
Fix cmake options.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
This commit is contained in:
parent
0bca377d52
commit
f934224351
@ -300,10 +300,17 @@ endfunction()
|
|||||||
|
|
||||||
# Add bin/hex output
|
# Add bin/hex output
|
||||||
function(family_add_bin_hex TARGET)
|
function(family_add_bin_hex TARGET)
|
||||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
if (CMAKE_C_COMPILER_ID STREQUAL "IAR")
|
||||||
COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin
|
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||||
COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex
|
COMMAND ${CMAKE_OBJCOPY} --bin $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin
|
||||||
VERBATIM)
|
COMMAND ${CMAKE_OBJCOPY} --ihex $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex
|
||||||
|
VERBATIM)
|
||||||
|
else()
|
||||||
|
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin
|
||||||
|
COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex
|
||||||
|
VERBATIM)
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Add uf2 output
|
# Add uf2 output
|
||||||
|
@ -27,13 +27,13 @@ function(add_board_target BOARD_TARGET)
|
|||||||
# LD_FILE and STARTUP_FILE can be defined in board.cmake
|
# LD_FILE and STARTUP_FILE can be defined in board.cmake
|
||||||
if (NOT DEFINED LD_FILE_${CMAKE_C_COMPILER_ID})
|
if (NOT DEFINED LD_FILE_${CMAKE_C_COMPILER_ID})
|
||||||
set(LD_FILE_GNU ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/${MCU_VARIANT}xxxxx${MCU_CORE}_flexspi_nor.ld)
|
set(LD_FILE_GNU ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/${MCU_VARIANT}xxxxx${MCU_CORE}_flexspi_nor.ld)
|
||||||
#set(LD_FILE_IAR ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/${MCU_VARIANT}xxxxx_flexspi_nor.ld)
|
set(LD_FILE_IAR ${SDK_DIR}/devices/${MCU_VARIANT}/iar/${MCU_VARIANT}xxxxx${MCU_CORE}_flexspi_nor.icf)
|
||||||
endif ()
|
endif ()
|
||||||
set(LD_FILE_Clang ${LD_FILE_GNU})
|
set(LD_FILE_Clang ${LD_FILE_GNU})
|
||||||
|
|
||||||
if (NOT DEFINED STARTUP_FILE_${CMAKE_C_COMPILER_ID})
|
if (NOT DEFINED STARTUP_FILE_${CMAKE_C_COMPILER_ID})
|
||||||
set(STARTUP_FILE_GNU ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/startup_${MCU_VARIANT_WITH_CORE}.S)
|
set(STARTUP_FILE_GNU ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/startup_${MCU_VARIANT_WITH_CORE}.S)
|
||||||
#set(STARTUP_FILE_IAR ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/startup_${MCU_VARIANT_WITH_CORE}.S)
|
set(STARTUP_FILE_IAR ${SDK_DIR}/devices/${MCU_VARIANT}/iar/startup_${MCU_VARIANT_WITH_CORE}.s)
|
||||||
endif ()
|
endif ()
|
||||||
set(STARTUP_FILE_Clang ${STARTUP_FILE_GNU})
|
set(STARTUP_FILE_Clang ${STARTUP_FILE_GNU})
|
||||||
|
|
||||||
@ -149,8 +149,6 @@ function(family_configure_example TARGET RTOS)
|
|||||||
# Link dependencies
|
# Link dependencies
|
||||||
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
|
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
|
||||||
|
|
||||||
family_add_bin_hex(${TARGET})
|
|
||||||
|
|
||||||
# Flashing
|
# Flashing
|
||||||
family_add_bin_hex(${TARGET})
|
family_add_bin_hex(${TARGET})
|
||||||
family_flash_jlink(${TARGET})
|
family_flash_jlink(${TARGET})
|
||||||
|
@ -103,11 +103,10 @@ function(family_configure_example TARGET RTOS)
|
|||||||
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
|
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
|
||||||
|
|
||||||
# Flashing
|
# Flashing
|
||||||
family_add_bin_hex(${TARGET})
|
|
||||||
family_flash_jlink(${TARGET})
|
family_flash_jlink(${TARGET})
|
||||||
|
family_add_bin_hex(${TARGET})
|
||||||
|
|
||||||
if (DEFINED TEENSY_MCU)
|
if (DEFINED TEENSY_MCU)
|
||||||
family_add_bin_hex(${TARGET})
|
|
||||||
family_flash_teensy(${TARGET})
|
family_flash_teensy(${TARGET})
|
||||||
endif ()
|
endif ()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -124,11 +124,10 @@ function(family_configure_example TARGET RTOS)
|
|||||||
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
|
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
|
||||||
|
|
||||||
# Flashing
|
# Flashing
|
||||||
family_add_bin_hex(${TARGET})
|
|
||||||
family_flash_jlink(${TARGET})
|
family_flash_jlink(${TARGET})
|
||||||
|
family_add_bin_hex(${TARGET})
|
||||||
|
|
||||||
if (DEFINED DFU_UTIL_VID_PID)
|
if (DEFINED DFU_UTIL_VID_PID)
|
||||||
family_add_bin_hex(${TARGET})
|
|
||||||
family_flash_dfu_util(${TARGET} ${DFU_UTIL_VID_PID})
|
family_flash_dfu_util(${TARGET} ${DFU_UTIL_VID_PID})
|
||||||
endif ()
|
endif ()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user