Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Sleep for SAMD, STM32 ?

Sleep for SAMD, STM32 ?

Scheduled Pinned Locked Moved Hardware
7 Posts 3 Posters 91 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KevinT
    wrote on last edited by
    #1

    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

    zboblamontZ 1 Reply Last reply
    0
    • K KevinT

      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

      zboblamontZ Offline
      zboblamontZ Offline
      zboblamont
      wrote on last edited by
      #2

      @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. ;)

      1 Reply Last reply
      0
      • K Offline
        K Offline
        KevinT
        wrote on last edited by
        #3

        @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:+1: , 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. :-)

        zboblamontZ 1 Reply Last reply
        0
        • K KevinT

          @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:+1: , 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. :-)

          zboblamontZ Offline
          zboblamontZ Offline
          zboblamont
          wrote on last edited by zboblamont
          #4

          @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.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            KevinT
            wrote on last edited by
            #5

            @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.

            mfalkviddM 1 Reply Last reply
            0
            • K KevinT

              @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.

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by mfalkvidd
              #6

              @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.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                KevinT
                wrote on last edited by
                #7

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

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                31

                Online

                11.7k

                Users

                11.2k

                Topics

                113.1k

                Posts


                Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • MySensors
                • OpenHardware.io
                • Categories
                • Recent
                • Tags
                • Popular