-
Notifications
You must be signed in to change notification settings - Fork 2
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
Pico multicore 'sleep_ms' not working on core1 / potential race condition on core1 #248
Comments
Is it possible that the race-condition might be in |
I can't tell for sure. I tried to "puts" before starting the second core but that didn't help.
|
I cannot reproduce this, can you please attach the MakeLists.txt and the build output files (i.e. .UF2, .ELF and .DIS) Also what compiler you are using. |
I attached my complete project folder to reproduce: It's compiled using Windows:
CMakelists.txt
https://www.dropbox.com/s/ceukqy6ver0a2rp/pico-core1.zip?dl=0 |
not reproducible with my Pico :) |
I cannot reproduce this on any Pico I have even using your UF2... I haven't tried on Windows, but given that you are using UART it'd be weird for it to be anyway affected by the host, as it is not synchronous. Does it happen regardless of whether the UART wires are connected initially? |
Ok let me check again. I did my test with picoprobe though. I'll also try to use another PICO. |
This issue seem to depend on flashing the PICO with SWD via PICOPROBE and openocd: If i reset the pico (run/gnd) after flashing it runs normal. The SWD/openocd command doesn't seem to reset the pico (at least core1) correctly. It also may be an openocd issue.
|
I can reproduce this flashing with openocd from a Pi 4 with:
Perhaps it's related to how the RP2040 is reset when openocd is used? |
Yes these flags which is what we say in the documentation are incorrect. See |
Thanks for the hint. I'm no openocd export but the flags mentioned are only related to loading to RAM aren't they. Up until now i'm using openocd only for flashing the pico withouht using USB UF2. Any tips for correct command doing this?
|
No they are wrong for everything. you must do "monitor reset init" before loading any time of executable (if you want it to work correctly always) |
@kilograham The jimtcl script that implements program/preverify/verify/reset/exit calls "reset init" so the commands below should function successfully, or do you see this differently?
See also OpenOCD User's Guide: Flash Programming. |
yeah i wasn't aware that's what |
Was this intentionally closed? |
i thoguht i had reopened |
I think this issue is rather related to openocd so maybe it can be closed? |
yeah it only remains open as a reminder to @lurch that the documentation is wrong |
I've got massive problems getting core1 to work.
I assume there is a problem using 'sleep_ms' on core1.
Code:
Output:
However if i add a short delay before starting core1 everythings works as expected:
Output:
The text was updated successfully, but these errors were encountered: