-
Notifications
You must be signed in to change notification settings - Fork 2.1k
dist/tools/PyCortexMDebug: Integrate GDB extension into RIOT #21863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
AnnsAnns
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat stuff 😄
|
It's still failing a static test, I'll test it in the meantime though :) |
|
Normal building/flashing/debugging works fine. When I use |
|
Indeed, should be fixed now |
|
Squash 👍 |
|
(Also wow that is such a neat feature) |
- Do not provide defaults for `${DBG}`, `${TUI}`, `${GDB_PORT}`,
`${TELNET_PORT}` with special shell functions, but use canonical
syntax for that
- Add `${DBG_EXTRA_FLAGS}` and pass them to GDB, as we do in OpenOCD
- Run `${DBG}` with `sh -c "..."` just like done in `openocd.sh` to
allow passing flags to GDB in the same way independent of whether
JLink or OpenOCD is used.
When running
make RIOT_USE_PYCORTEXMDEBUG=1 debug
RIOT will now fetch PyCortexMDebug and instruct GDB to load that
extension on start. If additionally RIOT provides `SVD_VENDOR` and
`SVD_MODEL` to identify the SVD file to load, an
`svd_load $(SVD_VENDOR) $(SVD_CLIENT)` is also passed to GDB.
Co-authored-by: crasbe <[email protected]>
Co-authored-by: Ann🐸 <[email protected]>
With this, running `make RIOT_USE_PYCORTEXMDEBUG=1 debug` for any nRF52 based boards will directly load the correct SVD file.
With this, running `make RIOT_USE_PYCORTEXMDEBUG=1 debug` for any STM32F7 based boards will directly load the correct SVD file. Co-authored-by: crasbe <[email protected]>
811c09e to
dde6e6e
Compare
AnnsAnns
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the continued review over the night 😄
Here is my approval, though crasbe should probably also approve
Oh, you actually tested this, your approval is enough :) |
Yeah but you also reviewed it, didn't want to overrule your review ;P |
|
Thx ❤️ |
Contribution description
When running
RIOT will now fetch PyCortexMDebug and instruct GDB to load that extension on start. If additionally RIOT provides
SVD_VENDORandSVD_MODELto identify the SVD file to load, ansvd_load $(SVD_VENDOR) $(SVD_CLIENT)is also passed to GDB.For nRF52 and STM32F7 based boards,
SVD_VENDORandSVD_CLIENTare already provided.Testing procedure
wget -O ~/.cache/cmdebug/cmsis-svd-data.zip https://github.com/cmsis-svd/cmsis-svd-data/archive/refs/heads/main.zip. (This is documented in theREADME.mdindist/tools/PyCortexMDebugand can be automated in a follow up.)make BOARD=nucleo-f767zi -C examples/basic/default flashmake RIOT_USE_PYCORTEXMDEBUG=1 BOARD=nucleo-f767zi -C examples/basic/default debugLoading SVD file STMicro/STM32F7x7...svdcommand works, e.g. trysvd SYSCFG EXTICR1nrf52840dkdefaults to using J-Link when installedExpected results:
svd_loadcommand is provided in GDB and works out of the box for both J-Link and OpenOCDsvd_load <SVD_VENDOR> <SVD_MODEL>command and directly inspect memory withsvdIssues/PRs references
None