[riot-users] Radio Interrupt Handler

Joakim Nohlgård joakim.nohlgard at eistec.se
Thu Nov 8 22:32:45 CET 2018


I think you are mixing up different aspects of low power operation.
pm_layered will cause the CPU to go to low power modes when there is no
thread running, it will not touch anything other than the CPU. The sleep
mode of the radio is the responsibility of a different module. You can
control the radio sleep mode manually from the shell using ifconfig x set
state sleep, or automatically if you configure a radio duty cycling layer,
such as ContikiMAC. If you are running the gnrc_networking example out of
the box with no modifications, then you are not using any duty cycling
method. This is similar to when contiki is configured with nullrdc instead
of TSCH or ContikiMAC.
There are two duty cycling modules in the master repo AFAIK: lwmac and
gomach. I have never used either of them because of limitations in the
implementations which means they are useless for my projects, so I can't
help you with those. The only duty cycling layer which I know anything
about is the proposed netdev ContikiMAC module in [1]. That module is
intended to wake up every 1/8 th of a second and do CCA checks, just like
contiki does when running contikimac for the RDC. Sending will strobe the
frame according to the rules described in the module API documentation (run
make doc locally), or in the original paper on ContikiMAC[2].
The module in [1] is highly experimental and has only ever been tested on
frdm-kw41z and samr21-xpro boards.

/Joakim

[1]: https://github.com/RIOT-OS/RIOT/pull/9478
[2]: http://dunkels.com/adam/dunkels11contikimac.pdf

Den tor 8 nov. 2018 20:09 skrev Navneet Pandey <navneet.pandey at outlook.in>:

> Hello Joakim,
>
>
>
> Thank you, the information was really helpful. I was exploring the
> ‘at86rf2xx_netdev.c’ file. I noticed something weird. When I enabled
> debugging all I got was
>
>    - To Idle state
>    - Evt TX_END
>    - Evt RX_END
>
>
>
> By enabling debugging in pm_layered.c and pm.c, I noticed
> cortex_sleep(deep) was being called when radio was not doing anything. So
> why am I not seeing any of the following debug statements being printed (or
> in other words none of the following cases being invoked).
>
> case NETOPT_STATE_STANDBY:
>
>             DEBUG("STANDBY\n");
>
>             at86rf2xx_set_state(dev, AT86RF2XX_STATE_TRX_OFF);
>
>             break;
>
>         case NETOPT_STATE_SLEEP:
>
>             DEBUG("To SLEEP\n");
>
>             at86rf2xx_set_state(dev, AT86RF2XX_STATE_SLEEP);
>
>             break;
>
>         case NETOPT_STATE_IDLE:
>
>             DEBUG("To IDLE\n");
>
>             at86rf2xx_set_state(dev, AT86RF2XX_STATE_RX_AACK_ON);
>
>             break;
>
>
>
> Regards,
>
> Navneet Pandey
>
>
>
> *From:* Navneet Pandey <navneet.pandey at outlook.in>
> *Sent:* Monday, November 5, 2018 11:10 AM
> *To:* users at riot-os.org
> *Subject:* Radio Interrupt Handler
>
>
>
> Hello,
>
>
>
> Could someone please point out the code where radio is switched on/off
> when sending a MAC/UDP packet.
>
>
>
> I am expecting something similar to the following code snippet:
>
> /** Turn the MAC layer on. */
>
>   int (* on)(void);
>
>
>
>   /** Turn the MAC layer off. */
>
>   int (* off)(int keep_radio_on);
>
>
>
> This code is from Contiki.
>
>
>
> I am interested in understanding the time it takes for system to wake up
> from sleep (dormant mode) to receive packets.
>
>
>
> Thank you.
>
>
>
> Regards,
>
> Navneet Pandey
>
>
> _______________________________________________
> users mailing list
> users at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/users/attachments/20181108/1af1b8a3/attachment.html>


More information about the users mailing list