Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CPU Can't stop #1072

Open
ssyqwer opened this issue Apr 20, 2024 · 1 comment
Open

CPU Can't stop #1072

ssyqwer opened this issue Apr 20, 2024 · 1 comment

Comments

@ssyqwer
Copy link

ssyqwer commented Apr 20, 2024

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;

}

@ssyqwer
Copy link
Author

ssyqwer commented Apr 20, 2024

I used your code to make an offline programming device, and the code debugging card is here.
6d7fd23dfda01159a06c37ded4bc516
Uploading 5ce8f227ad00b2107512c19a5bf7ae7.png…

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant