Building with select
impacts ssd1306
initialization on SEEED XIAO SAMD21
#12358
Replies: 9 comments 6 replies
-
At the end of the build log the memory area usage is displayed. What are the figures? |
Beta Was this translation helpful? Give feedback.
-
That does not look critical. I tried to locate where the error code 116 comes from, but did not find it yet. The MP error code go up to 115. When the error happens, was any data transferred to the display? It seems that at least the init data was sent. But from the I2C code I cannot tell where error 116 could be raised. |
Beta Was this translation helpful? Give feedback.
-
The corner is partially cleared, while the bulk of the display has noise in
it. --- I presume that means some data was sent.
…On Sun, Sep 3, 2023 at 10:22 AM Robert Hammelrath ***@***.***> wrote:
That does not look critical. I tried to locate where the error code 116
comes from, but did not find it yet. The MP error code go up to 115. When
the error happens, was any data transferred to the display? It seems that
at least the init data was sent.
—
Reply to this email directly, view it on GitHub
<#12358 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5QPQG5U2X3B3VG75CR3WLXYSOFFANCNFSM6AAAAAA4JLNG3M>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Rick Sorensen
***@***.***
651-470-5511
|
Beta Was this translation helpful? Give feedback.
-
I tried to replicate the situation. I've built the binary with from today's master branch:
I did not have your manifest.py file, so I skipped it. But I copied ssd1306.mpy to the file system, which is empty besides that file. Sitting on a XIAO expansion board, i2c.scan() returns When I tried before to run the script without having it placed on the expansion board (== item at I2C 60), I got error 116. Still no clue when that one is raised. You could try to increase the timeout in samd/machine_i2c.c, line 42. It is set ATM to 100 (ms), assuming that a MICROPY_EVENT_POLL_HOOK call takes at least 1 ms. But even for a timeout, the error code is 110. |
Beta Was this translation helpful? Give feedback.
-
That's another strange topic. The formula for the baud rate setting of the controller is: |
Beta Was this translation helpful? Give feedback.
-
My brain is scattered! I discovered error 116 comes up from ssd1306
initialization if the i2c is not correctly defined- it comes up on a
erroneous write of cmd. In my first case it was during a data write.
```
>> d=ssd1306.SSD1306_I2C(128, 64, i2c, addr=60)
>> d.show()
>> i2c = I2C(0, scl=Pin("A5_D5"), sda=Pin("A4_D4"), freq=400000) #
change i2c from underneath ssd1306 driver
>> i2c.scan()
[60, 81]
>> d.show()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ssd1306.py", line 1, in show
File "ssd1306.py", line 1, in write_cmd
OSError: 116
>> d=ssd1306.SSD1306_I2C(128, 64, i2c, addr=60) # reinitiate display
with updated i2c
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ssd1306.py", line 1, in __init__
File "ssd1306.py", line 1, in __init__
File "ssd1306.py", line 1, in init_display
File "ssd1306.py", line 1, in show
File "ssd1306.py", line 1, in write_data
OSError: 116
>>
```
I am looking into how modules are linked together -- maybe some interplay
between frozen and compiled? Rarely a long shot pays off- but it does
happen.
…On Sun, Sep 3, 2023 at 2:11 PM Robert Hammelrath ***@***.***> wrote:
I played with setting Frequency and HW I2C
That's another strange topic. The formula for the baud rate setting of the
controller is:
baud = peripheral_freq / (2 * baudrate) - 5 - (rise_time *
peripheral_freq) / 2
with peripheral_freq=48MHz, risetime = 200ns.
So there is value change for baud between 393_442 and 393_553, and 400_000
and 400_001, when integer arithmetic is used. But there is not reason why
just the value for 400_000, which is 51, should not work, but 50 and 52 do.
And why that depends on the select module being present or not.
Still unclear as well, why error 116 pops up.
Single-stepping through the code reveals nothing unexpected.
—
Reply to this email directly, view it on GitHub
<#12358 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5QPQF7Q7YZEUOIWIMFTL3XYTI6ZANCNFSM6AAAAAA4JLNG3M>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Rick Sorensen
***@***.***
651-470-5511
|
Beta Was this translation helpful? Give feedback.
-
Yes I've seen that error 116 comes up if i2c is not properly defined or no I2C peripheral is connected. Only: I do not see in the code how this error number is set. The samd/machine_i2c only uses the error numbers 5, 19 and 110. |
Beta Was this translation helpful? Give feedback.
-
That would be surprising. And not explain the behavior with varying baud rates. |
Beta Was this translation helpful? Give feedback.
-
I had tested the signals with an logic analyzer as well and found them perfect. Looking at them with an oscilloscope shows a slight overshoot of 900mV max, 100MHz, ~2 cycles, at the falling edge. But that is probably caused by using a standard GND clip at the probe. I see that all the time, and it does not affect the operation. The rising edge looks perfect. It's slope is slow. |
Beta Was this translation helpful? Give feedback.
-
I have an exception (memory/timeout) showing up when I include
select
andssd1306
in the build with the current (pre 1.21, 20230902) code. The V1.20 version works fine for my full example, but running with the new build fails when I include bothselect
andssd1306
. Note thatframebuf
is necessary, so I needed to change the code memory size. For V1.20.0 and earlier I used a custom link loader specification. For current version I used the codesize setting.Test board:
SEEED XIAO SAMD21 using the SEEED XIAO Expansion board with OLED and other devices
The test code in
testit.py
and the
manifest.py
is:I have included results using:
v1.20.0
withselect
andssd1306
: works20230902
master withselect
andssd1306
: gives exception on instantiation of ssd130620230902
master withoutselect
and withssd1306
: worksI am not particularly knowledgable about
select
and had been using it in this case to have a non-blocking poll of keyboard for demonstration code for the XIAO Expansion board. My demonstration code ran fine for multiple XIAO form processors at V1.20.0 and I am just now checking the newer builds with this code.Here details on builds and results:
Using version 1.20.0 I get (dumpinfo is just a script to ... dump info). This was built with:
results:
Using
master
code from 20230902 1700 CDT (-5) (approx!) usingselect
built with:results:
Using
master
code from 20230902 1700 CDT (-5) (approx!) withoutselect
built with:results:
Beta Was this translation helpful? Give feedback.
All reactions