#circuitpython-dev

1 messages ยท Page 320 of 1

gilded cradle
#

It's has dual Arm Cortex-A7 and Cortex-M4 processors

hybrid scarab
#

โค๏ธ

onyx hinge
ivory yew
#

600 whole bytes

slender iron
#

nope. damien was happy to hear about that savings too

thorny jay
#

Did you hear me?

lone axle
#

yep

slender iron
#

@idle owl you crash?

ionic elk
#

@idle owl dang it I should have thanked you for helping set up the PCBHelpers role

#

thank you for that

onyx hinge
#

I didn't quite get all the info in but I did my best

slender iron
onyx hinge
mental nexus
#

Cool. Iโ€™ll check those out to continue to educate myself. Iโ€™ll create a first draft and then see what corrections and clarifications are useful.

lone axle
#

Neat! I like the idea of Cartridges for PyGamer

slender iron
#

it may have been added before you could subclass group

lone axle
#

Interestingly it does extend Group also, but seems not to use the extended instance in favor of the property one.

slender iron
#

weird!

manic glacierBOT
onyx hinge
#

board.I2C() is preferred. Use busio.I2C if the pins or frequency need to be modified.

#

no idea which oldest version it works in

slender iron
#

I haven't gone through emails yet so spam away ๐Ÿ™‚

tidal kiln
onyx hinge
#

board.I2C() is in docs for 4.0 so there's no excuse there ๐Ÿ™‚

#

@ionic elk if you have secret tips on how to help search engines prioritize one version, send links ?

hybrid scarab
#

Sphinx ๐Ÿ˜ฌ

onyx hinge
#

however, builds cannot be triggered for inactive versions

slender iron
#

@solar whale mute?

onyx hinge
#

oh hey we can have custom 404 pages !

slender iron
#

thanks

mental nexus
#

Thanks!

modern wing
#

Thanks everyone! ๐Ÿ™‚

thorny jay
#

Thanks.

raven canopy
#

hehe. i'm double lurking (in a diff meeting) and was about to link RTD's SEO page. ๐Ÿ˜„

modern wing
#

@raven canopy I use a different laptop for work & personal -- one with external keyboard & mouse, and so often I reach for the wrong one and wonder... "why isn't that showing up? oops. posted in the wrong team chat."

crimson ferry
#

@vivid temple and others:

ESP32-S2 variants:
โ€ข Espressif Saola (-R Wrover with PSRAM) (@ Digikey, etc.; module-only @ Adafruit)
โ€ข Gravitech Cucumber (Saola near-clone) https://www.gravitech.us/curesdebo.html
โ€ข @slender iron Saola-to-Feather adapter (https://oshpark.com/shared_projects/s0SDBOI1)
โ€ข @atomic summit Feather https://unexpectedmaker.com/shop/feathers2-esp32-s2
โ€ข Electronic Cats Feather https://electroniccats.com/store/bast-wifi/
โ€ข Adafruit ...hopefully future #TopSecret :-)

Any others?

solar whale
#

I do a ls boards then copy/paste ....

tulip sleet
thorny jay
#

bang

solar whale
#

must be a way to do it in emacs -- ๐Ÿ˜‰

onyx hinge
#
Mon Aug 10 14:17:42 CDT 2020
jepler@eric:~$ !!
date
Mon Aug 10 14:17:42 CDT 2020
#

it's very old

#

before cursor up keys were invented

thorny jay
#

1978 ...

onyx hinge
#

see y'all later

idle owl
#

Later @onyx hinge!

#

I'm going to drop off as well. Thanks everyone!

onyx hinge
#

@idle owl i'll plan to run the meeting next week. we'll get into a regular cycle at some point soon

tulip sleet
#

!da

idle owl
#

@onyx hinge You running it next week will put us on that cycle. You'd run it every third week.

onyx hinge
#

thanks for hosting us

idle owl
#

Thanks for waiting through my network crash ๐Ÿ˜„

gilded cradle
#

Thanks

hybrid scarab
#

(๏พ‰โ—•ใƒฎโ—•)๏พ‰*โœฒ๏พŸ*๏ฝกโ‹† ORGANISATION! ๐Ÿ˜„

thorny jay
#

@hybrid scarab Do you want to quick chat about what is left to do for Enviro+?

hybrid scarab
#

Potentially tomorrow -am chillin' now. I have a TODO checkbox list on my reply to the 5.x GitHub issue that can be expanded upon

thorny jay
#

Just let me know if you need help in testing or so.

#

I think trying to rewrite example using the new library and Adafruit PM25 would be something I can do.

#

Then it would be visible if there are still oddities or if everything is working.

#

I now have 3 or 4 Feather MCU that I can test with and I have a workflow to copy over a minimum set of files for testing the same thing on all of those board.

hybrid scarab
#

You've presently got 3-4 more feather MCUs than me then! I've been testing on a CLUE ๐Ÿ˜ฌ

#

But- yes- broadly testing and feedback is super useful because I... I'm all alone ๐Ÿ˜ข

thorny jay
#

I believe I have an OCD. I was buying a lot of Pimoroni HAT and pHAT. I solved that problem by buying Adafruit CircuitPython board...

hybrid scarab
#

CircuitPython will get ya'

thorny jay
#

The good news is that if there is ever a Global Pandemic, I would have for years of fun playing with why I have at home already...

#

Part of my plan is to drive Pimoroni HAT and pHAT from CircuitPython... either with Blinka or with an adaptor. I do that already with the CLUE and Bit:2:Pi ... but it will be good to try from a Feather. I ordered a PCB that is supposed to help with that.

solar whale
#

@ionic elk @slender iron Thanks -- very informative! Sorry - i have to leave.

slender iron
#

gets lunch before tackling the email pile

mental nexus
idle owl
#

Fancy!

mental nexus
#

To do: 1) Understand how the input arguments are defined/type checked, set as default values, handling fixed vs variable # of parameters. 2) Understand data type conversion requirements between the C++ side and Python side.

#

I suspect that this library displayio.Shape may not be the best example to use, but it was one that I found that had a function with more than two parameters.

onyx hinge
#

Thanks @ionic elk

manic glacierBOT
idle owl
#

@onyx hinge You still around?

#

Looking at your Adabot PR. There's another one in that, if merged first, is going to cause a (simple, I think) merge conflict. That said, if I merge yours, the newer PR will have a conflict, so it's going to pop up somewhere regardless. Anyway, I had a question about a change. I can ask on the PR.

manic glacierBOT
onyx hinge
#

@idle owl I can take care of merge conflicts, see you in the comments on the PR

idle owl
#

@onyx hinge that works. Thanks.

orchid basinBOT
manic glacierBOT
ionic elk
#

@slender iron pushed the changes, sorry I forgot to after our conversation.

slender iron
#

np

idle owl
gilded cradle
#

Sure @idle owl

idle owl
#

Thanks!

#

@ivory yew @tulip sleet This PR has a merge conflict, simple one as far as I can tell. But you both reviewed it, is it otherwise ready to go now? https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/pull/51

manic glacierBOT
tulip sleet
#

@idle owl @ivory yew I may be misunderstanding, but I believe the BusDevice PR for IC timeouts is not the correct place to fix the problem. The I2C devices hang at a low level, and this problem should be fixed in the C code, and can't really be fixed here. That's why I mentioned https://github.com/adafruit/circuitpython/issues/2253. So I don't think this PR should be merged.

idle owl
#

@tulip sleet Understood. I'll reference your comment and close it this week.

slender iron
#

welp, I found my FS issue!

#

not wifi related

#

@solar whale want to test?

manic glacierBOT
solar whale
#

sure -- just a few minutes

slender iron
#

np, I'm confident it's more correct

solar whale
#

how should I test -- storage.erase_filesystem() ?

slender iron
#

I saw it if you erase, write a code.py, disconnect and then connect again

#

may only be a linux thing

solar whale
#

ok -- will try on linux

slender iron
#

basically if you write the first sector first then it'll be incorrectly written

#

because it'll think it's cached when it isn't

solar whale
#

Looking back at 3133 -- I was not able to reproduce the issue -- but I'll try the PR and see if helps my other linux issues

slender iron
#

kk

solar whale
#

@slender iron after storage.erase_filesystem() I get lots of errors in dmesg

slender iron
#

hrm

#

what are the errors?

solar whale
#

and my linux box hung -- will need to reboot -- cant get to them now ๐Ÿ˜ฆ

slender iron
#

huh, weird

#

may be a separate issue then

solar whale
#

it worked once -- though I had to d a hard reset after the erase to get anywhere.

slender iron
#

ya, I have to do a reset after erase too

solar whale
#

but on second try it was not happy. -- shoukld be able to get to logs in a a minute

slender iron
#

kk

solar whale
#

this may have been my old hang on disconnect issue....

slender iron
#

ya

solar whale
#

will try it on my RPi

#

FS looks OK on it.

#

seems fine on RPi

#

hmm -- on Linux I retried storage.erase_filesystem() and it seem OK -- no CIRCUTPY but I had not done the hard reset yet. -- dmesg has many i/o errors - was trying to capture when the box froze again. this tie I had not unplugged it ..... rebooting again.

#

I think I'm done with Linux testing for now....

slender iron
#

haha, ya

#

do you know what usb controller you have?

#

did the rpi crash or just the other box?

solar whale
#

IIRC its the same as Dans... the RPi is fine

#

do you recall the command to show it?

slender iron
#

I can test with my intel nuc at some point

#

my main linux box is amd

solar whale
#

just sec -- got it

#
Bus 002 Device 008: ID 05ac:828a Apple, Inc. 
Bus 002 Device 004: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Bus 002 Device 003: ID 0424:2512 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 1058:2621 Western Digital Technologies, Inc. Elements 2621
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 006: ID 046d:08b2 Logitech, Inc. QuickCam Pro 4000
Bus 003 Device 003: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 003 Device 013: ID 0461:4d22 Primax Electronics, Ltd 
Bus 003 Device 012: ID 413c:2106 Dell Computer Corp. Dell QuietKey Keyboard
Bus 003 Device 011: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 003 Device 004: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 003 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
jerryneedell@jerryneedell-ubuntu-macmini:~$ 
#

maybe thats not what you wanted

#

If I just plug it in -- mounts OK

slender iron
#

lspci -tv

#

that will print pci things

solar whale
#
-[0000:00]-+-00.0  Intel Corporation 3rd Gen Core processor DRAM Controller
           +-01.0-[04-9a]----00.0-[05-6a]--+-00.0-[06]----00.0  Intel Corporation DSL3510 Thunderbolt Controller [Cactus Ridge 4C 2012]
           |                               +-03.0-[07-37]--
           |                               +-04.0-[38-68]--
           |                               +-05.0-[69]--
           |                               \-06.0-[6a]--
           +-02.0  Intel Corporation 3rd Gen Core processor Graphics Controller
           +-14.0  Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller
           +-16.0  Intel Corporation 7 Series/C216 Chipset Family MEI Controller #1
           +-1a.0  Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #2
           +-1b.0  Intel Corporation 7 Series/C216 Chipset Family High Definition Audio Controller
           +-1c.0-[01]--+-00.0  Broadcom Inc. and subsidiaries NetXtreme BCM57766 Gigabit Ethernet PCIe
           |            \-00.1  Broadcom Inc. and subsidiaries BCM57765/57785 SDXC/MMC Card Reader
           +-1c.1-[02]----00.0  Broadcom Inc. and subsidiaries BCM4331 802.11a/b/g/n
           +-1c.2-[03]----00.0  LSI Corporation FW643 [TrueFire] PCIe 1394b Controller
           +-1d.0  Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #1
           +-1f.0  Intel Corporation HM77 Express Chipset LPC Controller
           +-1f.2  Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode]
           \-1f.3  Intel Corporation 7 Series/C216 Chipset Family SMBus Controller
#

this is an old Mac-Mini with Ubuntu 20.04

slender iron
#

kk

#

I see 3 usb chips in there

#

all intel

#

so I can probably repro on the nuc

solar whale
#

yes -- on the Pi there is only one and its a VIA Technologies VL805 USB 3.0

slender iron
#

yup, makes sense

solar whale
#

sorry -- not much help

#

I have to go offline for the night -- let me know if you need anything tested tomorrow. Good luck.

manic glacierBOT
hybrid scarab
#

Ruh roh, Sphinx strikes again

manic glacierBOT
mental nexus
#

@onyx hinge some questions on my quest to decode CircuitPython core. 1) do you have a good example bindings file to point me to that has best-in-class decoding of KW_style input parameters? 2) whatโ€™s the best way of decoding the *self pointer argument? 3) some functions are very explicit about using some kind of type changing functions to go between C and Python while others seem to throw care to the wind. Do you have a good function you can point to that shows the preferred method converting back and forth (preferably including all three: bools ints and obj)?

onyx hinge
#

I think stuff in displayio should reflect best practices, it's new-ish and scott's vision for how the shared-bindings / shared-modules / common-hal split should work should have been fully realized

stuck elbow
#

seconded

onyx hinge
#

the constructor of Display certainly has so many arguments it should hit all the relevant cases of what kwarg parsing can do

#

the only elaboration I can suggest is in a few cases I've introduced NUM_ARGS as the last item in the argument enum, so that I can write MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); and get a small guard against the enum and array items getting out of sync

stuck elbow
#

is that a compile-time thing?

onyx hinge
#

yeah

#

if you add/remove from the enum but don't add/remove from the array, you get a compile time error

#

@mental nexus ^

stuck elbow
#

neat

mental nexus
#

Thanks @onyx hinge I will focus on understanding Display as current best-practice.

onyx hinge
#

yay I got past the crashes plaguing me friday & monday .. it was not code I had written, it was code I had not yet written. Remaining: Enable the Sharp Memory Display framebuffer object to survive soft-reset

stuck elbow
#

@onyx hinge have you considered using displayio instead of the framebuffer approach?

onyx hinge
#

@stuck elbow "framebufferio", it keeps the full framebuffer in RAM but works with displayio primitives like groups and tilegrid

stuck elbow
#

the memory is what I'm worried about

onyx hinge
#

keeping the whole framebuffer in RAM in this case because the display can only do row-by-row updates and regenerating whole rows is slow. The framebuffer's about 12kB

stuck elbow
#

that's pretty much all the memory you have on a samd21

onyx hinge
#

this is not targeted at samd21

worn lark
#

Hi, I maybe have a bit of a weird question. I have a custom board with a samd21 where I'd like to use PA30 for SPI. Though this pin also is SWCLK. Does this make any problems? I currently get 'invalid pin' when starting spi with my configuration.

hybrid scarab
#

I can't be sure, but I strongly suspect the Circuit Python for the FT232H guide has lots of redundant steps

#

I built myself a driver installer package that targets the VID/PID of the FT232H, skipped the rest of the instructions, and just ran with set BLINKA_FT232H=1 with no problems on Windows 10

#

(Using the LibusbK driver wizard)

ivory yew
#

@worn lark that may not be a valid pin for the sercom peripheral

#

Let me check real quick

hybrid scarab
#

Now reading an LTR559 breakout through an FT232H, that's pretty sweet

#

Would be interested to know why Zadig was used in lieu of a driver package ๐Ÿค”

#

Curse you lot, you've made Blinka/CircuitPython very alluring

ivory yew
#

@worn lark you can use PA30 with SERCOM1 only.

#

If CircuitPython already give sercom1 to another set of pins, you might get that error.

#

But I'm not sure. I'm not all that familiar with our pin allocation stuff.

worn lark
#

I'll see if that is maybe the problem. Thanks so much for checking!

stuck elbow
#

cp uses sercom0 internally, all other is free to use

worn lark
#

do I need to set somewhere which sercom I want to use?

stuck elbow
#

no, it guesses based on the pins

worn lark
#

okidok! thanks ๐Ÿ™‚

stuck elbow
#

but several pins share the same sercom, so if you already use an i2c/uart/spi on some other pins, it may be in use already

worn lark
#

jep, that might be the problem in my case!

stuck elbow
#

swapping the order of initialization may help, because some pins have several sercoms, and it uses the first free

ivory yew
#

yeah, that

ionic elk
#

Isn't SWCLK a hard-protected pin, though, since it's required for debugging? I remember seeing some conversation about someone wanting to free it for another project... maybe that was another port though

idle owl
#

@hybrid scarab Sphinx always strikes. If you run into anything that you're giving more than x-amount of time (you choose what's reasonable), please ping me. I've been through all sorts of ridiculously obtuse Sphinx issues, and may have solutions for you in my head already.

hybrid scarab
#

@idle owl likewise (enough to never touch Sphinx again if I can help it), I think my issue might be a general is-this-the-way-CircuitPython-would-do-it issue as much as a Sphinx issue

idle owl
#

That is also distinctly possible.

hybrid scarab
#

Once upon a time I was naรฏve and full of gusto and thought "I'll do Sphinx docs for all our libraries!"

idle owl
#

I mean, we do. And we fight with it from time to time, but for the most part, the fighting is minimal. After we finally sorted out the kinks.

hybrid scarab
#

Yeah it's like anything else, learn the basics and stick to the same pattern and it'll all just kinda work as long as you don't get too fancy

#

A lot of my early problems stemmed from just being an inexperience Python developer coming in with some radical ideas about how user-facing libraries should work- and- oh boy- Sphinx didn't like those!

idle owl
#

Your issue might be solved by autodoc_mocking analogio. In conf.py in the docs folder (if you're following our standard anyway). Assuming analogio does work in your lib successfully?

hybrid scarab
#

It does, but I'm not 100% sure if I should have the analog setup in my lib, versus expect the user to pass in an analog pin explicitly

idle owl
#

Ah. Fair enough. So you're still working on the API.

hybrid scarab
#

Aye, yes! It can change if it's better

idle owl
hybrid scarab
#

Oh wow, that's... a thing

idle owl
#

That one is a special one, needing a TON of autodoc_mock_imports, but it's ok to do only one thing there if necessary.

hybrid scarab
#

I spent a good 20 minutes searching for an example of my error ๐Ÿ˜†

idle owl
#

Basically it makes Sphinx not try to utilise that function.

hybrid scarab
#

Probably calls "mock.MagicMock()" or something behind the scenes to stub it all out?

idle owl
#

In CircuitPython, a lot of things aren't available outside of the board using them because the libs are separate from the core.

#

So we have to add them there to get Sphinx to stop trying to use them.

#

I don't know if it will solve your particular issue, but it might.

hybrid scarab
#

I have similar issues with testing all of my normal Python libraries- having to mock and stub a whole bunch of stuff out. Though when you're testing you want the mock objects to verify they've been called a certain way/etc

idle owl
#

And that isn't even a thing yet if you're still working on the API.

#

Right

hybrid scarab
#

Yeah I think this is the right answer in terms for Sphinx anyway, thank you!

idle owl
#

You're welcome ๐Ÿ™‚

hybrid scarab
#

Not sure about the API though- I couldn't find another device library that uses a bunch of analog pins

idle owl
#

hmm.

#

Yeah the one I could think of uses a lot of digital pins.

#

Not analog.

hybrid scarab
#

Might still be a pattern to follow

idle owl
hybrid scarab
#

of course I'm almost sure I'd be likely to find both approaches in the wild

idle owl
#

The base for this assumes you're connecting a raw character LCD, which require a LOT of wires. versus the I2C/SPI versions which use breakout adapters to make it use less pins.

hybrid scarab
#

Oooh this link answers a question I never even thought to ask, that docstring is niice

idle owl
#

๐Ÿ™‚ Thanks.

hybrid scarab
#

But yes it looks like it expects an object of type digitalio.DigitalInOut, rather than a raw "pin"

idle owl
#

Check out the Circuit Playground Library if you want to see some serious documentation. It's one of the best documented libs we have.

#

Or code that uses the RGB version, but still.

#

Same idea for the first set of pins.

hybrid scarab
#

Okay some precedent for this approach is very helpful

idle owl
#

But that's not exactly a common thing. CP lib is a wrapper library.

hybrid scarab
#

I kinda feel this is the right approach- asking the user to supply a specific pin type

idle owl
#

Excellent.

hybrid scarab
#

On the off chance that they supply the wrong type of pin, I suppose

idle owl
#

You can throw an exception.

#

With a helpful error message

#

Supplied pin type must be digitalio.DigitalInOut() or some such.

hybrid scarab
#

Aye! thank you

idle owl
#

You're welcome!

hybrid scarab
#

Right- now to continue making a mockery of the FT232H setup ๐Ÿ˜†

idle owl
#

Good luck ๐Ÿ™‚

prime flower
#

@hybrid scarab you could do an if not isinstance(pin, TYPE): raise RuntimeError("Supplied pin type must be digitalio) with kattni's well-written error

manic glacierBOT
#

A common issue when searching for Circuitpython's ReadTheDocs hosted documentation is that the pages for module APIs returned by Google are often very old, sometimes even going back to version 3.x or even 2.x. A prominent warning has been added to these pages to prevent users confusing old APIs for current ones, but a better solution would be to prevent these pages from being indexed by search engines altogether.

I found a [Github issue](https://github.com/readthedocs/readthedocs.org/issu...

worn lark
#

oh guys, sorry. I was not aware that I can not freely choose where miso/mosi/sck go on the sercom pads. I think it's working now ๐Ÿ™‚

hybrid scarab
#

I like that the runtime type checking actually means I still have to mock AnalogIO for Sphinx ๐Ÿ˜†

#

Yay! FT232H set up clean on a Windows 10 laptop that's never even had Python installed

#

Now I need to take it off my lap because it's a hot day and I'm on fire

prime flower
#

couldn't find another device library that uses a bunch of analog pins

hybrid scarab
#

That would appear to have the same pattern as the DigitalIO example, which is a two-for-two confirmation that I need to slightly refactor

#

Enough for me to assume that "pass in a pin of a specific type" is a rule of thumb

#

So I can replace:

 def __init__(self, ox_pin, red_pin, nh3_pin, enable_pin=None): 
     self._enable_pin = None 
     if enable_pin is not None: 
         self._enable_pin = digitalio.DigitalInOut(enable_pin) 
         self._enable_pin.direction = digitalio.Direction.OUTPUT 
         self._enable_pin.value = True 
     self._ox_adc = analogio.AnalogIn(ox_pin) 
     self._red_adc = analogio.AnalogIn(red_pin) 
     self._nh3_adc = analogio.AnalogIn(nh3_pin) 
#

with something like:

    def __init__(self, ox_pin, red_pin, nh3_pin, enable_pin=None):
        self._enable_pin = enable_pin
        if enable_pin is not None:
            self._enable_pin.direction = digitalio.Direction.OUTPUT
            self._enable_pin.value = True
        self._ox_adc = ox_pin
        self._red_adc = red_pin
        self._nh3_adc = nh3_pin

(docstrings and type checking notwithstanding)

prime flower
#

much cleaner!

orchid basinBOT
hybrid scarab
#

Let's see if this build passes, whee!

manic glacierBOT
#

On the ESP32-S2, PulseIn and PulseOut are handled by a dedicated IR remote control peripheral, the RMT, which can both generate and receive pulse trains with a variable frequency carrier signal. Since this peripheral is completely independent of the ESP32's PWM peripheral, it does not make sense to require a PWMOut object, as is currently required by the API.

Since there is no set reason why PulseOut needs PWM set up externally, even on other ports, this suggests a change could be made to...

orchid basinBOT
#

I do have some experience with doing this on a PHP-based website. I'm not sure how well that would transfer to Jekyll, but we maintained phrase lists for each language, similar to how we do it with CircuitPython, and just substituted it in the phrases. For missing phrases, we could use English as a fallback such as adding new boards.

So there's really 2 parts to this. The first is the actual translations for the page, which I think would be the easier part. I think it would be similar to h...

ionic elk
#

@slender iron @tulip sleet Dahanzimin is sending me some CH579 chips, which is a 5 RMB/.72 cent BLE chip with equivalent ram and flash to the SAMD21. Wants to know if they'd be accepted into Circuitpython - I figure there's no reason they wouldn't?

manic glacierBOT
stuck elbow
#

so, I don't want to introduce panic, as I don't have a reproducer, but does anybody else get kernel panics on Linux due to usb stuff with the 6.x versions of CircuitPython?

#

I just had a third one

lone axle
#

I think I recall seeing something about people having USB related kernel issues on Linux recently, but I'm not sure if it was specific to 6.X

#

I think maybe Danh looked into it possibly

stuck elbow
#

I have seen him working on the issue that happened when you reformatted the filesystem

#

but this is when you disconnect the board

#

(or reset it)

lone axle
#

Ah that might have been it then, and a different thing. I don't have any experience using Circuit Python USB devices on Linux yet personally. The time is coming though.

slender iron
#

@stuck elbow I know @solar whale has been seeing this. do you have intel usb host chips?

stuck elbow
#

this is most likely a Linux bug anyways, external devices shouldn't be able to cause crashes like this

slender iron
#

@ionic elk we'll accept it but not do the work to add it

stuck elbow
#

@slender iron not sure, but possible, this is X1 Carbon

slender iron
#

@hybrid scarab in general I like to pass objects in because then the pin can be provided by a different driver

stuck elbow
#

0a:00.0 USB controller: Fresco Logic FL1100 USB 3.0 Host Controller (rev 10)

slender iron
#

interesting!

#

I haven't had a problem on my arch linux box

stuck elbow
#

but also 07:00.0 System peripheral: Intel Corporation JHL6540 Thunderbolt 3 NHI (C step) [Alpine Ridge 4C 2016] (rev 02)

slender iron
#

I think jerry had an intel thunderbolt controller too

#

last time we had an issue on intel chips it was a timing issue in tinyusb

stuck elbow
#

they are incredibly buggy

#

they don't even work with their own docks

solar whale
#

My Linux box has become almost unusable for CP -- It often hangs when I disconnect. I've moved to my Mac and Raspberry Pi 4s -- no issues there.

stuck elbow
#

the year of Linux on the desktop \o/

slender iron
#

do we have a tinyusb issue? can we repro with a tinyusb example?

stuck elbow
#

@slender iron I don't think this is a tinyusb issue, since the moment you disconnect/reset it, it doesn't matter what it does

slender iron
#

I know dan reach out to kernel devs about it

solar whale
#

It is a relatively recent (last few months) problem. for me I seemed to really notice it about the time I started using esp32s2's -- I thought it was related...

slender iron
#

we have updated tinyusb to get s2 support

solar whale
#

It happens with other boards as well now.

#

hmm -- coincidence....

slender iron
#

I bet checking a beagle trace may shed some light

solar whale
#

"beagle trace" ??

slender iron
#

a usb trace using a beagle device

stuck elbow
#

a hardware debugger

#

not beaglebone

solar whale
#

IF you can give me some examples of how to test tinyusb, I'll be happy to experiment with it.

slender iron
#

this example is a dummy cdc and msc device

solar whale
#

Thanks -- I see what I can break....

slender iron
#

thanks as always!

solar whale
#

@slender iron FYI -- for the esp32s2, it looks like I have to use the example in cdc_msc_freertos. Should I try that on all or use the cdc_msc on the others?

manic glacierBOT
slender iron
#

@solar whale non-freertos on the others

solar whale
#

ok -- first test on esp32 did not kill anything ....so far so good

manic glacierBOT
solar whale
#

@slender iron have tried esp32s2 and feather_m0 express -- several connect/disconnects TinyUSB_MSC comes up with no issues so far. -- all on Linux box.

slender iron
#

hrm. interesting!

manic glacierBOT
solar whale
#

hmm -- gets a bit confused if I plug in both at the same time -- does not appear to recognize the second one

manic glacierBOT
solar whale
#

or -- it recognizes it, but does not show a new drive mounted

#

maybe expecting too much of the example...

manic glacierBOT
solar whale
#

yes -- dmesg shows the second device as "sdd" first is "sdc" no errors just does not mount the "sdd" device. Don't think I need to pursue that.

#

hmm -- RPI -- mounts both -- maybe another Linux issue

#

Also tried on feather_m4_espress -- no issues connecting/disconnecting

silver tapir
#

@solar whale Some linux automounters (that would be software on the desktop side, not on the kernel) have a timeout in case a device is being read twice. As long as it shows up in dmesg and you can mount it manually, it should be ok.

solar whale
#

yes -- both seem to be working fine. I won't worry about this. So far I can't crash the linux box with this example.

manic glacierBOT
solar whale
#

@stuck elbow FYI --- when my Linux box hangs, I dont even see a kernel panic it just freezes immediately on disconnect of the USB -- I have to power cycle. Nothing reported in the logs.

stuck elbow
#

same here

manic glacierBOT
stuck elbow
#

I just assumed it hides the kernel panic message, since it's an ubuntu derivative and they don't like to confuse users with error messages

solar whale
#

@slender iron At this point, it looks like TinyUSB is well behaved on Linux on the M0,M4,esp32s2 --- I'll keep trying things and let you know if anything odd comes up, but it seems pretty solid so far.

slender iron
#

ok, so it may actually be circuitpython then

#

or the older version of tinyusb we're using

#

or some timing thing with msc interface

solar whale
#

or something else ๐Ÿ˜‰

slender iron
#

yup

solar whale
#

Thats a nice test -- you can connect to /dev/ttyACM0 and it prints a message and echos keystrokes as well.

slender iron
#

yup! and the fs is held in ram

manic glacierBOT
solar whale
#

@slender iron I put CP (tip of main) back on my feather_m4 express and it hung the linux box on the first disconnect ....

slender iron
#

the CP tinyusb version will be a little different

#

but I doubt that is it

#

may be timing related that changes with the slow writes to real flash

manic glacierBOT
solar whale
#

do you want me to document these tests somewhere?

slender iron
#

ya, on the issue would be great

solar whale
#

your new issue -- I can't find another one related?

tulip sleet
#

@solar whale do you have crash dumps in /var/crash? You'll need to sudo to see them. If not, you can apt install linux-crashdump (I think) to get them to show up. there. The dmesg file is the most interesting, and will show a stack backtrace.

slender iron
#

a new one? is there not one yet?

solar whale
#

I'm not finding one.... @tulip sleet do you know of a related issue?

tulip sleet
solar whale
#

thats it. thanks

tulip sleet
#

i'm not sure there was an issue

solar whale
#

for linux-crashdump -- it is asking if I want it to boot to kexec on a reboot -- Do I?

tulip sleet
#

i don't remember; what is the default?

solar whale
#

oh - thats a PR -- Do you want me to add my notes on tinyusb testing to it or start a new issue for these linux crashes

#

looks like no -- I'll take it

#

took all defaults

manic glacierBOT
tulip sleet
#

yes, a new issue would be good. I think there are multiple cases. The storage.erase_filesystem() was just the easiest way to get a crash, but I was beaten down in the linux-usb mailing list saying that I shouldn't expect it not to crash. But I also see crashes just on unplug, which is not necessarily the same thing. That should not cause crashes, because anyone can pull a USB drive suddenly. I am wondering if it's a FAT12-handling issue.

#

I have seen crashes on unplug only recently.

solar whale
#

AS I noted, I seem to recall them starting about the same time I started using the esp32s2. I initially thought it was only an esp32s2 issue. FYI -- what i just dis was build the tinyusb example/device/cdc_msc for feather_m0,feather_m4,esp32s2 and did several connect/ disconnects on each with no problem on the Linux box.. Then I restored latest CP to feather_m4 and it hung the lInux box on first disconnect.

tulip sleet
#

it's worth reading the bug report I submitted and the linux-usb correspondence. Could you add those to your new issue also?

#

(they are mnetioned in the PR)

raven canopy
#

@tulip sleet @solar whale a few months ago when i was going through this, i could reliably repro with microcontroller.reset into bootloader.

solar whale
#

@raven canopy is that the same isue dan was seeing associated with File Sytem reformat? For me it is on physical disconnect of the USB plug

raven canopy
#

ahh. nevermind then...

crimson ferry
#

@slender iron did random get explicitly removed from the latest esp32s2 builds?

tulip sleet
#

@raven canopy, no, it could be the same thing. I think there may be two problems: one is crash on disconnect; the other is crash on quick reconnect. The disconnect crash may happen if there is some ongoing activity on the USB drive.

#

Please do take a look at the issue after Jerry creates and add your two cents.

slender iron
#

@crimson ferry maybe. I think @ionic elk may have disabled it because we don't support the true random number generator

crimson ferry
#

oh ๐Ÿ˜ฆ OK, thanks

solar whale
#

@tulip sleet once I have the linux-crashdump installed, how to I make use of it after I reboot from a crash

slender iron
#

@crimson ferry you could turn it back on. it'll use the clock to seed the random generator otherwise

tulip sleet
#

just look in /var/crash as root. You'll see some dated directories. e.g. I have this:

halbert@salmonx:~$ sudo ls -R /var/crash
/var/crash:
202008050000  202008071843  linux-image-5.4.0-42-generic-202008050000.crash
202008052303  202008072211  linux-image-5.4.0-42-generic-202008052303.crash
202008071839  kexec_cmd     linux-image-5.4.0-42-generic-202008071839.crash

/var/crash/202008050000:
dmesg.202008050000  dump.202008050000

/var/crash/202008052303:
dmesg.202008052303  dump.202008052303

/var/crash/202008071839:
dmesg.202008071839  dump.202008071839

/var/crash/202008071843:
dmesg.202008071843  dump.202008071843

/var/crash/202008072211:
dmesg.202008072211  dump.202008072211
halbert@salmonx:~$ 
#

the dmesg files are what's readable. They'll have a traceback.

#

I cannot remember everything I did to set this up. I did something more elaborate and I'm not sure exactly what is generating these. But you don't have these now, is that right?

solar whale
#

correct

#
/var/crash/:
total 6204
drwxrwsrwt  2 root         whoopsie    4096 Aug 11 15:33 .
drwxr-xr-x 14 root         root        4096 Apr 23 03:42 ..
-rw-r--r--  1 root         whoopsie       0 Aug 11 15:33 kdump_lock
-rw-r--r--  1 root         whoopsie     312 Aug 11 15:33 kexec_cmd
-rw-r-----  1 jerryneedell whoopsie 6334327 Aug 10 20:54 _usr_share_discord_Discord.1000.crash
-rw-r--r--  1 jerryneedell whoopsie       0 Aug 10 20:53 _usr_share_discord_Discord.1000.upload
-rw-------  1 whoopsie     whoopsie      37 Aug 10 20:54 _usr_share_discord_Discord.1000.uploaded
tulip sleet
#

yah, apport puts crashes of other programs there, I think.

solar whale
#

ok -- just killed it -- but this time it is doing some sort of reboot on its own ....

#

oooh ```[sudo] password for jerryneedell:
/var/crash/:
202008111542
kdump_lock
kexec_cmd
linux-image-5.4.0-42-generic-202008111542.crash
_usr_share_discord_Discord.1000.crash
_usr_share_discord_Discord.1000.upload
_usr_share_discord_Discord.1000.uploaded

/var/crash/202008111542:
dmesg.202008111542 dump.202008111542
jerryneedell@jerryneedell-ubuntu-macmini:~$

tulip sleet
#

it can take a while; that's a bit of a disadvantage

#

upload the dmesg and I can point out what to look for

#

if it's not obvious

solar whale
#
[  554.275212] general protection fault: 0000 [#1] SMP PTI
[  554.275222] CPU: 5 PID: 5454 Comm: kworker/5:1 Kdump: loaded Tainted: P           OE     5.4.0-42-generic #46-Ubuntu
[  554.275225] Hardware name: Apple Inc. Macmini6,2/Mac-F65AE981FFA204ED, BIOS MM61.88Z.0106.B0A.1509111654 09/11/2015
[  554.275235] Workqueue: events acm_softint [cdc_acm]
[  554.275242] RIP: 0010:acm_read_bulk_callback+0x11f/0x280 [cdc_acm]
[  554.275247] Code: 44 24 10 48 c7 c1 70 a8 47 c1 48 c7 c2 5b a6 47 c1 48 c7 c7 48 d4 47 c1 48 8d 70 30 e8 9a ae 0d ee 4d 8b 34 24 e8 e1 14 cc e
d <49> 89 86 60 02 00 00 49 63 45 18 f0 49 0f ab 84 24 80 07 00 00 ba
[  554.275250] RSP: 0018:ffffb303c01e8ca8 EFLAGS: 00010016
[  554.275253] RAX: 000000811a85cab8 RBX: 00000000ffffffb9 RCX: 0000000000000018
[  554.275256] RDX: 0000000000000000 RSI: 000000000062a4ce RDI: 0013ec2bf0fc0f53
[  554.275258] RBP: ffffb303c01e8cc8 R08: 00000000ffffffb9 R09: 0000000000000080
[  554.275260] R10: 0000000000000310 R11: 000000022ea4c310 R12: ffff93409dc8a000
[  554.275263] R13: ffff93409dc8a668 R14: 6ace3cfc1dbe9fd2 R15: ffff9340a47ee000
[  554.275266] FS:  0000000000000000(0000) GS:ffff9340a7140000(0000) knlGS:0000000000000000
[  554.275269] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  554.275271] CR2: 00007f8e0d4fd000 CR3: 000000020900a001 CR4: 00000000001606e0
[  554.275273] Call Trace:
#
[  554.275289]  __usb_hcd_giveback_urb+0x7a/0x120
[  554.275294]  usb_hcd_giveback_urb+0xca/0xe0
[  554.275300]  xhci_giveback_urb_in_irq.isra.0+0x7b/0xf0
[  554.275304]  xhci_td_cleanup+0xf6/0x140
[  554.275308]  finish_td+0xcc/0x190
[  554.275313]  handle_tx_event+0x55d/0x11c0
[  554.275318]  xhci_irq+0x27a/0x3d0
[  554.275322]  xhci_msi_irq+0x11/0x13
[  554.275330]  __handle_irq_event_percpu+0x42/0x180
[  554.275335]  handle_irq_event_percpu+0x33/0x80
[  554.275339]  handle_irq_event+0x3b/0x5a
[  554.275343]  handle_edge_irq+0x93/0x1c0
[  554.275347]  do_IRQ+0x55/0xf0
[  554.275353]  common_interrupt+0xf/0xf
[  554.275356]  </IRQ>
[  554.275362] RIP: 0010:vsnprintf+0x34e/0x4e0
#

I think this is where it happened

onyx hinge
#

This feels like a bug, anybody have opinions? The lock on the board.SPI() object can survive soft resets! (nrf52840 particle xenon): ```>>> import board

board.SPI().try_lock()
True

soft reboot
...
Adafruit CircuitPython 6.0.0-alpha.2-190-g817a52228 on 2020-08-11; Particle Xenon with nRF52840

import board
board.SPI().try_lock()
False

tulip sleet
#

yep, that's what they want to see. It would be interesting to know if this is this pretty much the same for all crashes or is different. If you (and anyone else, e.g. @raven canopy) can start collecting these in a new issue then I can bring it up again on the linux-usb mailing list (maybe only to be beaten down again).

solar whale
#

OK -- in this case _ was connected to the REPL when I unplugged. I don't think that is relevant but will do more tests.

tulip sleet
#

i think it might be quite relevant, if related to CDC

#

@onyx hinge it does look like a bug

raven canopy
#

i never could get crashdump to grab the panic on the Pi, and then it stopped happening. ๐Ÿ˜ฆ

solar whale
#

I have not seen it on a Pi.

#

Not my issue anyway -- will try to reproduce yours....

raven canopy
#

all of mine were on ubuntu server; didn't see anyone have issue on Raspbian.

manic glacierBOT
tulip sleet
#

@onyx hinge is it just that board, just nrf, or is it across ports?

manic glacierBOT
#

For the past few moths, I have noticed that sometimes when I physically disconnects CP boards USB plug, the Linux system immediately "locks" up requiring a Power Cycle to recover.

this may be related to #3223
for reference @dhalbert reported this to the Linux folks: here is his correspondence:
My original Ubuntu bug report:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1871143

Correspondence on the linux-usb mailing list:
https://marc.info/?l=linux-usb&m=159387610928589&w=2
...

solar whale
#

@tulip sleet let me know what I left out of the issue... I'll keep adding reports and crash dumps -- but probably not until tomorrow....

manic glacierBOT
onyx hinge
#

@tulip sleet I only checked nRF so far

simple pulsar
#

@tulip sleet Hello. Did you have any thoughts on achieving predictable ordering of the ManufacturerData fields in Advertisement subclasses? https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/1185#issuecomment-670944106

manic glacierBOT
tidal kiln
#

what's the best way to clear out a displayio.Group? i.e., remove all items that have been added via append()

simple pulsar
#

@tidal kiln I don't know if it's the best way but I use this for clean-up of Group objects ``` def emptyGroup(self, dio_group):
"""Recursive depth first removal of anything in a Group.
Intended to be used to clean-up a previous screen
which may have elements in the new screen
as elements cannot be in two Groups at once since this
will cause "ValueError: Layer already in a group".
This only deletes Groups, it does not del the non-Group content."""
if dio_group is None:
return

    ### Go through Group in reverse order
    for idx in range(len(dio_group) - 1, -1, -1):
        ### Avoiding isinstance here as Label is a sub-class of Group!
        ### pylint: disable=unidiomatic-typecheck
        if type(dio_group[idx]) == Group:
            self.emptyGroup(dio_group[idx])
        del dio_group[idx]
tidal kiln
#

thanks. i'd want to remove tilegrids also.

#

there's remove and pop, but i'm seeing something odd trying to use those

simple pulsar
#

Actually the description is wrong

tidal kiln
#

it looks correct? you're checking type and only removing Groups?

simple pulsar
#

That's for the recusive destruction of any Group within a Group

#

I think I evolved the whole thing and didn't revisit the description

tidal kiln
#

oh. i see. recursive call.

stuck elbow
#

@tidal kiln I think you should be able to just do dio_group[:] = []

#

the garbage collector will take care of the recursive destruction

tidal kiln
#
>>> splash[:] = []
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NotImplementedError: Slices not supported
simple pulsar
#

@stuck elbow @tidal kiln Does group allow you to do that? I'm not sure if it has a full implementation of all the bits for sequences

#

Ah, indeed

stuck elbow
#

ouch

tidal kiln
#

@stuck elbow like that? looks like there's a slice support issue maybe?

stuck elbow
#

yeah, I can't understand why the groups are their own thing instead of being python collections

#

alternatively, you can just make a new group and let the garbage collector free the old one

tidal kiln
#

yah, i'm think that may be the way.

stuck elbow
#

just make sure no references to it are left anywhere

simple pulsar
#

Have you hit the ValueError: Layer already in a group ?

stuck elbow
#

I only ever have one group in my programs

tidal kiln
#

not sure if this is a bug?

Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit PyPortal with samd51j20
>>> import displayio
>>> splash = displayio.Group()
>>> layer1 = displayio.Group()
>>> layer2 = displayio.Group()
>>> layer3 = displayio.Group()
>>> layer4 = displayio.Group()
>>> splash.append(layer1)
>>> splash.append(layer2)
>>> splash.append(layer3)
>>> splash.append(layer4)
>>> len(splash)
4
>>> for layer in splash:
...     print("removing")
...     splash.remove(layer)
... 
removing
removing
>>> 
simple pulsar
#

You're modifying something you are iterating over

#

You need to know the per-language rules for doing that.

stuck elbow
#

it's hard to write that nicely without slicing

#

maybe something like:

try:
    while True:
        splash.pop()
except IndexError:
    pass
raven canopy
#

could you just del splash and re-create?

simple pulsar
#

In some cases splash will be being displayed.

lone axle
#

maybe:

while len(group) > 0:
    group.pop()
manic glacierBOT
tidal kiln
#

@lone axle maybe

Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit PyPortal with samd51j20
>>> import displayio
>>> splash = displayio.Group()
>>> layer1 = displayio.Group()
>>> layer2 = displayio.Group()
>>> layer3 = displayio.Group()
>>> layer4 = displayio.Group()
>>> splash.append(layer1)
>>> splash.append(layer2)
>>> splash.append(layer3)
>>> splash.append(layer4)
>>> len(splash)
4
>>> while len(splash) > 0:
...     print("removing")
...     splash.pop()
... 
removing
<Group>
removing
<Group>
removing
<Group>
removing
<Group>
>>> len(splash)
0
>>> 
#

and that behavior with remove may be what @simple pulsar mentioned

manic glacierBOT
tulip sleet
#

@simple pulsar Sorry, I missed your comment. I just answered now. I get about 500 emails a day and sometimes I miss one, especially because there's a lot of chaff in my GitHub emails.

simple pulsar
#

@tulip sleet NP, thanks, I'll go through it tomorrow,

tidal kiln
#

@simple pulsar thanks. i'll take a look.

manic glacierBOT
#

Every time I try to make mpy-cross I get a type-error. It seems that micropython was getting a similar error a few years back. They have an issue on their GitHub repository.

(base) user@mycomputer mpy-cross % make
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Traceback (most recent call last):
  File "../py/makeversionhdr.py", line 107, in 
    make_version_header(sys.a...
lone axle
#

@simple pulsar @tidal kiln if they are not worried about memory usage and want a way to show the image without converting it I believe the imageload library should support bmp images with negative height.

slender iron
#

yeah, I can't understand why the groups are their own thing instead of being python collections
@stuck elbow because I had enough to do when I implemented them and a static allocation up front doesn't secretly grow

lone sandalBOT
onyx hinge
#

and because a list couldn't enforce the "a tilegrid is in at most one list" invariant, which could lead to interestingness ๐Ÿ˜œ

silver tapir
#

Hosted via IPFS and build with Hugo.

#

SVG source for Quetzalblinka is in the site's blog.

manic glacierBOT
#

I downloaded the repository as a zip file directly from your GitHub repository.

I updated pip (v20.2.2), git (v2.24.3), homebrew (2.4.11), and python (v.3.7).

I retried the unzipped repository again and received the same error message.

Then I cloned the repository from git and received this error when I tried to make it:

(base) shadow@pypict mpy-cross % make
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
...
lone sandalBOT
manic glacierBOT
#

I am very happy to have NEOPIXEL working ( thank you all), but noticed this unexpected difference between the WROOM and the WROVER boards

No NEOPIXEL in dir(board)

Adafruit CircuitPython 6.0.0-alpha.2-216-gbbac68e77 on 2020-08-11; Saola 1 w/Wroom with ESP32S2

import board
dir(board)
['class', 'IO0', 'IO1', 'IO10', 'IO11', 'IO12', 'IO13', 'IO14', 'IO15', 'IO16', 'IO17', 'IO18', 'IO19', 'IO2', 'IO20', 'IO21', 'IO26', 'IO3', 'IO33', 'IO34', 'IO35', 'IO36', 'IO37', 'IO38'...

soft patio
#

This has probably been asked many times before. What toolchain is used when building Circuitpython 6? I'm assuming it has changed since 9-2019-q4-major for Circuitpython 5. Or do I assume too much?

stuck elbow
#

@soft patio still GCC

soft patio
#

@stuck elbow Still 9-2019-qr-major or 9-2020-q2-update or maybe even 10-2020-q2-preview?

stuck elbow
#

there is an issue for gcc 10 on the bugtracker, it doesn't fully work yet IIRC

soft patio
#

In the Adafruit documentation for building, the mention specific versions of the toolchain: "For CircuitPython 5 development we are using the 9-2019-q4-major version. If you want to build CircuitPython 4, use the 7-2018q2-update version." I'm guessing then that it isn't a significant issue which recent verions I use (but avoid 10)?

thorny jay
#

Reproducible build? Did we try and compare automatic build on GitHub and manual build at home to see if it is binary exactly the same result? It is always reassuring to have exactly the same result both from a security point of view and to know everything is properly setup.

solar whale
#

a few months ago when i was going through this, i could reliably repro with microcontroller.reset into bootloader.
@raven canopy When you had this issue -- what board were you using? With a feather_m4_express, I tried import microcontroller microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER) microcontroller.reset() and it reset into BOOTLOADER OK on a RPi 4

hybrid scarab
#

Connector or socket on the feather board? I just opened the M4 Feather and our Enviro+ FeatherWing and they both come with breakaway pin headers ๐Ÿ˜†

solar whale
hybrid scarab
#

Oooooh! That's an idea

#

All my fancy headers are in the office, ahh!

solar whale
hybrid scarab
#

Pretty sure I've got some of those floating about, possibly, unless Nat stole them for his feather ๐Ÿ˜†

#

Though I might wait for midday to pass before I brave The Great Outdoors

stuck elbow
#

note that male headers should always point down

#

female up

#

this way you can plug it into a breadboard

manic glacierBOT
hybrid scarab
#

You can still plug it into a breadboard if the headers point up ๐Ÿคฃ for a fun challenge transposing the pinout diagram.

stuck elbow
#

you can't see the leds and don't have access to the reset button then

#

and if you are not consistent, half your wings won't fit

hybrid scarab
#

Hard mode!

stuck elbow
#

I had to make some adapter boards with female headers on both sides

hybrid scarab
#

I was a little tempted to do that

stuck elbow
#

wasn't easy to solder

hybrid scarab
#

But the result would be... jaunty!

#

Did you deadbug solder them end-to-end?

stuck elbow
#

I inserted the female headers in the same holes on both sides

#

and soldered them from the side

hybrid scarab
#

๐Ÿ˜ฌ

stuck elbow
#

yeah, never again

#

male ones are easier, you can get long pin headers

hybrid scarab
#

yeah Iโ€™ve got a box of wonders in my office somewhere that I think has some of those left in from some arduino boards

manic glacierBOT
#

That is an odd error. Do you have an adafruit_character_lcd directory or .py in CIRCUITPY? It would take precedence over what's in lib, due to sys.path.

One thing though, is that you can't use a current bundle with 3.x. Many things have changed incompatibly since 3.x. You can try a much older bundle, like https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/tag/20190111

raven canopy
#

@solar whale it was any board for me. Metro M4, Grand Central, and a Feather M0. Again though, this was running Ubuntu Server, and it stopped happening.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

/lib is ok. This is sys.path:

>>> import sys
>>> sys.path
['', '/', '.frozen', '/lib']

I tried copying all the .py files over to / (not /lib, that was too much trouble), and when I do the import, I run out of memory. You'll need 3.x .mpy files from an old bundle; the .py files are too big.
My guess is that there's some kind of file corruption or incomplete copy, which is causing the error you see. Try erasing everything and copying some older .mpy's instead. I was unable to d...

#

I think the "compression increased length" message is inaccurate. It is comparing the length in Unicode code points to the length in bytes of the compressed string.

so for example, consider this one:

Note: compression increased length 'ๆผ”็ฎ—ๅญใŒใ‚ตใƒใƒผใƒˆใ—ใฆใ„ใชใ„ๅž‹' 14 18
len(utf8) = 42 len(utf16) = 28

The length in code points is 14, the compressed length in bytes is 18, but it's MUCH less than the length in UTF-8 encoding of 42 bytes, or in UTF-16 encoding of 28 bytes.

#

A "literal" compression could compress each unicode code point into a ceil(log2 |values|) bit number, so that's probably the "best" comparison. By that measure, only 3 of the ja strings in circuitbrains_basic_m0 have their length increased by compression. For example:

Note: compression increased length 'ใ‚คใƒณใƒ‡ใƒณใƒˆใฎ่งฃ้™คใŒใ€ๅค–ๅดใฎใฉใฎใ‚คใƒณใƒ‡ใƒณใƒˆใƒฌใƒ™ใƒซใซใ‚‚ไธ€่‡ดใ—ใพใ›ใ‚“' 31 35
len(unicode) = 31
len(utf8) = 93
len(utf16) = 62
len() * log2 |values| = 35

Since you have to pay 1 bit per message to indicate whether...

hybrid scarab
#

@timber mango did you give your Pinout.xyz for CircuitPython idea any more thought?

#

I don't know if you've seen it- but there's a micro:bit one now too- which Josh (EduBlocks) mostly cleaned up and finished for us - https://microbit.pinout.xyz/

#

Though I think the variety of host boards in the Feather ecosystem might change up the format quite considerably

manic glacierBOT
tidal kiln
#

is something changing in 6.x that's going to allow long ints on smaller boards, like trinket m0?

Adafruit CircuitPython 6.0.0-alpha.2 on 2020-07-23; Adafruit Trinket M0 with samd21e18
>>> import time
>>> dir(time)
['__name__', 'localtime', 'mktime', 'monotonic', 'monotonic_ns', 'sleep', 'struct_time', 'time']
>>> time.monotonic()
90.376
>>> time.monotonic_ns()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NotImplementedError: No long integer support
>>> 

or are those extra time methods just slipping through for some reason?

onyx hinge
#

@tidal kiln no, long int support for those boards is not likely to happen. @slender iron do we prefer NotImplementedError in these cases, vs not having the member at all? It is a trade off since you can't say if hasattr ....

tidal kiln
#

for ref, here's 5.3.1:

Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit Trinket M0 with samd21e18
>>> import time
>>> dir(time)
['__name__', 'monotonic', 'sleep', 'struct_time']
>>> 
slender iron
#

I prefer the exception because it actually explains the issue

tidal kiln
#

is that the change then for 6.x? putting the methods back in and then throwing an exception?

slender iron
#

at least in that case, check the commit log

onyx hinge
#

Fix for Issue #2812. Instead of reporting a missing attribute for functions such as time.time() and time.mktime(); platforms that do not have long integer support will raise a NotImplementedError

manic glacierBOT
tidal kiln
#

@onyx hinge ^^ thanks!

solar whale
#

@onyx hinge have we ever considered not offering all translations for the smaller boards?

onyx hinge
#

@solar whale yeah @slender iron prefers not to approach it that way

solar whale
#

ok

slender iron
#

languages are important

onyx hinge
#

The most advanced user can get the source, reenable what we had to disable for languages, and get their customized build in US english. A new user who doesn't have the knowledge to do any of those things benefits most from havning the translated core. All that said, I keep feeling like each time we hit size limits on M0 that "maybe this time it's the time we have to make the undesirable decision" and compromise on translations... I will work hard each time to find other ways, though.

slender iron
#

there are other things we can optimize instead

#

the uart pin finding logic is large and could be simplified for boards with few pins

fringe trench
#

This may be a completely off-base idea.

#

Why do the translated languages take up more space in the binary?

#

Is it a function of the character sets we're using for the translations?

slender iron
#

ya, the unicode strings tend to be longer (ja) and the words can be longer too (de)

fringe trench
#

I think UTF-8 isn't always the most efficient encoding, but I do think it's the standard.

#

๐Ÿ˜•

slender iron
#

yup

#

cross byte compression would probably help a bunch

fringe trench
#

I guess I just need to get my dev environment set up and start hammering on this.

slender iron
#

help is always welcome ๐Ÿ™‚

fringe trench
#

Well, before I lost power I ordered 9 Espressif boards to poke at S2 support, because I guess that's a thing that needs to happen?

solar whale
#

@slender iron I agree that languages are important. I was just wondering if a compromise on the most constrained boards would be better for all. Would the users prefer more functionality over more languages. Just a thought. Sounds like it has been considered and dismissed. That's fine. As noted, people can make custom builds ...

fringe trench
#

Still have to try to get everything updated on this machine.

tulip sleet
#

a translation could be put in a file that lives in CIRCUITPY, leaving more room for firmware, but that would still make some languages diffrent

onyx hinge
#

@fringe trench fwiw the translated strings are huffman coded UTF-16, with an optimization applied when none of the characters in the translation are above unicode 255.

manic glacierBOT
manic glacierBOT
#

It looks like #2143 (specifically, 863655044e0b08a917ebaebcd6c33094391d5f87) made it impossible to use C14 and C15 on stm32f411ce-blackpill โ€“ trying to construct a DigitalInOut on either of those pins complains that they're already in use. The datasheet certainly suggests that you should be a bit careful using them:

PC13, PC14 and PC15 are supplied through the power switch. Since the switch only sinks a limited amount of curren...

slender iron
#

esp folks tune into show and tell later for something exciting!

#

got his demo going

manic glacierBOT
thorny jay
#

I don't know if you've seen it- but there's a micro:bit one now too- which Josh (EduBlocks) mostly cleaned up and finished for us - https://microbit.pinout.xyz/
@hybrid scarab Sorry, no I did nothing, except suggest it should exist and Adafruit could spy on your code. Yes I noticed the micro:bit version and was unsure if it was really Josh. Also as far as I remember his EduBlocks also work at least with the CPX. The reality today is that even for some Adafruit Feather Wing, it is unclear what pin are in use. Sometime the best hint are parenthesis (.) (.) . around the used pin. I don't worry about the host boards, I just worry about what is physically in use and connected. One difficulty is to handle board where you can select the pins you enable or not with some soldering bridge or cut.

#

I am "good" at having idea and making suggestion (like a zip file always up to date with the library needed for a project or a board). But I don't have the time nor skill to implement that.

manic glacierBOT
thorny jay
#

note that male headers should always point down
@stuck elbow Except if you use double sided breadboard such as this https://www.kickstarter.com/projects/252587878/cake-board-new-lego-friendly-solderless-breadboard then you can have the Feather on top and the MCU on the other side. Pimoroni was selling something like that, but I could not find the product anymore (but I have one or two at home). Cc: @hybrid scarab

Kickstarter

Evolved Solderless Breadboard! Stackable board with thru-holes for multiple-layer design. And whatโ€™s more is itโ€™s LEGOยฎ friendly!

onyx hinge
#

@tulip sleet cpx_displayio: how do you feel about dropping rotaryio instead of audiobusio? Otherwise, I can add code to only enable pdmin and not i2sout and it'll probably start fitting maybe

#

actually SCSU seems kinda maybe relevant, as a compression step before huffman... though they don't really discuss how well these techniques work on CJK scripts

#

the script that does the compress step could really use some organization to facilitate testing alternatives like this .. though the size of the decoder in "C" / bytes of ARM code is pretty critical too, you can't judge "success" from just decreasing the compressed translation message size

manic glacierBOT
onyx hinge
#

I had read that some proprietary toolchains can compress the part of the flash memory that holds data that is stored in RAM but is initialized other than with all zeros .. but then I checked, and the savings in CircuitPython would probably be negative, since the decompressor costs memory size. trinket_m0 only has 276 bytes in its data section, for instance

#

SCSU appears to need a LOT of memory by CircuitPython standards

#

(it has either 128 or 256 "windows", not sure yet. 256 of anything is a lot)

onyx hinge
#

Without fully elaborating it, it's no sure thing that I got the code right.. but I made a "SCSU-like" encoding. Characters from 32 - 127 encode themselves, 1 is a special "page change" byte (followed by page number) and characters from 128 to 256 encode a non-ASCII character within a page. It encodes the Japanese translation more densely than UTF-8, but huffman-compressing it is worse than huffman-compressing the UTF-16.

#

there are 104 distinct "pages" used in the Japanese translation

#

encoding the "page shift" operation as code values starting at 256 is better than encoding them as a shift byte followed by the page number, but not by enough

#

only about 50% of the time are two non-ASCII symbols from the same page

orchid basinBOT
#

After this past weekend's inadvertent errors on the contributing page, I wondered if we could add some testing to the CI.

This is a very limited prototype, that only tests 3 of the 4 sections in contributing. It builds and serves a local site via Jekyll, and tests the site with a pytest function. It compares the resulting site build against the actual source data from the S3 bucket.

This should be easily expandable to include more parts of the site, but I understand there are like...

manic glacierBOT
#

This is to resolve issue https://github.com/adafruit/circuitpython/issues/3004, my request for bitmap "slice" function.

This function copies a selected rectangle of a source bitmap into the target bitmap. One palette index can be skipped from being copied using the skip_index parameter. This supports the updates for text handling using the bitmap_label.py library that has been developed to reduce memory usage for text.

This function added 1024 bytes to the .uf2 file that I built f...

manic glacierBOT
manic glacierBOT
#

The latest 3.x release I could find is this: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/tag/20190909
It worked, but I'm still getting this weird error, saying GPIO4 is in use. When the CIRCUITPY is plugged in and I reset using the button, it's outputting the following:

boot.py output:
main.py output:
Traceback (most recent call last):
  File "main.py", line 6, in <module>
  File "adafruit_character_lcd/character_lcd_rgb_i2c.py", line 87, in __init__
  File ...
manic glacierBOT
onyx hinge
#

Because some of the texts found by preprocessing are not actually in the final binary, any scheme which compresses everything together will include unused strings and make things bigger. In particular, these

            if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
                terse_str_format_value_error();
            } else {
                mp_raise_ValueError(translate("single '}' encountered in format string"));
            }

So saying "oh let's use a better compressor on the whole corpus (and e.g., separate messages with the \0 byte)" is unlikely to pay off. You've got to pay for the better decompressor's code size AND for the unused messages AND the runtime cost of going through up to half of the message catalog every time to find what you're looking for.

#

these also throw off the huffman weights a bit but probably not much.

stuck elbow
#

@onyx hinge I'm curious, how is the problem from your example solved?

#

how do you determine if a string is actually in the binary from a run-time check like the one you quoted?

onyx hinge
#

LTO is able to see the message is never produced so it's translated form is omitted from the binary. The test is actually a compile time constant

stuck elbow
#

but we don't use LTO? I remember there were problems with it

onyx hinge
#

We do for samd and nrf, not for others I think

#

There are always problems initially turning it on, so for the ports that seem to have a lot of space it's off

stuck elbow
#

so how many strings are like that? what order of magnitude are we speaking about here?

onyx hinge
#

I think the "terse" is the most common cause for this, so you could count them easily. Dozens I think.

#

But I'm almost certain they disappear from our most constrained m0 builds

stuck elbow
#

if it's mostly one variable, wouldn't it be easy to work around it?

#

for example, by putting them in an additional translation file

#

that is also conditionally included

onyx hinge
#

You could change a few to #If and see if the binary got smaller. If it did, we'd want to do it across the board

stuck elbow
#

does the code that collects strings for translation understand preprocessor directives?

#

because most tools I've seen don't

onyx hinge
#

Yes it does, makeqstrdefs

#

It determines which strings are still in the source after preprocessing

stuck elbow
#

nice

onyx hinge
#

Indeed

stuck elbow
#

I think that example above should be an #if anyways, for clarity

#

LTO or not

onyx hinge
#

If you felt like doing some mindless work .. there might be some reason for it I don't understand though

#

I'd check with tannewt before getting started though

#

unless you determined it did improve binary size, then we'd be for it for that reason

#

afk for awhile

tulip sleet
#

@onyx hinge I tried meowbit_v121 without removing _pypixelbuf, to see how much space it overflow by.But it still fits nicely:

m -rf build-meowbit_v121 
halbert@salmonx:~/repos/jepler/circuitpython/ports/stm$ make BOARD=meowbit_v121 LOCALE=ja
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated

384664 bytes used, 8552 bytes free in flash firmware space out of 393216 bytes (384.0kB).
53464 bytes used, 44436 bytes free in ram for stack and heap out of 97900 bytes (95.60546875kB).
#

so I do not understand what is going on that you would see an overflow

onyx hinge
#

CI did see it though

#

CI is bulding with main branch merged in, did something change in main? (I didn't merge main in again)

#

afk for real this time

tulip sleet
#

8k bytes seems like a lot; ttyl

stuck elbow
#

@onyx hinge I don't mind mindless work, I'm a python programmer after all

tulip sleet
#

@onyx hinge never mind, my fault, i did LOCALE=ja, not TRANSLATION=ja ๐Ÿคฆ

solar whale
#

Nice -- you found a way to save 8K bytes ๐Ÿ˜‰

onyx hinge
#

@tulip sleet ah the -Os solution is better than mine. Can you review and merge it now?

tulip sleet
#

@onyx hinge The stm Makefile doesn't have CFLAGS_INLINE_LIMIT or -flto; wasn't necessary so far, but there's plenty more to add for squashing STM builds

#

@onyx hinge did you try anything like converting ja to UTF-16 and then doing huffman 16 bits at a time? Id don't know the density of UTF8 vs UTF16 for characters that are mostly 16-bit.

orchid basinBOT
#

โ€ฆ Wio Terminal's RTL8720DN in CircuitPython.


Wrote to Seeed about WiFi/BLE support in the Wio Terminal, received the following message:

Hi
Thank you for like our wio terminal product.
We have a wiki to introduce the Circuitpython.
But we have no plan to add Wifi and BLE on the RTL8720DN chip supported in
CircuitPython.

Thanks for your time and patience.
Regards

manic glacierBOT
tulip sleet
#

@long forum I looked for info about software support for the RTL8720DN, and found absolutely nothing. Do you have any leads on that? If the RTL8720DN provides the HCI serial protocol to control it to use BLE, then it would be possible in the long run. I am implementing _bleio for HCI, targeting the ESP32, but another HCI-based BLE module should be easy to port to, with maybe essentially no changes. We would not do that work, but it would be possible.

mental nexus
#

Here's the next extension of my graphical understanding of the connections between CircuitPython and C, this time with a cursory look at how parameters are passed and decoded. With a few mentions about type conversions. Corrections and clarifications are welcome!

tulip sleet
#

@mental nexus that looks great! I have not proofed it in detail. We have something roughly similar here: https://learn.adafruit.com/extending-circuitpython, but it's out of date. Do you have any interest in turning what you wrote into a (major) revision of this guide or a new guide?

ionic elk
#

@onyx hinge have you talked to @fiery silo about font storage?

mental nexus
#

@tulip sleet I actually referred to that guide when I got started, but it is a bit terse for my current ability. I think the linear scrolling visuals of this guide made it hard for me to make all the connections. I scoured examples like this and tried making these "2D" connections (minus the yarn and push-pins on a CSI corkboard). I'd be glad to contribute back what I am learning from y'all. Let me know what your feedback and I can see how to convert this over to something usable by others. I've yet to make a learn guide but am willing to figure it out with a few examples and some guidance.

tulip sleet
#

Thanks, I will bring it up internally and we'll get back to you!

manic glacierBOT
#

PC14 and PC15 are reserved as low speed oscillator (LSE) pins on virtually all STM32 development boards. Since circuitpython depends on this oscillator for low power operation and use of the RTC, we do not provide any way to overwrite it - these pins are rarely even exposed on development boards for this reason (the Blackpill being sort of an outlier in this case).

If you urgently needed access to these pins for some reason, it is possible that we could add a flag to disable the external L...

ionic elk
#

@slender iron do you want me to leave that NEOPIXEL wroom label issue alone as something a beginner could contribute or can I fix it real quick

onyx hinge
#

@tulip sleet yes, the huffman codes are built off the UTF-16 code points and have been for some time

#

@ionic elk no, and realistically I won't have time to work on that anytime soon ๐Ÿ˜• kmatch98 and foamyguy have been very interested and active with font and text stuff in displayio though, they might be resources

manic glacierBOT
ionic elk
#

@onyx hinge I just mentioned it because it seemed like you were really diving into the storage

onyx hinge
#

ah that's the connection .. but we don't even have most of the ja characters, I don't think that's where the additional storage requirement is coming from. I say that because there are a large number of messages about characters not being in the font ..

ionic elk
#

Babel got me up and running with unicode for Japanese really fast which is why I brought it up.

onyx hinge
#

yasssssss we have a japanese translation now ๐Ÿ™‚ thank you danh

#

and thank you ciscorn whereever you are

ionic elk
#

So what is the Japanese translation in? Where is CJK stored?

onyx hinge
#

The messages in the core marked translate()

ionic elk
#

I guess you don't need any font support for the REPL but if you run DisplayIO what happens? Does it just appear as unicode binary?

#

Sorry for dumb question. I originally thought you fit the CJK fonts onto Circuitpython somehow but I guess the actual size reduction for the translations was just required because the actual translations ended up being bigger in terms of actual bytes?

#

I wonder if we could get Babel or just regular unicode fonts onto an SD card, and have them available for DisplayIO that way... or a CPY board with Babel built in as "Feather International".

tulip sleet
#

that's right; the messages strings are just longer

#

and/or don't compress as well

ionic elk
#

yeah I should have arrived at that conclusion sooner, fitting CJK on CPY makes no sense

#

@tulip sleet what does happen with DisplayIO right now though?

#

in terms of displaying repl errors

tulip sleet
#

i think you just see junk; it can't display what it doesn't have

#

or boxes or whatever

ionic elk
#

Hmm, definitely seems like a devboard with a 4MB flash with 2MB used for Babel Unicode might be an opportunity there

#

Especially for something with a built in screen

tulip sleet
#

i think there's no one using just the screen for debugging, since they always have a host computer. It might be more an issue of printing native language strings, from the user program, as opposed to the canned messages. e.g., can I print "Hello, World", in Japanese with the terminal font? probably not ??

ionic elk
#

^ yeah no you def can't

#

the Babel thing I'm mentioning is the font package @fiery silo made for the Open Book, it's all the unicode characters squeezed into under 2MB, so it fits on a nor flash

#

But I'm just spitballing. Might be something to wrap into a future board aimed at international education or something like that, so it has fast native font support.

fiery silo
#

so i have displayio labels working in babel (at least for left-to-right languages, so far) but i definitely optimized more for speed and less for space... it works well on a board like the pygamer where it's a 2MB font file on an 8MB flash chip, but it would take up all the space on a board like the feather express

ionic elk
#

@fiery silo you beat any font I could find online for both speed and space at readable sizes. But honestly I'd say speed is the more important thing anyway, I'm still not sure if it was a bug but the last time I tried unmodified unicode on Circuitpython it took about 2s per character

#

Anyway I don't mean to put pressure on you lol, I'm just thinking that if I or anyone else were making a CPy board for international use, like for education or something, a 4MB flash chip with half used for Babel might be a really nice touch. Since we're already seeing small CPy communities spring up in Japan, China, etc.

#

Either that or you figure out something with compressed fonts via SDIO and ship the board with a font SD included, which would probably be slower

fiery silo
#

i dunno about speed (tho i did tests, and seeking in the font file on the QSPI flash was at least as fast as reading font data from the dedicated SPI flash chip), but my worry there is that if SD the card got removed, you'd no longer have any glyphs to print an error message in the user's language

#

and no pressure felt, no worries! ๐Ÿ™‚ in fact i thought about revising the open book to do away with the second flash chip and just have one 4MB QSPI flash for code and font data, once i saw speed wasn't a concern

manic glacierBOT
#

That makes sense, thanks! Yeah, being new to STM32 and to CircuitPython I basically have no idea what I'm doing :upside_down_face:

It's not a huge deal; there's at least one spare IO I can attach a bodge wire to and use instead. There are a couple of other issues with the Blackpill for this usecase too, so I think ultimately the plan is to switch to a SAMD51 board which should have regular GPIO pins in the place of the Blackpill's C14/C15.

#

Sounds good - if you'd like more help with your specific application, feel free to ask on the Adafruit Discord, there are be lots of people who would be happy to help select a chip with the right IO for whatever it is you're trying to do. You could also look into other STM32 boards that have more IO, like a Discovery board or something similar. F411 MCUs go up to 100 pin packages, with whole new banks for PDxx and PExx

Closing this issue since it sounds like a workaround is acceptable.

orchid basinBOT
#

This was to be expected, however I may have heard another story in a recent
Adafruit video. Maybe during a Show and Tell, Phil was relaying a question
from the chat about WiFi...

Le jeu. 13 aoรปt 2020 ร  17:14, John Fink notifications@github.com a รฉcrit :

โ€ฆ Wio Terminal's RTL8720DN in CircuitPython.

Wrote to Seeed about WiFi/BLE support in the Wio Terminal, received the
following message:

Hi
Thank you for like our wio terminal product.
We hav...

orchid basinBOT
#

A note I left for @ adr in Discord:

If the RTL8720DN provides the HCI serial protocol to control it to use BLE, then it would be possible in the long run. I am implementing _bleio for HCI, targeting the ESP32, but another HCI-based BLE module should be easy to port to, with maybe essentially no changes. We would not do that work, but it would be possible.

summer belfry
#

Quick question if anybody is generous enough to answer. I just flashed my Seeeduino XAIO (Samd21) with circuitpython. The storage went from a little over 7 megabytes to 47 kilobytes. Why does this happen, and is it possible to unlock the rest of that storage?

stuck elbow
#

@summer belfry my guess is that it's now only using the internal flash for storage

#

@summer belfry where did you see the 7MB storage size?

slender iron
#

the 7mb was probably the fake uf2 partition

stuck elbow
#

it doesn't look like it has any external flash memory, looking at the schematic

#

you could probably make it a haxpress, but that's some effort

summer belfry
#

Yeah the datasheet said it only had 256kb of flash memory, but I dragged a 7mb file onto it before flashing and it worked fine. Honestly confused

stuck elbow
#

the uf2 filesystem is simulated, it doesn't actually store the files

#

it's just a way to flash the device

summer belfry
#

ahh. So you think there's any way to utilize the full 256kb of flash, or not without advanced knowledge? I'm a normie

stuck elbow
#

you are already utilizing it โ€” the circuitpython firmware itself takes up the rest of space

summer belfry
#

I see. Thanks!

mental nexus
#

How do you measure the amount flash used for a given CIrcuitPython build?

slender iron
#

it's output at the end of the build

ionic elk
#

we don't have that for ESP32-S2 yet, though, right? Or is there an option I should be turning on?

slender iron
#

correct, it isn't setup for -s2

#

you'll know when you go over though, it won't boot when you do

mental nexus
#

Wow how did I miss that? Thanks @slender iron

slender iron
#

the maximum size is fixed by the linker script usually

long forum
#

@tulip sleet no, no leads other than the mail I got from Seeed asking about potential support and them saying no.

manic glacierBOT
orchid basinBOT
manic glacierBOT
idle owl
#

I've got this PR that uses finally in it, and I'm unclear on how it works. There is a while True: loop under a try: and then finally with a single command under it. Traceback implies that on ctrl+C in the serial console, it runs the code under finally. This does not clear up the why or how, simply what it's appearing to do.

#

@tulip sleet or @onyx hinge Do either of you happen to know and can explain the above? I don't want to merge something I have no grasp on.

onyx hinge
#

typing Ctrl-C creates a KeyboardInterrupt exception

tulip sleet
#

the code in a finally: runs no matter what, even if an exception happens (or not)

idle owl
#

The python docs imply that finally is meant to run the code in it regardless of whether try results in an exception.

#

Oh.....

onyx hinge
#

that causes all of the normal things that occur when an exception is raised to happen

idle owl
#

That's the exception being generated.

#

I had forgotten that part.

onyx hinge
#

you could also katch the KeyboardInterrupt exception if you wanted

idle owl
#

In my mind there was no exception, so I was confused how it was doing anything.

onyx hinge
#

I am not sure whether there's a way to change how the finally processes in the case of a KeyboardException

tulip sleet
idle owl
#

@tulip sleet That's what I read, but I don't understand how it's running that code no matter what since that stops the rest of the code from working. It only runs it on ctrl+C

#

Reading.

onyx hinge
tulip sleet
#

even if there is an exception (nothing is caught) in the try block, it will do i2c.unlock()

#

and if there's no exception, it will also unlock

idle owl
#

Then how does the while True loop work at all?

tulip sleet
#

the ctrl-c exception is not caught, but before it happens, we want to unlock

idle owl
#

oh hmm

#

I feel like it's starting to become clearer. Still fuzzy.

onyx hinge
#

using busdevice also takes care of this for you, but this example doesn't use it

idle owl
#

Yeah the I2C scan is super basic, it's supposed to be.

onyx hinge
#

(in a slightly different way)

tulip sleet
#

the while True scans the bus over and over, every two seconds. You can control-C out of it, and the program will stop, but before the program stops, we want to unlock. So this guarantees that happens

idle owl
#

Oh!

#

Ok

#

That makes a lot more sense when put that way.

onyx hinge
#

but this only matters because of a bug -- if you lock you i2c and then re-run code.py in any way, it should not remain locked

#

(does reloading because of writing to CIRCUITPY also happen via KeyboardInterrupt?)

idle owl
#

Apparently it hangs pretty bad sometimes. With I2C scan. It totally did that with another sensor on my desk, I figured something was up with the sensor. Not sure.

#

Thank you so much @tulip sleet and @onyx hinge

tulip sleet
#

@onyx hinge There is an mp_reload_exception, but it doesn't have a name (you can't raise it from Python).

#

no wait, I am wrong, it does have a name, ReloadException. (bad grepping on my part)

onyx hinge
#

OK, but it happens via exception so you would get all the unlocks and finallys that are there. good.

tulip sleet
#
halbert@salmonx:~/repos/circuitpython$ ag reloadException
halbert@salmonx:~/repos/circuitpython$ ag ReloadException
#

are not the same thing

#

right, it delays until it would be safe to do a regular exception

#

that's Scott's idea

onyx hinge
#

makes sense to me

mental nexus
#

git question: I've have circuitpython fork called the old "master" that is way behind on commits. I made some updates on my local branch "bitmap_v2". I need to get my master up to date and merge it into my updates on my local branch. I think I need to reconnect somehow to the recently renamed "main" branch and then do some git commands to merge. I see some notes about "rebase" but I've heard that is dangerous! I'd be glad to have y'all git gurus to give me some incantations to use to reach git-nirvana.

raven canopy
mental nexus
#

Thanks sommersoft, will study that and see if I can get it figured out.

ionic elk
#

@slender iron I have a part of PulseIO that must be regularly serviced - FreeRTOS's ring buffer will crash the entire RMT if it fills up, so I need to periodically empty it. However, I can't access a callback based on the RMT interrupts (they're reserved by the idf). I tried to put these in background.c, but I'm finding that doesn't seem to consistently run. Do you have any suggestions?

#

Should background tasks be running as code.py does?

onyx hinge
#

you can "enable ticks" while your thing is running, that is intended to make the 1ms background task happen reliably.

#

supervisor_enable_tick when your peripheral is created (or starts capturing) and supervisor_disable_tick when it is deinitialized (or stops capturing)

#

@ionic elk

ionic elk
#

hmm. Interesting - ticks seem to be enabled the first time it runs off reset, but then maybe they get turned off.

#

A combination of that and a fix in the reset code fixed it, thanks @onyx hinge

onyx hinge
#

yeah there are probably bugs in that area

ionic elk
#

I'll check out the ticks stuff for ESP32 - I know there was an issue with STM32 where we accidentally had Systick on until a specific delay in Microcontroller was called that happened to turn it off. So it was disguising other errors until you called certain functions and then everything would break

#

Might be something similar here.

manic glacierBOT
#

Ok, I think I got all the requested changes in place. I struggled with git for a while but I think I found ally merged in all the changes from the main branch. I hope this works...

Many thanks for all the corrections above. Iโ€™m still learning a lot of things, so I appreciate you taking the time to help me out. And if this function takes up too much space I wonโ€™t be offended if you decide not to merge it. Anyway please let me know what additional inputs you have, I appreciate it.

manic glacierBOT
mental nexus
#

@raven canopy thanks for the git pointer yesterday. I got my local branch renamed to main, and then I proceeded to pull my hair out thinking that it wasnโ€™t updated when it actually was. My local only had a main now, but didnโ€™t realize that github now had both a master AND a main branch on it. I spent an hour looking at the github status of master wondering why it wasnโ€™t updated. Bleh... ๐Ÿคท

raven canopy
#

@mental nexus yeah, it can be a little daunting to keep local and GitHub in sync sometimes. did you update your GitHub to have main as the default branch? if you do that, you can go ahead and delete master afterwards to remove further confustion.

onyx hinge
#

fwiw I like to keep two remotes in my github -- "origin" (adafruit/circuitpython) and "jepler" (jepler/circuitpython). When I want to create a new branch, I "git fetch origin; git checkout -b new-branch-name origin/main^{}". I don't have to keep "my" main/master branch up to date at all.

#

I know that guides have suggested a different workflow but I have not grasped the benefit of doing it differently than I already learned how to do

raven canopy
#

for the core, i have adopted a similar system. i have a local with my fork as origin, a local with adafruit as origin, and then a local for each tagged version (result of docs work).

mental nexus
#

Just changed my default to main, thanks for the suggestion. Also it was making commits as my wifeโ€™s name. I think I figured that out too.

onyx hinge
#

@ionic elk had another suggestion about makefiles and tab-completion. If you're using the lowercase-m makefile trick, you can add targets like board-name: ; $(MAKE) BOARD=board-name. Then make board-name becomes tab-completable with the standard make tab completion in bash-completion.

#

seems like you have to repeat this for each board but you only have to do it once

#

also if you want to build a lot of boards you can do that via make rules, Scott recently added something for this in the top-level Makefile.

#

well that's curious, but there's probably nothing to be done about it ... ```>>> framebuffer = sharpdisplay.SharpMemoryFramebuffer(bus, board.D2, 400, 240)

displayio.release_displays()
framebuffer
None
framebuffer is None
False

#

(it's an object of type NoneType, but it is not at the same memory address as NoneType)

manic glacierBOT
#

.. when constructing the SPI bus again after reset.

Testing performed: on nRF52840, that these sequences would work repeatedly when soft-resetting in between invocations:

import displayio, board, sharpdisplay
displayio.release_displays()
bus = board.SPI()
framebuffer = sharpdisplay.SharpMemoryFramebuffer(bus, board.D2, 400, 240)

and

import displayio, board, sharpdisplay, busio
displayio.release_displays()
bus = busio.SPI(board.SCK, MOSI=board.MOSI)
framebuffer = sha...
onyx hinge
#

Does this seem like a familiar bug to anybody else? is my bundle just out of date? I have some labels that I keep changing, and the label position has moved left over time on the screen. it's using anchor_point / anchored_position. @lone axle ?

slender iron
#

@mental nexus @onyx hinge I also don't keep my master/main branch up to date. I just work off adafruit/main directly

mental nexus
#

@onyx hinge please get the latest version of label.py and report back.

slender iron
#

ESP32-S2 technical reference has USB and I2S sections now

onyx hinge
#

@mental nexus with the version in the latest bundle it also happens

#

the text seems to migrate left over time

idle wharf
#

ESP32-S2 technical reference has USB and I2S sections now
@slender iron Is that in the Espressif IDF docs or in an AdaFruit doc ?

onyx hinge
#

reestablishing the anchored_point and anchored_position each time the text is changed seems to help or fix it

#

@mental nexus I'll file a bug report about this after lunch, unless you think I should check with the absolute newest label, not just the bundle (august 11) version

mental nexus
#

@onyx hinge I think the last PR merge was the same day so I assume you have the latest revision. Please make an issue and I will take a look.

lone axle
#

Interesting we definitely did have a bug like that at one point but I did think it was taken care of with one of the recent PRs. If you are seeing that in the latest one from the bundle then we will want to take another look and see if either we re-introduced it or missed one of the cases where it occurs back when we fixed it.

manic glacierBOT
#

MICROPY_PY_COLLECTIONS_ORDEREDDICT is set individually for every port. We should centralize it's use to py/circuitpy* settings. MICROPY_CPYTHON_COMPAT is an example of a setting that has already been centralized.

../../ports/unix/mpconfigport.h
102:#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)

../../ports/nrf/mpconfigport.h
63:#define MICROPY_PY_COLLECTIONS_ORDEREDDICT       (1)

../../ports/mimxrt10xx/mpconfigport.h
43:#define MICROPY_PY_COLLECTIONS_ORDEREDDICT        ...
mental nexus
#

@slender iron Ouch I didnโ€™t realize it added all those files to the commit. I was being careful to do git add file name but I think something must have gone way wrong during the merge from main. What are your suggestions on how to resolve?

slender iron
#

looks at the git commit history

#

I've never seen the 2 file thing

#

I'd probably do an interactive rebase. It should ignore the merge commit

#

I'd also suggest ignoring your own main/master

#

it just adds an extra step and no benefit

mental nexus
#

In order to create the circuitpython.pot you said
You'll need to merge the latest changes from main and probably also run make translate to get your new warning strings added to circuitpython.pot.
But maybe I also pulled in some old stuff from my master/main?

slender iron
#

ya, merging tends to be easier

#

I honestly have no idea where the 2 came from

#

the submodules I've seen before because they usually need to be updated separately

mental nexus
#

So I want to somehow grab the "adafruit/circuitpython/main" and merge in my three files and call it the same branch bitmap_v2

slender iron
#

mind if I walk you through it? start with git remote -v so I know what your remotes are named

mental nexus
#
iMac-86:circuitpython margaret$ git remote -v
origin    https://github.com/kmatch98/circuitpython.git (fetch)
origin    https://github.com/kmatch98/circuitpython.git (push)
source    https://github.com/adafruit/circuitpython.git (fetch)
source    https://github.com/adafruit/circuitpython.git (push)
upstream    https://github.com/kmatch98/circuitpython.git (fetch)
upstream    https://github.com/kmatch98/circuitpython.git (push)
slender iron
#

kk, so next do git fetch source

#

that will get the latest from the adafruit repo

mental nexus
#

Done.

slender iron
#

are you on your local bitmap_v2?

#

then git rebase -i source/main

mental nexus
#
iMac-86:circuitpython margaret$ git branch
  bitmap_copy
  bitmap_insert
  bitmap_trial
* bitmap_v2
  bitmap_write
  main
  restart
slender iron
#

(or we can rename source to adafruit which I think is clearer)

mental nexus
#
iMac-86:circuitpython margaret$ git rebase -i source/main
Auto-merging shared-bindings/displayio/Bitmap.c
CONFLICT (content): Merge conflict in shared-bindings/displayio/Bitmap.c
error: could not apply 1dd4e51a7... Added bitmap.blit function for copying slices of bitmaps
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 1dd4e51a7... Added bitmap.blit function for copying slices of bitmaps
slender iron
#

so the rebase should present a list of commits

#

what does git status show?

mental nexus
#

A lot of files listed. Here's at the top:

slender iron
#

so the idea with rebase is that it's basically redoing your edits based on the latest version

mental nexus
#
iMac-86:circuitpython margaret$ git status
interactive rebase in progress; onto 98469322b
Last command done (1 command done):
   pick 1dd4e51a7 Added bitmap.blit function for copying slices of bitmaps
Next commands to do (7 remaining commands):
   pick 14294bfbe Added bitmap.blit function for bitmap slice copy
   pick 5581f25ec Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'bitmap_v2' on '98469322b'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    modified:   shared-bindings/displayio/Bitmap.h
    modified:   shared-module/displayio/Bitmap.c

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
    both modified:   shared-bindings/displayio/Bitmap.c

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   extmod/ulab (new commits)
    modified:   frozen/Adafruit_CircuitPython_BLE (new commits)
    modified:   frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center (new commits)
    modified:   frozen/Adafruit_CircuitPython_BusDevice (new commits)
    modified:   frozen/Adafruit_CircuitPython_CircuitPlayground (new commits)
    modified:   frozen/Adafruit_CircuitPython_Crickit (new commits)
    modified:   frozen/Adafruit_CircuitPython_DRV2605 (new commits)
    modified:   frozen/Adafruit_CircuitPython_DS3231 (new commits)
#

a long list of "modified" files

#

and some "untracked" files

slender iron
#

right and those modified ones are submodules

#

so do git submodule update --init

mental nexus
#

The untracked files all have a " 2" at the end.

slender iron
#

we can leave those untracked

mental nexus
#

Ok, it did a lot of churning and is done.

slender iron
#

ok, how does git status look?

mental nexus
#
iMac-86:circuitpython margaret$ git status
interactive rebase in progress; onto 98469322b
Last command done (1 command done):
   pick 1dd4e51a7 Added bitmap.blit function for copying slices of bitmaps
Next commands to do (7 remaining commands):
   pick 14294bfbe Added bitmap.blit function for bitmap slice copy
   pick 5581f25ec Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'bitmap_v2' on '98469322b'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    modified:   shared-bindings/displayio/Bitmap.h
    modified:   shared-module/displayio/Bitmap.c

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
    both modified:   shared-bindings/displayio/Bitmap.c

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    ports/atmel-samd/asf4_conf/same54/hpl_dac_config 2.h
    ports/atmel-samd/asf4_conf/same54/hpl_gclk_config 2.h
    ports/atmel-samd/asf4_conf/same54/hpl_mclk_config 2.h
    ports/atmel-samd/asf4_conf/same54/hpl_nvmctrl_config 2.h
slender iron
#

kk, so we can ignore untracked. open shared-bindings/displayio/Bitmap.c and find the >>>> marks

#

that's where you'll need to hand merge your changes with the newer code from main

mental nexus
#

Ok, I'll look into that file.

#

Hmm.. This looks like the really old version of the file.

slender iron
#

yeah, it'll be the old version of your changes because this is just the first commit

#

that's totally ok

mental nexus
#

Ok, so just resolve any of these >>> lines?

slender iron
#
Last command done (1 command done):
   pick 1dd4e51a7 Added bitmap.blit function for copying slices of bitmaps
Next commands to do (7 remaining commands):
#

yup

#

once this is merged we'll continue to apply your commits to it

#

the first tends to be the toughest

mental nexus
#

Got it. I made the updates. Here is status:

#
iMac-86:circuitpython margaret$ git status
interactive rebase in progress; onto 98469322b
Last command done (1 command done):
   pick 1dd4e51a7 Added bitmap.blit function for copying slices of bitmaps
Next commands to do (7 remaining commands):
   pick 14294bfbe Added bitmap.blit function for bitmap slice copy
   pick 5581f25ec Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'bitmap_v2' on '98469322b'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    modified:   shared-bindings/displayio/Bitmap.h
    modified:   shared-module/displayio/Bitmap.c

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
    both modified:   shared-bindings/displayio/Bitmap.c

Untracked files:
  (use "git add <file>..." to include in what will be committed)
slender iron
#

k, now git add shared-bindings/displayio/Bitmap.c and then git rebase --continue

mental nexus
#
iMac-86:circuitpython margaret$ git rebase --continue
[detached HEAD 4ba9ff892] Added bitmap.blit function for copying slices of bitmaps
 Author: Margaret Matocha <ksmatocha@gmail.com>
 3 files changed, 94 insertions(+), 1 deletion(-)
error: Your local changes to the following files would be overwritten by merge:
    shared-module/displayio/Bitmap.c
Please commit your changes or stash them before you merge.
Aborting
hint: Could not execute the todo command
hint: 
hint:     pick 5581f25ec4a9b03a19adcab88ecdec29d13dd94c Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
hint: 
hint: It has been rescheduled; To edit the command before continuing, please
hint: edit the todo list first:
hint: 
hint:     git rebase --edit-todo
hint:     git rebase --continue
Could not apply 5581f25ec... Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
slender iron
#

what does git status show?

mental nexus
#
iMac-86:circuitpython margaret$ git status
interactive rebase in progress; onto 98469322b
Last commands done (4 commands done):
   pick 5581f25ec Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
   pick 14294bfbe Added bitmap.blit function for bitmap slice copy
  (see more in file .git/rebase-merge/done)
Next commands to do (6 remaining commands):
   pick 5581f25ec Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
   pick 14f5d03b6 bringing up to date
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'bitmap_v2' on '98469322b'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    ports/atmel-samd/asf4_conf/same54/hpl_dac_config 2.h
    ports/atmel-samd/asf4_conf/same54/hpl_gclk_config 2.h
    ports/atmel-samd/asf4_conf/same54/hpl_mclk_config 2.h
    ports/atmel-samd/asf4_conf/same54/hpl_nvmctrl_config 2.h
    ports/atmel-samd/asf4_conf/same54/hpl_osc32kctrl_config 2.h
slender iron
#

weird that git status doesn't show shared-module/displayio/Bitmap.c as edited

mental nexus
#

Should I have done a commit after the add above?

slender iron
#

no, the rebase should do that for you

#

because it's updating redoing an existing commit

#

try git rebase --continue again

mental nexus
#
iMac-86:circuitpython margaret$ git status
interactive rebase in progress; onto 98469322b
Last commands done (5 commands done):
   pick 14294bfbe Added bitmap.blit function for bitmap slice copy
   pick 5581f25ec Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
  (see more in file .git/rebase-merge/done)
Next commands to do (5 remaining commands):
   pick 14f5d03b6 bringing up to date
   pick 3d26ab150 Updated formatting of stubs for Python documentation
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'bitmap_v2' on '98469322b'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    modified:   shared-bindings/displayio/Bitmap.c
    modified:   shared-module/displayio/Bitmap.c

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
    both modified:   locale/circuitpython.pot

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    ports/atmel-samd/asf4_conf/same54/hpl_dac_config 2.h
    ports/atmel-samd/asf4_conf/same54/hpl_gclk_config 2.h
    ports/atmel-samd/asf4_conf/same54/hpl_mclk_config 2.h
slender iron
#

ok, so locale/circuitpython.pot needs merging

mental nexus
#

Ok, do I "git add locale/circuitpython.pot"?

slender iron
#

after you've done the merges yes

#

so the file should have no >>>> in it

mental nexus
#

Oh, I'll look for >>>>'s.

#

There's 23 of them, does it matter how I resolve them?

#

I'm not sure what I'm lookint at.

slender iron
#

you can also do git checkout locale/circuitpython.pot and then make translate

#

the checkout will replace the merge conflict version with the one from main and then the make translate will re-include the strings you added

mental nexus
#

Ok, will do that.

slender iron
#

you'd only want to manually merge if you added translations

mental nexus
#
iMac-86:circuitpython margaret$ git checkout locale/circuitpython.pot 
error: path 'locale/circuitpython.pot' is unmerged
#

Should I go ahead with make translate?

slender iron
#

sure, you can try that

#

I'm not sure it'll work though

#

actually, I think it will

mental nexus
#
iMac-86:circuitpython margaret$ git checkout locale/circuitpython.pot 
error: path 'locale/circuitpython.pot' is unmerged
iMac-86:circuitpython margaret$ make tranlate
make: *** No rule to make target `tranlate'.  Stop.
iMac-86:circuitpython margaret$ make translate
find extmod lib main.c ports/atmel-samd ports/cxd56 ports/mimxrt10xx ports/nrf ports/stm py shared-bindings shared-module supervisor -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale
lib/tinyusb/lib/FreeRTOS/FreeRTOS/Demo/lwIP_MCF5235_GCC/lwip/src/core/ipv6/ip6_addr.c:79: warning: unterminated string literal
iMac-86:circuitpython margaret$ git status
interactive rebase in progress; onto 98469322b
Last commands done (5 commands done):
   pick 14294bfbe Added bitmap.blit function for bitmap slice copy
   pick 5581f25ec Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
  (see more in file .git/rebase-merge/done)
Next commands to do (5 remaining commands):
   pick 14f5d03b6 bringing up to date
   pick 3d26ab150 Updated formatting of stubs for Python documentation
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'bitmap_v2' on '98469322b'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    modified:   shared-bindings/displayio/Bitmap.c
    modified:   shared-module/displayio/Bitmap.c

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
    both modified:   locale/circuitpython.pot
slender iron
#

ok, are the >>> out of locale/circuitpython.pot now?

#

if so, you can add it and continue the rebase

mental nexus
#

Yep >>>> are gone.

slender iron
#

k, add and continue away

mental nexus
#
iMac-86:circuitpython margaret$ git rebase --continue
locale/circuitpython.pot: needs merge
You must edit all merge conflicts and then
mark them as resolved using git add
#

Hm.. let me search again.

manic glacierBOT
slender iron
#

did you add the file? that tells git you merged it

#

git add locale/circuitpython.pot

mental nexus
#

Here's my status.```
iMac-86:circuitpython margaret$ git branch
warning: ignoring ref with broken name refs/remotes/origin/bitmap_insert 2

  • (no branch, rebasing bitmap_v2)
    bitmap_copy
    bitmap_insert
    bitmap_trial
    bitmap_v2
    bitmap_write
    main
    restart
    iMac-86:circuitpython margaret$
slender iron
#

that branch status is ok since you are in the middle of a rebase

mental nexus
#

ok, did that and rebased again:

#
iMac-86:circuitpython margaret$ git rebase --continue
[detached HEAD a66ef32da] Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
 3 files changed, 58 insertions(+), 31 deletions(-)
Successfully rebased and updated refs/heads/bitmap_v2.
slender iron
#

now what is git branch ?

#

should be bitmap_v2

mental nexus
#

bitmap_v2

#

Yep.

slender iron
#

great! now build circuitpython to make sure it's all ok

#

it should be up-to-date now

mental nexus
#

Ok, will build and check the code.

slender iron
#

๐Ÿ‘

mental nexus
#

I think the code is correct. git status shows this:

#
iMac-86:nrf margaret$ git status
On branch bitmap_v2
Your branch and 'origin/bitmap_v2' have diverged,
and have 12 and 9 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   ../../extmod/ulab (new commits)
    modified:   ../../frozen/Adafruit_CircuitPython_BLE (new commits)
slender iron
#

ok great! now git push upstream bitmap_v2 --force-with-lease

mental nexus
#
iMac-86:nrf margaret$ git push upstream bitmap_v2 --force-with-lease
To https://github.com/kmatch98/circuitpython.git
 ! [rejected]            bitmap_v2 -> bitmap_v2 (stale info)
error: failed to push some refs to 'https://github.com/kmatch98/circuitpython.git'
slender iron
#

ok

mental nexus
#

Should I git add the bitmap files?

slender iron
#

no, everything looks added

#

the two changes not staged are submodules to update

#

do you push to upstream or origin usually?

mental nexus
#

Usually just say git push

slender iron
#

ok, then try git push --force-with-lease

mental nexus
#
iMac-86:nrf margaret$ git push --force-with-lease
Enumerating objects: 101, done.
Counting objects: 100% (101/101), done.
Delta compression using up to 4 threads
Compressing objects: 100% (74/74), done.
Writing objects: 100% (74/74), 12.28 KiB | 838.00 KiB/s, done.
Total 74 (delta 56), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (56/56), completed with 18 local objects.
To https://github.com/kmatch98/circuitpython.git
 + 9e73de381...b89005610 bitmap_v2 -> bitmap_v2 (forced update)
slender iron
#

ok great!

#

refreshes the PR

#

๐Ÿ˜ฆ all of the submodules are still changed

manic glacierBOT
slender iron
#

@mental nexus so commit 1f21 "bringing up to date" looks incorrect

mental nexus
#

That was my feedble attempt at merging in the adafruit/main

slender iron
#

so you'll need to do the rebase -i again but delete the pick 1f21 line in the editor it pops up

#

that will drop the commit from the new version

mental nexus
#

This is what it says:

#
noop
  
# Rebase b89005610..b89005610 onto b89005610 (1 command)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
slender iron
#

hrm, ok. that makes sense since you are still based on it

thorny jay
#

@idle owl Somebody made a PR on Pimoroni EnviroPlus Feather Wing that push sensor values to AdafruitIO. It involve an M4, the AirLift and the Enviro+. (It does not work with the PM25 because of an incompatibility on the Pin use... to have Enviro+ + Wifi we will need to wait for ESP32S2 Feather). I was wondering if that was interesting for a learn guide, as this might be a too complex example a library example. The idea would to finish the integration of Pimoroni Driver in the Community Bundle, then adapt that PR, the write a learn guide. Can I propose that to the author, or could I do the learn guide for the author (I wanted to learn about that). Here is the PR: https://github.com/pimoroni/EnviroPlus-FeatherWing/pull/13

GitHub

I've been meaning to share this forever!!!

For the Enviro Plus Python repo, I know instead of approving the pull request, you guys just added the link to my repository on the README pag...

slender iron
#

I have to look up how to redo it

#

@mental nexus try git rebase -i HEAD~8

mental nexus
#

@onyx hinge @lone axle I confirmed that label.py changing the text makes it move around strangely. Will look into it.

thorny jay
#

@idle owl The goal would be to celebrate the new drivers for that board. And since it is available from Adafruit and the example require two other Feather and an adaptor, it make a lot of sense.

mental nexus
#

How do I get out of the editor without messing somehting up?

slender iron
#

you can save, it won't do anything

onyx hinge
#

@mental nexus thanks, would you still like me to file an issue?

mental nexus
#

I'll talk with @lone axle and decide who will work on it.

#

Ok, then I'll delete the pick 1f21..... line

slender iron
#

yup

#

and the rebase should finish without interaction after

#

since you did the merges already

mental nexus
#
iMac-86:nrf margaret$ git rebase -i HEAD~8
Auto-merging shared-bindings/displayio/Bitmap.c
CONFLICT (content): Merge conflict in shared-bindings/displayio/Bitmap.c
error: could not apply dda9f2446... Deleted trailing whitespace
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply dda9f2446... Deleted trailing whitespace
thorny jay
#

@idle owl also require Adafruit IO...

slender iron
#

I jinxed myself

mental nexus
#
iMac-86:nrf margaret$ git status
interactive rebase in progress; onto 98469322b
Last commands done (4 commands done):
   pick a66ef32da Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison
   pick dda9f2446 Deleted trailing whitespace
  (see more in file .git/rebase-merge/done)
Next commands to do (2 remaining commands):
   pick 2b8f63da1 deleted whitespace
   pick b89005610 deleted whitespace
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'bitmap_v2' on '98469322b'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    modified:   ../../shared-bindings/displayio/Bitmap.h
    modified:   ../../shared-module/displayio/Bitmap.c

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
    both modified:   ../../shared-bindings/displayio/Bitmap.c
lone axle
#

@onyx hinge if you have some basic code that illustrates it go ahead and make an issue. If it's deep into something and not easy to extract then I'd say don't worry about it.

#

I'll be around tonight and I can look into it for sure. If it doesn't end up getting resolved I can make an issue with what I've found.

slender iron
#

@mental nexus go ahead and edit that file to fix the >>> areas and then add and continue

mental nexus
#

Got it.