Closed mitsake closed 5 years ago
just to check , what version are you running on trinket m0 of circuitpython?
Sorry, should have included that! I'm running 4.1.0.
wanna try 5.0? just in case...
Just upgraded (libraries too), and got the same error I'm afraid.
@caternuson wanna take a stab at this?
Sure, can take a look. @mitsake Can you give me a simple code.py that I can use for testing?
Of course - the following code.py produces the error for me:
import board
import busio
import adafruit_ssd1306
i2c = busio.I2C(board.SCL, board.SDA)
oled = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)
oled.text("Hello world!", 0, 0, 1)
oled.show()
The error can be replicated without the framebuf library:
import os
os.stat('code.py') # can be any file that's present on the drive
As a result, I'm not sure if this issue belongs here, or in the core CircuitPython repo? Apologies if I've put it in the wrong place - this is my first time reporting something!
@mitsake Thanks for the example. @ladyada This might be a core issue?
Adafruit CircuitPython 4.1.0 on 2019-08-02; Adafruit Trinket M0 with samd21e18
>>> import os
>>> os.stat("/font5x8.bin")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: small int overflow
>>>
EDIT 5.0 alpha 4 FWIW:
Adafruit CircuitPython 5.0.0-alpha.4 on 2019-09-15; Adafruit Trinket M0 with samd21e18
>>> import os
>>> os.stat("/font5x8.bin")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: small int overflow
>>>
ahh yeah small non-express boards do not have long int support :( can we work around it somehow?
By the way... also the Feather M0 Adalogger samd21g18 have the same issue. Of course, it's a non-express board.
Could add a try/except? The usage is just a sanity check: https://github.com/adafruit/Adafruit_CircuitPython_framebuf/blob/c22eca93045aa9090b46f075be817f3f0ef32f82/adafruit_framebuf.py#L403-L405 And just give up in the except and hope for the best. If the file is not valid, just let it break elsewhere.
Or is this something worth changing in CP?
yah try/except is probably ok. im not actually sure framebuf/oled will work on a trinket m0 at all :D
can at least get as far as hello world :)
yay looks good
@mitsake Please try the 1.2.1 release when it becomes available: https://github.com/adafruit/Adafruit_CircuitPython_framebuf/releases/tag/1.2.1
Seems to work fine for me! Thanks very much - do I close the issue, or do you?
nice!
I've been working with CircuitPython on a Trinket M0-based board, and I'm currently unable to use text() to write to the screen. I get the following error:
I think the culprit is the file size check added in commit b7c793787afaf6f355cf55a4dd5b1e48fc0656ca.
os.stat()
can return integers larger than non-Express boards support (particularly st_mtime, and friends), which then causes an error when attempting to load the font file.I'm trying to work out an alternative way to determine file size, and if I come across one will try to submit a pull request.