diff options
| author | hathach <[email protected]> | 2023-11-28 18:27:40 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-11-28 18:28:45 +0700 |
| commit | 0a4d92a71e8b25daedc8cf4a388dd9abd2539419 (patch) | |
| tree | 9a0e3f12b78f4f0045ba2ddf73f00769ba4a5fd9 /hw | |
| parent | 1eb6ce784ca9b8acbbe43dba9f1d9c26c2e80eb0 (diff) | |
update hil for pi4 to use new hil_test.py
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/bsp/family_support.cmake | 16 | ||||
| -rw-r--r-- | hw/bsp/rp2040/family.cmake | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/hw/bsp/family_support.cmake b/hw/bsp/family_support.cmake index 930237fea..bd072e89d 100644 --- a/hw/bsp/family_support.cmake +++ b/hw/bsp/family_support.cmake @@ -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) diff --git a/hw/bsp/rp2040/family.cmake b/hw/bsp/rp2040/family.cmake index 53e2add56..77d8029d9 100644 --- a/hw/bsp/rp2040/family.cmake +++ b/hw/bsp/rp2040/family.cmake @@ -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() |
