Closes #40. Fix openocd.cfg for lpc4337, issue pertaining m0 core not halting.#41
Merged
evolentini merged 1 commit intolabmicro:mainfrom Aug 6, 2025
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
programcommand which, as part of the programming sequence, usesreset initthat 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:
The fix was tested with an edu-ciaa-nxp board