Sleep for SAMD, STM32 ?



  • Hi all,

    I've been looking for an mcu that would provide me with more interrupts for my RFM69 nodes and support sleep functions.
    I've checked out SAMD and STM32 and they don't appear to support sleep. "MY_SLEEP_NOT_POSSIBLE"

    Is there any plans to add sleep functionality for these mcu's?

    Other options?

    Thanks,

    KevinT



  • @KevinT Suggest a keyword search - I stumbled across a post which mentioned "Sleepy Dog" working for SAMD0, whilst trying to figure out how to similarly deploy a Feather RFM69.
    I'm still a novice with this device, but I do recall the author saying Adafruit's "Sleepy Dog" worked, and IIRC there was some discussion over the power consumption not being spectacular, but best find and read with fresh eyes.
    The stumbling block for MySensors appears to be that the only SAMD0 implementation developed was for the Sensebender Gateway, which logically was never intended to go to sleep. πŸ˜‰



  • @zboblamont When I search the MySensors library (2.3.2) for sleep(), I find the return value "MY_SLEEP_NOT_POSSIBLE" for the sleep functions. file: MyHwSAMD.cpp

    int8_t hwSleep(uint32_t ms)
    {
    	// TODO: Not supported!
    	(void)ms;
    	return MY_SLEEP_NOT_POSSIBLE;
    }
    
    int8_t hwSleep(uint8_t interrupt, uint8_t mode, uint32_t ms)
    {
    	// TODO: Not supported!
    	(void)interrupt;
    	(void)mode;
    	(void)ms;
    	return MY_SLEEP_NOT_POSSIBLE;
    }
    
    

    But, as you mentionedπŸ‘ , it looks like @Alpoy has implemented his own sleep code.
    Feather m0 (SAMD) sleep and interrupt
    I'll have to try it and see if it will work for me.
    Thanks. πŸ™‚



  • @KevinT Hopefully it helps, the Sleepy Dog implementation was mentioned here https://forum.mysensors.org/topic/6908/adafruit-feather-m0-rfm69hcw-with-mysensors/6?lang=en-GB
    I'm still at the screwing around stage, even managed to get a puff of magic smoke when I removed the battery while still on USB power. Oops... Presumably I've blown the battery charging circuit, but it's still functional for fiddling with and testing otherwise.

    For mains plus battery backup nodes I'm less concerned over sleep than continuity through power cuts, the extra pins over the 328 are a godsend. If frugal consumption is possible so much the better.

    The recommended Adafruit library and FeatherM0 board definition are fine for Blink etc., but anything MySensors related fails to compile, so will try the Sensebender definition next and hopefully make some progress.



  • @zboblamont Thanks for the link, I wasn't finding anything with "sleepy dog", never thought to remove the space. That should help too. I just have to figure out what to do with the RFM radio, if it has a power down mode, etc. Keep us posted on the Sensebender trials. Thx.


  • Mod

    @KevinT MySensors already has code for sleeping the radio (it is the same code regardless of which cpu is used). It gets called automatically. So if you implement hwSleep, you're good to go.

    Actually, the radio is sent to sleep now as well, but it is woken up again immediately because the cpu doesn’t sleep.



  • @mfalkvidd Good point. I don't know too much about the library, but if that's all it takes, I'll definitely try it.


Log in to reply
 

Suggested Topics

  • 87
  • 7
  • 7
  • 10
  • 8
  • 6

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts