#circuitpython-dev

1 messages ยท Page 250 of 1

tidal kiln
#

you can type commands in REPL and get stuff to happen - like an LED turns on and stays on

#

those same lines in a file do not

#

without somekind of parking loop at the end

simple pulsar
#

yes, it's not intuitive to a beginner

tidal kiln
#

but hopefully easy to explain, and thus the guide update

#

and can always update and improve as we go

obsidian dome
#

I have a possible bug. Does anyone have a Feather M0 running Adafruit CircuitPython 4.0.1 on 2019-05-22 they could check something for me?

#

it seems to be an error with importing adafruit_ssd1306

#

If so try the following code: ```import board
import busio
import digitalio
import adafruit_ssd1306 # bad if done here

btns = list()
for inp in [board.A3, board.A4, board.A5]:
da_btn = digitalio.DigitalInOut(inp)
da_btn.switch_to_input(digitalio.Pull.UP)
btns.append(da_btn)

import adafruit_ssd1306 # fine if done here

i2c = busio.I2C(board.SCL, board.SDA)
oled = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)

oled.fill(0)
oled.text('Hello', 5, 0, 1)
oled.text('World', 5, 10, 1)
oled.show()

old = [x.value for x in btns]

while True:
for i in range(len(btns)):
v = btns[i].value
if v != old[i]:
print('%d %s becomes %s' % (i, old[i], btns[i].value))
oled.pixel(1, i*10, not v)
oled.show()
old[i] = v```

#

Line 4 vs line 12 being commented seems to toggle an error. line 4 will result in :main.py output: Traceback (most recent call last): File "main.py", line 4, in <module> File "adafruit_ssd1306.py", line 38, in <module> File "adafruit_framebuf.py", line 342, in <module> MemoryError: memory allocation failed, allocating 136 bytes

#

Seems odd since my perusal of adafruit_freambuf.py does not seem to have 342 lines.

#

Though I am using the .mpy version downloaded tonight.

#

If someone can reproduce, I will file a bug

tidal kiln
#
Adafruit CircuitPython 4.0.1 on 2019-05-22; Adafruit Metro M0 Express with samd21g18
>>> 
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 4, in <module>
  File "adafruit_ssd1306.py", line 38, in <module>
  File "adafruit_framebuf.py", line 342, in <module>
MemoryError: memory allocation failed, allocating 136 bytes
#

might not be a bug, but just the limited space on the M0

obsidian dome
#

ok, it's legit.

tidal kiln
#

if it's a bug, it'd happen on M4 as well

obsidian dome
#

try with the line 4 commented out and line 12 uncommented

#

I ran it with 'import gc' and had about 2K space free when using line 12 instead of line 4

#

Never got past line 4 to print the gc output otherwise.

tidal kiln
#

yah, i get past it if i comment/uncomment

#
Adafruit CircuitPython 4.0.1 on 2019-05-22; Adafruit Metro M0 Express with samd21g18
>>> 
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 14, in <module>
RuntimeError: SDA or SCL needs a pull up
#

don't have anything wired up, so hit the I2C pull up issue

obsidian dome
#

if i insert this: ```import gc
print(gc.mem_free()) # this fixes it

tidal kiln
#

could do a gc.collect() also

manic glacierBOT
#

There seems to be an issue with adafruit_framebuf.py (perhaps in conjunction with adafruit_ssd1306.py) in some circumstances.

This is observed when running

Adafruit CircuitPython 4.0.1 on 2019-05-22; Adafruit Feather M0 Express with samd21g18

and using libraries from the 4.0 bundle downloaded today the following behavior is observed:

In the code below line 4 and 12 are identical. Which one is uncommented determines which behavior is seen.

import board
import busio
...
obsidian dome
#

This is going to be a tough one to track, as all my attempts to instrument the code to find out what is happening cause the problem to move / evaporate.

manic glacierBOT
tough flax
#

Hi folks - right now, what's the recommended solution for a simple CircuitPython board with WiFi support? Feather M4 + Airlift Wing? Metro M4 Airlift? Is there a board (like the M0+WiFi) that has wifi built in in a Feather Form factor? I don't think the ESP32 runs CP right?

manic glacierBOT
#

If you have enough experience with the memory management system to assert this, then I bow to your expertise.

Question: Give that adafruit_framebuf.py has 148 lines, how is the following happening:

... File "adafruit_framebuf.py", line 342, in ...

The things that make me scratch my head include:

  1. Calling gc.mem_free() shows at least 2K free once code starts executing. (ok so free might not be contiguous)
  2. Calling gc.collect() doesn't change anything. Grated, for some me...
manic glacierBOT
crimson ferry
#

@tough flax I think you hit the two main strategies that are currently available and fully supported by Adafruit. You can substitute an ItsyBitsy M4 (or any Adafruit M4 board) for the Feather M4. And you can substitute an Airlift Breakout or an ESP32 Breakout or even an ESP32 Feather (no stacking onto a Feather M4 though). There are some supported 3rd-party M4 boards out there: https://circuitpython.org/downloads There's no CP to run directly on an ESP32, just the NINA firmware that acts as a co-processor.

#

There is a 3rd-party single-board M4+ESP32 out there,https://circuitpython.org/board/sam32/ (I have no experience with this one) I can't find it for sale, but it's open source hardware afaict.

tidal kiln
#

@tough flax In general - something that uses ESP32 as a SPI peripheral. Starting with 4.x, there won't be CP builds for ESP.

ESP8266 is no longer supported. With 4.x we've chosen to focus on microcontrollers with built-in USB to ensure a consistent CircuitPython experience across all boards we support.
pastel panther
#

@idle owl @slender iron do either of you know how easy or not it is to use cookiecutter for non-python projects? I have arduino in mind

slender iron
#

I imagine it'd be easy. it just generates files

pastel panther
#

I was mainly wondering if the templating works well for non-python stuff, so I could sub-in class names, etc

modest atlas
#

Hello gang

#

I was going over Dave's guild on his trinket m0 hack

#

Is there a list of flash IC's that will work with this mod

#

Does any one k ow if the AT25SF041 4mb serial flash 8-soic will work the same way

stuck elbow
slender iron
#

it almost works perfectly except with the quotes demo which leaves some pixels unchanged

tired cloak
#

I've got what may be a weird question... is there a way to write error messages to SD card? My PyPortal sometimes hangs but with the display frozen not on the REPL. TIA! -z

pastel panther
tired cloak
#

Yes, the REPL errors. For some reason, after running it connected to a PC for multiple days it didn't hang, but moving it just out of reach (by like 10 feet) and it hangs, but I can't see why.

#

I may look into adding serial/sd output to try to identify where it is hanging, but I suspect it is a weird internet connectivity issue. (Also running one of the AdaBox 011 examples, so I doubt it is the code.)

manic glacierBOT
#

Hi,

I'm interested in audio applications using the nRF52840, as far as i know there is no support (yet) for the I2S peripheral on this device.

I did a very basic research and i think i know the big picture on how to add support for this and i would like to know if I am on the right track or if there is work already done in this regard, so i won't duplicate it.

So the nRF hal is based on nrfx which already have support for the I2S peripheral. I should implement I2SOut.h and `I2SOut....

orchid basinBOT
manic glacierBOT
#

@C47D #1035 already has this as a goal.

I did a very basic research and i think i know the big picture on how to add support for this and i would like to know if I am on the right track or if there is work already done in this regard, so i won't duplicate it.

I don't know of anyone working on it at the moment. I have PDMIn started, but its kind of stalled as of late. I will throw this out though: AudioOut also isn't done yet on the nRF52, which has proved a bit of a barrier to ver...

manic glacierBOT
#

Add pygamer's pin to support SD card

Ref: forums post

Code used to test:

import sys
import os
import adafruit_sdcard
import board
import busio
import digitalio
import storage

# Connect to the card and mount the filesystem.
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs,...
manic glacierBOT
manic glacierBOT
#

Hi,

Here's the ongoing work for the support of I2S on nRF targets, i do have a Feather nRF52840 express, so i'm planning to test with it (i haven't looked if i have i2s pins available on the breakout pins).

I am still new to CP codebase so if you see anything wrong don't hesitate on letting me know, that is why i rather have this PR publically available and not in a local machine.

Regards,

  • Carlos
idle owl
#

<@&356864093652516868> Here is the notes doc for Monday's CircuitPython Weekly 11amPT/2pmET. Everyone is welcome! Please add your hug reports and status updates, even if you'll be attending the meeting - it's super helpful! If you're going to miss the meeting, feel free to add your notes as well and I'll read them off as we get to them. Thanks! https://docs.google.com/document/d/1E9pEBg_u_hkA36JRgLDmqVWBWV5UJeNeyQ0wacl1R8E/edit?usp=sharing

manic glacierBOT
umbral dagger
manic glacierBOT
#

Hi,

I did a simple loop test in python to compare to my STM32F4 based MicroPython board and the results are quite unexpected. CircuitPython is 16x than MicroPython slower for equivalent CPU frequency.

Details available here:
https://forums.adafruit.com/viewtopic.php?f=60&t=152372&p=753830#p753830

Test code:

def test():
    s = time.monotonic
    count = 0
    r = range(0, 10000000)

    startTime = s()
    for count in r:
        pass
    endTime = s()

    du...
bronze geyser
#

I expected NOT to get an import error for ustruct? : >>> import ustruct Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: no module named 'ustruct' Adafruit CircuitPython 4.0.1 on 2019-05-22; Adafruit ItsyBitsy M0 Express with samd21g18

raven canopy
#

@bronze geyser we changed ustruct to just struct.

bronze geyser
#

@raven canopy ah - thank you. There seems to be learning docs and docs in general that have ustruct.

raven canopy
#

yeah, guides may be outdated. if you come across one, please submit feedback on the guide. the libraries have all been updated to at least try both ways, for backwards compatibility.

bronze geyser
raven canopy
#

yeah, there's the fallback for ustruct:

try:
    import struct
except ImportError:
    import ustruct as struct

it first tries struct, and if that fails it assumes 3.x and then attempts to import ustruct

manic glacierBOT
#

Hi,

Thanks for your patience, I did a quick debug session for this and noticed a couple of things:

  • The common_hal_pulseio_pwmout_set_duty_cycle breakpoint is hit and then i continue but the LED takes a little while to lit or sometimes i doesn't lit at all, at the end of the attached log there's an example self=0x20001ca8 <rgb_status_r>, duty=12336) but the red LED remains off.
    Is this somewhat expected?

  • When the common_hal_pulseio_pwmout_set_duty_cycle breakpoint is hit...

obsidian dome
#

I just had a pull request build fail. It says the build failed, but it isn't clear to me what about the build failed.

#

Can someone point me to the clue?

#

OK, it looks like a missing docstring. Fixed that.

#

Will the CI run again or is the pull request dead now?

tidal kiln
#

it will run again when you push the commits

obsidian dome
#

Should a FeatherM4 get hot when driving a Feather Oled? Something between the battery connector, NeoPixel and M4 is getting really hot (as in too hot to touch). If I disconnect the oled, it doesn't happen. I don't know enough about the

#

board layout to understand what it might be.

main meteor
#

No, it shouldn't get hot.

tulip sleet
#

@obsidian dome Could you start a forum thread about this, with a photo of the boards showing your soldering? Describe how you're connecting the board. That will help our hardware support people help you.

obsidian dome
#

Will do.

obsidian dome
#

Has anyone gotten the ssd1306 to scroll? Reading https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf i see it can do it. I have been able to make it happen a couple times, but not reliably. Given that I2C can get painfully slow, I was hoping to off-load some of the display animation to the ssd1306 itself.

manic glacierBOT
novel sail
#

How do I make this for an rgbw neopixel?

manic glacierBOT
idle owl
#

<@&356864093652516868> Here's the notes doc for today's CircuitPython Weekly. Everyone is welcome! Please add your hug reports and status updates to the doc even if you'll be attending. If you're not attending, you can still add your updates and I will read them off as I get to them. Meeting is today at 11amPT/2pmET. Talk to you soon! https://docs.google.com/document/d/1E9pEBg_u_hkA36JRgLDmqVWBWV5UJeNeyQ0wacl1R8E/edit?usp=sharing

umbral dagger
#

@gilded cradle The name badge running on the PyBadge was great at the conference. I was constantly getting asked about it.

gilded cradle
#

That's awesome Dave

#

Do you have a video of your presentation?

umbral dagger
#

No, they didn't record them. It's a small (700 attendees) regional conference with a tight budget. They're looking into recording for the future. It's too bad, there were some really good talks. Many were hyper-regional, but there were plenty of general ones.

gilded cradle
#

Aww, well I'm glad it was such a big hit.

obsidian dome
#

I see that the adafruit_ssd1306 is using the (older) framebuffer instead of (newer) displayio. Is anyone looking at switching it over?

gilded cradle
#

Yeah, we were waiting until CircuitPython 4.0 stable was released and now that it has been, we can start looking at adding monochrome and eInk displays soon.

modern wing
#

Good afternoon folks -- finally able to make the call live, and I'll be lurking due to background noise adabot

#

๐Ÿ‘‹

minor plume
#

I'm mostly lurking in the live chat because I'm at work (on my lunch break, but still...) Nit O

#

But I made it!

idle owl
#

<@&356864093652516868> Meeting starts in a couple of minutes!

slender iron
tidal kiln
#

lurking ๐Ÿ•ต

sterile bronze
#

lurking

modern wing
#

"We're going to drive this back-end loader through the property. I'd be a shame if that house got in the way."

turbid radish
#

Lurking today

inland tusk
#

crunched the flora and fauna completely

neat folio
#

lurking (distracted by rl ๐Ÿ˜ฆ )

prime flower
modern wing
#

Thanks ๐Ÿ˜ƒ

pastel panther
#

@minor plume If you want you can post any hug reports or updates here (@ me) and @idle owl can read them

minor plume
idle owl
minor plume
#

I also want to get more involved with contributing to Circuit Python, but I found out this morning I need to get the okay from my employer's Legal team first. ๐Ÿ™ Hoping to get that this week.

pastel panther
#

@minor plume Did you want that included in the notes?

slender iron
#

@minor plume thank for checking that first

minor plume
#

@pastel panther The hug report can be. The other I'd rather not have in the notes.

pastel panther
#

OK!, no problemo

raven canopy
#

๐ŸฅŠ

solar whale
#

so - is clock streching OK -- just an issue with MCP9600?

tulip sleet
pastel panther
#

(i bad ad tyuping)

neat folio
#

"EVERYONE IS awersome!" ๐Ÿ˜‰ (yes awersome)

raven canopy
#

i've been meaning to dig deeper into the stubs. scanned the PEP, but just barely.

slender iron
#

welcome!

modern wing
#

+1 for the quad featherwing kits. They're earmarked for my next order.

minor plume
#

Updates: I'm designing a CircuitPython/Maxbotix LV-EZ4 sensor for my car to avoid running into the wall when I'm parking at home, because I have bad depth perception. I'm also getting my first 3D printer this week, which I'm very excited about.

obsidian dome
#

@minor plume I would love to hear more about your sensor for parking!

slender iron
#

me too!

minor plume
#

@obsidian dome I'm planning to blog about it and also do a project writeup on github when it's done.

raven canopy
#

put me down as a third! ๐Ÿ™Œ 3โƒฃ

minor plume
obsidian dome
#

Where do you blog? I've got a number of projects I would like to shar and I am looking for how to best do this.

minor plume
#

Right now my blog is on Wordpress, but I'm trying to get Jekyll set up and migrate it this week/weekend.

#

(My Wordpress site also hasn't been updated in a year, which I'm trying to fix.)

neat folio
#

:badger:

pastel panther
#

๐Ÿ„ ๐Ÿ„

raven canopy
#

"ohhh! its a snake!" blinka

modern wing
#

Also lurking ๐Ÿ˜ƒ

idle owl
#

๐Ÿ˜Š

neat folio
#

statusssss update = <-- progresssss + distractions -----> ๐Ÿ˜ฎ

pastel panther
#

ADD-A-adabot

pastel panther
#

@raven canopy dem's some sweet logs

#

@minor plume mangled the notes that @idle owl read, sorry ๐Ÿ˜ฆ

gilded cradle
#

Nice! I'm getting my 3rd 3D printer this week.

minor plume
#

@pastel panther No worries, thanks for trying. ๐Ÿ˜ƒ

#

@gilded cradle What are you getting? I'm getting a Creality Ender 5. Seemed a reasonable place to start...

gilded cradle
#

I'm getting a Prusa MK3S.

minor plume
#

Nice!

neat folio
gilded cradle
#

Thanks

modern wing
#

@gilded cradle What are your other printers?

gilded cradle
#

A Creality Ender 3 and a Custom one based on the MendelMax that I built and upgraded multiple times.

modern wing
#

Nice ๐Ÿ˜ƒ I have a Prusa Mk2S -- pretty solid. I want to get the multi-material upgrade eventually.....

gilded cradle
#

Yeah, I was eyeballing that

main meteor
#

I started with a Mini Delta, eyeing the Prลฏลกa i3 Mk3S as a next step.

slender iron
#

@obsidian dome are you using a monochrome screen?

gilded cradle
#

yeah, ssd1306 is monochrome

slender iron
#

kk, we'll get to that in the weeds

obsidian dome
#

@slender iron Yes. It's pn 2900

#

@slender iron 128x32

inland tusk
#

In-the-weeds How to poll the interupt pins on the MCP23017?

slender iron
#

k displayio only supports 16bit screens now

raven canopy
inland tusk
#

@raven canopy thanks Iwill look into that. But I need to for more than one chip.

raven canopy
#

you're very welcome, charles!

modern wing
#

Thank you all ๐Ÿ˜ƒ

neat folio
#

has anyone done the solenoid drum kit in circuitpython?

minor plume
#

Thank you, all! I'll try to not be text-only next time.

slender iron
#

thanks!

gilded cradle
#

Thanks everyone

turbid radish
#

Thanks Kattni!

pastel panther
#

thanks everyone!

modern wing
#

I'm going to bounce, ya'll have a good one ๐ŸŒ‡

solar whale
#

Have a great week -- off to the farmers market ๐Ÿ˜€

obsidian dome
#

@minor plume Are you planning on putting the LV-EZ4 on the car or on the garage? If the car, then where is your readout? On the garage wall I could see creating a light that displays how close you are to ideal position.

neat folio
#

if it was a function of the garagewall, would work for any vehicle parking there... ๐Ÿ˜ฎ

main meteor
minor plume
#

@obsidian dome On the car. Sensor on the license plate frame to a display inside the car, is my current thought. But we'll see.

#

I don't have a garage where I live. My parking space is against the side of the house.

neat folio
#

ah, silver lining... if function of vehicle, works for any parking location ๐Ÿ˜‰

minor plume
#

Yup.

neat folio
#

if you use a 1 meter neopixel strip as your indicator, it could be a one-to-one display of distance to object ๐Ÿ˜ฎ

obsidian dome
#

My concern becomes dirt and debris smacking it while driving. That could take it out fast. Need an appropriate cover.

minor plume
#

Version 1 I'll run a wire from the sensor to the display. Version 2 I'd like to use BLE, but will see.

#

And making a cover is part of the reason I bought a 3-D printer. That will be one of my first projects, I think.

obsidian dome
#

rain?

main meteor
minor plume
#

It doesn't rain often here, but yeah, need to figure out how to waterproof the sensor.

obsidian dome
#

I know a lot of cars have some sort of range sensor in the rear bumpers these days. I wonder what they use.

minor plume
#

I wonder if there's a laser sensor I could use for V2? Those would be easier to waterproof, I'd think.

obsidian dome
#

And you could turn up the voltage to "vaporize obstacle" ๐Ÿ˜‰

minor plume
#

Ha!

#

I wish.

main meteor
#

Some are ultrasonic, some are radar.

neat folio
slender iron
neat folio
#

I "always" have problems with permissions(?) with downloaded files... (I'm a proud tinfoilhat wearer, and usually have security jacked way higher than it needs to be, and suffer the side-effects) ... could the MacOS be "being helpful" in the background on the files created by the downloaded files? (which it seems ran OK)

#

just a conspiracy theory, I'm a PC user mostly, know just enuf to ask silly questions

tidal kiln
slender iron
#

or circuitpy serial apparently

tulip sleet
#

we have also seen CIRCUITPY fail to appear when certain MacOS RAID drivers are installed

#

if they've installed software for a third-party external drive it might interfere

#

also make sure they're running latest Mu

#

@tidal kiln ^^

tidal kiln
#

@slender iron probably easiest is to suggest they try another, preferably non-mac, computer and see what happens

slender iron
#

kk, will reply

#

thanks!

tidal kiln
#

np. if it starts looking like what @tulip sleet is suggesting, then he's more knowledgeable about that stuff than i am

slender iron
#

yup, on it

lone sandalBOT
manic glacierBOT
idle owl
#

@tulip sleet Regarding sorting which board and therefore what things to init etc, what about using if hasattr(board, 'ACCELEROMETER_INTERRUPT'):? It looks like both PyBadge (nonLC) and PyGamer both have it, and presumably PyBadgeLC would not.

#

Haven't loaded the LC firmware yet to test

tulip sleet
#

@idle owl, that's one way, but os.uname() will give you the actual name of the board. If you're looking for functionality, testing pins is good. If you're looking for "is it this board", then I'd use uname

idle owl
#

ok thanks

tulip sleet
#

`os.uname[1] or [2] or something, not sure which

manic glacierBOT
manic glacierBOT
raven canopy
manic glacierBOT
#

I did some research on this. I looked at the stm32 port settings in MicroPython. In our ports, we use MICROPY_VM_HOOK_LOOP and MICROPY_VM_HOOK_RETURN to call run_background_tasks()` very frequently. This happens after every jump opcode and every return. We do this to service USB background tasks that need to use polling instead of interrupts.

If do not define the HOOK macros to call run_background_tasks() , your timingtest and a similar one done with explicit increment and test cod...

manic glacierBOT
#

Thanks Dan! Interesting findings! "This happens after every jump opcode and every return" looks pretty scary :)

so everything happens here, ans especially usb_background(), right?

// aka MICROPY_VM_HOOK_LOOP and MICROPY_VM_HOOK_RETURN

void run_background_tasks(void) {
    // Don't call ourselves recursively.
    if (running_background_tasks) {
        return;
    }
    assert_heap_ok();
    running_background_tasks = true;

    #if (defined(SAMD21) && defined(PIN_PA02)...
manic glacierBOT
#

Further testing: I have turned on MICROPY_OPT_COMPUTED_GOTO which is a performance enhancement in the VM interpreter (adds about 1700 bytes ti firmware). This further speeds up the basic timing loop by a factor of 5. Together these seem to account for pretty much all the speed differences.

The basic test I am using (to avoid any issues about how range() is implemented:

import time
def test():
    i = 100000
    startTime = time.monotonic()
    while i > 0:
        i -= 1
  ...
idle owl
#

@tulip sleet You said I could load the LC firmware on the non-LC PyBadge? Did I misunderstand that?

tulip sleet
#

yes, exactly

idle owl
#

I can't find the build. I only see PyBadge.

tulip sleet
#

have to build it by hand, hold on

#

... we don't have a board def yet, only a bootloader for LC

idle owl
#

@tulip sleet Ah. That would explain it.

manic glacierBOT
gilded cradle
#

@tulip sleet @idle owl Regarding the PyBadge LC, I think it uses the same firmware as the PyBadge. I noticed a resistor in the product photos for the neopixels that isn't present on the full PyBadge and I believe the purpose of that is to set the middle neopixel as neopixel 0.

tulip sleet
#

@idle owl @gilded cradle MakeCode folks are using the board info in the bootloader to determine what's on the board. They store board-specific info (what kind of joystick, light sensors, etc.) in the Arcade bootloaders. We don't have ready access to that without adding some C code to CPy.

gilded cradle
#

Ok, that makes sense about it being a different bootloader.

idle owl
#

Hmm. Checking for button presses only works with a delay, otherwise it returns 0 more than half the time even if something is pressed

gilded cradle
#

Yeah, I had to put in a delay as well. I think the way it was designed was to give you it's last state, but it doesn't seem to maintain that state and instead clears the state when reading.

idle owl
#

Bleh ok. Hmm.

gilded cradle
#

Maybe it might be worth filing as a bug?

idle owl
#

Possibly

gilded cradle
#

I think @stuck elbow wrote it. I just don't know if that was the intended behavior.

manic glacierBOT
idle owl
#

At least we could find out if if was intentional.

gilded cradle
#

Yeah

idle owl
#

Had a message fail to send: If you want to file an issue, that would work.

gilded cradle
#

Ok

manic glacierBOT
#

One of the things that I found while working with GamePadShift is that reading it too fast will sometimes return 0 even if there are buttons pressed. I believe this is because it shifts the bits out when it is read and doesn't maintain state. I'm not sure if this was the intended behavior or just a result of a fast CPU reading faster than the shift register is reading the buttons. I think it would be useful to maintain the state after reading the buttons so subsequent reads don't show up as n...

slender iron
#

@tulip sleet nice job on the performance stuff!

manic glacierBOT
#

It's not a bug, this is how it is supposed to work, and how it is documented. Reading the buttons state clears the buffer, and it will remain empty until new button presses are registered. This is shouldn't be a problem in any normal application, as the buttons are being read every 30ms or so, and no human is able to see that.
I suppose it can be surprising if you read the button state in a tight loop more than once per frame, but why would you ever need to do that?

#

It's a sparse WIP. I can create a quick repo and push the code if you want it. It's designed to work on PyGamer/PyBadge, though only tested on gamer so far.

I'm writing a library that's meant to be designed like the Circuit Playground Express cpx library - a general purpose wrapper library that makes all the functionality of the boards available in one place. The first thing I did to test the button code was the equivalent of print(pybadger.get_pressed()) in a while True: loop. It d...

tulip sleet
#

@slender iron (thanks for above) I'm submitting the MICROPY_OPT_COMPUTED_GOTO PR against master, but would you want it against 4.0.x instead? (Prob not). If 4.0.x, I'll be doing another PR to pull in the latest 4.0.x changes, because I need some of them to shrink a few more builds properly.

slender iron
#

@tulip sleet I think master. we should do 4.1.0 soon

#

it sped up celeste load times from 5+ seconds to under 2 ๐Ÿ˜ƒ

tulip sleet
#

woot! how about game play?

slender iron
#

I was thinking we should do the audio mixer stuff with 5.x too

#

some of it is now too fast ๐Ÿ˜ƒ

tulip sleet
#

lol. Also, we could tighten up the background task stuff and achieve I think maybe 2x there (3x is if it's not present at all). We call some of the background tasks only at certain intervals, but I'm not sure what intervals we can tolerate. E.g. have to ask Thach what the tusb task max interval is. Also should inline some of that if possible

slender iron
#

ya, agree there is room to improve that too

manic glacierBOT
marble hornet
#

I figured it had to do dynamic rescaling and sizing of apps!

manic glacierBOT
slender iron
#

@tulip sleet are you fixing the broken builds for the speedup?

tulip sleet
#

yes, on the phone but will start again in a few

slender iron
#

kk, just didn't see anything going by

tulip sleet
#

@slender iron, starting another batch of builds I think will partially fail. will ping you when ready

slender iron
#

kk, I'm having space issues in m0 builds too

tulip sleet
#

do you have a PR in the pipelin?

#

i mean, do you have a PR you need to get in for the beta

slender iron
#

ya, the partial updates

tulip sleet
#

excellent

slender iron
#

fixes three issues ๐Ÿ˜ƒ

tulip sleet
#

[:bowling pin:] * 3

slender iron
#

@tulip sleet what do you think about disabling gc optimization instead of your vm one?

tulip sleet
#

to make things fit? I shrunk stuff a lot so once this PR works you may have an easier time

#

did you test the diff? (time and space)

slender iron
#

space was over 1k free on hallowing

#

didn't test speed

#

but I'd take slow memory over slow vm

tulip sleet
#

yah

# optimising gc for speed; 5ms down to 4ms on pybv2
$(PY_BUILD)/gc.o: CFLAGS += $(CSUPEROPT)
slender iron
#

ya, I commented it out

tulip sleet
#

could try -O2

slender iron
#

but we could do it for m0 only

tulip sleet
#

yes, definitely, not sure how much time we're losing by pruning the inlines lower and lower

#

But I think the VM improvement would swamp that

#

so hallowing m0 is the stumbling block now with your new code?

#

I can fiddle with that while the build is going

slender iron
#

one of the worst

#

I'm looking into function inlining to figure out why that knob wins us back space. also tried one lto partition and only got a 100s of bytes back

tulip sleet
#

well, any function that's called twice or more but is smaller than the threshold will get inlined. is that what you mean?

slender iron
#

I'm looking to see what functions those are

tulip sleet
#

all functions called only once will get inlined, I think

slender iron
#

so we could mark some noinline directly

tulip sleet
#

i have a script for that, I think. I'll look

#
#!/bin/bash
arm-none-eabi-nm --print-size --size-sort --reverse-sort --radix=d $1

named elf-function-size

slender iron
#

what does it do?

tulip sleet
#

feed it an elf file, it prints out the size of all functions (and other sized things)

slender iron
#

but not which ones were inlined right?

#

I'm having gcc output a cgraph file

tulip sleet
#

right

#

i used it to find very big functions and see why they were so big and did I need them

#

it actually might not skip the inline ones, because it incldues all the lto symbol names

slender iron
#

hrm

tulip sleet
#
00057288 00000036 T mp_sys_exit.lto_priv.1727
00081792 00000036 T mp_stream_close
00111340 00000036 T mp_obj_get_float
00075988 00000036 T mp_math_radians.lto_priv.1314
00075952 00000036 T mp_math_degrees.lto_priv.1315
#

etc

#

i wonder if they're there for debugging or whether that info is elsewhere in some -g table

#
00110528 00000032 T mp_obj_len
00100796 00000032 t mp_obj_is_float.lto_priv.1555
00100796 00000032 T mp_obj_is_float.lto_priv.1554.lto_priv.1746
00100796 00000032 T mp_obj_is_float.lto_priv.1553.lto_priv.1755
00100796 00000032 T mp_obj_is_float.lto_priv.1552.lto_priv.1756
00100796 00000032 T mp_obj_is_float.lto_priv.1551.lto_priv.1759
#

also, unrelated to this, we might want to be grabby in travis and start splitting up into 7 or 8 jobs instead of 5

main meteor
#

I used to use nm for that.

slender iron
#

I think I'd rather try and optimize the build

#

00037900 00000632 t mcu_processor_get_temperature

tulip sleet
#

@slender iron ok, the VM opt PR is all successful

raven canopy
#

i've been pushing some heuristic methods around in my head to only build what needs to be built. for instance, if a PR has changes to only ports/nrf/*, then there is no need to build samd. but, if changes are in shared-bindings/etc, then a full suite build is needed.

#

obviously, this doesn't speed up any individual builds. which would still be a good goal to have, imo. ๐Ÿ˜„

slender iron
#

the other approach could actually be to share more files between builds

#

have to track flags better then though

raven canopy
#

yeah. if only cacheing propagated across stages... ๐Ÿ˜ฆ travis docs mention uploading to S3, iirc.

slender iron
#

inline limit is such a big stick

tulip sleet
#

we are reaching the limit with the pinyin translation. Basically I turned off nearly all inlining, I think. When the limit is 23 it frees up a tremendous amount of space, which might be a lot of the hri routines

#

the temperature code could use some algebra

#

it's pretty much copy/paste from atmel

slender iron
#
    2667```
#

running now with 23 limit

tulip sleet
#
-fno-inline
Do not expand any functions inline apart from those marked with the always_inline attribute. This is the default when not optimizing.

Single functions can be exempted from inlining by marking them with the noinline attribute.

slender iron
#

with 23 its 2494

tulip sleet
#

the hallowing has longints turned on; I turned it off in the CPX Crickit build, Gemma, and Trinket

#

i turned those off months ago, not recently

slender iron
#

sorry for the slow review @tulip sleet I want to figure out what the inline stuff is doing

tulip sleet
#

np - I thought you were doing that in your own PR.

manic glacierBOT
#

@dhalbert, with the last CircuitPython source code, when I add #define MICROPY_OPT_COMPUTED_GOTO (1) I got this error at compilation time:

In file included from ../../py/vm.c:129:0:
../../py/vmentrytable.h:27:5: error: "__clang__" is not defined, evaluates to 0 [-Werror=undef]
 #if __clang__
     ^~~~~~~~~
../../py/vmentrytable.h:116:5: error: "__clang__" is not defined, evaluates to 0 [-Werror=undef]
 #if __clang__
     ^~~~~~~~~
cc1: all warnings being treated as...
manic glacierBOT
tough flax
#

Anybody up late for some PyPortal debugging?

#

I'm getting this:

Saving data to  /sd/buttons.json
Read 12000 bytes, 16565 remaining
Traceback (most recent call last):
  File "code.py", line 84, in <module>
  File "adafruit_pyportal.py", line 612, in wget
OSError: [Errno 5] Input/output error
OSError: 
#

It creates the file buttons.json in the right place, but it's empty

tough flax
#

Seems it can read from the SD fine but fails on the write() call
I am going to manually load up the SD card with the data I need - I need this to move forward, but down the road, I think there's an issue here

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Using regular -Os instead of -O3 (SUPEROPT) for gc.c saves 2144 bytes.

Using regular -Os instead of -O3 (SUPEROPT) for vm.c only saves 524 bytes.

My inclination is to slow down gc for CIRCUITPY_SMALL_BUILD and/or for the overflowing builds, as you suggested. Then we can dial way back towards normal on CFLAGS_INLINE_LIMIT. I'll work on setting up compilation flags for this.

tulip sleet
#

@slender iron I'm on track with turning off -O3 for gc.c for certain builds. I had to fix a debugging typo that turned off -O3 for vm.c also, which I didn't intend. Oddly, that caused tests/micropython/extreme_exc.py to fail, but only on the native gcc used by travis, which is quite old. It didn't fail on my more recent native gcc.

slender iron
#

@tulip sleet

#

have you tried gcc 9 yet?

#

I'm wondering if it'll speedup lto

#

that does look like the difference between samd and nrf build times

#

doesn't look faster to me. on my arch box a translation is still 17 sec

tulip sleet
#

gcc 9 for arm? No, haven't tried it yet. There's no ARM release yet for that. I tried gcc 8 a while ago, and it was very similar: a trinket build was maybe 100 bytes smaller

#

there should be a new bi-annual ARM release soon, within a few weeks

#

@slender iron &

#

this new stuff I did this morning means the clean builds for pinyin are no longer necessary, so that will speed things up a bit

slender iron
#

ya, arch builds it themselves. will compare size

#

not sure the arm release is very different than upstream

tulip sleet
#

i dont' really expect lto to get much faster: it has to do a lot of work

slender iron
#

alot of the work is loading in large files I think. if they get smaller then it could speed up

#

limiting it to one lto partition is a couple second speed boost and a few hundred bytes I think

tulip sleet
#

@slender iron PR #1934 succeeded; no more teeny inline limits. Smallest is 55.

#

I have to take J to an appt in 15 mins. Will be out for several hours.

slender iron
#

ok, great! will merge in and get my pr sent out

tulip sleet
#

do you still want to try for a beta tonight, or no rush?

slender iron
#

no rush if you are out. we can always say it's coming soon

tulip sleet
#

ok - not sure when I'm back but will be before meeting

slender iron
#

np

manic glacierBOT
slender iron
#

@stuck elbow I'm going to rebase your fix so it goes out in the next stable release

#

(and merge into 4.0.x)

prime flower
#

@tough flax I had a similar issue yesterday with sd write as well, freshly formatted card, wasnt sure if it was my hardware or the code at the time

tough flax
#

Very strange - today, that same device decided to just "disappear" 1/2 the /lib directory contents. It wasn't even connected to a PC

lone sandalBOT
manic glacierBOT
idle owl
#

@slender iron Do you Limor's input on that? I think it was primarily for her use in the end.

slender iron
#

I don't think it's worth it regardless. 800 bytes is a lot for something not used often

idle owl
#

Ok.

slender iron
#

wishing I had stopped it in review

#

it impacts hallowing in particular

idle owl
#

Merged.

slender iron
#

thank you!

idle owl
#

Yep!

slender iron
#

I'm releasing it now

idle owl
#

Right on

manic glacierBOT
#

Different operations to the display tree have different costs. Be
aware of these costs when optimizing your code.

  • Changing tiles indices in a TileGrid will update an area
    covering them all.
  • Changing a palette will refresh every object that references it.
  • Moving a TileGrid will update both where it was and where it moved to.
  • Adding something to a Group will refresh each individual area it
    covers.
  • Removing things from a Group will refresh one area that covers all
    previous loc...
idle owl
#

@slender iron Is there a built in font anywhere in CircuitPython or related stuff? That doesn't require you to have a separate bdf or bin file or whatever else.

slender iron
#

yup! in terminalio

idle owl
#

Oh! Beautiful. Ok. Thanks.

idle owl
#

@tidal kiln Thanks, already got it working ๐Ÿ˜ƒ

idle owl
#

@slender iron Am I seeing right that terminalio.FONT is one size only?

slender iron
#

yup

idle owl
#

Ok, thanks.

slender iron
#

you can scale it in a group though

idle owl
#

Oh

#

Ok

slender iron
#

it'll look chunky

idle owl
#

Fair enough

rose root
#

@tulip sleet i'm here

tulip sleet
#

if you take a look at the CPX schematic, that's a great example.

#

do you have any adafruit samd21 or 51 boards?

rose root
#

I do

tulip sleet
#

any express boards?

rose root
#

Adalogger M0. And I think the Feather BLE.

#

No CPX.

#

the .sch file doesn't name the flash chip. Looking through the tutorials to see if it's said there.

tulip sleet
#

you can get a small version of circuitpython on the adalogger. Microsoft wrote a nicer bootloader that appears as a USB drive, and you just drop files on it. Also it emualtes the arduino bootloader

#

mostly we've ben using the GD25Q16C

rose root
#

Yeah I really like the pulse sensor. It comes out really clean too.

#

If you could move the IR LED (which I think is closer to the center) next to the light sensor, you could do pulse oximetry.

tulip sleet
#

we'll take note of that!

rose root
#

Also, any thoughts on adding a battery charger to the CPX? That was pretty critical for my smartwatch.

tulip sleet
#

reason for no battery charger was that LiPO batteries aren't that great for primary classrooms, because they're dangerous if punctured, bent, etc. So we encourage AA battery holders, etc.

rose root
#

That makes sense. I was debating whether to go with LiPo or coin cell myself.

#

I settled with LiPo somewhat reluctantly, but this year I'm putting the watch in an enclosure so that will make me feel better. I'm teaching high schoolers so I'm a bit more at ease. If these were middle schoolers though, definitely not.

tulip sleet
#

that sounds ok. Coin cells might not last that long.

rose root
#

Yeah. They're a bit smaller than AAA batteries, but I could get some rechargeable ones. Their capacity is a bit of the downside though.

tulip sleet
#

@rose root sorry, distracted by video and a PR. Take a look and see what you think.

rose root
#

No worries. Iโ€™m distracted by Ask An Engineer. Iโ€™ll dig in a bit. I probably wonโ€™t get it running for this year, due to time constraints but Iโ€™m already working on a version for next year anyway. I also want to use this design for college students too. I need a few more sensors. Environmental, UV, etc.

#

Also, whatโ€™s PR? Lol.

tulip sleet
#

pull request, in github ๐Ÿ˜ƒ

rose root
#

Got it. Hahaha.

manic glacierBOT
manic glacierBOT
craggy galleon
#

shhh... That was meant to be a secret Git Bot ๐Ÿ™ƒ ๐Ÿ˜‚

tulip sleet
#

@slender iron I just changed run_background_tasks() in a very simple way to run the tasks only every msec. That gives a 2.2x speedup. 1 msec is good for USB, according to thach. is 1 msec ok for display refresh (or even longer? how long?). Only other one to worry about is the ethernet support background task.

#
void run_background_tasks(void) {
    if (last_finished_tick == ticks_ms) {
        // Wait at least a msec between running background tasks.
        return;
    }
...
#

so combination of this and the other is >10x

pastel panther
#

hey @gilded cradle Which display that adafruit carries (and has displayio support or can with a bit of work) has the largest pixels? I want to work on some graphics stuff that would me much easier if I could see single pixel errors without squinting and turning my head sideways

main meteor
#

Heh, I have a flip-dot display where each dot is about 60mm across, but AdaFruit doesn't carry it and I sincerely doubt displayio supports it.

slender iron
#

@tulip sleet the displays should regulate their own timing via queue_refresh. may need to make it faster to get to though

#

1 ms isn't great because the frames don't always align on those bounds

pastel panther
#

@slender iron is a working CDC but now MSC likely a flash chip issue? If so, I should be able to get a working CPY drive by enabling INTERNAL_FLASH_FILESYSTEM=1 instead of QSPI_FLASH_FILESYSTEM, ya?

tulip sleet
#

@slender iron Since 60fps is 16.67/msec per frame, I thought 1msec might be fast enough. Do you want it to be on 1msec boundaries? The display refresh should run for no more than 1msec itself so that USB gets serviced often enough.

gilded cradle
#

@pastel panther, it's the HX8357 display.

#

You could use RA8875, but it doesn't currently have displayio support yet

pastel panther
#

Oh goodie, I have one of those

#

how hard is it to get 8-bit support working with it in CP? The pyportal uses 8-bit, right?

gilded cradle
#

Yeah, it does. I just haven't tried it yet.

slender iron
#

@pastel panther ya, CDC but no MSC implicates the flash chip

#

@tulip sleet ideally we can line up with the displays actual refresh signal

pastel panther
#

Still haven't ruled out a soldering issue but trying to get the super small winbond W25Q80DV working by adding a def to the flash devices.h didn't help so far

slender iron
#

then from the debugger you can verify that you matched the id correctly

tulip sleet
#

@slender iron The check is

bool displayio_display_frame_queued(displayio_display_obj_t* self) {
    // Refresh at ~30 fps.
    return (ticks_ms - self->last_refresh) > 32;
}

so it looks like checking this every 1msec will be fine. The current impl is still on a msec boundary because it's checking ticks_ms, it seems to me.

slender iron
#

true for now but at some point it may change

pastel panther
#

Ah excellent thanks. On the topic of gdb, when I was working on the bitmap stuff I got tonnes of milage out of turning off the size optimization whle debugging. Is that still a good way if you have the space, or is there something else I could be doing? My main issue was with arguments being optimized out

slender iron
#

celeste isn't running the right speed so that may be part of it

tulip sleet
#

do you mean you tried my change or do you mean tip of master rightn ow

slender iron
#

@pastel panther I usually turn lto off but not change -Os. anything optimized out you can mark volatile temporarily ๐Ÿ˜ƒ

tulip sleet
#

or you mean less < 1msec granuarlity may be necessary?

slender iron
#

@tulip sleet the ms boundary may be causing it to run too fast

#

ya

pastel panther
#

Ya I tried that previously and I guess wasn't satisfied for some reason. Maybe it was just that I had to do it for everthing I cared about and turning off -0s was just easier?

tulip sleet
#

i was thinking about adding several counters to the tick interrupt routine to count when a particular background task needed to be run. They would then set a global flag for that background task, saying "yes, please run me the next time you check"

#

still, 1msec granularity on a 30fps frame rate seems pretty granualar if it's 1/32

#

i can submit a PR with the current simple patch and we can hold it for further testing. I still need to vet that 1ms is good enough for network

#

network is 1 second (!)

void network_module_background(void) {
    static uint32_t next_tick = 0;
    uint32_t this_tick = ticks_ms;
    if (this_tick < next_tick) return;
    next_tick = this_tick + 1000;
...
#

oh, also audio_dma_background() to consider. Do you think that def might need <1msec?

slender iron
#

audio depends on the buffer size

manic glacierBOT
slender iron
#

@tulip sleet anything else you want to get in for 4.1.0-beta.0?

tulip sleet
#

no, i think it's good!

slender iron
#

kk, will kick it off now before I eat lunch

tulip sleet
#

i'll away from home for a couple of hours shortly.

slender iron
#

k np

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 4\.1\.0\-beta\.0
manic glacierBOT
orchid basinBOT
idle owl
#

@slender iron About to cookie BusDevice_Debug - realising that the way we cookie things means that the repo name and the lib name have to be consistent (unless I go through and change a bunch of things manually afterwards, which I can do if needed). It's not currently consistent with BusDevice/adafruit_bus_device. Should I go with Bus_Device_Debug for the name?

slender iron
#

sure, I'd do debug first too

#

so Debug_Bus_Device

idle owl
#

Any particular reason?

slender iron
#

reads better to me?

idle owl
#

fair enough

slender iron
#

not sure how to describe

idle owl
#

No worries

slender iron
#

debug is an adjective I think. modifying bus device

simple pulsar
#

@slender iron @idle owl Does alphabetical ordering/grouping come into your decision? (I know nothing about what you are discussing, btw)

idle owl
#

@simple pulsar Not really. It's going to be a short lib that inherits bus_device but allows for debug statements.

simple pulsar
#

On a different subject, I'm thinking about implementing a msgpack library as I've been playing with CircuitPython code to read IR from MakeCode. Would Adafruit want a small general purpose msgpack library? I was going to implement the small subset needed for MakeCode IR protocol but the rest could be added later. I need to see how much can be reused from existing libs too.

slender iron
#

libraries are always good. I don't know what msgpack is though

simple pulsar
#

It sounds like the JSON generation realised their stuff was getting a bit bulky at times

main meteor
#

I think that (and the ability to transport binary information) is what's behind BSON as well.

#

I'm glad good old XDR is still remembered.

simple pulsar
#

I remember when XML started being used a lot for pasisng data around and I thought I wonder what's going to happen next

slender iron
#

sounds like protocol buffers

simple pulsar
#

Each generation has their XDR!

#

Ok, I'll take a stab at a very small version that respects the M0 world but allows more to be added as people want to do more with it.

slender iron
#

thanks! having the same api as the normal python module is a bonus. I wouldn't name it the same though

simple pulsar
#

I've glanced at two python modules, will take that into account

#

Trivia: Just realised ASN.1 might battle XDR in age terms.

manic glacierBOT
lone sandalBOT
manic glacierBOT
simple pulsar
crimson ferry
#

Installing a new .uf2 never used to wipe my CIRCUITPY, but adafruit-circuitpython-pyportal-en_US-4.1.0-beta.0.uf2 did. Expected? circuitpython also seems much larger, I assume general practice now will be not to load the whole lib bundle even on 8MB devices.

crimson ferry
#

Change in Group behavior? ValueError: Layer already in a group. when trying to add the same group to more than one layer (used to be allowed).

#

Where's the best place for beta feedback? Wow, displayio is ๐Ÿš… (fast), nice!

tulip sleet
#

@crimson ferry Please file issues in the circuitpython repo, like any other bug. Thanks!

crimson ferry
#

OK, thanks. Sometimes I don't know if it's a bug or me doing something n00b ๐Ÿ˜‰

tulip sleet
#

@crimson ferry I loaded the beta three different boards, including a PyPortal, and it didn't erase CIRCUITPY. I'm mystified why yours would get erased.

#

And it's true that the lib is getting larger all the time. We've modified the guides and stopped recommending copying over the whole thing. Now just copy what you need.

crimson ferry
#

Sounds good. The wiping could have been spurious, or more related to me renaming my CIRCUITPY last night... looking like something local... macOS Finder shows the new name, but bash shows 11 space chars for the Volume name. I'll start over clean and sort it out.

stuck elbow
tulip sleet
#

@timber mango Congratulations!! We'll publicize this well via our usual outlets.

#

Try the 4.1 beta and see how much faster it is for your games.

solar whale
#

Just put 4.1 beta on a pew-pew 10 -- works fine!

stuck elbow
#

\o/

#

unfortunately the europython ones will ship with 4.0.0-rc3 or some such

#

because I had to provide the firmware to be flashed to the factory up front

old smelt
#

@tulip sleet - I was inspired by your Show and Tell update regarding the speed-up with 4.1 Beta. I'm seeing ~2X increase in speed from reset to initial

#

....draw of the screen.

#

Oh and it it's refreshing much faster, too. Nice. Thanks!

#

What's the secret to that 5X improvement? ๐Ÿ˜ƒ

stuck elbow
#

goto optimization

tulip sleet
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

Via the EuroPython blog: Usually, we try to have something as surprise for our attendees every year. However, for this yearโ€™s conference, we have decided to give our attendees something to play witโ€ฆ

lethal abyss
#

Is there anything started to have Arcada equivalent with CircuitPython?
asking for a friend ๐Ÿ˜ƒ

manic glacierBOT
tulip sleet
#

@slender iron this is weird:

../../shared-module/displayio/TileGrid.c: In function 'displayio_tilegrid_get_refresh_areas':
../../shared-module/displayio/TileGrid.c:443:52: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         if (displayio_area_size(&self->dirty_area) <= 2 * self->pixel_width * self->pixel_height) {
                                                    ^~
cc1: all warnings being treated as errors

Only happens when I compiled an nrf build with DEBUG=1. Doesn't happen on non-DEBUG or on atmel-samd DEBUG builds. Changing 2 to 2U makes it go away. I'll include that in next BLE PR.

slender iron
#

@lethal abyss @idle owl is working on a badge focused abstraction and we intend to have a gaming one

lethal abyss
#

Good news. I'll watch what will come, I will test it and use it for sure. If I may help, i will

idle owl
#

@lethal abyss I'll keep you posted as I get something worth testing ๐Ÿ˜ƒ

lethal abyss
#

@idle owl ooops, spotted ๐Ÿ˜ƒ no problem, I'll be around ๐Ÿ˜‰

idle owl
#

@slender iron With displayio if I create some rects and text using splashby appending, I'm finding if all I have is that set of code in there, and nothing in a loop, it appears for a moment, disappears, and the code finishes running. Is that how it's supposed to work? If I wanted to simply create that set of things and have them remain on the display, does that mean a while True: pass below it?

#

Because it works with the pass in a loop below the code.

#

But it feels like it might be a kludge.

slender iron
#

@idle owl can you post your full example?

slender iron
#

@crimson ferry I hadn't thought of reusing a group in more than one parent but with the dirty area tracking I needed to do it because the child elements only have one set of areas

manic glacierBOT
#

Adafruit Feather M4 Express with samd51j19 (31b)
CircuitPython 4.1.0-beta.0 on 2019-06-13
CircuitPython Library Bundle 20190613
2.4" TFT FeatherWing

This test will initialize the display using displayio
and draw a solid red background
"""

import board
import displayio
import adafruit_ili9341
import time

spi = board.SPI()
tft_cs = board.D9
tft_dc = board.D10

displayio.release_displays()
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)

...
crimson ferry
#

@slender iron Thanks, I figured it was some optimization or tightening some loose checking. I've changed my code.

manic glacierBOT
idle owl
#

Pro tip: save your changes, or the updates won't apply. ๐Ÿคฆ

manic glacierBOT
#

Ugh, weird.

Agreed. I looked at the sheet, and from what I can tell it's similar to a clock stretch, by holding SCL high for a minimum amount of time to wake from sleep.

Dropping the frequency does seem the best approach. I peeked at the M4 sheet and saw an SCL hold register/property, but that would likely be just as bleh to implement; if it would even address this. Not to mention far less useable across the ecosystem.

idle owl
#

@slender iron I'll post the code in a bit, I got into something else in the meantime. :multitracking:

slender iron
#

ya, I'm off to solder for a bit

manic glacierBOT
#

Ok, here's what I observed while testing it using the above code. When you start it, it paints a red rectangle on the entire screen fine and then prints test starting from the bottom.

Each time you save the file it repaints the red rectangle just fine showing that the init commands seem fine. However, the terminal seems to shrink a little each time. So this may be related to terminalio.

prime flower
#

@gilded cradle heya - I'm testing a PyBadge and I'm not sure how to read button presses from CircuitPython (the front btns)

gilded cradle
prime flower
#

Perfect! thanks

gilded cradle
#

๐Ÿ˜ƒ

prime flower
#

@gilded cradle yup, works ๐Ÿ˜ƒ thanks for writing that code

#

btw super helpful explanations in that guide

gilded cradle
#

You're welcome. I'm glas it was helpful.

#

Thanks

prime flower
#

i read over some of the arcada stuff this AM and was like "why are the bits being masked"

gilded cradle
#

๐Ÿ˜ƒ

tulip river
#

trying to get a pyportal project working. the url returns a json blob with entries[] and I need the data out of those entry objects... I'm not grokking how to do that with json_path

errant jetty
#

Just seen a 1.78 speedup on itsy bitsy M4 using 4.1.0-beta for my CPU-bound code compared to 4.0.1 - wow, don't need any C modules! Thank you ๐Ÿ‘Œ

tidal kiln
#

are you using the pyportal library? @tulip river

tulip river
#

yeah

scarlet maple
#

@tulip river assuming a JSON structure like:

[{"status":"At home",
   "date":"- Monday, May 1, 9:54 PM",
   "graph":"https://host/graph.png"}]

the image_json_path I use is image_json_path = [0, 'graph']

#

i.e., take the 0th element from the JSON list, and get the graph element from there.

tidal kiln
#

if you call fetch it will return the JSON blob as a Python list

#

and you can use that to access the data

#

...a list of Python dictionaries actually

#

how familiar are you with Python lists/dictionaries?

tulip river
#

very, I'm just not familar with how pyportal exposes things

scarlet maple
#

(now that I reread, cater probably is more on the right track than I am)

tidal kiln
#

ah. then you're probably closer than you think.

tulip river
#

cater so if I use json_path["entries"] I should expect to just get the list of entries back

tidal kiln
#

as a first pass, just do something like that and then print the return

#

to see what you've got

#
raw_info = pyportal.fetch()
print(raw_info)
#

hopefully once you see that, it'll be obvious how to access

#

combo of indexing and dictionary keys

tulip river
#

thanks, I think that will get me on the right track

tidal kiln
#

cool. good luck!

tulip river
#

using that api... thats the goal

tidal kiln
#

looks like all the info is rooted at "entries"

#

so that's what you'd set for json_path when creating your pyportal object

#

and then fetch will return a list of dictionary(s) with all that data

#

ex for getting latitude:

raw_data = pyportal.fetch()
lat = raw_data[0]["lat"]
lethal abyss
#

@idle owl I just started to explore pygamer with Circuit Python. Is your current work about having something kinda like adafruit_pyportal? I mean, something that helps having main elements grouped in a class (screen, pad, buttons...)
For now, tell me if I'm wrong, but it is up to anyone to gather compatible libraries to write anything involving pygamer?
(hope my english is clear enough)

idle owl
#

@lethal abyss Yes, it's similar to PyPortal in that it will handle all of the setup for all the components of the board in one place. You'll import this library, and then have access to all of the main functionality of both PyGamer and PyBadge. Right now, yes, it is up to you to gather the necessary libraries and write code that sets all of the hardware up. It will be easier once Adafruit_CircuitPython_PyBadger is completed.

lethal abyss
#

Ok, it makes sense

#

so really, if I can help, coding, doc, tests, let me know. it is a very nice product I'd like to use in the little coding club I founded and Python is such a success with kids...

manic glacierBOT
tidal kiln
#

"PyBadger" ๐Ÿ˜€

stuck elbow
#

badger badger badger badger badger badger mushroom mushroom

meager fog
#

โš  we have pygamer kits in stock right now but they're going FAST! โš  https://www.adafruit.com/product/4277

manic glacierBOT
exotic pumice
#

let my distributor buy me one ๐Ÿ˜›

meager fog
#

they're not available for disti's at this time

#

and wont be till we can have significant stock - so it may be a month

#

only digikey will have em earlier

manic glacierBOT
simple pulsar
#

@stuck elbow @slender iron Computed Goto? That's a phrase from the past: https://en.wikipedia.org/wiki/Goto#Computed_GOTO_and_Assigned_GOTO ๐Ÿ˜ฑ

GoTo (goto, GOTO, GO TO or other case combinations, depending on the programming language) is a statement found in many computer programming languages. It performs a one-way transfer of control to another line of code; in contrast a function call normally returns control. T...

main meteor
#

Easily done on an 1802 CPU, since you can do the math in a register, then make that register the program counter.

manic glacierBOT
manic glacierBOT
#

Hi,
I just figure out that there is a 'slight' difference when reading files from the flash or from the SD card.

Version: master (6/16/2019)

File generation (copied to the flash and to the SD card

time dd if=/dev/urandom of=test.dat bs=1 count=1M

Code:

import sys
import os
import adafruit_sdcard
import board
import busio
import digitalio
import storage

# Connect to the card and mount the filesystem.
spi = busio.SPI(board.SCK, board...
manic glacierBOT
manic glacierBOT
lethal abyss
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
slender iron
#

<@&356864093652516868> Meeting is the normal 11am Pacific/ 2pm Eastern time here on Discord tomorrow in the CircuitPython voice channel. Notes doc is here: https://docs.google.com/document/d/17bOJ2-2B11kmfcJQzcs_5tMk-FBWzA_SeUYtInaBws8/edit?usp=sharing

manic glacierBOT
mystic estuary
#

so like

#

I've done the tutorials and stuff for the circuit playground express and I'm a little stumped at what to do now.

pastel panther
#

@tulip sleet and @slender iron Any idea what this is about? I can't use gdb or JLink commander for some reason

tulip sleet
#

@pastel panther do you see the same thing if you do JLinkGDBServer -device ATSAMD51J19 -if SWD ? I wonder if you're not connected properly. Try it on a second board.

manic glacierBOT
indigo wedge
#

Hi everyone, nice work with the displayio stuff, I just connected a display and got the REPL on it for free ๐Ÿ‘

#

I see I got demoted from circuitpythonista, makes sense ๐Ÿ˜…

stuck elbow
#

why does it make sense?

#

now if only there was an easy way to get input into that repl as well

indigo wedge
#

cause i stopped contributing

#

yeah i was wondering if there was an easy way, i would love to be able to easily use my qwerty keyboard with repl

#

@stuck elbow did you see my FeatherWing? ๐Ÿ˜„

#

Not sure if you would be interested in hacking on it, I could get you a unit once I assemble more ๐Ÿ˜ƒ

stuck elbow
#

I did

#

it surely looks great and there is a million things that could be done with it if only one had time for it... ;-)

indigo wedge
#

๐Ÿ˜„

#

I also need unlimited time ๐Ÿ˜ƒ

stuck elbow
#

I had to pause my CircuitPython stuff for a while, and now I have a pile of things to catch up to, with displayio having partial updates now

#

I would love to play with your featherwing, but I can't really promise I will get to it any time soon

#

I should receive the PyGamer in a few hours

#

@indigo wedge by the way, you you also have one of those lora featherwings?

#

they would make a great combo

#

@indigo wedge do you have an int pin on the keyboard driver chip?

indigo wedge
#

Yes but it's optional, you can also poll the fifo state

#

Since we all know circuitpython and interrupts don't mix ;)

#

I don't have a Lora feather, hope someone else might get something going there

tulip sleet
#

@indigo wedge you left the Adafruit server a while ago! That's probably why, or maybe it was even automatic when that happened.

indigo wedge
#

Yes I know, that's why I said it's fair ๐Ÿ˜ƒ

#

And Hi, Dan ๐Ÿ˜ƒ

tulip sleet
#

hi! i'm making BLE progress - you'll see more library work and bleio soon.

#

the keyboard featherwing is really neat

indigo wedge
#

I've been trying to minimize my SW work and focus on HW so really happy with the bring-up. I used all components that already had circuitpython libraries so it was just a matter of changing some pins ๐Ÿ˜ƒ

#

Wanted to say thanks to everyone for their awesome work on CP and the libs

tulip sleet
#

yw! if you're around today we have our weekly audio meeting 2pm Eastern time

indigo wedge
#

not sure if I have anything to say but I might listen in ๐Ÿ˜„

tulip sleet
indigo wedge
#

Yes, I updated my custom samd51 board from 3.0-beta to master and wow, so much good stuff ๐Ÿ˜„

tulip sleet
#

more people on the team and more outside PR's :cornucopia:

#

and talking about your latest hw is right on topic

indigo wedge
#

Yes, soon I'm gonna be looking for people who would like to write some code for it, in exchange for free HW ๐Ÿ˜„ But first I need to assemble more than 1 unit

tulip sleet
#

stop by with some photos, etc.

indigo wedge
#

I have many, is this the right channel to post them?

tulip sleet
#

sure!

indigo wedge
#

Aww, only shows one

#

I also made a video demoing CP on it and explaining the HW:

main meteor
#

Portable Python!

indigo wedge
#

That's the dream ๐Ÿ˜‰

stuck elbow
#

I have it on my phone...

indigo wedge
#

But can it blink a LED? ๐Ÿ˜›

stuck elbow
#

is it just me, or are PyGamer's JOYSTICK_X and JOYSTICK_Y swapped?

#

or am I holding it wrong?

manic glacierBOT
#

I've used this Adafruit Si1145 board with an Arduino and would really appreciate a CircuitPython driver to use with CircuitPlayground Express and Itsybitsy M4 Express. Now the sun might come out in UK anytime soon it would be really helpful.

manic glacierBOT
lethal abyss
#

@stuck elbow i'll have a look as soon as I'm home. That's weird

pastel panther
#

@indigo wedge I will absolutely help with software in trade for hardware

#

(probably even without it, but my free time is spare)

slender iron
#

@indigo wedge welcome back! I added you to circuitpythonistas

raven canopy
#

๐Ÿ‘‹ @indigo wedge. welcome back!

indigo wedge
#

@slender iron thanks ๐Ÿ˜ณ

prime flower
#

@tidal kiln heya - reading over your displayio guide (really useful). what do you like using for building/displaying/modifying spritesheets?

tidal kiln
#

actually, haven't done much of that since guide.

stuck elbow
#

recommends Aseprite

tidal kiln
#

i think i just used gimp for the guide, since it was so simple

#

^^ there you go. pretty sure @stuck elbow has done ~99999999% more of this than i have )

stuck elbow
#

tbh all my life I used gimp

#

but it wasn't optimal

tidal kiln
#

yep. was fine for a quick one off.

stuck elbow
#

oh, I used Paint Shop Pro a long time ago, before Corel bought it

#

on Windows 95

indigo wedge
#

anybody got a link to the guide?

tidal kiln
#

displayio guide?

indigo wedge
#

yeah

indigo wedge
#

thanks!

tidal kiln
#

the sprite coverage is very basic

stuck elbow
#

I got the bouncing balls demo going!

tidal kiln
#

also maybe checkout some of what JP's been doing lately? he's been doing lots more sprite gamey stuff recently.

stuck elbow
#

next up: porting Jumper Wire

pastel panther
#

@tulip sleet does the trinket_m0 build not have displayio support? I saw it has the CIRCUITPY_SMALL_BUILD set but drawing a line from that to displayio support isn't clear to me

stuck elbow
#
45:# Some are always on, some are always off, and some depend on CIRCUITPY_FULL_BUILD.
55:CIRCUITPY_AUDIOBUSIO = $(CIRCUITPY_FULL_BUILD)
60:CIRCUITPY_AUDIOIO = $(CIRCUITPY_FULL_BUILD)
65:CIRCUITPY_BITBANGIO = $(CIRCUITPY_FULL_BUILD)
91:CIRCUITPY_DISPLAYIO = $(CIRCUITPY_FULL_BUILD)
96:CIRCUITPY_FREQUENCYIO = $(CIRCUITPY_FULL_BUILD)
101:CIRCUITPY_GAMEPAD = $(CIRCUITPY_FULL_BUILD)
111:CIRCUITPY_I2CSLAVE = $(CIRCUITPY_FULL_BUILD)
147:CIRCUITPY_PIXELBUF = $(CIRCUITPY_FULL_BUILD)
#

(CIRCUITPY_FULL_BUILD is the opposite of CIRCUITPY_SMALL_BUILD)

pastel panther
#

@stuck elbow do you have your ball.bmp handy?

prime flower
#

@tidal kiln @stuck elbow
I keep hitting a NotImplementedError: True color BMP unsupported when exporting a 16b BMP with GIMP. What export settings did y'all use?

stuck elbow
#

@prime flower convert it to indexed first

tidal kiln
#

image -> mode -> indexed

pastel panther
#

it should perhaps be updated to use OnDiskBitmap?

stuck elbow
#

it shouldn't

#

OnDIskBitmap is slooooooow

prime flower
#

@stuck elbow You cant export an indexed image with transparency as a bmp?

stuck elbow
#

you can select one color to be transparent

pastel panther
#

@stuck elbow slow compared to holding it in memory? That's not fair ๐Ÿ˜ƒ

stuck elbow
#

that's what palette.make_transparent(15) does

tidal kiln
#

^^ that. but i'm not sure how you actually come up with the index value for any given .bmp file

stuck elbow
#

I use a fixed palette for my sprites

#

so I know all the indices of all my colors

pastel panther
#

does imageload not have the same support for bitdepths as OnDiskBitmap? Perhaps that should be addressed by them sharing some code?

stuck elbow
#

imageload is in Python, OnDiskBitmap is in C

#

I want to discuss the possibility of copying an OnDiskBitmap as Bitmap in today's in the weeds

prime flower
#

@stuck elbow Got it going with the indexed bitmap, thanks!

manic glacierBOT
#

Some updates to above comments:

The 2.4" FeatherWing does appear to run faster with 4.1.0-beta.0 fresh out of a power cycle.

But now working on the 3.5" FeatherWing more, I am seeing some quirky behavior. It's in a super slow mode now that I can't get out of even through reverting to 4.0.1 (or back) and / or power cycling. Could be specific to my unit (I only have the one to test), or it possibly implies there is some static storage on the display chip that isn't getting completely rese...

lethal abyss
pastel panther
#

do all of the express boards support FULL_BUILD?

sterile bronze
#

just a hug report today

old smelt
#

Lurking

prime flower
#

that's so crisp @errant grail

tidal kiln
#

lurking

prime flower
#

wants a tote bag with blinka..

inland tusk
#

@idle owl @slender iron Just lurking

stuck elbow
#

@lethal abyss I think the stage module is enabled in the official pygamer firmware

inland tusk
#

Figures

slender iron
ionic elk
#

lurking

sterile bronze
#

Adabox has arrived at my door

slender iron
#

@tulip sleet you are unmuted

gilded cradle
river quest
#
#

EuroPython 2019 attendees getting CircuitPython-powered PewPew Game Consoles! They are looking for attendees to help Radomir with workshops on the PewPew. See more on the blog post and on the PewPew workshop page.
https://blog.europython.eu/post/185584014022/europython-2019-warning-spoiler-alert
https://ep2019.europython.eu/events/pewpew-workshops/

#

8/8/2019 is CircuitPython day! 8/8/2019 is CircuitPython day! This year, weโ€™re in the planning stages and will have live videos, celebrations, and more for this very snake friendly date! For now, weโ€™re starting to assemble the artwork in our public DropBox CircuitPython folder, check it out
https://www.dropbox.com/sh/cod3wllmyninyn5/AADC6Z5EhEsG18X8WDRMEZuta?dl=0

If you need to get in touch with us for planning your event and more, email: circuitpythonday@adafruit.com

#

Bluefruit Circuit Playground Express is in early prototyping phase
https://youtu.be/6VQpo3v5jo8

We have a buncha' updates on circuitpython.org, specifically in BLINKA! Thanks Melissa!
https://circuitpython.org/blinka

Discord now offers "server boosts" we have 6 on our server (level 1), if we get to 10 boosts we get a banner and some other good features for the community: 150 emojis, 256 Kbps audio, server banner, 50 mb uploads for all members. Stop by and boost!
https://adafru.it/discord

Company note: Adafruit is hiring too! We're looking for PHP developers in the NYC area! Email: apply@adafruit.com

Circuit Playground Express Bluefruit prototype update #adafruit #bluetooth #iot Visit the Adafruit shop online - http://www.adafruit.com --------------------...

โ–ถ Play video
Discord

Check out the adafruit community on Discord - hang out with 12,651 other members and enjoy free voice and text chat.

meager fog
#

hihi here for a few mins

sly falcon
#

๐Ÿ˜Š

meager fog
#

ok mic!

#

๐Ÿšค

pastel panther
stuck elbow
#

that's fast :P

pastel panther
#

I increased the speed to try and beat the frame rate

stuck elbow
#

you may want to add display.wait_for_frame() in the loop

prime flower
manic glacierBOT
errant grail
stuck elbow
sly falcon
#

woo for a clean office!

gilded cradle
#

Nice! I'll have to try that out @stuck elbow

lone sandalBOT
prime flower
solar whale
#

What is the "trick" for setting the baudrate for a display -- I am using a 2.4 inch TFT featherewing on a feather_nrf52840 and it works, but thr REPL updates are very slow -- IIRC there is a simple way to tweak the baudrate

slender iron
#

make sure you are using 4.1.0

stuck elbow
#

@idle owl can you just scale the pixels on the display?

solar whale
#

@slender iron I am -- do I just let it default or do I need to explicitly set it?

slender iron
#

default but I haven't test with nrf much

solar whale
#

OK -- I'll compare to feather_m4

slender iron
#

thanks!

#

repl can be kinda slow since it updates most of screen on scroll

stuck elbow
#

and not all displays have hardware scrolling that is actually useful

slender iron
#

ya, nothing uses hardware scroll now

solar whale
#

OK -- may just be "they way it is" I'll poke at it.

slender iron
#

its usually the wrong direction

solar whale
#

@pastel panther hope you still have time for mushroom farming!

slender iron
pastel panther
#

@solar whale I'll find some (likely growing in a warm damp place)

manic glacierBOT
meager fog
#

hi im back

idle owl
#

@meager fog We're in the weeds on version numbers and bleio

meager fog
#

np

#

thanks everyone!!

errant grail
#

Thanks!

prime flower
#

@slender iron defaults write com.apple.finder AppleShowAllFiles YES

#

idk where it is in finder, I have an Alfred3 command

#

oh, then killAll Finder after

pastel panther
granite thicket
#

Well hello! I've just arrived from Twitter, Adafruit suggested I join :D

solar whale
#

@sly falcon just a heads up -- I have run into an issue loading the NINA_W102-1.3.1.bin file via the Metro_m4 passthru on an metro_m4_airlift. If I build it from your master repo, it loads and works OK but if I buil it from the Adafruit nina_fw repo, the load fails partway trough with a timeout ... see examples ```jerryneedell@Ubuntu-Macmini:~/projects/adafruit_github/nina-fw$ /usr/local/bin/esptool.py --port /dev/ttyACM0 --before no_reset --baud 115200 write_flash 0 NINA_W102-1.3.1.bin
esptool.py v2.5.1
Serial port /dev/ttyACM0
Connecting.....
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
MAC: c4:4f:33:0e:a9:dd
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 1129472 bytes to 610164...
Writing at 0x00024000... (26 %)
A fatal error occurred: Timed out waiting for packet header
jerryneedell@Ubuntu-Macmini:~/projects/adafruit_github/nina-fw$ cd ../../docmollo/nina-fw/
jerryneedell@Ubuntu-Macmini:~/projects/docmollo/nina-fw$ /usr/local/bin/esptool.py --port /dev/ttyACM0 --before no_reset --baud 115200 write_flash 0 NINA_W102-1.3.1.bin
esptool.py v2.5.1
Serial port /dev/ttyACM0
Connecting.....
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
MAC: c4:4f:33:0e:a9:dd
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 1129472 bytes to 610173...
Wrote 1129472 bytes (610173 compressed) at 0x00000000 in 53.7 seconds (effective 168.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
``` first is from Adfruit repo, second from yours -- for both I just do make the 'make firmware` Have you built it from the Adafruit repo?

#

This is repeatable...

granite thicket
#

Can you try with no stub? I think it's --no-stub

solar whale
#

still faield with --no-stub ```jerryneedell@Ubuntu-Macmini:~/projects/adafruit_github/nina-fw$ /usr/local/bin/esptool.py --port /dev/ttyACM0 --before no_reset --no-stub --baud 115200 write_flash 0 NINA_W102-1.3.1.bin
esptool.py v2.5.1
Serial port /dev/ttyACM0
Connecting.....
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
MAC: c4:4f:33:0e:a9:dd
Enabling default SPI flash mode...
Configuring flash size...
Auto-detected Flash size: 4MB
Erasing flash...
Took 3.69s to erase flash block
Writing at 0x0005e400... (34 %)
A fatal error occurred: Timed out waiting for packet header

granite thicket
#

How are you powering this device? Can you ensure it has a clean power supply?

solar whale
#

It's the same as when I load from docmollos repo ??

#

will try with a 9v supply

granite thicket
#

The only reason, currently, I can think different firmware causes a crash is that the bit sequence has an effect on the power system

#

Another option, is trying a slower baud rate. This may help mitigate power sag due to flashing.

solar whale
#

same failer with external 9V suppy -- interstingly -- without --no-stub it get to 26% -- with it it gets to 34%

granite thicket
#

What board are you flashing?

solar whale
#

metro_m4_airlift

#

same failure at 57600

granite thicket
#

Same percent?

solar whale
#

yes

#

I mainly wanted to see if there was someconfiguration diff betwen the repos. I'll try to dig into it.

granite thicket
#

What other binary files do you have instead of the one you are flashing now ?

#

Since you're writing at 0x0, this flash binary must have very large strings of padding. Either 0xFF or 0x00 is usual. I suspect 0xFF since that is the cleared state of NAND flash

solar whale
#

Ic an load other from the adafruit guide and I can load the one I build from docmollo's repo ,, just not the one I build from adafruits repo.

granite thicket
#

Do you have an application.bin, a partition.bin and a bootloader.bin that you can flash individually ?

#

They should be in the build outputs

solar whale
#

I can try that.

granite thicket
#

You'll need to know their addresses.

#

Bootloader is usually 0x1000, partition table is 0x8000 and application is 0x10000

#

Start with the bootloader if you can. See if you can flash that

solar whale
#

actually, the build provide the list -- I'll try it ```python /home/jerryneedell/projects/esp-idf-3.2/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /home/jerryneedell/projects/adafruit_github/nina-fw/build/bootloader/bootloader.bin 0x30000 /home/jerryneedell/projects/adafruit_github/nina-fw/build/nina-fw.bin 0x8000 /home/jerryneedell/projects/adafruit_github/nina-fw/build/partitions.bin

granite thicket
#

0x30000 is an unusual choice but so be it :)

#

Try flash them individually if flashing them in a one liner does not work

#

But. That command should flash them one after the other anyway

#

I'm just not sure how much information it gives. I don't recall if it tells you which image failed

solar whale
#

hmm -- it seem sto have loaded ...

granite thicket
#

Unless I do not understand

solar whale
#

and it seems to work ... interesting -- thanks for the guidance --

granite thicket
#

No problem.

#

Writing the entire flash like with the all in one image is very abusive on the flash and heavier on the power system.

solar whale
#

still no clue what the differenc is between the images -- I'll dig into that later

granite thicket
#

Check your versions btw. Ensure you are running the firmware you think you are. If you have written your firmware to the wrong address it may not be immediately obvious

solar whale
#

I'll reload an older version then repeat

granite thicket
#

One image is bootloader, partition table and application all in one file. But with lots of padding between them so that they end up in the right place

#

The padding can cause trouble in the right conditions

solar whale
#

well -- I was able to revert to an old version then reload the new one with the multiline command and it seems happy and reports the correct version ... progress -- thanks again.

granite thicket
#

No problem. You may wish to raise the issue in GitHub. Telling them what you encountered with which board and your work around. Tag me if you like @NeverCast

solar whale
#

will do!

#

problem is, there is no "issue" button on the repo ๐Ÿ˜ฆ

granite thicket
#

Is this not CircuitPython?

solar whale
#

thats why I raised it here initailly.

#

I can put it in the esp32spi repo

granite thicket
#

This is the firmware you are using right ?

solar whale
granite thicket
#

I see

#

@solar whale do you know if the Adafruit fork is largely diverged ? If Adafruit tracks Arduino you could report the issue up stream.

solar whale
#

Not sure -- I'll see what responses it gets from @sly falcon and @meager fog first.

granite thicket
#

Ah you posted a comment on an unrelated pull request on an unrelated repository haha.

solar whale
#

well -its a related PR in a related repo.

granite thicket
#

This is why the readme should tell one where they may direct their issues xD

solar whale
#

In this case, I think it is getting to the correct people for now.

granite thicket
#

You have a formatting issue on your comment btw. Your paragraph is inside the log snippet

manic glacierBOT
solar whale
#

@granite thicket thanks -- fixed comment

crimson ferry
#

@slender iron Is there a well-known set of things that don't get reset upon reload, or is it more likely that an on-board or connected peripheral is holding some state (e.g., some pin assignments, SPI frequency in some cases)?

slender iron
#

only things used by the supervisor shouldn't be reset.

slender iron
#

@solar whale @granite thicket I turned on issues

#

ya, that's the python api for it

#

it's not a simple question

crimson ferry
#

LOL, suspected not. thanks!

slender iron
#

np, is there something specific you are wondering about?

granite thicket
#

Thanks for that, tannewt

manic glacierBOT
lone sandalBOT
crimson ferry
#

@slender iron Not miission-critical, just trying to understand for design and debugging. Things like when displayio.release_displays() or other explicit startup deinit-type actions are needed, SPI behaviors, any (presently to me) unknown unknowns, etc.

manic glacierBOT
manic glacierBOT
#

More testing in the Gist comments. Observations:

  • "slow mode" seems independent of whether an external display is actually connected

  • therefore, seems to be tied to processor / circuitpython rather than the external display hardware

  • hardware reset button during run seems to be a trigger for slow mode

  • slow mode persists across reloads

  • SPI frequency is sticky across reloads in normal mode, not in slow mode

  • normal mode can be re-established by reloading without displa...

timber mango
#

hi, i found bugs using circuitpython with TSL2561 and MPL3115A2 on a Raspi i2c bus, what should i do ?

#

MPL3115a2 : in file "adafruit_mpl3115a2.py" line 117 [[if self._read_u8(_MPL3115A2_WHOAMI) != 0xC4]] should be commented to get readings. Using the test script by Tony DiCola, only temperature and pressure readings work, the altitude reading hangs the script

#

TSL2561 : have to run "i2cdump -y 1 0x39" before each reading, using the test script (so cmd is i2cdump -y 1 0x39 >/dev/null 2>&1 && python3 TSL2561-test.py)

solar whale
#

@timber mango you should open issues in the library github repostories describing the problem https://github.com/adafruit/Adafruit_CircuitPython_MPL3115A2/issues https://github.com/adafruit/Adafruit_CircuitPython_TSL2561/issues

timber mango
#

ok, thanks ! Can I copy/paste what I wrote here, is that enough ?

solar whale
#

That should be fine

timber mango
#

thanks ๐Ÿ˜ƒ have a nice evening ! ++

solar whale
#

You're welcome -- you too!

slender iron
#

@gilded cradle w

#

wha

#

agh

#

enter is next to h

#

what display needed chip select toggled every command? the 1ms delay is killing our speed

gilded cradle
#

I think it was the ST7789

#

Originally I was going to make it a flag that got passed in

slender iron
#

ya, I'm wondering how long we actually need it high

gilded cradle
#

Probably not that much. I think it is supposed to be closer to 10 microseconds

#

So maybe start with 100 uS and see if it still works

slender iron
#

kk, that'll be much faster

gilded cradle
#

Do you have that display on hand?

slender iron
#

ya, the pygamer advance is a 7789

gilded cradle
#

Ok, that works

slender iron
#

my guess is that the clock speed is the limit

gilded cradle
#

I think it'll probably work without a delay at all, but we threw it in for faster procs

slender iron
#

ya, I think I'll do 1 us to be safe

gilded cradle
#

Sounds good