CC2340R5: west flash openocd path specification

Part Number: CC2340R5

Hello,

In lp_em_cc2340r53/board.cmake

The cmake file sets the OPENOCD path as follows:

set(OPENOCD_BASE $ENV{TI_OPENOCD_INSTALL_DIR}/openocd/bin)
set(OPENOCD ${OPENOCD_BASE}/bin/openocd)

This results in a path that has two levels of bin directories. This doesn't match what's externally distributed in ti-embedded-debug vscode plugin which makes it impossible to set the correct path when defining the TI_OPENOCD_INSTALL_DIR environment variable.

Which for me generates in the runners.yml:

openocd: /Users/munan/Library/Application Support/Texas Instruments/ti-embedded-debug/openocd/1.3.1.50/openocd/bin/bin/openocd
 
Can we make sure to update the board.cmake files to reference the correct directory structure so that west flash will work with openocd?
 
Munan
  • Note the correct path is:

    /Users/munan/Library/Application Support/Texas Instruments/ti-embedded-debug/openocd/1.3.1.50/bin/openocd

    Also, the scripts directory has a similar issue since it inherits OPENOCD_BASE:

    set(OPENOCD_DEFAULT_PATH ${OPENOCD_BASE}/share/openocd/scripts)
    which puts the scripts path behind an unnecessary "openocd/bin" 
    Munan
  • Hi Munan,

    You're completely correct, I've added an additional "bin/openocd" to my own local board.cmake files for a while now.
    The reason for this is because when you download ti-OpenOCD through the https://www.ti.com/tool/download/CCSTUDIO-OPENOCD/1.5.2 you have the correct path with "openocd/bin/openocd.exe" as the end of path. Since R&D is using ti-OpenOCD directly like this, they don't know of the issue.

    I'll try to get in touch with the ti-embedded-debug team and the Zephyr R&D team to know which team/codebase should align on which path format.

    Kind regards,
    Lea

  • I was wrong, even the ti-openOCD download doesn't match the openocd/bin/bin/openocd format.
    I really don't know why this is happening, I think the best solution would be for customers to download ti-openOCD and for the R&D team to remove the initial openocd/bin path.