Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

QT PY, DPS310, Haxpress
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

QT PY, DPS310, Haxpress

by dashworth on Thu Oct 08, 2020 8:01 pm

Hardware: QT PY, flash soldered on back (now working), Adafruit DPS310.

The below code.py will work with non - haxpress circuitpython loaded on the qt py. Of course, the flash chip isn't available.

If I load the haxpress version of circuitpython (adafruit-circuitpython-qtpy_m0_haxpress-en_US-6.0.0-beta.2), the flash chip is available, but the same code below gives a memory allocation error.

Is this because the haxpress circuitpython takes up most/more RAM and the code.py (and necessary modules) don't have enough?
Do you anticipate a "leaner" qtpy_m0_haxpress circuitpython in the future?




import time
import board
import busio
import adafruit_dps310

i2c = busio.I2C(board.SCL, board.SDA)

dps310 = adafruit_dps310.DPS310(i2c)

while True:
print("Temperature = %.2f *C" %dps310.temperature)
print("Pressure = %.2f hPa" %dps310.pressure)
print("")
time.sleep(1.0)


lib folder:
adafruit_bus_device folder
adafruit_register
adafruit_dps310.mpy

Adafruit CircuitPython 6.0.0-beta.2 on 2020-10-05; Adafruit QT Py M0 Haxpress with samd21e18
>>>
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 5, in <module>
File "adafruit_dps310.py", line 172, in <module>
File "adafruit_dps310.py", line 418, in DPS310
MemoryError: memory allocation failed, allocating 376 bytes



Press any key to enter the REPL. Use CTRL-D to reload.

dashworth
 
Posts: 20
Joined: Fri Oct 02, 2020 5:36 pm

Re: QT PY, DPS310, Haxpress

by kattni on Tue Oct 13, 2020 11:25 am

You are correct - it appears this library will not work on the QT Py, Haxpress or otherwise. I was able to replicate your results by simply importing the library without any other code. So it's entirely an issue with memory needs of the library exceeding the available memory. The CircuitPython build is as lean as it can be - there's nothing extraneous built in. We have been running into the limitations of the SAMD21 (M0) microprocessor for quite some time. We have simply begun to exceed it's capabilities.

Have you filed an issue on GitHub before? I would suggest filing an issue on the DPS310 CircuitPython repository on GitHub (https://github.com/adafruit/Adafruit_Ci ... 310/issues). Explain the situation. It's possible that we can refactor the library to be more memory efficient and resolve the issue that way. It is also possible that this library simply won't run on SAMD21. I haven't dug into it enough to know, but it's always worth filing an issue so we can look into it.

Hope this helps.
~ Kattni

kattni
 
Posts: 78
Joined: Fri Aug 18, 2017 6:33 pm

Re: QT PY, DPS310, Haxpress

by dashworth on Tue Oct 13, 2020 11:40 am

kattni wrote:You are correct - it appears this library will not work on the QT Py, Haxpress or otherwise. I was able to replicate your results by simply importing the library without any other code. So it's entirely an issue with memory needs of the library exceeding the available memory. The CircuitPython build is as lean as it can be - there's nothing extraneous built in. We have been running into the limitations of the SAMD21 (M0) microprocessor for quite some time. We have simply begun to exceed it's capabilities.

Have you filed an issue on GitHub before? I would suggest filing an issue on the DPS310 CircuitPython repository on GitHub (https://github.com/adafruit/Adafruit_Ci ... 310/issues). Explain the situation. It's possible that we can refactor the library to be more memory efficient and resolve the issue that way. It is also possible that this library simply won't run on SAMD21. I haven't dug into it enough to know, but it's always worth filing an issue so we can look into it.

Hope this helps.
~ Kattni



Thanks for your research and response.

I decided to abort using CircuitPython on the QT PY and went back to arduino. Now have multiple sensors, oled, and RTC working.

Dennis

dashworth
 
Posts: 20
Joined: Fri Oct 02, 2020 5:36 pm

Please be positive and constructive with your questions and comments.