Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.

equeue_mbed problem with sleep #16

Closed
aracosta1 opened this issue Sep 20, 2016 · 2 comments
Closed

equeue_mbed problem with sleep #16

aracosta1 opened this issue Sep 20, 2016 · 2 comments

Comments

@aracosta1
Copy link

Hello,
I'm using Mbed SDK with this library on an NRF51822 cpu.
If I use the plain code it never dispatch any event and get blocked in equeue_sema_wait.

I did some test and finally replaced the sleep() call with __WFI() and now it works correctly.

The sleep() function code calls __WFE() that dont wake up if interrupt are disabled.
I understand sleep() is more portable across different platform, but this is a big issue in using this library with the Nordic cpu.

Any suggestion ?

@pan-
Copy link
Member

pan- commented Sep 20, 2016

@aracosta1 From what I see, the sleep function in mbed SDK is not correct.
It doesn't even takes into account the softdevice which has some requirements regarding sleep.
A correct implementation would be something like the one for mbed OS 3: https://github.com/ARMmbed/mbed-hal-nrf51822-mcu/blob/master/source/sleep.c#L26

Please open a ticket for this in the mbed OS repository: https://github.com/ARMmbed/mbed-os

@aracosta1
Copy link
Author

You are right, I opened the ticket on mbed OS.
We can close this as it need to be resolved there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants