diff options
| author | JF <jf@codingfield.com> | 2020-01-26 19:25:28 +0100 |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-01-26 19:25:28 +0100 |
| commit | a3ff41705e5dde48aab2c4fb2cb80f2144562648 (patch) | |
| tree | b496dacce0c0e3e7f5582828533396ac0ee55a9a /cmake-nRF5x | |
| parent | 7c03810f46ff1f7accd2f5adb7404b4f2cb723d9 (diff) | |
| parent | 61284527048c0a9caeea81ff0da92d2c1adedfd7 (diff) | |
Merge branch 'messing-with-openocd' of https://github.com/luben93/Pinetime into luben93-messing-with-openocd
Diffstat (limited to 'cmake-nRF5x')
| -rwxr-xr-x | cmake-nRF5x/CMake_nRF5x.cmake | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/cmake-nRF5x/CMake_nRF5x.cmake b/cmake-nRF5x/CMake_nRF5x.cmake index 0ecc60a3..8a43cf12 100755 --- a/cmake-nRF5x/CMake_nRF5x.cmake +++ b/cmake-nRF5x/CMake_nRF5x.cmake @@ -344,6 +344,15 @@ macro(nRF5x_setup) COMMAND ${GDB_CLIENT_BIN_PATH} -nx --batch -ex 'target extended-remote ${GDB_CLIENT_TARGET_REMOTE}' -ex 'monitor swdp_scan' -ex 'attach 1' -ex 'mon erase_mass' COMMENT "erasing flashing" ) + elseif(USE_OPENOCD) + add_custom_target(FLASH_SOFTDEVICE + COMMAND ${OPENOCD_BIN_PATH} -c "tcl_port disabled" -c "gdb_port 3333" -c "telnet_port 4444" -f interface/stlink.cfg -c 'transport select hla_swd' -f target/nrf52.cfg -c "program \"${SOFTDEVICE_PATH}\"" -c reset -c shutdown + COMMENT "flashing SoftDevice" + ) + add_custom_target(FLASH_ERASE + COMMAND ${OPENOCD_BIN_PATH} -f interface/stlink.cfg -c 'transport select hla_swd' -f target/nrf52.cfg -c init -c halt -c 'nrf5 mass_erase' -c reset -c shutdown + COMMENT "erasing flashing" + ) endif() if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin") @@ -401,6 +410,12 @@ macro(nRF5x_addExecutable EXECUTABLE_NAME SOURCE_FILES) COMMAND ${GDB_CLIENT_BIN_PATH} -nx --batch -ex 'target extended-remote ${GDB_CLIENT_TARGET_REMOTE}' -ex 'monitor swdp_scan' -ex 'attach 1' -ex 'load' -ex 'kill' ${EXECUTABLE_NAME}-full.hex COMMENT "flashing ${EXECUTABLE_NAME}-full.hex" ) + elseif(USE_OPENOCD) + add_custom_target("FLASH_MERGED_${EXECUTABLE_NAME}" + DEPENDS ${EXECUTABLE_NAME} + COMMAND ${OPENOCD_BIN_PATH} -c "tcl_port disabled" -c "gdb_port 3333" -c "telnet_port 4444" -f interface/stlink.cfg -c 'transport select hla_swd' -f target/nrf52.cfg -c "program \"${EXECUTABLE_NAME}-full.hex\"" -c reset -c shutdown + COMMENT "flashing ${EXECUTABLE_NAME}-full.hex" + ) endif() endif() @@ -419,7 +434,12 @@ macro(nRF5x_addExecutable EXECUTABLE_NAME SOURCE_FILES) COMMAND ${GDB_CLIENT_BIN_PATH} -nx --batch -ex 'target extended-remote ${GDB_CLIENT_TARGET_REMOTE}' -ex 'monitor swdp_scan' -ex 'attach 1' -ex 'load' -ex 'kill' ${EXECUTABLE_NAME}.hex COMMENT "flashing ${EXECUTABLE_NAME}.hex" ) - + elseif(USE_OPENOCD) + add_custom_target("FLASH_${EXECUTABLE_NAME}" + DEPENDS ${EXECUTABLE_NAME} + COMMAND ${OPENOCD_BIN_PATH} -c "tcl_port disabled" -c "gdb_port 3333" -c "telnet_port 4444" -f interface/stlink.cfg -c 'transport select hla_swd' -f target/nrf52.cfg -c "program \"${EXECUTABLE_NAME}.hex\"" -c reset -c shutdown + COMMENT "flashing ${EXECUTABLE_NAME}.hex" + ) endif() endmacro() |
