Skip to content

Closes #40. Fix openocd.cfg for lpc4337, issue pertaining m0 core not halting.#41

Merged
evolentini merged 1 commit intolabmicro:mainfrom
fmirandabonomi:fix-issue40-lpc5337-openocd-cfg
Aug 6, 2025
Merged

Closes #40. Fix openocd.cfg for lpc4337, issue pertaining m0 core not halting.#41
evolentini merged 1 commit intolabmicro:mainfrom
fmirandabonomi:fix-issue40-lpc5337-openocd-cfg

Conversation

@fmirandabonomi
Copy link
Contributor

OpenOCD's reset halt resets and halts all cores. The m0 core in lpc4337 is held reset until deasserted by software by writing a zero in bit 24 of RESET_CTRL1, therefore it cannot halt and causes a timeout.

This breaks OpenOCD's program command which, as part of the programming sequence, uses reset init that expects the m0 core to halt. Furthermore the m0 core doesn't support the vectreset method and must be reset by sysresetreq.

To fix the error, lpc4337's openocd.cfg was modified in three ways:

  • Added an event handler to lpc4337.m0 that writes 0 to RESET_CTRL1, thus deasserting the m0 core's reset so it can be halted
  • Applied the vectreset reset_config only to lpc4337.m4
  • Applied the sysresetreq reset_config to lpc4337.m0

The fix was tested with an edu-ciaa-nxp board

OpenOCD's reset halt resets and halts *all cores*. The m0 core in lpc4337
is held reset until deasserted by software by writing a zero in
bit 24 of RESET_CTRL1, therefore it cannot halt and causes a timeout.

This breaks OpenOCD's `program` command which, as part of the
programming sequence, uses `reset init` that expects the m0 core to
halt. Furthermore the m0 core doesn't support the vectreset method and
must be reset by sysresetreq.

To fix the error, lpc4337's openocd.cfg was modified in three ways:

- Added an event handler to lpc4337.m0 that writes 0 to RESET_CTRL1,
  thus deasserting the m0 core's reset so it can be halted
- Applied the vectreset reset_config only to lpc4337.m4
- Applied the sysresetreq reset_config to lpc4337.m0

The fix was tested  with an edu-ciaa-nxp board
@evolentini evolentini merged commit 742584a into labmicro:main Aug 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants