Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    ULP Testing (pycom firmware with ULP support)

    Scheduled Pinned Locked Moved Guides
    ulpfirmwaregithub
    5 Posts 3 Posters 111 Views 5 Watching
    Loading More Posts
    • 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.
    • DualMaticD Offline
      DualMatic
      last edited by

      Re: Ultra Low Power (ULP) processor - Part 1

      Hello,

      I'm trying to test ULP coprocessor in pycom firmware, so if anyone is interested I've created a fork of pycom-micropython-sigfox on my github.

      There are two branches
      IDF 3.3.1 Based on stable firmware v1.20.2.r4
      IDF 4.1 Based on latest beta release v1.20.3.b3

      In order to compile, must follow exact steps as on readme but replacing the branch (and the repo address of course). BTW I'm thinking uploading bin files to another repo...

      Please, excuse me because I'm not an expert with makefiles and c programming, I've just figured it out which files and lines to modify from original micropython repo and adapt to pycom. Also seeking experts help here ;) because the code/makefile can be improved.

      The firmware compiles correctly without errors and you will end up with the same ULP as micropython repo
      ULP Help from micropython
      BUT instead of esp32.ULP() the function here on pycom is machine.ULP()

      I've testing it at the moment with good results compiling the assembly files on my computer with micropython for windows (compiling on lopy fails)
      py-esp32-ulp

      Now I will figure out how ULP works and if we can do things while asleep, my goal is "listen" to inputs with ULP coproc.

      Regards!

      DualMaticD 1 Reply Last reply Reply Quote 5
      • DualMaticD Offline
        DualMatic @DualMatic
        last edited by

        Hello all,

        I've just compiled and released binaries for lopy4, gpy and fipy n my repo.
        Firmware

        Please note,

        • This firmware is for testing ulp coprocessor
        • Based on last beta release
        • Doesn't have pybytes enabled
        • I've compiled with Differential Update enabled

        I'll maintain this post updated with my findings, and I encourage other users to test if interested on ULP.

        Best regards

        G 1 Reply Last reply Reply Quote 1
        • C Offline
          Calvin Foo
          last edited by

          nice! will try this.

          trying to implement ULP pulse counting for gas metering....

          1 Reply Last reply Reply Quote 1
          • G Offline
            Géza Husi @DualMatic
            last edited by

            @DualMatic
            Hello!
            May I ask that did you manage to make the ULP work? Is the binary you upload and load/run via the MP APIs executed ?
            Thanks !

            DualMaticD 1 Reply Last reply Reply Quote 1
            • DualMaticD Offline
              DualMatic @Géza Husi
              last edited by DualMatic

              @Géza-Husi Yes! I've tested with some code from different repositories and it works, I'll prepare some sample code and post here.

              I'm neither makefile nor esp-idf expert, so my current procedure is to use ThomasWaldmann py-esp32-ulp on my local computer with micropython v1.12 in order to compile .S file to .ulp and then upload to pycom module via FTP, this allowed me to quick test if ULP works but has some downsides (some of them because my lack of knowledge):

              • You have to load and run the ulp file at every boot
              • py-esp32-ulp converter doesn't take into account Espressif ULP macros/helpers issue#19 (READ_RTC_REG, WRITE_RTC_REG, and so on...)
              • I'm still figuring out how to do I/O manipulation from ULP (read digital input accomplished, but figuring out how digital output works)
              • I don't know how to signal main processor to wake up from ULP.

              I think the best way to implement ULP is to flash or generate binary file with esp-idf (in order to make use of macros) Maybe someone at pycom (Géza ;-) ) or people with more esp-idf knowledge than me can shed us some light.

              My use case with ULP is more or less the same as @Calvin-Foo but for water metering, counting pulses while asleep and waking up the module every 'N' pulses in order to take actions or save values.

              Regards and thanks for chiming in!

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom