Skip to content

Conversation

maribu
Copy link
Member

@maribu maribu commented Jan 18, 2023

Backport of #19050

Contribution description

  • Add support for XDS110 debugger via OPENOCD_DEBUG_ADAPTER=xds110
  • Clean up OpenOCD configs in boards/common/cc26xx_cc13xx
    • No longer hardcode the debugger to xds110, but use OPENOCD_DEBUG_ADATER ?= xds110
    • Add support for cc13x0, cc13x2, cc26x0
  • boards/cc2650*: drop custom OpenOCD config in favor of shared one
  • add variables needed to support flashing with PROGRAMMER=jlink
  • allow specifying a custom OpenOCD command to bring the device to a halt state, as the default reset halt (which causes a second reset) is causing issues with the ICEPick JTAG routers in the CC26xx - CC13xx devices
  • Use halt instead of reset halt for CC26xx / CC13xx boards in OpenOCD to avoid issues in flashing

Testing procedure

make BOARD=cc2650-launchpad -C examples/default flash

Should now work. The same should still work for other cc26xx cc13xx boards.

Issues/PRs references

Partially fixes: #18750

This adds the configuration to allow choosing the XDS110 used in
cc13xx-launchpad and cc26xx-launchpad boards via the
`OPENOCD_DEBUG_ADAPTER` variable.

(cherry picked from commit 7bb5232)
Place common OpenOCD configs for the different cc13xx and cc26xx
families in boards/common/cc26xx_cc13xx/dist and automatically select
the correct one based on the (prefix of the) value of `$(CPU_MODEL)`, if
`OPENOCD_CONFIG` was not specified and no custom `openocd.cfg` is
located in the board's `dist` folder.

The `cc2650-launchpad` and `cc2650stk` have been adapted to use the
common config instead.

(cherry picked from commit c4ff80b)
Add the required variables to support flashing with `PROGRAMMERS=jlink`.

(cherry picked from commit 5c16318)
Typically, OpenOCD is already performing a reset on connect. A
`reset halt` to bring the target to a `halt` state for flashing will
result in the device going through a second reset cycle. This can be
problematic with some device, such as the CC26xx MCUs. For these
devices, an `OPENOCD_CMD_RESET_HALT := -c 'halt'` will avoid the second
reset that is causing the issues.

(cherry picked from commit 3e1dcf3)
This adds a work around that allows flashing with upstream OpenOCD,
most of the time.

(cherry picked from commit c78c005)
@maribu maribu requested a review from smlng as a code owner January 18, 2023 11:06
@maribu maribu added Area: boards Area: Board ports Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation labels Jan 18, 2023
Copy link
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backport-ACK.

bors merge

@bors
Copy link
Contributor

bors bot commented Jan 18, 2023

🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@riot-ci
Copy link

riot-ci commented Jan 18, 2023

Murdock results

✔️ PASSED

fdadea4 boards/common/cc26xx_cc13xx: Fix flashing with upstream OpenOCD

Success Failures Total Runtime
6770 0 6770 15m:51s

Artifacts

@kaspar030
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Jan 18, 2023

Build succeeded:

@bors bors bot merged commit d5a4380 into RIOT-OS:2023.01-branch Jan 18, 2023
@maribu maribu deleted the backport/2023.01/boards/common/cc26xx_cc13xx/openocd.cfg branch April 25, 2023 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants