-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pm: use of wrong pm_set_lowest
?
#6709
Comments
Obviously,
vs.
|
There are three |pm_set_lowest| implementations in the code base:
1. |drivers/periph_common/pm.c| <= |__atribute__((weak))|
2. |cpu/cortexm_common/periph/pm.c|
3. |sys/pm_layered/pm.c|
My understandig is, that the implementation in 3. is the correct one
(given that I include the |pm_layered| module). However, as can be seen
above, the implementation defined in 1. is chosen.
See #5757.
|
Thanks for the hint! I am wondering with what setup the |
seems like I completely overlooked #6655. Sorry! I still keep my issue open as it provides additional info, though. |
We've just run into his same issue with the samd21. So glad you documented what's going on here. We were pulling our hair out. Any hope of a solution emerging? |
I don't know if there's a proposed solution yet but looking at the status of the PRs marked for this release I think this issue should be also postponed. |
Just a reminder, this is present in 2017.04 release: power management doesn't work on samr21. |
@cgundogan This should be fixed with 2017.10, could you verify again? |
Fixed by #7726. |
(Thanks for hinting @MichelRottleuthner)
When I add
USEMODULE += pm_layered
to theMakefile
of thedefault
example and when I build for thesamr21-xpro
board, I get the following:There are three
pm_set_lowest
implementations in the code base:drivers/periph_common/pm.c
<=__atribute__((weak))
cpu/cortexm_common/periph/pm.c
sys/pm_layered/pm.c
My understandig is, that the implementation in 3. is the correct one (given that I include the
pm_layered
module). However, as can be seen above, the implementation defined in 1. is chosen.The last line of the
make
command (withQUIET=0
) contains:The above output conforms with what we do in https://github.com/RIOT-OS/RIOT/blob/master/Makefile.modules#L6-L7 : The modules are sorted alphabetically and thus,
pm_layered
is passed to the linker quite lately and is (AFAIK) ignored by the first matchingpm_set_lowest
inperiph_common/pm.c
.(s. https://en.wikipedia.org/wiki/Weak_symbol#Limitations)
I tried to prepend
--whole-archive
to the linker flags, but encountered a lot more issues with that.When I manually move the line
above
and do the linking manually, then I get the desired behavior:
Any ideas on how to fix, or am I doing something wrong here?
The text was updated successfully, but these errors were encountered: