#circuitpython-dev
1 messages ยท Page 320 of 1
โค๏ธ
600 whole bytes
nope. damien was happy to hear about that savings too
Did you hear me?
yep
@idle owl you crash?
@idle owl dang it I should have thanked you for helping set up the PCBHelpers role
thank you for that
I didn't quite get all the info in but I did my best
http://docs.micropython.org/en/latest/develop/cmodules.html describes how MicroPython thinks of things but it doesn't really cover the questions that you had @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.
Neat! I like the idea of Cartridges for PyGamer
it may have been added before you could subclass group
Interestingly it does extend Group also, but seems not to use the extended instance in favor of the property one.
weird!
@tannewt giving you some fresh mention-spam
board.I2C() is preferred. Use busio.I2C if the pins or frequency need to be modified.
no idea which oldest version it works in
I haven't gone through emails yet so spam away ๐
there is a font guide here:
https://learn.adafruit.com/custom-fonts-for-pyportal-circuitpython-display
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 ?
Sphinx ๐ฌ
Active versions that are hidden will be listed as Disallow: /path/to/version/ in the default robots.txt file created by Read the Docs. https://docs.readthedocs.io/en/stable/versions.html
however, builds cannot be triggered for inactive versions
@solar whale mute?
oh hey we can have custom 404 pages !
thanks
Thanks!
Thanks everyone! ๐
Thanks.
hehe. i'm double lurking (in a diff meeting) and was about to link RTD's SEO page. ๐
@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."
@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?
I do a ls boards then copy/paste ....
@ionic elk
bang
must be a way to do it in emacs -- ๐
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
1978 ...
see y'all later
@idle owl i'll plan to run the meeting next week. we'll get into a regular cycle at some point soon
!da
@onyx hinge You running it next week will put us on that cycle. You'd run it every third week.
thanks for hosting us
Thanks for waiting through my network crash ๐
Thanks
(๏พโใฎโ)๏พ*โฒ๏พ*๏ฝกโ ORGANISATION! ๐
@hybrid scarab Do you want to quick chat about what is left to do for Enviro+?
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
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.
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 ๐ข
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...
CircuitPython will get ya'
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.
@ionic elk @slender iron Thanks -- very informative! Sorry - i have to leave.
Can we get this merged quick while it isn't stuck on CI failures or translation conflicts?
Looks good to me, I don't see anything that should hold it up.
gets lunch before tackling the email pile
Here's my one-page image of explaining C<->Python:
Fancy!
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.
Thanks @ionic elk
@jerryneedell Was too optimistic, will get to this tomorrow
I think the safe mode will take a gdb backtrace to debug. Maybe I can circle back to this once wifi is going on the S2. We'll also need to see why these three builds are bigger.
@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.
Looks good! Thank you! @jepler please approve and merge if your concerns have been addressed.
I think this is waiting for the rgb status change we talked about earlier @hierophect
[I intended to Request Changes with my earlier review, but failed to do so]
By the way I pre-ordered the PCB for this keyboard so I am excited about your work on it! Thanks again.
@idle owl I can take care of merge conflicts, see you in the comments on the PR
@onyx hinge that works. Thanks.
Ok, I've pinged the pid.codes person to see if they need help doing reviews for the repo. (I'd be happy to help review.)
@ricardodeazambuja Please open a separate issue. This PR can't have its state modified anymore. Thanks!
Looks great to me! Thank you! @dpgeorge may want this in MicroPython as well.
One memory question and looks good otherwise. Thanks!
This is a memory allocation. Can you pass in a stack allocated tuple instead?
@fede2cr Please do! I'm not sure the process for translation with Jekyll so please do whatever works for you. Thanks!
@jwcooper Here is the translation offer you and I talked about the other day.
@fede2cr It'll be best for you to work with Justin on how to do this.
Should we modify the compression code to support literals for when the compression is longer than the original?
@slender iron pushed the changes, sorry I forgot to after our conversation.
np
@gilded cradle When you get a chance, can you check out this PR? https://github.com/adafruit/Adafruit_CircuitPython_BitmapSaver/pull/12
Sure @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
By allocating a static tuple in pixelbuf_pixelbuf_subscr, perhaps? The maximum length would be 4 items.
Passing a stack allocated tuple would be a problem if the callee saved it, since it would become immediately
And a statically allocated tuple would disobey mutability when given new content
The list/tuple here is only used during common_hal__pixelbuf_pixelbuf_set_pixels. However, as it was part of an attempt to avoid having to refactor _pixelbuf_parse_color and _pixelbuf_set_pixel_color, i think i'll just go refactor _pixelbuf_parse_color.
@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.
@tulip sleet Understood. I'll reference your comment and close it this week.
This was the FS issue I saw when debugging wifi and only happens
when the first write is to sector 0. It causes issues because it
blanks all of sector 0 after the first block.
Fixes #3133
sure -- just a few minutes
np, I'm confident it's more correct
how should I test -- storage.erase_filesystem() ?
it's related to this: https://github.com/adafruit/circuitpython/issues/3133
I saw it if you erase, write a code.py, disconnect and then connect again
may only be a linux thing
ok -- will try on linux
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
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
kk
@slender iron after storage.erase_filesystem() I get lots of errors in dmesg
and my linux box hung -- will need to reboot -- cant get to them now ๐ฆ
it worked once -- though I had to d a hard reset after the erase to get anywhere.
ya, I have to do a reset after erase too
but on second try it was not happy. -- shoukld be able to get to logs in a a minute
kk
this may have been my old hang on disconnect issue....
ya
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....
haha, ya
do you know what usb controller you have?
did the rpi crash or just the other box?
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
-[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
yes -- on the Pi there is only one and its a VIA Technologies VL805 USB 3.0
yup, makes sense
sorry -- not much help
I have to go offline for the night -- let me know if you need anything tested tomorrow. Good luck.
FYI (nothing to change): clang has a builtin for this, because it's a single instruction in some architectures.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50481
Thanks for the note; yes this does look useful for us as well!
Ruh roh, Sphinx strikes again
want to also init the variable with = 0xffffffff ?
@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)?
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
seconded
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
is that a compile-time thing?
yeah
if you add/remove from the enum but don't add/remove from the array, you get a compile time error
@mental nexus ^
neat
Thanks @onyx hinge I will focus on understanding Display as current best-practice.
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
@onyx hinge have you considered using displayio instead of the framebuffer approach?
@stuck elbow "framebufferio", it keeps the full framebuffer in RAM but works with displayio primitives like groups and tilegrid
the memory is what I'm worried about
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
that's pretty much all the memory you have on a samd21
this is not targeted at samd21
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.
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)
@worn lark that may not be a valid pin for the sercom peripheral
Let me check real quick
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
@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.
I'll see if that is maybe the problem. Thanks so much for checking!
cp uses sercom0 internally, all other is free to use
do I need to set somewhere which sercom I want to use?
no, it guesses based on the pins
okidok! thanks ๐
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
jep, that might be the problem in my case!
swapping the order of initialization may help, because some pins have several sercoms, and it uses the first free
yeah, that
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
@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.
@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
That is also distinctly possible.
Once upon a time I was naรฏve and full of gusto and thought "I'll do Sphinx docs for all our libraries!"
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.
I raised an issue to myself for the particular case - https://github.com/pimoroni/Pimoroni_CircuitPython_MICS6814/issues/1
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!
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?
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
Ah. Fair enough. So you're still working on the API.
Aye, yes! It can change if it's better
Here is the magical bit you might need if it turns out you'd rather leave it that way: https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/blob/a0692dfbdd05ff0bfbcbad7294ac9c6f694b0404/docs/conf.py#L29
Oh wow, that's... a thing
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.
I spent a good 20 minutes searching for an example of my error ๐
Basically it makes Sphinx not try to utilise that function.
Probably calls "mock.MagicMock()" or something behind the scenes to stub it all out?
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.
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
Yeah I think this is the right answer in terms for Sphinx anyway, thank you!
You're welcome ๐
Not sure about the API though- I couldn't find another device library that uses a bunch of analog pins
Might still be a pattern to follow
of course I'm almost sure I'd be likely to find both approaches in the wild
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.
Oooh this link answers a question I never even thought to ask, that docstring is niice
๐ Thanks.
But yes it looks like it expects an object of type digitalio.DigitalInOut, rather than a raw "pin"
Check out the Circuit Playground Library if you want to see some serious documentation. It's one of the best documented libs we have.
Here's an example of the code: https://github.com/adafruit/Adafruit_CircuitPython_CharLCD/blob/master/examples/charlcd_rgb_simpletest.py
Or code that uses the RGB version, but still.
Same idea for the first set of pins.
I guess it depends on how interactive you want the user to be. The Circuit Playground library handles EVERYTHING in the background. https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/blob/a0692dfbdd05ff0bfbcbad7294ac9c6f694b0404/adafruit_circuitplayground/circuit_playground_base.py#L82
Okay some precedent for this approach is very helpful
But that's not exactly a common thing. CP lib is a wrapper library.
I kinda feel this is the right approach- asking the user to supply a specific pin type
Excellent.
On the off chance that they supply the wrong type of pin, I suppose
You can throw an exception.
With a helpful error message
Supplied pin type must be digitalio.DigitalInOut() or some such.
Aye! thank you
You're welcome!
Right- now to continue making a mockery of the FT232H setup ๐
Good luck ๐
@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
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...
@kattni @sommersoft pinging for your attention.
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 ๐
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
couldn't find another device library that uses a bunch of analog pins
@hybrid scarab Have you seen this lib >> https://github.com/adafruit/Adafruit_CircuitPython_MCP3xxx/
specifically the mocked analogin class here >> https://github.com/adafruit/Adafruit_CircuitPython_MCP3xxx/blob/master/adafruit_mcp3xxx/analog_in.py
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)
much cleaner!
I've been looking into plugins that might help us out. Tricky part is maintaining all of our existing links.
Will test this plugin out first: https://github.com/kurtsson/jekyll-multiple-languages-plugin
Let's see if this build passes, whee!
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...
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...
@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?
The Cholesky factorization is present in micropython ulab:
https://github.com/v923z/micropython-ulab/blob/master/code/linalg/linalg.c#L93
but not present in circuitpython ulab. This is an issue because the circuitpython ulab docs include the Cholesky factorization:
https://circuitpython.readthedocs.io/en/latest/shared-bindings/ulab/linalg/index.html
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
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
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)
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.
@stuck elbow I know @solar whale has been seeing this. do you have intel usb host chips?
this is most likely a Linux bug anyways, external devices shouldn't be able to cause crashes like this
@ionic elk we'll accept it but not do the work to add it
@slender iron not sure, but possible, this is X1 Carbon
@hybrid scarab in general I like to pass objects in because then the pin can be provided by a different driver
0a:00.0 USB controller: Fresco Logic FL1100 USB 3.0 Host Controller (rev 10)
but also 07:00.0 System peripheral: Intel Corporation JHL6540 Thunderbolt 3 NHI (C step) [Alpine Ridge 4C 2016] (rev 02)
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
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.
the year of Linux on the desktop \o/
do we have a tinyusb issue? can we repro with a tinyusb example?
@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
I know dan reach out to kernel devs about it
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...
we have updated tinyusb to get s2 support
I bet checking a beagle trace may shed some light
"beagle trace" ??
a usb trace using a beagle device
IF you can give me some examples of how to test tinyusb, I'll be happy to experiment with it.
this example is a dummy cdc and msc device
these are the supported BOARD= values: https://github.com/hathach/tinyusb/tree/master/hw/bsp
Thanks -- I see what I can break....
thanks as always!
Looks great! Thank you!
@jepler My understanding is that it's short lived so stack allocated would be ok.
@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?
want to also init the variable with = 0xffffffff ?
@solar whale non-freertos on the others
ok -- first test on esp32 did not kill anything ....so far so good
want to also init the variable with = 0xffffffff ?
Yup, switched to that because I think it's simpler and smaller code-wise.
I don't think we need to change the API. Internally we can make it work without API changes at the cost of using a timer for the plain PWM.
@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.
hrm. interesting!
@tannewt how would you like it to appear on the ESP32? Currently, I have it set to change the API based on a mpboardconfig ifdef.
hmm -- gets a bit confused if I plug in both at the same time -- does not appear to recognize the second one
Or are you saying that we use a PWM timer and then just de-init it, as I mentioned in Discord?
or -- it recognizes it, but does not show a new drive mounted
maybe expecting too much of the example...
Ya, just have the same API and get the pwm properties from the given object. deiniting after could be weird because it can't be reused then.
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
@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.
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.
I'm less of a fan of that because there aren't that many PWM timers and channels available on the ESP32 - this reserves 1 out of only 4 timers without actually using it for anything. If we were to put it in as an API change, I would envision putting it alongside the PWMIO change, since that'll be breaking things anyway.
@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.
same here
@dhalbert suggested we "expand" the API, but I wasn't quite sure what he meant.
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
@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.
ok, so it may actually be circuitpython then
or the older version of tinyusb we're using
or some timing thing with msc interface
or something else ๐
yup
Thats a nice test -- you can connect to /dev/ttyACM0 and it prints a message and echos keystrokes as well.
yup! and the fs is held in ram
I mean that you could have PulseOut(pwmout) and PulseOut(pin, ...) coexist, for backward compatibility. The former would be deprecated in favor of the latter. It could be dropped later.
I think having PulseOut take a PWMOut initially was an unwarranted assumption, based on how PulseOut would be implemented on most chips.
@dhalbert you have a comparable example in Shared-Bindings? I can kind of see how I could do it myself, with MP_OBJ_IS_TYPE and some delayed checks for number of arguments, but if it's been done before that'd be handy to reference.
@slender iron I put CP (tip of main) back on my feather_m4 express and it hung the linux box on the first disconnect ....
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
Maybe vectorio/VectorShape.c. I don't have an example of arg number checking.
do you want me to document these tests somewhere?
ya, on the issue would be great
your new issue -- I can't find another one related?
@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.
a new one? is there not one yet?
I'm not finding one.... @tulip sleet do you know of a related issue?
i am late to this party, but do you mean, for example https://github.com/adafruit/circuitpython/pull/3223
thats it. thanks
i'm not sure there was an issue
for linux-crashdump -- it is asking if I want it to boot to kexec on a reboot -- Do I?
i don't remember; what is the default?
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
The other reason I was ok with taking in a PWMOut was that it takes in a lot of the same parameters that we'd need for PulseOut. So, no need to duplicate the PWM parameters.
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.
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.
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)
@tulip sleet @solar whale a few months ago when i was going through this, i could reliably repro with microcontroller.reset into bootloader.
@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
ahh. nevermind then...
@slender iron did random get explicitly removed from the latest esp32s2 builds?
@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.
@crimson ferry maybe. I think @ionic elk may have disabled it because we don't support the true random number generator
oh ๐ฆ OK, thanks
@tulip sleet once I have the linux-crashdump installed, how to I make use of it after I reboot from a crash
@crimson ferry you could turn it back on. it'll use the clock to seed the random generator otherwise
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?
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
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:~$
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
[ 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
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
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).
OK -- in this case _ was connected to the REPL when I unplugged. I don't think that is relevant but will do more tests.
i think it might be quite relevant, if related to CDC
@onyx hinge it does look like a bug
i never could get crashdump to grab the panic on the Pi, and then it stopped happening. ๐ฆ
all of mine were on ubuntu server; didn't see anyone have issue on Raspbian.
Adafruit CircuitPython 6.0.0-alpha.2-190-g817a52228 on 2020-08-11; Particle Xenon with nRF52840
>>> 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
Hi, I'd like to add the description for the generative PicoPlanet boards :)
@onyx hinge is it just that board, just nrf, or is it across ports?
Looks good! Just two minor things. After this, submit a PR to https://github.com/adafruit/circuitpython-org.
You don't need these because these pins are not even defined for SAMD21E variant.
As long as you're editing this, could you touch up the indentation here, and remove the double blank lines?
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
...
Typical construction:
bus = board.SPI()
framebuffer = sharpdisplay.SharpMemoryFramebuffer(bus, board.D2, 400, 240)
display = framebufferio.FramebufferDisplay(framebuffer, auto_refresh = True)
Full demo, which happens to be set up for Particle Xenon, CS on D2: code.txt
I should also retest with rgbmatrix, as dirty row tracking could affect it in some unantipated way. Testing so far is only with the 400x240 sharp display on nrf52840 though
@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....
I have fixes for this that will be part of the _bleio HCI PR.
Hi, thanks so much for your feedback! I fixed indentation and double blank lines, but it seems pre-commit still fails. Did I miss something?
@tulip sleet I only checked nRF so far
@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
OK, my objection is irrelevant -- I assumed the value was either escaping as a return value or passed to python code as a parameter.
what's the best way to clear out a displayio.Group? i.e., remove all items that have been added via append()
You have trailing white space at the end of this line. The pre-commit check doesn't like it.
You also need a newline at the end of the file.
@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]
thanks. i'd want to remove tilegrids also.
there's remove and pop, but i'm seeing something odd trying to use those
Actually the description is wrong
it looks correct? you're checking type and only removing Groups?
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
oh. i see. recursive call.
@tidal kiln I think you should be able to just do dio_group[:] = []
the garbage collector will take care of the recursive destruction
>>> splash[:] = []
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotImplementedError: Slices not supported
@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
ouch
@stuck elbow like that? looks like there's a slice support issue maybe?
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
yah, i'm think that may be the way.
just make sure no references to it are left anywhere
Have you hit the ValueError: Layer already in a group ?
I only ever have one group in my programs
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
>>>
You're modifying something you are iterating over
You need to know the per-language rules for doing that.
it's hard to write that nicely without slicing
maybe something like:
try:
while True:
splash.pop()
except IndexError:
pass
could you just del splash and re-create?
In some cases splash will be being displayed.
maybe:
while len(group) > 0:
group.pop()
More trailing whitespace here.
I think it also doesn't like the spaces on the empty lines.
If you click on "details" by the failed test, you can see what failed exactly. It also shows you the diff of what needs to be changed.
@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
Check here and similar for the details about what's wrong. https://github.com/adafruit/circuitpython/runs/973297866
Which editor are you using? emacs and other editors can automatically remove trailing whitespace (and fix missing newlines) on save.
@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.
@tulip sleet NP, thanks, I'll go through it tomorrow,
@tidal kiln BTW, unrelated to last discussion, there's a guy in forums with a genuine bmp with negative height and OnDiskBitmap doesn't like it: https://forums.adafruit.com/viewtopic.php?f=65&t=168292
@simple pulsar thanks. i'll take a look.
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...
The fix mentioned in the MicroPython issue has already been incorporated into our sources.
What version of python are you using, and did you clone or fork our repo in a conventional way?
@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.
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
and because a list couldn't enforce the "a tilegrid is in at most one list" invariant, which could lead to interestingness ๐
The site is live. I still need to fix a bit of spanglish and minor things.
https://diacircuitpython.org/
Hosted via IPFS and build with Hugo.
SVG source for Quetzalblinka is in the site's blog.
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
...
Great! Glad you got it working. If you have not read this already, it may explain more for you: https://learn.adafruit.com/building-circuitpython
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'...
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?
@soft patio still GCC
@stuck elbow Still 9-2019-qr-major or 9-2020-q2-update or maybe even 10-2020-q2-preview?
there is an issue for gcc 10 on the bugtracker, it doesn't fully work yet IIRC
The arm gcc10 toolchain is available in preview form here: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads (currently second item in...
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)?
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.
a few months ago when i was going through this, i could reliably repro with
microcontroller.resetinto bootloader.
@raven canopy When you had this issue -- what board were you using? With a feather_m4_express, I triedimport microcontroller microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER) microcontroller.reset()and it reset into BOOTLOADER OK on a RPi 4
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 ๐
I usually use these on the MCU board -- then I can add a featherwing or put it on a breadboard, https://www.adafruit.com/product/2830
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
note that male headers should always point down
female up
this way you can plug it into a breadboard
I'm using CircuitPython on ESP8266 and I know it's depreciated, but I wanted to give it a shot. I'm trying to use the Adafruit 16x2 Character LCD + Keypad with a Wemos D1 mini (ESP8266). I installed the latest version by following this guide:
Adafruit CircuitPython 3.1.2 on 2019-01-07; ESP module with ESP8266 - `adafruit...
You can still plug it into a breadboard if the headers point up ๐คฃ for a fun challenge transposing the pinout diagram.
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
Hard mode!
I had to make some adapter boards with female headers on both sides
I was a little tempted to do that
wasn't easy to solder
I inserted the female headers in the same holes on both sides
and soldered them from the side
๐ฌ
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
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
@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.
Yay! Thanks for your patience with the pre-commit checker.
Thank you so much for your patience with me :)
Yes it's exactly like I illustrated above. adafruit_character_lcd is a folder, that's holding .py files.
yay! do we also wanna maybe turn on uninited-var warning at some point?
I believe we have the warning on but it doesn't apply to static or global variables. Without an = they default to 0.
@d-c-d Want to add it? It should be straightforward.
Did 3.x already use the lib directory? Maybe try putting the libraries directly next to your code.
/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...
@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
A few minor things. Nothing major. Thanks!
Want to move this comment below to state it only applies to nrfx?
uint16_t first_pixel_offset;
uint16_t row_stride;
Want to just turn this on for good?
#3258 doesn't fit on these boards, so I trimmed them.
The most concerning change (to me) was disabling long int support on the hallowing_m0_express. If someone can provide a different alternative that passes the TRANSLATION=ja build I'm open to it.
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?
@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 ....
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']
>>>
I prefer the exception because it actually explains the issue
is that the change then for 6.x? putting the methods back in and then throwing an exception?
at least in that case, check the commit log
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
Thanks for helping @dhalbert! That worked. Used adafruit-circuitpython-bundle-3.x-mpy-20190111.zip from the release, you referred to. Now I'm getting another error: ValueError: Pin GPIO4 in use
@onyx hinge ^^ thanks!
@onyx hinge have we ever considered not offering all translations for the smaller boards?
@solar whale yeah @slender iron prefers not to approach it that way
ok
languages are important
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.
there are other things we can optimize instead
the uart pin finding logic is large and could be simplified for boards with few pins
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?
ya, the unicode strings tend to be longer (ja) and the words can be longer too (de)
I think UTF-8 isn't always the most efficient encoding, but I do think it's the standard.
๐
I guess I just need to get my dev environment set up and start hammering on this.
help is always welcome ๐
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?
@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 ...
Still have to try to get everything updated on this machine.
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
@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.
Slipped my mind when I added the mpconfig for the wroom, my bad.
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...
Thanks for spending time on this. COUNTIO going away seems OK on the M0 boards. Hallowing M0 has largely been superseded by Hallowing M4, so that doesn't bother me terribly.
Is AUDIOBUSIO useful for this CPX build? How does it compare with the other CPX builds, in terms of features?
AUDIOBUSIO is removed from (nearly?) all the other SAMD21 Express builds except for Metro M0. Could we be consistent about what's in generic M0 Express builds? Here instead GAMEPAD was removed, but you left I2CPERIPHERAL.
If we can be consistent, then these defaults could be moved to mpconfigport.h in the SAMD21 conditional section.
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.
oh -- yes it is -- PDMIn for the mic :microphone: . Might have to find something else to cut. I thought only in terms of I2SOut.
The ad-hoc-ness of this does point towards doing something more consistent. That said, I would like to get the "ja" translation in sooner rather than later...
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
@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
probably nothing applicable here but I'll read it in case https://www.unicode.org/notes/tn14/UnicodeCompression.pdf
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
This I'd worry about, because it would be popular for a general-purpose board like this. Not sure what to suggest.
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)
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
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...
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...
In some cases, we want to change the mac address of a ble device. For a keyboard, we can change the mac address to connect to another computer or phone.
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 ...
Thanks for this! Please do re-test after you make the changes, of course.
Have this return a bool instead of a SoftDevice code.
Put on previous line: ... address) {
Return a success/failure bool:
return sd_ble_gap_addr_set(&local_address) == NRF_SUCCESS;
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.
@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?
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
but we don't use LTO? I remember there were problems with it
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
so how many strings are like that? what order of magnitude are we speaking about here?
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
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
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
does the code that collects strings for translation understand preprocessor directives?
because most tools I've seen don't
Yes it does, makeqstrdefs
It determines which strings are still in the source after preprocessing
nice
Indeed
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
@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
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
8k bytes seems like a lot; ttyl
@onyx hinge I don't mind mindless work, I'm a python programmer after all
@onyx hinge never mind, my fault, i did LOCALE=ja, not TRANSLATION=ja ๐คฆ
Nice -- you found a way to save 8K bytes ๐
@tulip sleet ah the -Os solution is better than mine. Can you review and merge it now?
@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.
โฆ 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
FYI, Nordic have an interesting diagram showing how radio tx/rx works for advertising, channels aren't labelled but there are three of them: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsds_s140%2FSDS%2Fs1xx%2Fble_power_profiles%2Fadvertising_event.html&cp=4_7_4_0_17_0
@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.
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!
@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?
@onyx hinge have you talked to @fiery silo about font storage?
@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.
Thanks, I will bring it up internally and we'll get back to you!
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...
@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
@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
Thanks for continuing to work on this squeezing.
@onyx hinge I just mentioned it because it seemed like you were really diving into the storage
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 ..
Babel got me up and running with unicode for Japanese really fast which is why I brought it up.
yasssssss we have a japanese translation now ๐ thank you danh
and thank you ciscorn whereever you are
So what is the Japanese translation in? Where is CJK stored?
The messages in the core marked translate()
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".
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
i think you just see junk; it can't display what it doesn't have
or boxes or whatever
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
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 ??
^ 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.
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
@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
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
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.
Looks good to me. Thank you @jbfink for reaching out to them to find out and this PR to update the page!
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...
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.
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?
@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?
the 7mb was probably the fake uf2 partition
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
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
the uf2 filesystem is simulated, it doesn't actually store the files
it's just a way to flash the device
ahh. So you think there's any way to utilize the full 256kb of flash, or not without advanced knowledge? I'm a normie
you are already utilizing it โ the circuitpython firmware itself takes up the rest of space
I see. Thanks!
How do you measure the amount flash used for a given CIrcuitPython build?
it's output at the end of the build
we don't have that for ESP32-S2 yet, though, right? Or is there an option I should be turning on?
correct, it isn't setup for -s2
you'll know when you go over though, it won't boot when you do
Wow how did I miss that? Thanks @slender iron
the maximum size is fixed by the linker script usually
@tulip sleet no, no leads other than the mail I got from Seeed asking about potential support and them saying no.
I did a merge to update things. Ok to merge after CI is happy.
I'll merge this change so that we don't promise anything. However, I do believe @ansonhe97 or someone else at Seeed is working on RTL8720DN Arduino support which should make it easier to add CircuitPython support. Our ESP32SPI coprocessor actually runs Arduino based firmware that someone may be able to port to the RTL8720DN Arduino.
Nice work getting this going! A number of questions but nothing major.
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.
Thanks!
{MP_QSTR_source_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ},
//| def blit(self, x: int, y: int, source_bitmap: bitmap, *, x1: int, y1: int, x2: int, y2: int, skip_index: int) -> Any:
The * indicates everything after it is KW_ONLY (which it is and should be.)
Are the maximum values inclusive or exclusive. I think they are typically exclusive.
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.
typing Ctrl-C creates a KeyboardInterrupt exception
the code in a finally: runs no matter what, even if an exception happens (or not)
The python docs imply that finally is meant to run the code in it regardless of whether try results in an exception.
Oh.....
that causes all of the normal things that occur when an exception is raised to happen
you could also katch the KeyboardInterrupt exception if you wanted
In my mind there was no exception, so I was confused how it was doing anything.
I am not sure whether there's a way to change how the finally processes in the case of a KeyboardException
this is a good answer: https://stackoverflow.com/a/11552007/142996
@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.
the thing kjw is talking about here should probably be treated as a bug in the core and fixed. I encountered something similar recently with SPI. https://github.com/adafruit/circuitpython/issues/3266
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
Then how does the while True loop work at all?
the ctrl-c exception is not caught, but before it happens, we want to unlock
using busdevice also takes care of this for you, but this example doesn't use it
Yeah the I2C scan is super basic, it's supposed to be.
(in a slightly different way)
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
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?)
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
@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)
OK, but it happens via exception so you would get all the unlocks and finallys that are there. good.
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
makes sense to me
Updated per your request. (Somehow I got hung up on the x2,y2 checking and decided this needed it too.)
I updated to raise an error if the target bitmap (self) has fewer bits per pixel than the source.
Future extension
Provide a function to remap the palette of a bitmap, so you could chain a palette remap along with this blit function.
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.
@mental nexus this is a good article on how to do it: https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx
Thanks sommersoft, will study that and see if I can get it figured out.
@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?
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
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
yeah there are probably bugs in that area
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.
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.
Updated. Thanks for the review.
@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... ๐คท
@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.
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
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).
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.
@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)
.. 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...
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 ?
@mental nexus @onyx hinge I also don't keep my master/main branch up to date. I just work off adafruit/main directly
@onyx hinge please get the latest version of label.py and report back.
ESP32-S2 technical reference has USB and I2S sections now
@mental nexus with the version in the latest bundle it also happens
the text seems to migrate left over time
ESP32-S2 technical reference has USB and I2S sections now
@slender iron Is that in the Espressif IDF docs or in an AdaFruit doc ?
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
@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.
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.
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 ...
Which of those two cases didn't work? Do we have this issue with FourWire displays too? This feels weird.
Looks like your PR now includes a lot of submodule changes and extra 2 files. This can happen when you add everything to a commit without checking git status enough. I'd be happy to walk you through cleaning this up. Just ping me on Discord.
@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?
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
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?
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
So I want to somehow grab the "adafruit/circuitpython/main" and merge in my three files and call it the same branch bitmap_v2
mind if I walk you through it? start with git remote -v so I know what your remotes are named
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)
Done.
iMac-86:circuitpython margaret$ git branch
bitmap_copy
bitmap_insert
bitmap_trial
* bitmap_v2
bitmap_write
main
restart
(or we can rename source to adafruit which I think is clearer)
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
A lot of files listed. Here's at the top:
so the idea with rebase is that it's basically redoing your edits based on the latest version
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
The untracked files all have a " 2" at the end.
we can leave those untracked
Ok, it did a lot of churning and is done.
ok, how does git status look?
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
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
Ok, I'll look into that file.
Hmm.. This looks like the really old version of the file.
yeah, it'll be the old version of your changes because this is just the first commit
that's totally ok
Ok, so just resolve any of these >>> lines?
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
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)
k, now git add shared-bindings/displayio/Bitmap.c and then git rebase --continue
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
what does git status show?
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
weird that git status doesn't show shared-module/displayio/Bitmap.c as edited
Should I have done a commit after the add above?
no, the rebase should do that for you
because it's updating redoing an existing commit
try git rebase --continue again
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
ok, so locale/circuitpython.pot needs merging
Ok, do I "git add locale/circuitpython.pot"?
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.
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
Ok, will do that.
you'd only want to manually merge if you added translations
iMac-86:circuitpython margaret$ git checkout locale/circuitpython.pot
error: path 'locale/circuitpython.pot' is unmerged
Should I go ahead with make translate?
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
ok, are the >>> out of locale/circuitpython.pot now?
if so, you can add it and continue the rebase
Yep >>>> are gone.
k, add and continue away
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.
Neither case worked. I did not test with FourWire displays. I also didn't test with a different platform than nrf52.
did you add the file? that tells git you merged it
git add locale/circuitpython.pot
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$
that branch status is ok since you are in the middle of a rebase
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.
great! now build circuitpython to make sure it's all ok
it should be up-to-date now
Ok, will build and check the code.
๐
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)
ok great! now git push upstream bitmap_v2 --force-with-lease
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'
ok
Should I git add the bitmap files?
no, everything looks added
the two changes not staged are submodules to update
do you push to upstream or origin usually?
Usually just say git push
ok, then try git push --force-with-lease
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)
Fourwire buses are not affected according to my testing (6.0.0-a.1 on particle xenon)
import displayio, board, busio
displayio.release_displays()
#spi = busio.SPI(board.SCK, MOSI=board.MOSI)
spi = board.SPI()
displayio.FourWire(spi, command=board.D2, chip_select=board.D3)
@mental nexus so commit 1f21 "bringing up to date" looks incorrect
That was my feedble attempt at merging in the adafruit/main
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
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
hrm, ok. that makes sense since you are still based on it
@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
@onyx hinge @lone axle I confirmed that label.py changing the text makes it move around strangely. Will look into it.
@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.
How do I get out of the editor without messing somehting up?
you can save, it won't do anything
@mental nexus thanks, would you still like me to file an issue?
I'll talk with @lone axle and decide who will work on it.
Ok, then I'll delete the pick 1f21..... line
yup
and the rebase should finish without interaction after
since you did the merges already
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
@idle owl also require Adafruit IO...
I jinxed myself
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
@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.
@mental nexus go ahead and edit that file to fix the >>> areas and then add and continue
Got it.