multicore_sleep_core1() causes compile failure, missing core1_hang #77

Closed
opened 2021-02-02 13:12:03 -06:00 by tomkunz2021 · 1 comment
tomkunz2021 commented 2021-02-02 13:12:03 -06:00 (Migrated from github.com)

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 to core1_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

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 to `core1_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
Wren6991 commented 2021-03-01 08:12:20 -06:00 (Migrated from github.com)

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();.

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();`.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#77
No description provided.