update flash openocd

This commit is contained in:
hathach 2024-05-06 10:52:52 +07:00
parent 3791514908
commit d79c71abf5
No known key found for this signature in database
GPG Key ID: 26FAB84F615C3C52
10 changed files with 16 additions and 12 deletions

View File

@ -415,17 +415,17 @@ endfunction()
# Add flash openocd target
function(family_flash_openocd TARGET CLI_OPTIONS)
function(family_flash_openocd TARGET)
if (NOT DEFINED OPENOCD)
set(OPENOCD openocd)
endif ()
separate_arguments(CLI_OPTIONS_LIST UNIX_COMMAND ${CLI_OPTIONS})
separate_arguments(OPENOCD_OPTION_LIST UNIX_COMMAND ${OPENOCD_OPTION})
# note skip verify since it has issue with rp2040
add_custom_target(${TARGET}-openocd
DEPENDS ${TARGET}
COMMAND ${OPENOCD} ${CLI_OPTIONS_LIST} -c "program $<TARGET_FILE:${TARGET}> reset exit"
COMMAND ${OPENOCD} ${OPENOCD_OPTION_LIST} -c "program $<TARGET_FILE:${TARGET}> reset exit"
VERBATIM
)
endfunction()

View File

@ -179,7 +179,7 @@ function(family_configure_target TARGET RTOS)
pico_enable_stdio_uart(${TARGET} 1)
target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_board${RTOS_SUFFIX} tinyusb_additions)
family_flash_openocd(${TARGET} ${OPENOCD_OPTION})
family_flash_openocd(${TARGET})
family_flash_jlink(${TARGET})
endfunction()

View File

@ -112,5 +112,5 @@ function(family_configure_example TARGET RTOS)
# Flashing
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})
#family_flash_openocd(${TARGET} ${OPENOCD_OPTION})
#family_flash_openocd(${TARGET})
endfunction()

View File

@ -108,5 +108,5 @@ function(family_configure_example TARGET RTOS)
# Flashing
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})
#family_flash_openocd(${TARGET} ${OPENOCD_OPTION})
#family_flash_openocd(${TARGET})
endfunction()

View File

@ -105,5 +105,5 @@ function(family_configure_example TARGET RTOS)
# Flashing
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})
#family_flash_openocd(${TARGET} ${OPENOCD_OPTION})
#family_flash_openocd(${TARGET})
endfunction()

View File

@ -4,3 +4,7 @@ JLINK_DEVICE = ATSAMG55J19
# All source paths should be relative to the top level.
LD_FILE = $(BOARD_PATH)/samg55j19_flash.ld
OPENOCD_OPTION = -f board/atmel_samg55_xplained_pro.cfg
flash: flash-openocd

View File

@ -11,7 +11,7 @@ set(CMAKE_SYSTEM_PROCESSOR cortex-m4 CACHE INTERNAL "System Processor")
set(CMAKE_TOOLCHAIN_FILE ${TOP}/examples/build_system/cmake/toolchain/arm_${TOOLCHAIN}.cmake)
set(FAMILY_MCUS SAMG CACHE INTERNAL "")
set(OPENOCD_OPTION "-f interface/cmsis-dap.cfg -c \"transport select swd\" -f target/at91samdXX.cfg")
set(OPENOCD_OPTION "-f board/atmel_samg55_xplained_pro.cfg")
#------------------------------------
# BOARD_TARGET
@ -110,5 +110,5 @@ function(family_configure_example TARGET RTOS)
# Flashing
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})
#family_flash_openocd(${TARGET} ${OPENOCD_OPTION})
family_flash_openocd(${TARGET})
endfunction()

View File

@ -41,5 +41,5 @@ INC += \
$(TOP)/${SDK_DIR}/CMSIS/Core/Include
# flash using edbg from https://github.com/ataradov/edbg
flash: $(BUILD)/$(PROJECT).bin
flash-edbg: $(BUILD)/$(PROJECT).bin
edbg --verbose -t samg55 -pv -f $<

View File

@ -112,5 +112,5 @@ function(family_configure_example TARGET RTOS)
# Flashing
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})
#family_flash_openocd(${TARGET} ${OPENOCD_OPTION})
#family_flash_openocd(${TARGET})
endfunction()

View File

@ -91,5 +91,5 @@ function(family_configure_example TARGET RTOS)
# Flashing
family_add_bin_hex(${TARGET})
family_flash_openocd(${TARGET} ${OPENOCD_OPTION})
family_flash_openocd(${TARGET})
endfunction()