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

    MemoryError: memory allocation failed, allocating 175 bytes

    Scheduled Pinned Locked Moved LoPy
    lopymemoryallocationcross compile
    19 Posts 2 Posters 5.2k Views 2 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.
    • robert-hhR Offline
      robert-hh @Marco den Hartog
      last edited by

      @Marco-den-Hartog You just go into the esp32 subdirectory of microypython-pycom, and follow the instrutions in the README.md file there.

      M 1 Reply Last reply Reply Quote 0
      • M Offline
        Marco den Hartog @robert-hh
        last edited by

        @robert-hh Great I am going to try that.

        1 Reply Last reply Reply Quote 0
        • M Offline
          Marco den Hartog @Marco den Hartog
          last edited by

          @robert-hh Hi I have tried image 1.6.9.b1 but when I put an .mpy cross compiled file in the lib directory or another directory it is complaining that it can't find the module ImportError: no module named 'bme280'. When I put the normal .py file there is no problem. Is image 1.6.9.b1 really supporting cross compiled files out of the box. Do you have another suggestion for me otherwise I need to compile everything and make my own image.

          robert-hhR 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @Marco den Hartog
            last edited by

            @Marco-den-Hartog Maybe it's not. I'm building the images myself since they were first published, and always added that config line myself. So I had pre-compiled and frozen code support before Pycom enabled it. It was in the code from the beginning on.
            On a Linux machine, it's no problem to build the image. Only flashing it could be a problem, since USB support from a virtual machine was always fragile.
            If that fails, you could use the manual procedure as written here: https://software.pycom.io/downloads/LoPy_868-1.6.0.b1.tar.gz
            That would require to build your own gz-package, or you use the -f option. I never did that, but that's the way I would try.

            M 1 Reply Last reply Reply Quote 0
            • M Offline
              Marco den Hartog @robert-hh
              last edited by

              @robert-hh It isn't supported in that version. I am already busy building my own image with the specified config line. Only then I know for sure that it will work :)

              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @Marco den Hartog
                last edited by

                @Marco-den-Hartog Once you get used to it, you don't want to miss it. That way, you can also put you own code into flash, and useful other scripts. It#s only a shame that PyCom updates the repository so tardy,

                M 1 Reply Last reply Reply Quote 0
                • M Offline
                  Marco den Hartog @robert-hh
                  last edited by

                  @robert-hh You have a lot experience in manual compiling the source code. I am getting the following error on the end. I am using the following code
                  https://github.com/pycom/pycom-micropython-sigfox/blob/master/esp32/README.md
                  LINK build/LOPY/release/application.elf
                  text data bss dec hex filename
                  961873 170156 73056 1205085 12635d build/LOPY/release/application.elf
                  Building partitions from lib/partitions.csv...
                  Traceback (most recent call last):
                  File "/home/serveradmin/pycom-esp-idf/components/partition_table/gen_esp32part.py", line 356, in <module>
                  main()
                  File "/home/serveradmin/pycom-esp-idf/components/partition_table/gen_esp32part.py", line 345, in main
                  table.verify()
                  File "/home/serveradmin/pycom-esp-idf/components/partition_table/gen_esp32part.py", line 83, in verify
                  for p in sorted(self):
                  TypeError: unorderable types: PartitionDefinition() < PartitionDefinition()
                  application.mk:397: recipe for target 'build/LOPY/release/lib/partitions.bin' failed
                  make: *** [build/LOPY/release/lib/partitions.bin] Error 1

                  Do you know what I am missing here ?

                  I agree that it is a pitty that the code isnt't often updated in the github. That would be great if the guys of Pycom will do that more often.

                  Thx.

                  robert-hhR 2 Replies Last reply Reply Quote 0
                  • robert-hhR Offline
                    robert-hh @Marco den Hartog
                    last edited by

                    @Marco-den-Hartog I see now, that the second line in README looks wrong. so the make command should be:

                    make BOARD=LOPY -j5 TARGET=boot
                    make BOARD=LOPY -j5 TARGET=app
                    

                    I personally use a GNUmakefile, in which I add the extra settings. It looks like:

                    BOARD = LOPY
                    $(info BOARD = $(BOARD))
                    FROZEN_MPY_DIR = modules
                    $(info FROZEN_MPY_DIR = $(FROZEN_MPY_DIR))
                    include Makefile
                    

                    And then I either type (very rarely):
                    make TARGET=boot
                    or just:
                    make
                    and them
                    make flash
                    I tried to reproduce your error, but do not get it.

                    1 Reply Last reply Reply Quote 0
                    • robert-hhR Offline
                      robert-hh @Marco den Hartog
                      last edited by

                      @Marco-den-Hartog Found it. It#s a python version problem.

                      try in the second make step:
                      make BOARD=LOPY -j5 TARGET=app PYTHON=python2
                      You need python2 installed for that.

                      M 2 Replies Last reply Reply Quote 0
                      • M Offline
                        Marco den Hartog @robert-hh
                        last edited by

                        @robert-hh Thx a lot robert. Yes I am using python3 because in their readme file they say " MicroPython implements the entire Python 3.4 syntax (including exceptions, "with", "yield from", etc., and additionally "async" keyword from Python 3.5). I will switch over to python2 to see if that is working.

                        robert-hhR 1 Reply Last reply Reply Quote 0
                        • M Offline
                          Marco den Hartog @robert-hh
                          last edited by

                          @robert-hh Robert thx for pointing me in the right direction. I am able to compile the image. Play time.

                          1 Reply Last reply Reply Quote 0
                          • robert-hhR Offline
                            robert-hh @Marco den Hartog
                            last edited by

                            @Marco-den-Hartog Micropython itself implements Version 3.4, but the scripts used in the build procedures on PC are a mix of Python2/Python3 code. For some branches you need Python2, for others Python3. for instance esptool.py was only recently Ported to Python3.

                            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