Core1 not starting correctly #1977
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#1977
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I was having some trouble getting some multicore code running. So I added some serial uart feedback to see what was happening. It appeared as if Core1 wouldn't start it's loop code without a soft reset immediately after bootup. I was able to replicate this with a clean project and minimal code. This is the 2.0 SDK in VSCode and the SDK plugin. This is also just a Pico1. I have not tried it on any of my PicoW.
If the 5ms sleep is commented out or removed, core1 will never get to looping. It will say "Core1 up" but never says "Hello from core1".
With the sleep and reset kept in, core1 seems to start just fine.
multicore_test.c
CMakeLists.txt (was generated by the plugin, except for "pico_multicore" which I added. )
And.... now I can't get it to replicate the issue. Let me poke at this a bit more. I should know soon if this in an actual issue or not.
I've updated the original post to the minimum amount of code that will replicate this on my system. However, it only shows the issue after a SWD flash finishes. If I do a hard restart by resetting the power, it boots up just fine.
How are you doing the SWD flash? Perhaps the SWD flash isn't resetting Core 1 properly, which is why it only works correctly after a "hard restart"?
Does https://github.com/raspberrypi/pico-feedback/issues/153 help?
The SWD flash is being done via the "Flash" task setup by the Pico SDK Plugin. It is using OpenOCD. The command line is as follows:
openocd.exe -s C:\Users\rbryson74/.pico-sdk/openocd/0.12.0+dev/scripts -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c adapter speed 5000; program "c:/Sync/code/tft_pio_dma/build/tft_pio_dma.elf" verify reset exitHowever, once I got to the pico-feedback link you provided there was a comment for another issue ( https://github.com/raspberrypi/pico-feedback/issues/248 ) that basically makes my submission an exact duplicate.
However, the "flash" task only uses OpenOCD and there is no "monitor" command since that seems to be for GDB instead.
So, I'm not sure how the command needs to be modified.
I always load images via gdb. I'll have to test loading via openocd.
I suspect this is a debug scenario where core 1 is not reset by the debugger on launch; we should consider just always resetting core 1 before launching it.
That said, i'm also curious if there is something peculiar to VS Code, so assigning to @will-v-pi for now
This looks like an OpenOCD problem not a VS Code problem - I can reproduce this issue, where loading and resetting directly from OpenOCD (ie Flash task in VS Code) only prints "Core1 Up", but when loading using gdb over OpenOCD (ie debugging in VS Code) it runs fine. My recommendation would be to use debugging in VS Code to load the program for now, rather than using the Flash task.
This is the openocd command that seems to be causing the issues, but I'm not sure why, so assigning back to @kilograham as I don't think it's a VS Code issue
Moving to 2.2.0 as sounds like an openocd issue