Skip to content

setting CoreDebug->DEMCR #47

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

Open
reimerp opened this issue Apr 30, 2025 · 1 comment
Open

setting CoreDebug->DEMCR #47

reimerp opened this issue Apr 30, 2025 · 1 comment

Comments

@reimerp
Copy link

reimerp commented Apr 30, 2025

Hi, first thank you for the enlightening book and resources.
While implemeting I found a little type in the examples given on pages 79 and 118:
CoreDebug->DEMCR = CoreDebug_DEMCR_TRCENA_Msk;
should be replaced with
CoreDebug->DEMCR =| CoreDebug_DEMCR_TRCENA_Msk;

else tracing will fail if running in debugger which already sets DEMCR to != 0

@reimerp
Copy link
Author

reimerp commented May 1, 2025

There is another one in int semihosting() (in the examples)
if this function is declared "naked", the compiler omits the epilogue. Its working in debug only, since the function does not return when free running.
just add

#if defined __ARM_ARCH && __ARM_ARCH == 7
  }
  __asm__ ("bx   lr \n");
#endif

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

No branches or pull requests

1 participant