CPU Can't stop
- Dominant language
- C
- Stars
- 2.8k
- Forks
- 1.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 1
Description
HELLO !
When I connect the target, the cpu is still working, and I want to stop the cpu. This function cannot be realized.
I hope you can help me.
static uint8_t swd_wait_until_halted(void)
{
// Wait for target to stop
uint32_t val, i, timeout = MAX_TIMEOUT;
for (i = 0; i < timeout; i++) {
if (!swd_read_word(DBG_HCSR, &val)) {
return 0;
}
if (val & S_HALT) {
return 1;
}
}
return 0;
}
Contributor guide
Research direction
Start by tracing swd_wait_until_halted() and inspect how DBG_HCSR, S_HALT, and MAX_TIMEOUT are used when the target connects. Reproduce the failure with a target and verify whether the CPU reaches the halted state; the issue is resolved when the stop function reliably reports a halted CPU.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100