-
Notifications
You must be signed in to change notification settings - Fork 12
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
RTIC incompatibility #21
Comments
Hi, yeah it might be a C library issue. Not sure. The C library does want to know whether the microcontroller is in interrupt context. Also, make sure the interrupt that drives the modem has a higher priority than the interrupt with which you interact with the modem |
I have set the IPC prio to the maximum of RTIC which is the maximum interrupt priority. I tried changing the function |
It's there for a reason though... I think the issue might be here: Lines 457 to 459 in f9d4a24
I think the modem library has a pretty strict idea of its execution. It's either in an interrupt or not. All normal usage is in thread mode and all interrupts are of the same priority. Not sure what the best way to support RTIC with this is though... It might just be that you cannot use the modem apis from an interrupt. In RTIC that still can be done if you define a software task at prio 0. Those are not run as interrupts but in thread mode. |
I've been trying to use this library with RTIC and ran into an issue.
The issue resides in using the modem in an RTIC task with a priority > 0. I created a repo with a two runnable examples at https://github.com/TomSievers/rtic-nrf-modem. One example shows that the modem can be used with RTIC, the other shows it not working in an interrupt context.
When initializing the modem at priority > 0 it will fail with the NRF error code of -116 (NRF_ETIMEDOUT). If the modem is succesfully initialized and afterwards one tries to bind a UdpSocket it fails with NRF error code of -1 (NRF_EPERM).
Maybe these functions are designed in a way where they will not work from an interrupt context.
I will look into trying this with the libmodem_log instead of the default libmodem to get more info into why it fails.
The text was updated successfully, but these errors were encountered: