MemoryError: memory allocation failed, allocating 175 bytes
-
@robert-hh Great I am going to try that.
-
@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.
-
@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. -
@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 :)
-
@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,
-
@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 1Do 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.
-
@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=appI 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 MakefileAnd 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. -
@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. -
@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-hh Robert thx for pointing me in the right direction. I am able to compile the image. Play time.
-
@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.
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