Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MemoryError when loading module #36

Open
explody opened this issue Jan 7, 2024 · 1 comment
Open

MemoryError when loading module #36

explody opened this issue Jan 7, 2024 · 1 comment

Comments

@explody
Copy link

explody commented Jan 7, 2024

Using an Adafruit Metro Express M0, CircuitPython 8.2.8, and MPU boards from Amazon, with or without having an MPU board connected, I get an. immediate memory error upon loading the module:

paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== import time
=== import board
=== import digitalio
=== import adafruit_mpu6050
=== 
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "adafruit_mpu6050.py", line 45, in <module>
  File "adafruit_register/i2c_bits.py", line 25, in <module>
MemoryError: memory allocation failed, allocating 60 bytes
>>>

The boards in question do work if I use C - is the M0 just not beefy enough, maybe?

@dhalbert
Copy link
Contributor

dhalbert commented Jan 7, 2024

The SAMD21 on the Metro M0 only has 32kB of RAM. This library is probably too big. You could try trimming down the source code to remove things you don't need. Are you loading the .py or the .mpy version? The .mpy version will not require on-board compilation, and that might help. But the SAMD21 boards have issues with larger pieces of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants