multicore_sleep_core1() causes compile failure, missing core1_hang #77
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#77
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 originally posted this on the Pico forum at raspberrypi.org and jamesh informed me to post it over here. The following is an excerpt of what I posted there.
Hi All
I was thoroughly enjoying my testing of the Pico's dual processors last night when I think I discovered either a bug or a serious lack of documentation, or both. My intention was to see if I could put core 1 to sleep while core 0 did something for a little while, then wake it back up to continue on. At this point, I'm not doing anything serious with the Pico, this is all just test code that will simply output the index of a loop to the serial port. (I have successfully had two separate counting loops running one in each core, each outputting their count via printf() to the serial, and it works fine.) So, in the documentation, I found the reference to multicore_sleep_core1() and I thought I would try it. I called it from core 0. When I recompiled the code, I got
16% Linking CXX executable mctest.elf
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: CMakeFiles/mctest.dir/home/tkunz/pico/pico/pico-sdk/src/rp2_common/pico_multicore/multicore.c.obj: in function
multicore_sleep_core1': multicore.c:(.text.multicore_sleep_core1+0x94): undefined reference tocore1_hang'collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/mctest.dir/build.make:972: mctest.elf] Error 1
make[1]: *** [CMakeFiles/Makefile2:1454: CMakeFiles/mctest.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
I searched the SDK code for "core1_hang" and could only find references to it, but no definition of it!
I can post the code sample to recreate this if needed, but I'm thinking you can easily reproduce it by putting multicore_sleep_core1 into anything and trying to compile it.
I was also then advised that this function is a one-way sleep and puts core1 out of action and it can't be re-awakened from that sleep and to use other means of saving power.
Thanks
Tom
Thanks,
Tom
This is now removed by #198. Core 1 enters a low power sleep state at reset, and you can force it back into this state after launch with
multicore_reset_core1();.