Merge pull request #2355 from hathach/update-hil-rp2040

Update hil test for rp2040 on self-hosted PI4
This commit is contained in:
Ha Thach
2023-11-29 15:34:05 +07:00
committed by GitHub
6 changed files with 139 additions and 97 deletions

View File

@@ -395,6 +395,22 @@ function(family_flash_stlink TARGET)
endfunction()
# Add flash openocd target
function(family_flash_openocd TARGET CLI_OPTIONS)
if (NOT DEFINED OPENOCD)
set(OPENOCD openocd)
endif ()
separate_arguments(CLI_OPTIONS_LIST UNIX_COMMAND ${CLI_OPTIONS})
# 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"
VERBATIM
)
endfunction()
# Add flash pycod target
function(family_flash_pyocd TARGET)
if (NOT DEFINED PYOC)

View File

@@ -12,6 +12,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/pico_sdk_import.cmake)
# include basic family CMake functionality
set(FAMILY_MCUS RP2040)
set(JLINK_DEVICE rp2040_m0_0)
set(OPENOCD_OPTION "-f interface/cmsis-dap.cfg -f target/rp2040.cfg -c \"adapter speed 5000\"")
include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)
@@ -158,6 +159,7 @@ function(family_configure_target TARGET RTOS)
pico_enable_stdio_uart(${TARGET} 1)
target_link_libraries(${TARGET} PUBLIC pico_stdlib pico_bootsel_via_double_reset tinyusb_board${RTOS_SUFFIX} tinyusb_additions)
family_flash_openocd(${TARGET} ${OPENOCD_OPTION})
family_flash_jlink(${TARGET})
endfunction()