#circuitpython-dev
1 messages ยท Page 356 of 1
๐
@marble hornet i'm looking, and it looks like you might even be able to remove BOARD_HAS_CRYSTAL from the nrf port completely
it is set but it is never used
it is mentioned only in ports/nrf/boards/*/mpconfigboard.h (and in the atmel-samd port
I don't know of any nRF boards or modules that don't have this crystal, since the chip is useless for BLE without it
so a PR just to remove it completely from ports/nrf would be the most appropriate
agreed. if there is a toggle for turning on bluetooth in the port then it would make sense for it to stay, otherwise I agree it is clearer for it to be removed.
(seems like page 83 of the datasheet specifies the clock as optional)
page 84: The HFXO must be running to use the RADIO or the calibration mechanism associated with the 32.768 kHz
RC oscillator. So you need the HFXO (and the crystal) to use the RADIO.
bluetooth is on by default in the port and no board turns it off
then do we want to remove that toggle as well?
it's CIRCUITPY_BLEIO, and it's on in ports/nrf/mpconfigport.mk. Someone might want to turn it off for obscure debugging reasons, but no board turns it off.
that's a CPy-wide toggle, so we wouldn't remove it
just "for fun" I changed the gps code to continue as long as anything was in the UART and now both the gps_simpltest.py and gps_time_source.py examples work.
This is what I changed at https://github.com/adafruit/Adafruit_CircuitPython_GPS/blob/master/adafruit_gps.py#L200
#if self.in_waiting < 32:
if not self.in_waiting:
return None
Not a fix, but it's nice to see it running
Okay, the pr is on my CircuitPython todo list.
And to summarize, the nrf port without Bluetooth (debugging excluded) is not a supported use? Thus the BOARD_HAS_CRYSTAL is not needed.
@marble hornet right, I know of no boards or modules without a 32 MHz crystal. THe makerdiary board in boards/ has it set to 0, but that is an error. I looked at their schematic and they have both crystals.
**is on
thanks! we have both wasted too much time puzzling through this (I don't mean this conversation).
Good day everybody! Today finished my first trial to program a RPi Pico with a Pico scroll pack, both on a Pico Decker. Its a scrolling text script (marquee). Here is e very very shot video impression (to keep it under 6 Mb Discord wants). Running standalone on a 3.71 V battery
Quick heads up @lone axle and @mental nexus - the PR for the ProgressBar updates ready for a general review. I mentioned in a comment a few additional edge cases that need to be handled, but I'd love some feedback on things that could be better in some way, particularly if what I've got isn't quite "The Python Way(tm)"
Also, thanks in advance! ๐
I may look at this in conjunction with #3895. If I can get a good reference implementation going, then it will be easy to port.
I will be diving in soon and will check it out tonight, gotta wrap up the last few things for work for the week.
I am going to look at this whole issue again, reviewing the current implementation, and I hope come up with a reference implementation that can be ported easily.
Enjoying the guest appearance by @onyx hinge on Deep Dive. Nice to see the other members of the team and hear the interaction with @slender iron .
hi folks please try
I haven't done anything exhaustive, but I was able to verify some of the functionality of the UART0 communication with a project I had set up already! Thanks for putting this up!
@lone axle Planning to livestream this weekend?
yep sure am. Saturday morning 10am Central time
What will you be covering on "Cooking Python with FoamGuy" ?

I'll have to watch the tape-delay on YT, but I've enjoyed the shows!
I am not certain yet. Maybe get a few PR reviews in, and work on my new type of label a little.
I've also been kicking around an idea in the back of my mind to play with RFM LoRa radios on the stream a little bit one of these days. That may end up being the first one I do that is less focused on displayio things.
Talking about the new label, maybe tomorrow we can discuss this, after reviewing the "\t" tab no being seen by text, I think that maybe it could be interesting, to use the same methods for three labels types.
And +1 for the LoRa, communications protocols are my favorite things and the most frustrating one
I think the best suggestion for git with existing micropython fork is: 1) clone adafruit/circuitpython locally 2) add foo/micropython as a remote to push to
using a local clone is complex when switching branches
Thank you @jposada202020
Yup, makes sense. I usually implement 1 by passing 3 MAXINT.
Looks good to me! Thank you!
This is similar to the approach I was thinking: https://github.com/micropython/micropython/pull/6894/files
Use PIO to debounce and deduplicate pin values. Push the value out and trigger an interrupt on it.
I want to do this soon so moving to 6.2.0 milestone. Its a natural fit with usb_hid projects.
I started with it originally but then based it on the SAMD code.
Did you try larger buffers?
do we want to close this as 'wontfix' since we have dual CDC support now and honestly thats a way way better system for reading lines?
ditto on closing as wontfix, send people to dual CDC instead?
ditto on closing as wontfix, send people to dual CDC instead?
Ah, ya. That 80 is confusing. I must not have checked the frequency. I think 1907.35 is the minimum.
The TODO item here is to raise an exception when given a frequency below what is possible.
I'll update and verify the example too.
yesss! oldest issue closed :D
We now have byte-based reading from the REPL stream or a second serial stream, unencumbered by REPL-specific characters: https://circuitpython.readthedocs.io/en/latest/shared-bindings/usb_cdc/index.html.
It does seem that the \n behavior is the same in CPython (same result on Windows and Linux):
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stdin.read(2)
a
...
We now have a second CDC channel on many boards: https://circuitpython.readthedocs.io/en/latest/shared-bindings/usb_cdc/index.html. It sends an dreceives raw bytes, with no substitutions.
The original thing of using readlines() is still a problem, but the secondary CDC can substitute, and you can signal the end of the read however you want. Plus there are timeouts, and you can ask how many characters are left to read, etc. So, yes, I'm closing, but @jerryneedell, if you still want some other semantics, feel free to reopen.
Coding note: you might want to consider storing the pins, buttons, and debouncers in lists or tuples, so you can reference them in a loop and avoid repeated code.
Closing for now. Please reopen if you are still having trouble.
I'm looking into the second CDC channel on Mac with a Clue, and is there a way to differentiate the two serial lines ?
Jeff, thanks for the quick reply. I work with multiple MCUs (Nordic, ST Micro, Espressif, etc.), so a HW debugging solution that works across the collection of devices is more useful than one per specific dev kit. (I've got a drawerful of Nordic dev kits with bundled Segger adapters :-). So trying avoid the cost and YADA (Yet Another Debugging Adapter) situation this time.
like i get this, how do I know which one is the REPL, other than assuming it's the first ?
>>> import serial.tools.list_ports >>> for port in serial.tools.list_ports.comports():
... print(port.device,port.interface)
...
/dev/cu.Bluetooth-Incoming-Port None
/dev/cu.usbmodem144443121 CircuitPython CDC data
/dev/cu.usbmodem144443123 CircuitPython CDC data
the second one should say CDC2 -- I'm confused why it doesn't
Ok, I was confused. I've suggested a way to clarify it.
I think something like this structure will make it clearer. It separates out the flash operations for deciding which to do.
bool all_ones = true;
for (uint32_t i = 0; i < len; i++) {
if (values_in[i] != UINT8_MAX) {
all_ones = false;
break;
}
}
if (all_ones) {
write_pages(start_index, len, values);
} else {
erase_and_write_sector(start_index, len, values);
}
return true;
...
Oh, I see. You do write sector if any value is not 0xff. But regular program otherwise.
ah I was wondering
let me try it again on Linux with the latest build
$ lsusb -D /dev/bus/usb/003/068 |grep CircuitPython
iInterface 4 CircuitPython CDC control
iInterface 5 CircuitPython CDC data
iInterface 6 CircuitPython CDC2 control
iInterface 7 CircuitPython CDC2 data
iInterface 8 CircuitPython Mass Storage
iInterface 9 CircuitPython HID
ython 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial.tools.list_ports
>>> for port in serial.tools.list_ports.comports():
... print(port.device,port.interface)
...
/dev/ttyS4 None
/dev/ttyS0 None
/dev/ttyACM1 CircuitPython CDC2 control
/dev/ttyACM0 CircuitPython CDC control
>>>
@jaunty juniper ๐คท I don't know what's up with Mac pyserial!
hmmmm I'm gonna compile locally to be sure I have the right version
I grabbed artifacts and I might have done it wrong
try ioreg -p IOUSB
that doesn't tell me enough
To match existing error text:
mp_raise_RuntimeError(translate("All UART peripherals are in use"));
You'll need to add a call into port_reset to call this.
Thank you for this! I think we do need to add buffering before we merge this because the API explicitly allows setting the buffer size.
We can either copy other ports and use an interrupt to write into a ring buffer. Or, we can use the RP2040 ring DMA while constraining the buffer sizes to powers of two.
I'd be happy to add the buffering next week if you'd like to hand it off.
Is it possible to implement? If so, then lets match the existing error "RS485 Not yet supported on this device"
@jaunty juniper it's not the build, it's pyserial on the Mac, or whatever it's trying to use. I tried the latest (3.5), and it gives the same duplication you see. The exact same board shows CDC2 on Linux
anyway, I think if you sort the devices alaphabetically, the second one will be [1]
well I'm gonna look into a way to get that info somehow
thanks, let us know if you find anything
https://superuser.com/questions/781982/how-can-i-install-usb-prober-from-the-developer-sdk-on-mac-os-x Installing the package is not recommended as it will overwrite your installed kernel extension, and can cause kernel panics at startup if the version downloaded does not match the OS
@jaunty juniper code is here, specific to MacOS:https://github.com/pyserial/pyserial/blob/master/serial/tools/list_ports_osx.py
I use system_profiler to find and associate boards with their mounted drive, but I wasn't able to find the path to the serial ports that way
info.interface = search_for_locationID_in_interfaces(serial_interfaces, locationID) may not be working right
I assume "locationID" (a property of a USBDevice) is something assigned by the OS, and each serial port has the same, which is the same as the parent USB device
so basically the way it's written pyserial assumes there can be only one serial port by USB device
I seem to have a fix, but...
i'm holding my breath ๐ I have to ๐ค but if you have a PR for pyserial that would be great
I'm gonna look at pyserial's repo and see if I should open an issue or if doing a PR is fine
i searched for list_ports in issues and PR's and found various things
thanks, good night!
good night
wait... on linux it lists CDC control, and on mac it lists CDC data ? what ?
Well I have no idea what the difference is anyway...
HI
I see 2nd serial is added and thanx to this.
Let's say I want just talk to connected TTL serial
hardware and I need a simple command to cut
me off current REPL and to 8-bit transparently conect to
TX/RX pins, but in background, to keep current
application running.
for example if I have modem on pins 10 and 11
I just need something like this
connect(tx=10,rx=11,baud=115200)
ATD1234
OK
no more REPL until reboot and that's all I need.
@tulip sleet ran af few tests with CDC2 -- grandcentral_m4 , nrf52840_sense , pico -- all worked fine -- treed read,write, readline,readlines --- nice!
basic tests, but all good so far
For that you just use busio.UART (docs). It's not yet implemented on the RPi Pico, but will be fairly soon. It's on all other boards.
Thanks for testing!
Do I understand correctly that esp32s2 and stm cannot support it?
or do we have to give up something to enable it?
the latter ... They don't have enough endpoints. Also SAMD21 sadly needs one more endpoint, because on SAMD21 I had to use two endpoints for MSC (CIRCUITPY) instead of just one endpoint pair (IN and OUT, which works on SAMD51. It was flaky with just one. I should re-test that in case something has been fixed, but it seemed like it might be a hardware issue.
If I disable usd_hid or usb_midi in the esp32s2 build, shouId be able to enable usb_cdc
usb_cdc needs 2 endpoint pairs, one for control and one for data.
endpoint pair 0 - USB control (always needed)
endpoint pair 1 (only IN used) - CDC #1 control
endpoint pair 2 - CDC #1 data (IN and OUT)
endpoint pair 3 - CDC #2 control
endpoint pair 4 - CDC #2 data
endpoint pair 5 - MSC
Most of the STM's have only 4 (0-3 endpoints), so they're completely out of the running. I'm going to double-check that.
ESP32-S2 has 5 (0-4) endpoint pairs, so also mostly out of luck
MIDI and HID each take only one endpoint pair
MIDI is already off in ESP32-S2
I see that now -- thanks for the explanation -- lots to understand.
grep for USB_NUM_EP in ports/*/mpconfigport.mk to get the settings. I am still trying to figure out how many endpoints the Spresense has: the datasheet is very unclear. I inquired.
people casually say "endpoints", but they mean "bidirectional endpoints", which I am calling a pair
occasionally datasheets count each member of a pair separately
so on something like the STM -- with only 4 -- is MSC on pair 3?
yes,though the ordering usually doesn't matter, except for 0
so the spresense is weird
have you looked at imx (teensy)
the imx have 8 pairs, so they're fine
nice -- will try one soon.
ports/nrf/mpconfigport.mk:15:USB_NUM_EP = 8
ports/raspberrypi/mpconfigport.mk:54:USB_NUM_EP = 8
ports/stm/mpconfigport.mk:12: USB_NUM_EP = 4
ports/stm/mpconfigport.mk:28: USB_NUM_EP = 4
ports/stm/mpconfigport.mk:47: USB_NUM_EP = 9
ports/stm/mpconfigport.mk:65: USB_NUM_EP = 6
ports/litex/mpconfigport.mk:10:USB_NUM_EP = 16
ports/esp32s2/mpconfigport.mk:45:USB_NUM_EP = 5
ports/mimxrt10xx/mpconfigport.mk:21:USB_NUM_EP = 8
ports/atmel-samd/mpconfigport.mk:26:USB_NUM_EP = 8
ports/cxd56/mpconfigport.mk:11:USB_NUM_EP = 6
stm varies based on the family
do you know of a way to end EOF to readlines from "screen" -- -- so far I have only tested it with a timeout -- have not been able to send EOF
or is there some other way to terminate it.
no, there's no way to do this cleanly right now. Sp I closed your very old issue https://github.com/adafruit/circuitpython/issues/307, based on explanation on https://github.com/micropython/micropython/issues/3356 (and no change since then)
it's just not clear what EOF would mean. This is not a file stream, it's a UART-like stream. I don't know if pyserial handles EOF either, though it's worth trying
ah -- I missed that -- thanks! Had forgotten about it. Not a problem
I'd suggest instead doing single readline()s and looking for a marker, you could look for ctrl-d
or "exit" or whatever makes sense for your protocol. usb_cdc is a bytes stream, not a text stream: utf decoding/encoding is not done
makes sense --nice for "streaming" data -- don't want it interpreting things.
read/readline are kind of a funny case -- with the concept of "lines"
Cpython readlines has an optional limit on the number of lines -- that does not appear to be implemented, correct?
that's right, not implemented yet, and it would be implemented not in usb_cdc but in the general stream code that we reuse
ok -- many layers.... Thanks for all the work on this.
yw! this opens up several projects Limor had in mind. I will be writing a short guide soon with a simple example or two.
we could conceivably use the Bluefruit Connect packet protocol too, and just not transmit it over BLE. It is UART-based protocol, after all
The readthedocs info was very helpful to get started --- looking forward to playing with this
only 3 older issues that that one!!
just tested on teensy4.1 -- works fine!
Definitions are for:
- Pimoroni Tiny 2040
- Pimoroni Keybow 2040
- Pimoroni PicoSystem
I believe I have set all the files up correctly, but am creating this as a draft PR so we can check things over first.
A few questions I couldn't find answers to:
- Is there a way to specify the amount of flash available on our boards, or does CPy not require this?
- Some of our LEDs are common anode, so need to be driven low to turn on. Is there a way to invert the pin behaviour globally so do...
Thanks and welcome!
Several of your files have no trailing newline. This will cause the pre-commit checks to fail. You can turn on pre-commit locally to catch this before you push.
$ pip3 install pre-commit # Just do this once.
...
$ pre-commit install # Do this once in each repo clone.
You can run the pre-commit checks manually: check the help info for pre-commit.
- Is there a way to specify the amount of flash available on our boards, or does CPy not req...
@tulip sleet in reference to PR #4228, would having something like invert as an argument to DigitalInOut allow a user to define a button with a button.pull = Pull.UP and button.invert = True so that button.value is True when it is pressed instead of button.value being False when it is pressed?
yes, that would be the idea. It could make things simpler but would introduce new support issues as well.
I think it would be an improvement for code readability. It is counterintuitive for a non-electronics person to use not button.value when you want to tell if a button is pressed.
This fixes several problems:
- memoryview(ndarray) & internal uses of ndarrays with
mp_get_bufferandmp_get_buffer_raiseno longer hardfault - ones(), full(), zeros() and eye() with dtype=bool gave wrong results
- linalg.dot() could give incorrect results
Thanks to @v923z for making these fixes in the "legacy" branch of ulab, which is used by CircuitPython!
or is there room for some sort of button class that handles common tasks like pressed and held and inverts .value of the DigitalInOut object itself?
the debouncer class(es) could do that. #4228 is talking about common-anode LED's which must be grounded to turn on, so a button class would only solve one of those problems.
I understood that it was talking about LEDs, but the invert argument appealed to me for use with buttons in particular.
@ZodiusInfUser asked in #4228 whether DigitalInOut has functionality to invert the sense of .value, so that True represents a low signal level , and False represents high. The motivation is that Pimoroni has boards where the RGB LEDs are common anode. But this functionality could also be used for buttons that ground when on, etc.
MicroPython has a Signal class that wraps Pin and has an optional invert argume...
i made an issue for discussion. ^^
I've kind of wanted a .on property that would be value != pull basically (I use a Button class for that purpose in some of my code)
I agree, something like a .on or .active property that relies on the pull is probably better than inverting value
Feel free to add these suggestions to the issue so we can capture your thoughts
I like the idea, though it may be good alongside a guide (or reference) on buttons and why they are "False" when pressed and how this can invert it. At least as a newbie that got me for a while, maybe I missed something that exists too. But I think it would make code flow a lot better to set some invert type property and the rest of the code can say if pressed is True.
In terms of CP would potentially inverting .value though cause issues with pre-existing libraries that expect it a ce...
It would be helpful to have an easier way to indicate that a button is pressed is True instead of having to use negation in user code. An additional property like .on or .active would probably be a better solution than an invert argument that modified .value.
button = DigitalInOut(board.GP0)
button.direction = Direction.INPUT
button.pull = Pull.UP
# this is counterintuitive for a newbie to electronics
if button.value:
print('button is NOT pressed')
if not b...
I see no reason why you couldn't write a Signal class in Python (and add it, say, to simpleio) for this purpose, without having to add it to digitalio and making the space on the samd21 boards even tighter.
You could even have a Button class that also does debouncing for you.
I see no reason why you couldn't write a
Signalclass in Python (and add it, say, tosimpleio) for this purpose, without having to add it todigitalioand making the space on the samd21 boards even tighter.
You could even have a
Buttonclass that also does debouncing for you.
I agree with both of these points, but was offering support that the solution to the original issue could have a benefit with using buttons as well.
I am a bit concerned about adding it to Digitalio -- at some point, we do want people to understand the hardware. Messing with .value in Digitalio really hides things.... I agree with @deshipu that this should be implemented at a higher level like simpleio.
I feel like this is related to the discussion we had In The Weeds recently about whether to have a ".voltage" property of AnalogIn objects, or have code need to scale ".value * .reference_voltage / 65535". I think we concluded that while the decision to have a 0..65535 value was also made very early when it was unclear whether CircuitPython would support floating-point numbers at all, it was b...
I've kind of wanted a .on property that would be value != pull basically. In fact I use a Button class to encapsulate a DigitalInOut for that purpose in some of my code and give it a .on. For outputs I kind of think of it as an equivalent to pull in the way it is a default value: decide what that value is, treat .on as not being that.
That kind of abstraction is already done in board-specific libraries like magtag.button_a_pressed (return not self.buttons[0].value). In Pimo...
Thanks for the reply, and mention about new lines. I thought I'd followed the other board definitions in the folder exactly, but clearly not.
Just tried installing pre-commit, but the second line does not work, as in it cannot find pre-commit. Note I am developing under Ubuntu.
"This has not yet been parameterized, and if yours are different". Yes, I believe both Tiny2040 and PicoSystem have more flash than the default 2MB of the Pico. Also Adafruit's own Feather RP2040 has 4MB accordin...
I'm having trouble compiling CircuitPython. This is what I'm getting (without any changes):
melissa@MacBook-Pro ~/D/c/c/p/atmel-samd (main)> make BOARD=metro_m4_express
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
../../lib/tinyusb/src/common/tusb_fifo.c: In function 'tu_fifo_write':
../../lib/tinyusb/src/common/tusb_fifo.c:149:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
if ((p > p + offset) || (p + offset > f->max_pointer_idx))
^
cc1: all warnings being treated as errors
make: *** [build-metro_m4_express/lib/tinyusb/src/common/tusb_fifo.o] Error 1
@tulip sleet do you have any ideas?
hi - what is arm-none-eabi-gcc --version, and did you git submodule update yet?
7.3.1 and yeah, I did git submodule update
7.3.1 is really old, use gcc 10. SEe https://learn.adafruit.com/building-circuitpython/macos
Ah, that's probably it then
Thank you
Apparently I had both versions and it was defaulting to the older one. I deleted the older one off my system, ran make clean, and it seems to be working now.
Fixed the pre-commit issues with a bit of trial and error, so if my config looks okay and matches the style you're expecting, then I think this is good to turn into a proper PR.
This allows the following Python3-compatible code to work:
>>> b = bytearray([0] * 4)
>>> memoryview(b).cast('H')[0] = 0xffff
>>> b
bytearray(b'\xff\xff\x00\x00')
At one point I thought I might need this for my neopixel bit-twiddling, but I don't specifically need it right now. However, I wanted to post it up as a PR rather than just forgetting about it.
Just tried installing pre-commit, but the second line does not work, as in it cannot find pre-commit. Note I am developing under Ubuntu.
You should have /home/yourusername/.local/bin in your $PATH. If not, that's probably why it can't find pre-commit.
Fixed the pre-commit issues with a bit of trial and error, so if my config looks okay and matches the style you're expecting, then I think this is good to turn into a proper PR.
"This has not yet been parameterized, and if yours are different". Yes, I believe both Tiny2040 and PicoSystem have more flash than the default 2MB of the Pico. Also Adafruit's own Feather RP2040 has 4MB according to the product page, but that is yet to be configured.
So we need you to provide you a way to s...
Thanks to @jepler and @v923z! This fixes #4207, which was crashing due to the ulab issue https://github.com/v923z/micropython-ulab/issues/328, and was fixed by https://github.com/v923z/micropython-ulab/pull/329.
"So we need to provide you a way to specify a larger flash chip, I think? Or can you live with 2MB for now?"
With the B1 silicon arriving imminently and being put into products, we can live with the 2MB definition for now. Then hopefully in a month we can push an update once the flash changes you mention are in place.
"Are you using a chip from the same family as the Pico or a different manufacturer's chip?" I don't have that information sadly, but I would guess that it's a different flas...
Sounds fine. Do the current builds indeed work on all your boards?
This fixes the board config for TG-Watch to match the available crystals. and updates some frozen libraries.
It turns BOARD_HAS_CRYSTAL on and BOARD_HAS_32KHZ_XTAL off since the board has a 32mhz crystal but not a 32khz one.
I'm currently drafting a PR/implementation to remove the confusing naming of BOARD_HAS_CRYSTAL as discussed on discord.
The micropython state decoder looks like a solid design for "x4" quadrature decoding that avoids some problems that more naive implementations have. Crucially,
- the data checked by the decoder is exactly the seen edges, not a sample of the inputs at a later time
- every state transition is handled, rather than just handling certain transitions
Tracking the previous direction (positive or negative) in an attempt to decode changes in both bits simultaneously I think is of dubious valu...
I've tested the Tiny2040, but don't have the other two boards to hand so will have to get colleagues to test on Monday
WIP
Group should be a subclass of python list, with all the niceties. This will allow easier manipulation of its contents, and reuse more code.
Looking further into the inheritance mechanisms, it seems that more than one base class for a subclass is not supported: https://github.com/adafruit/circuitpython/blob/main/py/objtype.c#L108
That means that displayio.Group can't be a subclass of Layer and List at the same time.
lgtm! We should update all the frozen libs before final release, thanks for the implicit reminder.
I'll factor out the flash size early next week. I don't want to release anything with the 2MB setting because changing it later would require reformatting the file system. We can make the size configurable as a stop-gap before we have settings per flash sku and board.
About porting alarm to nRF I think we can find most of what we need in the nRF52 SDK's ram_retention example. I want to start testing the most basic implementation of this, preferably without having to account for every call from bindings (Like a big bang implementation). Is there any easy way to get started and then gradually expand, instead of my current approach which is: make, solve error(s) hackishly, repeat?
@wise wigeon you can just copy the esp32s2/common-hal/alarm tree, and then comment out everything, just returning dummy values as necessary. I'd say implement TimeAlarm first; it will be the easiest
Where is pulseio located? Is this coming from MicroPython? I haven't been able to find it.
I'll give that a shot tommorow! ๐ด
Thank you. That was helpful. Somehow I overlooked it. I am lost as to how these modules build into the final CircuitPython file for the board. I see the implementation in the Shared Bindings for PulseIO but can't follow how these shared bindings are connected (well how they would be connected in the case of the RP2040) to the rest of the code. Can someone offer guidance here?
I'm sometimes getting "OSError: [Errno 19] Unsupported operation" when attempting to write to an i2c device (a SparkFun Serial LCD) using a RasPi Pico.
import board
import busio
i2c = busio.I2C(board.GP17, board.GP16)
while not i2c.try_lock():
print("i2c not locked, retrying...")
print(i2c.scan())
i2c.writeto(114, "|-") # Clear
i2c.writeto(114, "Hello world!") # Show some text. Error happens here.
The error appears to be happening on line 11, accord...
I have implemented alarm (deep and light sleep) for nrf52.
PinAlarm, TimeAlarm and SleepMemory works on my nRF52840 board. My code is based on esp32s2 alarm implementation, with HW specific parts re-implemented.
Set CIRCUITPY_ALARM = 1 in config.mk file to enable the alarm function (already defined in mpconfigport.mk).
Please refer to README_impl.txt below.
I am not sure whether this works on other typical nRF52 boards,
and the source files contain some debugging codes.
Please let...
I can't make the Group a subclass of List, because then mp_instance_cast_to_native_base will return the list struct, when we want the group struct. I'm instead trying to wrap the list inside the group, and forward the methods we need.
x2 on this question. Can I just use the wifi module to create the AP?
I tried with up to WaveFile(wav_file, bytearray(2 * 4096)). It crackles in a different way. Copying small files to CIRCUITPY still makes it go haywire.
BTW, I think there's a second issue/big here. I've noticed after interrupting and restarting program sometimes it gets stuck while waiting for the sample to complete playing with the typical code of
while audio_out.playing:
pass
I did some audio RawSample experiments on command line and then copied working code.py onto board and got this
Traceback (most recent call last):
File "code.py", line 198, in <module>
TypeError: 'float' object does not support 'protocol_audiosample'
Code done running.
It's definitely not a float! I copied code again and it worked.
On Adafruit CircuitPython 6.2.0-beta.2-18-g2a467f137 on 2021-02-15 this code spits a RuntimeError: All state machines in use
import time
import rp2pio
import adafruit_pioasm
print("15 second pause in case anything bad happens")
time.sleep(15)
flash_pio_code_2pin = """
.program flash2
set x, 31
onloop:
set pins, 3 [5]
jmp x-- onloop
set y, 31
offloop:
set pins, 0 [5]
jmp y-- offloop
"""
flash_pio_code_3pin = """
.program flas...
@jwhevans This may be slightly out of date but the basic concepts are still true: https://circuitpython.readthedocs.io/en/latest/docs/common_hal.html
I did a brief test, and it did what I expected. I had no idea memoryview.cast() existed.
There are issues with some I2C devices. The I2C peripherals on the RP2040 do not allow zero-length writes, which are the typical way to do scanning. We are working on a workaround for that.
If you remove the i2c.scan(), does the problem go away?
We could add .inverted property to specific board. pins, which would make it automatic. However, that doesn't solve the problem of external devices which are not known in advance.
A simple Signal-like class would help. However, you still have to know to specify the inverted behavior. So I am still interested in naming pins with active-low behavior in a way that helps the reader, such as a _INV suffix. On schematics one typically puts an overbar over the signal name or adds a N su...
Hey, @fossil gorge, what did you say about the french translation? ๐
I dunno, that "Franska" looks suspicious. I'm very particular about my Ska music! ๐
Note that it would be possible to add just the sort method without using a list internally โ that function can sort any continuous array of python objects.
What is wrong with French? I tryed to fix that, but someone else was also busy.
lol, that was me
I mentioned to @cobalt grail on FoamyGuy's stream yesterday that French needed some updates from new strings, so he was "kindly" reminding me about it!
It's a nice other way to see what has recently been added to CP. I guess some of it was PIO. Then some stuff related to program size... maybe also PIO.
Yeah, looks like a lot of it was on the RPI board. I like to keep a look on the right-hand side to see which directory/module and path the text is from. Also handy to see what the message might mean in context.
I was indeed nudging @fossil gorge about me getting to 100%. ๐
And yes, most of the new strings are RPi related.
"nudging", just like hockey players "nudge" each other! ๐
A couple of conversions from float to uint64_t in usb_cdc brought in a bunch of floating-point library routines that were otherwise not needed, adding a couple of kB to the build. Use a special-purpose conversion routine instead.
Another alternative would be to limit the conversion to uint32_t, but then I have to check for the timeouts being too large, so this is probably less code.
This is the inverse of a routine I wrote a long time ago to compactly convert a uint64_t to a `fl...
A long time ago when I was working on HID, I found that MSC on the SAMD21 needed to use separate endpoint pairs for IN and OUT. I discovered this only empirically. There is no erratum that would dictate needing two endpoints. At the time we were using the ASF4 USB stack. I was suspicious it was due to ASF4, but could not be sure.
Now that we are using TinyUSB, I tried this again, and, after some mild testing, I di...
say, has anyone looked into setting up an ESP32S2 as an access point ?
Hmm. I commented out the scan call, and I now get the same error every time! I don't think the scan() is what's causing it.
Could you try some other I2C device? What is the part number of the serial LCD you are using?
The LCD is SparkFun ID LCD-14073. Give me a bit to scrounge up another device.
I don't get the error at all using a 8x8 bicolor LED matrix backpack (Adafruit PID 902). I am using the adafruit_ht16k33 library and not writing raw bytes though.
I didn't actually test or check binary sizes. However, I did use cbmc to "prove" that your code is equivalent to the standard cast. This should include any possible floating-point value (though this is done via theorem prover, not exhaustive testing):
#include
#include
uint64_t float_to_uint64_danh(float f) {
// 4294967296 = 2^32
const uint32_t upper_half = (uint32_t) (f / 4294967296.0f);
const uint32_t lower_half = (uint32_t) f;
return (((uint64_t) upper_ha...
I just want to note that after the whole discussion several years ago about adding a Signal class and renaming value to ``on`, breaking dozens of libraries in the process, to date I am not aware of a single piece of public code that would use that class. Many of the libraries, though, were never updated and are still broken.
I am following this tutorial. Everything was going well up to the point where I ran make BOARD=circuitplayground_express. An alert popped up on my screen that arm-gcc was not a verified developer and so the download would not be processed. I have run into this quite a bit with Apple (I wish there was a way to turn this annoying feature off...) so, I opened up my System Preferences and then Security & Privacy and on...
When the change to fix use of this routine via the case '(uint64_t)(float
expression)' is reverted, this error occurs during the build of
feather_m4_express:
.../firmware.elf.lto.o: in function `usb_cdc_serial_write_stream':
.../Serial.c:81: undefined reference to `__aeabi_f2ulz'
.../ld: firmware.elf.lto.o: in function `usb_cdc_serial_read_stream':
.../Serial.c:44: undefined reference to `__aeabi_f2ulz'
I don't exactly know why it says that __aeabi_f2ulz is the undefined
...
CircuitPlayground "classic", with a 32u4 microcontroller, is not compatible with CircuitPython.
This is an interesting approach. I was thinking of grepping the firmware.elf.map for the unwanted symbols.
Okay, good to know @jepler. I will purchase an express.
I am getting a new error now.
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
[Errno...
git version 2.24.3
python3 version 3.9.2
gettext version 0.21
gcc-arm-embedded is installed (Confirmed this when I ran --version it returns zsh: command not found: gcc-arm-embedded. So, I ran brew install gcc-arm-embedded and it returned already installed).
cost: may use more stack
Most (all?) usb string descriptors use ASCII, but are stored as uint16_t[], and on metro m0 express these total 273 elements. If we "compress" them (store 8-bit values) we save half of that (546->273 bytes).
Tag the string pointers with the low bit to distinguish them; when requested, decompress them to a stack buffer, something like (untested)
if ((intptr_t)desc_str & 1) {
desc_str = (uint8_t*)((intptr_t)desc_str - 1);
uint8_t d...
This saves about 60 bytes (Feather M4 went from 45040 -> 45100 bytes free) โ 66 bytes of data eliminated, but 6 bytes paid back to initialize the length field.
I didn't test it yet, but I think the idea is solid.
I don't know enough to really comment, and I don't think I have any interesting hosts to test on (just linux). but if it was always superstition and you feel you've done adequate testing, go for it.
Added first pass board definitions for my new TinyS2 board
This is a nice savings for descriptors in flash. We have to make sure they are really transmitted before giving up the stack buffer. Once we go to some kind of dynamic descriptors, they will be constructed at runtime anyway, so we will just store the strings, or even concatenate them at runtime. (There's a lot of duplication of "CircuitPython", for instance.)
@jaunty juniper I don't think we have an API for it now
so, no. it isn't supported yet
I have never seen any issues with SAMD21 one pair endpoints with MSC, have been running it with simple examples in my tinyusb repo as well as Arduino TinyUSB lib without any issues. It is probably other issue such as Controller 2-bytes overflown and/or else.
A couple of questions about Issues and PRs:
Is one big PR or multiple smaller PRs the preferred way?
Should every PR be based off an issue, or are PRs without an issue still considered?
I've a list of about 10 changes I want to make to the Adafruit_CircuitPython_GPS library including at least one bug and want to decide on the best way to approach it.
This PR solves the problem with Spresense enumeration on Windows and Mac.
@stiff pelican depends. Don't put multiple unrelated changes into a single PR, for sure. A PR is already an issue, though it might make sense to create an issue if it's going to need several PRs
Another PR related Q :). I've designed a few testers (like https://twitter.com/burtyb/status/1362321502624956416) I'm going to run CircuitPython on. Is it OK to add them to CircuitPython proper (once I've got the schematics/docs published) or do you not want that sort of thing?
I moved this to 6.2.0 because it's a blocker for #4082. The problems seem more widespread than that single device, though they are not pervasive.
I don't think this is particularly significant but worth checking this works on any bugfix
Adafruit CircuitPython 6.2.0-beta.2-18-g2a467f137 on 2021-02-15; Raspberry Pi Pico with rp2040
>>> import pwmio
>>> import board
>>> pwm0 = pwmio.PWMOut(board.GP0, frequency=5000, variable_frequency=False, duty_cycle=0)
>>> pwm1 = pwmio.PWMOut(board.GP1, frequency=5000, variable_frequency=False, duty_cycle=0)
>>> pwm0.frequency ### working output
5000
>>> pwm1.frequency ### broken outpu...
@copper crescent the CP projects welcomes al CP-based hardware, by all means add it, then it will be maintained as things change
@stuck elbow ok, thanks :)
@wicked garden one small hassle is that you will need a unique usb vid/pid
I had a moment of crazy with the CC before one of the many USB-IF price rises so that bit won't be a problem :)
@copper crescent my understanding is that you distribute these boards, so there are multiple ones out in the world, and more coming, is that right?
(as opposed to you have one or a few copies that exist solely at your house)
@tulip sleet they only exist in my office atm
I had a read of the code. This might be caused by a failure to initialise self->top for the second PWM in a channel's slice. The duty cycle code depends on this
but it's only set in common_hal_pwmio_pwmout_set_frequency and pwmio_pwmout_set_top. The latter is not called in PWMOut.c and the former is only called once per slice. This woul...
Hello. I may have found the PWM bug for Pi Pico, see last comment on https://github.com/adafruit/circuitpython/issues/4210 Any chance of getting that in 6.2.0?
Same thing discussed in #4235
For @jaunty juniper and @last crater , I remember seeing something related to AP mode a little while ago, and managed to dig up a bit of it - hopefully it helps.
In the ESP32 library, there are these APIs
Adafruit_CircuitPython_ESP32SPI
I was wondering if anybody had started or looked into implementing AP on the S2
On reflection, there's a bit of an issue here with having independent values of top per PWMOut when it's a per slice value...
so far it seems nobody has it on their radar
There's also a "WSGI Server" implementation. I'm not sure how well filled out the docs are in ReadTheDocs are, but the repo is here: https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/
(which is fine, there's a lot to do, especially with the rp2040 poping unexpected)
Unless I've completely misunderstood something
(as a married man, I'm used to completely misunderstanding.... everything?)
@tulip sleet how exactly does a "value based" pin interrupt work? Is it polling the pin value really slowly, or something?
I don't really get how you could have an interrupt associated with the value of a pin that doesn't trigger when the pin actually changes to that value, unless it's checking it on some kind of regular schedule
even then it's still kind of an edge detection, just a really slow and inaccurate one
where is that phrase "value based" coming from?
are you talking about pin alarms?
when you start the hw polling for a value, it will interrupt as soon as it sees that value. On the other hand, an edge-based interrupt will definitely look for a transition from the opposite value to the desired value
so a value-based one will trigger as soon as it sees the value, but an edge-based one will require a transition
if you want to alarm on high, then if the pin is already high, it will trigger, for value-based. For edge-based, it must start as low and move to high
I'm just trying to figure out what to do with "value" since that's not a thing in STM32 land
yes, the RTC peripheral does polling
it's just not implemented. There are some chips that do edge triggering even during sleep
so you would complain if someone set edge=True
you mean if value=True, right?
Basically I should throw a NotImplemented if they try to use Value since an ST chip should always be Edge.
Why aren't misread the APIvalue and edge a single variable? Are there cases where you could trigger on both an edge and a value?
ah ok, I thought you were saying there was not edge detection
the sleep pin stuff is very different on different chips, unfortuantely
No I thought it was two redundant flags, bad reading comprehension
Implement API to run an Access Point on the S2 instead of connecting to one.
Just to track the feature request.
I think the question with the ESP32SPI library is how much it will apply to the S2 hardware.
Ah, ok. So yeah, I misunderstood. Probably should make that my "default state of being"!
Hello friends ๐ - in an attempt to avoid timezone-mageddon... umm... when (how long until) is the weekly catch-up meeting..?
@plucky flint Hey!! ~2 hours.
Cool... 7pm UK time.
I've been booked for a run with my daughter at 6pm, so I should be good to make it. Looking forward to it. ๐
Brilliant! Looking forward to seeing you!
I ran storage.erase_filesystem() in the repl, then got a traceback in gdb using a picoprobe.
The debugger shows that this is down in the USB device enumeration workaround code. The "tight loop" never terminates.
^Ctarget halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
Thread 1 received signal SIGINT, Interrupt.
hw_line_state ()
at sdk/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c:...
Hope to raise โ๏ธ for wider input. (Also, it'll be great to say "hi" again).
Sounds like a plan. Here's the notes doc if you want to add yourself alphabetically to "Status Updates" or add it to "in the Weeds" https://docs.google.com/document/d/10c1pc8x_d5PM5QPUSj9Ex0OfgyFvTiLZV9Cuno_UQDI/edit
CircuitPython Weekly for February 22nd, 2021 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canโt make the meeting and would still like to particip...
Perfect.... looking forward to this... ๐
@slender iron would you like to see a PR for MicroPython V1.14 merge
@plucky flint In the Weeds is probably the best place for a discussion. Status updates is more what you're up to and a quick answer to a question if you had one, for example.
Got it. ๐
Obviously feel free to add Hug Reports and Status Updates as well, if you wish ๐
PRs don't need their own issue. It's just good to link them together if an issue exists already. That way it'll be closed when the PR is merged. Multiple smaller ones are usually better.
@idle owl how long do these meetings usually take..? I also have an 8pm meeting (an hour after CP meeting starts).
probably not much. the apis are pretty different
@plucky flint 60-90 minutes. We can mix up the order of things and do an "in the weeds" during "status updates" so we can get it in. I'll let the host know we're going to "mix is up a bit" and we'll have you go first for Status Updates.
Yup! It's a huge task though so be warned
Yeah..! I have got it compiling ๐
whoa! that's epic
@plucky flint So that said, put your notes under your name under "Status Updates" so it's easier for us to move things around later to get them in numerical order with time stamps.
Totally new to MCU land but that's what I figured.
mpy-cross builds successfully.... ports are next
@analog bridge do you want me to finish uart?
OK... I'll move from "weeds" -> "status". Sorry for the disruption.
@plucky flint I can follow up on that issue too
No apology needed!
I have got suggested changes implemented... haven't done the internal buffering part yet.
Better to sort it out now than later ๐
Quite..! ๐
kk, I think we do want the buffering since the buffer size is part of the api
Thanks, that's what I was thinking. Also, thanks @slender iron .
@onyx hinge Hey! Quick note about the meeting, when it's time for Status Updates, we're going to change things up a little bit and do a mini-in-the-weeds. You can do your status update, then turn it over to @plucky flint to talk about a GitHub issue. He needs to leave 60 minutes into the meeting which means he's unlikely to make to actual-in-the-weeds. Does that make sense? I had ntoll put his notes under Status Updates so it's easier for your timestamping.
@tulip sleet One option for ST is to interrupt on both rising and falling edges. Do you think this is worth implementing? It would need a tri-state for value, not sure what the best format for that would be.
Excellent! Thanks Jeff!
@hathach if you have a chance can you look at this? As usual, CircuitPython is behind, but I tried with tinyusb at master and it was the same.
ya... I can take a look at it tomorrow... I'll be taking the ringbuf approach.
Thank you..! ๐ค
ok, thanks @analog bridge
bbiaw...
โก๏ธ ๐ โก๏ธ
โก๏ธ moar meetings ๐
<@&356864093652516868> this is as good a time as any to remind you that our weekly meeting is in about 90 minutes! We're changing things up slightly starting today: If you're just listening (lurking) there's no need to do anything in the notes document. On the other hand, if you are speaking you will need to make sure your name is in the document in the right spot(s). Adding your notes is super helpful, and it's of course critical if you want us to read your notes for you. This is basically what you are all doing already (we really appreciate everyone's attention to the notes doc!) except for being even easier for the casual listener. If what I said isn't clear, please ask and I'll do my best to clear it up for you. Also, as noted earlier, @plucky flint has an In The Weeds topic that we'll handle out of order, as they have a time limit on participating with us today. Notes: https://docs.google.com/document/d/10c1pc8x_d5PM5QPUSj9Ex0OfgyFvTiLZV9Cuno_UQDI/edit?usp=sharing
CircuitPython Weekly for February 22nd, 2021 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canโt make the meeting and would still like to particip...
Just realized I'll be absent for this week's meeting, since I've been scheduled for a 1-2pm CST meeting along with 2-3 by "Those folks who pay me to do stuff and junk" :/ I'd rather attend the CP one!
@fossil gorge We'll read your notes. Thanks for including them!
Thanks!
Sorry I cannot be in the meeting, but I "modified" the I2C from the pico, only address.
Feel for you as I'm in the same boat, at least don't have a 2-3 meeting too.
Don't need to brag about it! ๐
Usually have the 2-3(ish) one on a weekly basis, this one is just a handoff for [another] project I'm taking over. The curse of being good at stuff maybe?
Good afternoon folks -- happily lurking. Notes doc not updated....because I'm a rebel like that. 
@modern wing I wondered what you were doing in the other voice channel ๐
@solar whale The same thing I do every night in the other voice channel! Try to take over the World! Realize that I'm just in the wrong place at the wrong time.
lurking just listening thanks for the changes to the notes docs for us professional lurkers just listeners
Text only today
I'm gonna lurk too, listening live for once
lurking
We'll be there soon! Finishing up an internal meeting.
lurking, did not do much, but some note in the document.
๐
Yes I can do notes.
Yep, I have links ready
Thank you..! ๐
Made this with @adafruit #magtag using #circuitpython to remind me when the cat is in the garage. https://t.co/Jb32fyR8aO
They knew I was too sharp to be Pranked but they got their brother! They shared their #CircuitPython code (heavy lifting via @adafruit) & hardware from @Raspberry_Pi ยฃ3.60 makes a great project. #RaspberryPiPico #RaspberryPi #edtech #stem
#coding https://t.co/85iwhnSMZR
If you have a #pico and #CircuitPython and the @Pimoroni RGB Keypad you may like - https://t.co/x95AdhdC9H - It's a CircuitPython class to drive the leds and read the buttons.
A class (and example) for the Pimoroni Pico RGB Keypad and CircuitPython - rgbkeypadcp.py
this one didn't onebox for some reason but does look pretty cool!
lurking
They said videos would be up in a couple days
two day video lag I think. the chat was excited about it
๐
That's a new voice...
can't unmute, sorry
are we detouring to the weeds first?
@onyx hinge Detour to @plucky flint after you.
did it just cut or it is me?
I can still hear fine
@plucky flint Thank you for stopping by and putting that together!
Thanks @plucky flint
Thanks folks. You're welcome @idle owl ..! Here's to making wonderful things happen. I'm dropping off to go help some local musicians build a website..! ๐ ๐
Doodle-poll for organising a Mu-moot about CircuitPython mode improvements: https://doodle.com/poll/uw4mrfe5kuehxqka?utm_source=poll&utm_medium=link
Zephyr's multiple repo & build management tool, west, may be useful. It manages both ninja & cmake builds, and has a nice clean way to manage multiple git repos.
https://github.com/zephyrproject-rtos/west
Please disregard this comment if if it's not useful.
@errant grail Expanding your horizons!
@onyx hinge - regarding your comment about warmer weather, it's nearly 60 degrees warmer today than it was one week ago.
I think I fixed my mike
๐
nice!!!
there is some "big" announcement from ST on the 25th, sounds like it might be a new family of low-power chips
hmm
that's interesting
I'd be interested in adding L4 and G4 support, but the primary complication for them is they need some extra work to make sure the flash management is set up properly
see their homepage: i got some email
one of the biggest areas that ST families diverge is their flash, they barely even share APIs and the structure is totally different
@tulip sleet will do
@fossil gorge Please let me know what you'd like to work on with regards to other libraries. I'm happy to discuss it.
the "Trailer" video mentions low-power, the rest is a vague teaser
@tulip sleet do you think I should register for the webcast?
They say "free chips" on the homepage... ๐คค
i think you could just review the stuff after the announcement. They are having drawings for free boards, it's not guaranteed to be free
bah
I finally figured out how to listen ๐
welcome @hoary moat
Just lurking today. Will likely want to speak in a future meeting.
@hoary moat I've added you to the circuitpythonistas role on Discord. We notify about the meetings, and it's required to be able to speak in the meeting. ๐
@idle owl thank you!
You'll get a couple of pings each week about the meeting.
You're entirely welcome!
Some of the new bitmap manipulation functions that kmatch98 is working on might be helpful for rotating bitmaps I think.
Sorry had to duck out to answer a phone call. Sounds like the Tilegrid rotation is a good option if you want 90 degree rotations. @honest nova if you want to evaluate the bitmap rotation tool (any angle), I have a version in Python you can try out. https://gist.github.com/kmatch98/263866738b064ae81970e5c9c8e85ff0
was talking about:
https://www.adafruit.com/product/4712
@marble hornet I was supposed to end up with a couple, but didn't. I wrote the guide for it without them. ๐
I do have one of those breakouts and am willing to do any needed tests on it when the time comes @marble hornet feel free to ping me when you need someone to try running a test.
thank you @lone axle I will take you up on that!
Actually now I'm wondering if I did end up with a proto and I'm not sure where it is. Because the screenshot in the guide is from my terminal. And I would have needed it to get the screenshot.
ยฏ_(ใ)_/ยฏ
@marble hornet I have some as well and can help with testing. Do you have a basic test case that shows the issue. I have not noticed problems with them but have not looked too closely. They return data and don't cause errors....I've had them running for quite a while ( several weeks)
I'm using them on esp32s2 boards
March?
March 22nd??
What is time?
wibbly-wobbly timey-wimey
Maybe more use of the glossary can increase compresability (is that a word) of weblate translation.
The ides of March have come....and gone.
๐ฌ
the IDE of March
Hugs @onyx hinge
๐ค
Thanks everyone
@solar whale huh! and i've been using the simple test as the test script , a 350mah lipo, and a feather. running it w/out a thermistor attached.
Thanks everyone! Thanks @onyx hinge for hosting!
Thanks. Did someone said timezone and daylight saving?
at least we are still limited to just one planet
I'm off to have lunch
@marble hornet what is the issue you see?
Bless you all
I was trying to make a project a week and send to Anne.
RuntimeError: CRC failure on reading word
based on the guithub issue it only exists on the nrf
I was tagging Anne in twitter stuff, would using email be the preferred method now?
On Twitter I try to use @CircuitPython below. I believe one trick is that Anne actively search on Twitter and started to follow frequent poster and those making RT.
cpnews@adafruit.com for e-mail @gloomy shuttle
twitter tagging with #circuitpython-dev is good too
#circuitpython-dev or @CircuitPython?
@solar whale what board are you running it on?
Hashtag will work better for me @thorny jay
Thanks everyone!
@ help find what it is...
@marble hornet mostly on umfeathers2 -- but I can set it up on any board -- what are you seeing errors on?
Many maker project might pop up on the week-end...
@thorny jay Exactly. That's why having Monday is super useful.
the TG-Watch, A board derived from the nrf52840 feather express (it's basically that + sensors and a screen)
could you set it up on am nrf52840 feather please
But then again... timezone and everything. My target was to finish for the meeting of Monday and put it in the note from the meeting. But that was already last minute for Anne.
@solar whale I'm also free to audio chat if that is a preferred form of communication.
@marble hornet Yes -- I'll do that -- probably not until tomorrow -- but then I'll let you know if I can reproduce the issue. Have you opened an issue in the library?
Thanks. and There was one already open. https://github.com/adafruit/Adafruit_CircuitPython_LC709203F/issues/3
๐ค.
I'll try it on a metro and do the same.
looks like most of the issues have been with nrf52840...
yeah, all excluding anecdata's
OK -- will try on nrf52840 first -- I have a few variants. Ten can compare with other MCUs
should be able to try some tests this evening.
๐. gtg, thank you.
I'll put any debug modifications to the library on a fork.
Thanks @fossil gorge , my confusion stems from my belief that the FeatherS2 doesnโt use the ESP as a coprocessor, itโs the main processor. The main SPI interface is with flash. Not sure how to construct the esp32spi object to pass to the instantiation shown in that library.
btw, the volume on the weekly meeting on youtube for everyone except the organizer are just barely audible when i have the volume cranked up all the way on my laptop.
I'm happy to help out where ever help is needed, so I guess the more "high-urgency/need" issues that would get people passed a given blocker. If there are several, or you need more info or details, let me know.
Trying to catch up on this week's meeting - seems like the participant audio is pretty low. Not sure how it compares to other meetings (listening in background)
@mental nexus Thank you for the code, I will take a look. I think is the same code that you were using for the new library right?
Yep also Iโm working on adding this as an option to the core so it will run a lot faster.
@stuck elbow Thanks for the info, three weeks ago I tried to rotate the tile Inspired by one your games, I could not rotate a characters, granted at that time I was not so familiar with the display text libraries. I will try again and harder. Thanks for the info
Ok thanks, I will try that too, and give my comments and see if we can have the fayette Font in vertical mode ๐
@still zephyr at least with terminalio this should work -- you just rotate the TileGrid that you pass to the terminal class
YEs agree with Endico and Hugo the volume was too low, and I am using my headphones to eatch the youtube video
I will.. thanks for the info, I will try later, and report my findings
Do you mind if I DM you?
Not at all!
@alpine nimbus and @still zephyr thats on the youtube recording right? It might be jeff's setup. is last week's ok? I recorded last week
Last week was ok
@slender iron Yes, the youtube recording. I believe last weeks was ok
And to confirm this is youtube for me also
the audio levels?
ya, for the desktop audio
I was having trouble today adjusting my headphones separately from obs's monitor
if my headphones are "up" too much it is picked up by the mic
I had hoped it would be OK but I guess not ๐ฆ
I'll fiddle with it before next time.
kk, np
sorry for the trouble, @alpine nimbus , @still zephyr I'll try to do better next time
I could probably be able to hear the others if I hooked up an external speaker and cranked it up (and back down when jeff speaks). But I can't get that loud with the old macbook speakers
no biggie
Okay, good to know @jepler. I will purchase an express.
I'd recommend the CircuitPlayground Bluefruit over the Express. It has more RAM and bluetooth.
Can you try brew list gcc-arm-embedded (IIRC) to list the files that brew installed? Perhaps it isn't in your path.
@slender iron @onyx hinge Just was listening to the meeting about the countio. I can try IRQs (I looked at them but saw the SDK handled it as well). I'll look at what examples already used them (off hand if you know one I'll take a look at it). The PMW way with a background task could still miss a wrap if the task is delayed, so I do like IRQ better
people really do listen to this thing after the fact
@blissful pollen https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/audio_dma.c#L275
then the function is: void isr_dma_0(void)
looks at the pwm structure
enabling irqs is usually a two step process. enabling it in the peripheral and then enabling it in the nvic in the cpu
Thanks, just want to keep it consistent with what you did. I thought (could be wrong) each core could only handle one call back function?
ya, doing it that way will override the sdk's implementation
@worldly dragon I disconnected you from the voice chat so no one popped in and startled you.
looks like there is only one pwm interrupt so things might get trickier when its shared
(section 2.3.2 shows interrupt lines into the nvic)
This looks fine to me! Maybe the error is post-inlining?
I was looking at the GPIO interrupts too but even that is shared too hmm
@dhalbert Are you ok merging?
@blissful pollen it's ok if it's shared. it just means you need to check the peripheral registers to determine why the interrupt happened
the pico-sdk might do this
the samd port has to handle this too: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/timer_handler.c
@deshipu Is this ready for review? Could you update the title to match your implementation? Thanks!
okay i'll dig into it a bit more and see what I find.
Of couse Jeff, and Thank you for hosting!!!
I got a pylint error in a library (displayio_layout) due to the examples. Any idea how to resolve this?examples/displayio_layout_gridlayout_simpletest.py:1:0: R0801: Similar lines in 2 files
@mental nexus Oi. Apparently it's a Pylint issue, and it's a bug that it can't be disabled.
@mental nexus Try doing a # pylint: disable=duplicate-code which I think is the error name, in the example file(s). See if they fixed that bug at least.
I feel like this is going to bite us across the board.
I think we'll need to add duplicate-code to the things it skips for examples.
I don't really like the idea of changing DigitalInOut. value is meant to represent the gpio's binary value, not really "on-ness" of a button or LED.
My gut aligns with @jerryneedell's point to do it in Python. However, having native support would be very nice so that board could have objects that work out of the box.
What if we added two new native classes LED and Button (module TBD)? They'd be similar to Signal except they'd lean into what they are. LED could be explicitly do...
Can someone offer guidance here?
The mechanics for adding a module to the build and putting it in the top level modules is in py/circuitpy-. It's controlled by the CIRCUITPY_PULSEIO definition. Once it's enabled, the build will fail because ports/raspberrypi/common-hal/pulseio is missing. That's where the implementation goes.
I tried adding this locally and it gave the same error. Maybe this can't be overridden? -> https://github.com/PyCQA/pylint/issues/214#issuecomment-778429794
According to that issue, it can't be.
Thank you for trying. I will look into it tomorrow. Sorry for the blocker.
No problem.
@dhalbert Mind doing this review?
Sounds good to me! Thanks for going back and testing this. I agree it's best to leave it off. We'll likely need that space for code re-org for existing stuff.
Thanks for the tip @durapensa! Can it do ninja without cmake? I don't really know want cmake to be a piece we use.
I'm OK merging, but there are other cases where we bring in various routines, and __aeabi_f2ulz may not always be something brought in. For instance, __aeabi__dadd might get called by accident if double-precision is accidentally invoked. So perhaps just examining the firmware.elf.map for various "uh-oh" symbols could be more comprehensive.
From the CI:
Run python3 -u ci_new_boards_check.py
Boards missing in .github/workflows/build.yml:
unexpectedmaker_tinys2
You may want to install pre-commit as well. It'll auto-fix the issues it finds. https://pre-commit.com/#installation
I converted this to a draft for now.
@jun2sak Should I wait for you to do further work, or are you requesting some feedback on the work so far? Thanks.
@jepler If you pick this up again I'd recommend reading the interrupt state of the USB peripheral. There may be an interrupt occurring that the irq handler fails to handle leading to an infinite irq loop.
I think this would go on the wifi.Radio object
This might be caused by a failure to initialise
self->topfor the second PWM in a channel's slice
This definitely seems like a bug! Mind making a PR for it?
BTW, why does
common_hal_pwmio_pwmout_set_frequencycallcommon_hal_pwmio_pwmout_set_duty_cycle?
duty_cycle is called again because the duty_cycle is scaled by the top value (which set_frequency changes.)
On reflection, there's a bit of an issue here with having independent values of
topperPWMOutwhen it's a ...
@hathach Any idea why the code size grew? It looks like the CI failures are due to builds running out of space.
The difference between Gemma M0 ja before and after this is only about 240 bytes, so I could see a small amount of new code would push it over the edge.
Stop-gap solution for #4041. Comment is there to provide info
needed in the future. (We currently run the generic "safe" settings.)
#4247 has the stop-gap move for flash size. I'll follow up with a better fix after we get some functionality lots of folks are asking for.
We've watched Seinfeld. The replay is like George's cassette recorder in the briefcase ๐
These should be parenthesized.
From the CI:
Run python3 -u ci_new_boards_check.py
Boards missing in .github/workflows/build.yml:
unexpectedmaker_tinys2You may want to install
pre-commitas well. It'll auto-fix the issues it finds. https://pre-commit.com/#installation
Ok, I'll have a read through that doc and try to find some time to get it all installed and setup later this week, thanks :)
@tannewt Peeking at the west docs, it uses cmake to generate ninja build files & board files. But since it's Python, that part can probably be replumbed. There's also a flashing component; could that be handy for priming/repairing boards for usb disk?
Anyone have a good way of testing PDMIn? Maybe @meager fog or @onyx hinge? I have numbers coming from it now
@slender iron you can graph its intensity or even an fft of it
https://learn.adafruit.com/adafruit-pdm-microphone-breakout/circuitpython [there's some ulab way of doing the math for that too]
ok, will look at that tomorrow
the second code is probably good to start with, small numbers when not much noise, big numbers when big noise
at least it's not crashing now ๐
you'll see things like "is there a signed/unsigned problem" right away
good to hear -- look forward to the results of your testing tomorrow
I also need to check to see if the fifo is overflowing on the pio
I'm trying not to use dma
but I'm not sure I can keep up
I can probably leave it as a TODO
PDMIn is rarely used
Just tested it using the absolute newest build as of https://github.com/adafruit/circuitpython/commit/b19e7c914844634306745ff6858f52df308f85ff, and the error still happens.
For all interested in the Vertical Text tests: 1. Label, will require a refactor of the factory as each character is a bitmap, and then the result will be each turning. Bitmap_label is more promising as probably transpose_xy and flip_X and flip_y combination could do the trick with less coding. Bimap only is the easier, as probably some folks have tested already. I have changed the old library to include a parameter and do the tests, please disregard this parameter. results and test code are here: https://github.com/jposada202020/Label_Vertical
Thanks for accommodating my pedantry.
it could be caused by recent PR to the MIDI driver https://github.com/hathach/tinyusb/pull/618 . Flash seems to get tighter each PR. Next time, I will try to refactor endpoint stream = endpoint + fifo which currently used by multiple class driver to claim back some flash.
I think I can fix all of these by doing SUPEROPT_VM = 0. This was already done on some builds, like trinket_m0 -- it just wasn't done consistently.
(A few of these failures are transient network failures.)
I think I can fix all of these by doing
SUPEROPT_VM = 0. This was already done on some builds, liketrinket_m0-- it just wasn't done consistently.(A few of these failures are transient network failures.)
ah great, that would buy us some time to have a better testing for refactor code :)
@dhalbert I have done most of my implementation, but I would like to hear from you to decide further work.
(1)
Checking nRF SDK info and nrf touchin discussion in CY github, I understand nRF processor cannot be woken up by touch (neither light sleep nor deep sleep).
Should we simply ignore TouchAlarm operations (current implementation), or should we raise an exception ?
(2)
I have moved all the debugging codes to a new file debug_uart.c under ports/nrf/supervisor/, and these codes a...
@tannewt I ran python3 -u ci_new_boards_check.py (after installing pyjama and sh) and it did it's thing, and I can see tinys2 in the build.yaml file, but nothing new to commit. How do I get this up to git to make the CI happy ?
We had many ad-hoc build-shrink settings for builds that were too big, most of which are SAMD21 boards with no external flash. This set of changes sets SUPEROPT_VM = 0 on most of these boards, except for those that already have several modules turned off to make space. It removes the translation-specific shrinks that increase build time and make performance vary by language.
SUPEROPT_VM = 0 is reported to decrease performance by about 20%. This is somewhat regrettable, but there were a...
Anyone able to compile any ESP32S2 firmware using the latest? I can't build FeatherS2 or TinyS2 - I keep getting a bunch of errors around tud_cdc_* stuff <- never seen this before.
../../supervisor/shared/serial.c:82:12: error: implicit declaration of function 'tud_cdc_connected'; did you mean 'serial_connected'? [-Werror=implicit-function-declaration]
return tud_cdc_connected();
^~~~~~~~~~~~~~~~~
serial_connected
../../supervisor/shared/serial.c:82:12: error: nested extern declaration of 'tud_cdc_connected' [-Werror=nested-externs]
../../supervisor/shared/serial.c: In function 'serial_read':
../../supervisor/shared/serial.c:104:19: error: implicit declaration of function 'tud_cdc_read_char' [-Werror=implicit-function-declaration]
return (char) tud_cdc_read_char();
^~~~~~~~~~~~~~~~~
../../supervisor/shared/serial.c:104:19: error: nested extern declaration of 'tud_cdc_read_char' [-Werror=nested-externs]
../../supervisor/shared/serial.c: In function 'serial_bytes_available':
../../supervisor/shared/serial.c:118:12: error: implicit declaration of function 'tud_cdc_available' [-Werror=implicit-function-declaration]
return tud_cdc_available() > 0;
^~~~~~~~~~~~~~~~~
../../supervisor/shared/serial.c:118:12: error: nested extern declaration of 'tud_cdc_available' [-Werror=nested-externs]
../../supervisor/shared/serial.c: In function 'serial_write_substring':
../../supervisor/shared/serial.c:138:18: error: implicit declaration of function 'tud_cdc_write'; did you mean 'tu_fifo_write'? [-Werror=implicit-function-declaration]
count += tud_cdc_write(text + count, length - count);
^~~~~~~~~~~~~
tu_fifo_write
../../supervisor/shared/serial.c:138:18: error: nested extern declaration of 'tud_cdc_write' [-Werror=nested-externs]
cc1: all warnings being treated as errors
make: *** [build-unexpectedmaker_tinys2/supervisor/shared/serial.o] Error 1```
@atomic summit submodule update?
I tried that... seems it's up to date
I've tried all of the usual stuff...
other than stomping the repo and starting again
But the CI is also failing with the same error on my PR
I am compiling the latest main now...
oh, hmm, has the USB_DEVICES = "CDC,MSC,HID" stuff now been removed?
yes... it was in #4215
trying again now without it.... as I cant find any boards using that
ok, I missed that memo... checking that now...
yup, mine is compiling now
nice! ๐
so has anyone implemented the newer compile time flags for USB stuff in a board profile?
I might leave that for another time - hopefully the CI will be happy now!
ya... dan updated the flags in his 4215 work
Right, but has anyone added those flags to a board definition anywhere? Just curious to look at one if someone has
as per my understanding they aren't needed anymore...
I think this has moved to a port specific basis rather than board specific
Oh, right... I'm a little lost reading the comments on this ๐ Ok, I'll move on, thanks for the help @analog bridge !
Ok, CI failed build again, but this time it looks like it's not me... Clone IDF submodules failed...
Failed to clone 'components/asio/asio' a second time, aborting
But that was on my FeatherS2_Prerelease, My TinyS2 built ok.
Sorry, I missed the title is wrong. I rebased on top of main now, and removed the unnecessary changes. It's ready for reviews, thank you.
There's a single execution of pwmio_pwmout_set_top lurking in the mono/stereo PWM audio code:
@tannewt Can you again suggest some representative hardware target devices to focus this build system retooling effort? I don't mind buying several devices with bare minimum features if helps with quicker wins. A power outage damaged my Metro M4 Airlift which was plugged into a wall outlet at the time. Maybe a device that you're also using and that's still in production?
Thanks @tannewt. I've added those definitions to our boards now.
Should I expect to see Windows/Linux report a larger mass storage size than 1MB, or is that not hooked in yet? I've tried both our board firmwares and the new QTPy RP2040 and they all report 1MB free.
If so, and you think everything else on this PR looks good, i'll go ahead and submit it.
say, I have the following example object. Is it possible to get the value of b when only base and a are known?
typedef struct {
mp_obj_base_t base;
uint8_t a;
uint8_t b;
} example_obj_t;
Sure, private variables with a little logic in a getter method might suffice
I canโt say for certain how it would look off the top of my head though
yes... I am interested in knowing if CPY already has a function for this
I am going to revise the Learn Guide with the new flags. I did fix all the existing board defs to use the new flags.
I'm not sure what you want. Knowing base tells you to cast the obj to an example_obj_t. Or is this a subclass?
ignore it... I have found an easier way to accomplish what I am trying to do
its one those things where you start making it more complex and then suddenly realize an easier way to do it
@atomic summit @analog bridge Guide has now been revised to describe the new way to enable/disable various USB and USB HID devices: https://learn.adafruit.com/building-circuitpython/customizing-usb-devices
@brentru following a long and unproductive troubleshooting session, a complete reinstall of circuitpython/libs on the device seems to have sorted the issue (same versions as previously). I am uncertain as to what caused it but I can confirm this is now working as expected. Please accept my apologies for time wasted.
While writing this up for the Learn Guide, I noticed I had typo'd CIRCUITPY_USB_HID_SYS_CONTROL a couple of places.
Either @jepler or @tannewt for review (or anyone - this is simple).
looks fine, no testing performed.
@onyx hinge Do you understand why we are getting " [Hosted Weblate] New language added to CircuitPython/CircuitPython" messages? There have been several. The latest is for "de", not "de_DE", but when I click on the appropriate links in the message, it goes to the existing translation.
No, I'm not sure. It could be related to the "glossary" feature which was recently added. There's a glossary/de https://hosted.weblate.org/projects/circuitpython/glossary/de/
though our de_DE translation is also just /de/ in their URL https://hosted.weblate.org/projects/circuitpython/main/de/
yes, the link in that message is to "glossary", so I gues some action someone took on the website added the glossary for our German translation
@idle wharf Good morning! Please ping me when you're around.
I think you are right about the "glossary". I remember that word in the previous messages as well.
https://docs.weblate.org/en/latest/user/glossary.html#managing-glossaries "Changed in version 4.5: Glossaries are now regular translation components and you can use all Weblate features on them โ commenting, storing in a Git repository, or adding explanations."
It's ok for me to wait. But I would like this PR to be in the next CircuitPython release.
Currently on the website: https://circuitpython.org/board/spresense/ there are 2 versions of CP that you can choose from: CircuitPython 6.1.0 and CircuitPython 6.2.0-beta.2.
Unfortunately, CircuitPython 6.1.0 does not work for Spresense and CircuitPython 6.2.0-beta.2 only works on Linux.
@ionic elk Around for a question?
@slender iron I have got the the internal buffering implemented but the pico-sdk doesn't have functionality of passing args in callbacks...
I need to pass data regarding uart instance and the linked ringbuf... how should I proceed with this
https://github.com/raspberrypi/pico-sdk/issues/71
@analog bridge are there per-instance callbacks?
you could probably statically do it because there are only two
@idle owl what's up?
ok... this could be a temporary fix until the sdk has required functionality
Is this valid? "the STM32F405 only supports 128KB RAM in CircuitPython"
Feedback on one of my guides saying I should mention that you can't use 192+ or something in CP.
From November 2020 though. So I thought I'd ask you.
yes... but then how to get the linked ringbuf
@idle owl yes, that's still true I think. It has two different kinds of RAM, and one of them is small and invalid for certain kinds of processor operations. So we use it to buffer the flash, instead of being user accessible.
Alright. Thank you!
np
just store it in a global. have two different callbacks, one for [0] and one for [1]
Please include (or follow up with) the flash part numbers and how they are connected. I'll need that info for my future refactoring.
@kamtom480 It will merge soon enough, after the #4248 is merged that save flash on the samd21 build.
I merged the PR and triggered a re-run. Hopefully it'll pass.
Nice! Thank you! When can I expect the next CircuitPython release?
I have just have the same error, however this is in the main code, should I do the same, it is for this PR https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/pull/121
@still zephyr It can't be disabled. I'm looking into the solution. Please sit tight for a bit and I'll let you know as soon as I know what we're going to do.
I will, thanks for the info, let me know if I can help :). Thanks for the quick answer.
@still zephyr I will definitely let you know if you can help. Whatever solution we come up with will need to be tested, so you may be able to help there. And you're welcome ๐
Thanks Scott. Will follow up with flash codes in the near future
#4228 Adds three pimoroni boards.
TOTAL_FLASH_SIZE has been refactored into board settings to handle different flash sizes.
@zodiusinfuser want to add the remaining pimoroni board too?
Grabbed latest (adafruit-circuitpython-raspberry_pi_pico-en_US-20210223-cca6cfe) this morning and haven't see any problems. I'll check it again in a few hours and will post an update if it fails.
@kamtom480 Please rebase this. I can't get it to run the checks against the newest main branch with the size fixes.
We can release a beta this week with these changes.
Thank you for tackling this!
I think you should add a deprecation notice in the docs of max_size (yay!!!) to say it'll be removed in 7.x and make it do nothing internally.
Shouldn't this call into shared-module as well? As-is, it won't trigger any rectangular redraws.
It may be worth comparing the previous sort vs current to limit what area is updated too.
How about making list_insert public as well and using it here?
the API explicitly allows setting the buffer size
I see. I have added internal buffering now.
@jerryneedell can you do a retest of gps_simpletest.
@tannewt Peeking at the west docs, it uses cmake to generate ninja build files & board files. But since it's Python, that part can probably be replumbed. There's also a flashing component; could that be handy for priming/repairing boards for usb disk?
Flashing is interesting but not very urgent. Most CircuitPython boards have UF2 bootloaders that are easy to manage separately. The main reason I'd like to rework our build system is to simplify configuration of different boards and genera...
That's just a network failure we can ignore. Will merge now. Thanks!
Thanks Scott. We'll stick with the boards I've already added for now, as the other's still need more dev work if I recall correctly. Also we need to look more seriously into the USB PID situation as we only had a few spare.
Thanks again Scott. I'll look at the website soon. Does it automatically associate the UF2 with the page? Looks like there's some magic going on under the hood
Thanks @tulip sleet
@tulip sleet could we hop in voice chat sometime to talk about the alarm system? I'm having trouble grokking the get_wake_alarm subsystems.
I wanted to talk to you about ESP32-S2 I2C, so sure. Now is fine.
Ok, I'm in amelia
Matrix vector multiplication isn't working in ulab on the following version:
Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit Grand Central M4 Express with samd51p20
Here is an example of it's current functionality:
import ulab as np
A = np.eye(3)
B = np.array([1,2,3.0])
# the following two lines don't work
C = np.linalg.dot(A,B) # ValueError: matrix dimensions do not match
C = np.linalg.dot(A,B.transpose()) # ValueError: matrix dimensions do ...
@tulip sleet
import board
import busio
i2c = board.I2C()
#i2c = busio.I2C(board.IO5, board.IO6)
def printdevices():
i2c.try_lock()
devices = i2c.scan()
print("I2C devices:", len(devices))
for device in devices:
print(hex(device))
i2c.unlock()
printdevices()
@slender iron I figured it might make more sense to continue the discussion here instead of GitHub for scheduling the chat about migrating to ninja build. I see that from the time you introduced the project to me at the pycon hackathon in May, there are 2 more commits to your ninja branch. I would like to learn about your vision. I'll have some time to work on the weekends, but for the chat we can also meet during the week. I noticed you had some "Deep Dive" sessions on the Adafruit YouTube channel about every week; perhaps it might make sense for me to attend one of those sessions and touch on it sometime then if it's not going to put off other listeners? Are you have a session this Thursday or Friday?
@microdev - sorry... It does not work at all. Even the "echotest" now just returns a steady stream of "HHHHHHH" characters. the "simpletest" crashes due to a memory allocation error.....
@stiff pewter thanks for pinging me! ya, I plan on doing a deep dive this friday
Ok, great. I'll stop by then.
I noticed a pinned Google doc. Is there an agenda somewhere I should add this on to?
should fit in nicely with the flash work I want to do sooner too
I can make the doc now
the pinned doc is for the circuitpython weekly which is on mondays at 11am pacific
that may be a better place to discuss actually
to get input from other circuitpython folks
we have an "in the weeds" section that usually happens around noon
@slender iron on this topic is there a specific reason you don't want to use cmake as the build system?
I am guessing that you plan on a python wrapper anyway and cmake would allow for simpler integration to other projects such as the esp-idf.
This is also the direction micropython is moving towards.
@subtle sun I dislike cmake every time I look at it. One thing it doesn't do that I'd like to is generate one ninja file that produces all of the artifacts
usually cmake is setup like our make is now where the board is an input to a bunch of conditional code
I do think it's worth thinking about how to integrate with cmake
I don't want to learn another language (cmake) if python can do what it does
When you compile python itself from source, it uses python as it's "build" system
of course, I should caveat this with the fact I haven't used cmake for any of my projects
I like what ninja provides though
I don't care to do the build from python directly
python is good at generating text ๐
I've put in my calendar to attend both Friday and Monday's sessions. See y'all then!
thanks!
Totally understood. As long as it plays nicely with circuitpython dependencies should be fine.
I have been working with a colleague at work on building micropython as a library for embedding into a native executable.
This is probably a good example for how this would look in cmake.
https://github.com/michelhe/micropython/tree/libmicropython-port-fixes
Just to get a feel
ya, it is interesting because I'm very much of the opinion that CP is always the top level project
whereas MP is going the libmicropython route
Sorry my mistake the version with cmake is hasn't been pushed yet.
Will update when it is up.
๐
I'm super biased about this. ๐ I don't feel like most vendor hals work well for us either. they are all geared towards being their own ecosystem and supporting a project on a single board
the HALs also don't do much dynamically. there is a lot of "this pin shall do this" baked into the compile
tinyusb represents the world I want
one API that works across vendors
Personally i am hoping to get back to work on the the successor to the https://circuitpython.org/board/aramcon_badge_2019/ .
The conference has been postponed because of the pandemic but we are hoping to be able to reschedule the conference to September (the vaccination here in Israel is moving extremely quick).
๐ BLE workflow is a higher priority than this build stuff for me
Agreed. I don't see how one could implement https://github.com/adafruit/circuitpython/pull/4215 across boards without tinyusb.
But this is traditionally what you would get from an RTOS.
The HAL that is.
๐ฏ my beef with RTOSes is that they are usually monolithic and usually bake configuration in at compile time
Sadly USB comms are still stopping. I will continue to try future builds I guess.
did a simple test --
Adafruit CircuitPython 6.2.0-beta.2-48-gefe6aab5f on 2021-02-23; Raspberry Pi Pico with rp2040
>>> import time
>>> import board
>>> import busio
>>>
>>> uart = busio.UART(board.GP12, board.GP13, baudrate=9600, timeout=10)
>>>
>>> uart.in_waiting
235
>>> uart.read(1)
b'H'
>>> uart.read(1)
b'H'
>>> uart.in_waiting
235
>>>
It is a trade-off they choose to take for code size, performance and safety.
I don't think that there is one true answer.
The possibility of a dynamic environment like CircuitPython on commodity hardware is quite recent.
yup, I totally get configuring stuff at compile time for that reason
I do think some could be less tightly coupled
migrating to zephyr for example is all-or-nothing really
And i would be unlikely to deploy CircuitPython as is into an industrial / safety critical environment.
That said i think there is a lot to be said about using it in less constrained use cases.
ya, we don't claim to be good enough for industrial and safety critical
the MP space stuff though used it for non-critical things which makes a lot of sense to me
I think something like LibOpenCM3 for RISC-V could bring us much closer to where you would like us to be
I like to watch the zephyr project because of the safety stuff they do
libopencm3 is gpl though which means we can't use it in CP unless we relicense (which we won't)
I wasn't talking so much about the license but more about a vendor agnostic library (although not architecture agnostic)
Would you be interested to accept work on a Zephyr port of CP?
ya, I still think its likely more monolithic than necessary though. I like that tinyusb is just for usb. I think the same could be done for SPI
I'd definitely review and merge. I was hoping to convince maureen to do it
(maureen has been doing MP zephyr work)
I thought this worked well for tinyusb because the USB IP is the same across many vendors. Not sure this applies for SPI.
I guess this is similar to the use of shared binding in CP. Maybe extracting out to a separate project could create this generic SPI HAL.
I would be happy to contribute but i don't think i could start this on my own. Will keep track and see if i can help.
HAH. Me: 1, Pylint: 0.
@subtle sun USB IP varies enough that you have multiple implementations under the hood. I suspect it's about the same for SPI. And yes, you are understanding where I'm going with this. common-hals could be split out as separate libraries. I like the idea of moving to a peripheral IP based model rather than chip family like we have now. Suddenly your driver support becomes much more like I2C drivers then.
@gilded cradle Do you have a few minutes to discuss your Tri-Color SSD1681 PR and give me a little more information on what failed? I can't find a failing Actions run for your PR.
Sure
Excellent. First thing, where is the failure? I need to see what it failed on and how.
Ok yeah @idle owl. That's weird. This one failed yesterday: https://github.com/adafruit/Adafruit_CircuitPython_EPD/pull/45/checks?check_run_id=1957020052
Thanks!
@slender iron sounds good. This would make the effort on the abstraction well spent.
Oh I see. Not today though.
Alright, please remove duplicate-code from the .pylintrc file and run it again. I don't think it did anything anyway, but it shouldn't be there. But trigger another run and see if it fails.
Yep, I see there's a new release of pylint. They probably messed up
The thing is, this check has been in place for ages, and it wasn't working
Something in the latest release made it work
I have a fix for it but I need to make sure it will work.
Fact is, it's a good check, and should be run on the libs. But not on the examples which will obviously have duplicate code.
Yeah, I was looking through commits and they fixed something that caused it to work
Yeah. I wanted to make sure it was failing on the examples for you and not on the lib files.
If it's failing on the lib files, we need to do something else as well.
It was the lib files because it selectively loads the right eink drivers, so there really is a lot of duplicate code.
There are settings for the check we can use, but I don't want to blanket use them to fix the example files issue. So I have a fix for that, but need to know if we need to also change the config a little.
Here it's failing: https://github.com/adafruit/Adafruit_CircuitPython_EPD/runs/1964931784
Oi ok.
@v923z I reproduced the same in the legacy branch of ulab as well as in master branch. Can you please look into it? If possible we'd like it fixed in legacy so we can take the fix in 6.2.
I imagine the Adafruit_CircuitPython_RGB_Display library would suffer a similar fate on the next update/
The EPD could probably be refactored, but it would need major refactoring.
@jepler Sure! What is the deadline? I should be able to fix it tomorrow.
Ok.
It's kind of a hold over until we can add eInk support to Blinka displayio
So It's probably not worth a major refactor
That's fair. Still, this is my grumpy face.
Ok.
Do you think there are many libs like this? Other than this and RGB Display?
No, probably not. Those are the only 2 I can think of and I don't even know if we used RGB_Display anymore since I added in Blinka Displayio
Ok. I think I'm going to make an exception to the rule and have us change the .pylintrc only in those repos. We're already taping them together to keep them going, I refuse to put the rest of the libraries in a less-than-useful state to accommodate two that we're limping along.
Yes give me a moment, I'll have you make the change I think.
Remove the change you already made, if you haven't already. Update line 256 in the .pylintrc file in the EPD repo to 210. This section here should look like this when you're done ```[SIMILARITIES]
Ignore comments when computing similarities.
ignore-comments=yes
Ignore docstrings when computing similarities.
ignore-docstrings=yes
Ignore imports when computing similarities.
ignore-imports=no
Minimum lines number of a similarity.
min-similarity-lines=210```
We'll be patching all the other libs' build.yml file here in a bit, but this change will apply ONLY to EPD and RGB_Display.
I just ran it locally and it's still failing with 210
Please save the output to a file and send it to me here
Or paste it into a file rather. I figure it's too long for a Discord message
Looking into it.
Yeah, the number doesn't make a difference. I changed it as high as 20000 and it still had a wall of errors.
I tried pushing a merge commit, but we don't have permission. However, I was able to build one of the failed builds successfully.
@gilded cradle I just generated a new pylintrc and it works.
There's something in our config making it ignore that change.
I'm sorting out what it is.
Oh, ok
Good find though
Thanks
Ok, changing to jobs=1 fixes the issue
๐
For now, just do that.
It's only two libs, so we'll deal with manually updating them if we need to later.
Ok. I also think I can use something lower than 210 like 50
based on the file I uploaded, yeah
Test it out and go as low as you can, but bear in mind we don't want to keep updating this.
50 works, 40 fails
Ok go with 50.
ok
Can you update the .pylintrc on the RGB Display lib as well? It fails, I checked.
sure
Perfect.
This is a bit tricky to do. We would need to find all descendants that moved to the front of any descendants the overlapped with.
For the particular use case I need, the sprites being sorted are animated and thus will be refreshed on every frame anyways.
I wonder if we could simply mark the whole group as dirty?
Thinking further, we would need to make a copy of the original members before sorting, and then, after sorting, iterate over it, and for every element, locate its previous position โ if that position is more to the back than the new one, then iterate over all layers in between the two positions, and check for overlaps โ if an overlap is detected, mark the layer dirty.
A simplified, and possibly much faster approach, would be to mark dirty any layers that moved forward, no matter if the...
This is actually much more complex, as a layer can stay in the same position in the list, and still require redrawing if something moved behind it.
@tulip sleet I found the ST table for power utilization. It turns out that sleep mode (WFI) by itself on the STM32 really doesn't do too much, unless you shut off peripherals - the difference between Run and Sleep with all peripherals on is 87mA vs 59mA. Stop mode (all state retained, but clocks disabled) is much, much lower - 0.45mA. Standby is 3uA or lower but can only be woken by the RTC and a specific Wakeup pin.
There are also big power savings if you turn the clock speed down, but I'm wary of how that would affect things on the fly.
I'm tempted to just do bubble sort, and check for overlap each time we swap two items.
But the Stop mode savings do show some potential value to an intermediate low power mode. Sleep by itself isn't going to do very much and I worry that Deep Sleep could drop an unacceptable amount of state for some projects.
If I call m_malloc() in a core module routine; do I need to free up that memory upon a deinit(). I see some modules that are just setting the pointer to NULL. Is that sufficient?
@jepler @kevin-tracy https://github.com/v923z/micropython-ulab/pull/339 should hopefully fix the issue.
Thanks for working on this. I left a bunch of comments, but some would change as you clean up the draft. I will reply to other things in another comment that quotes from your comments.
There are some functions and definitions in nrfx/hal/nrf_vmc.h and nrfx/hal/nrf_power.h that abstract this a bit. Do you want to look at those?
Did you add this because it was too big otherwise?
These are extraneous. You can use a global .gitignore for your own purposes.
@v923z thank you very much! Out of curiosity, how come that change was made to the micropython-ulab repo instead of circuitpython-ulab?
@kevin-tracy Because @jepler simply links to micropython-ulab, so it makes sense to implement all fixes there. I think, having the same thing at two different places is generally not a sound idea.
TimeAlarm for deep sleep (I am not sure if it is possible)
This is quite possible if you just use System ON. The power consumption can still be negligible. You don't have to use System OFF if it is inconvenient. See the chart below from the datasheet. System ON with wake from RTC is on about 3uA, which is still wonderfully low. SYSTEM OFF gets it below 1 uA in certain circumstances. You could choose which to do based on which alarms are set. But to start you don't have to differentiate a...
You don't need to free it. Usually the bugs are where it's freed automatically too early
OK, thanks!
np, what are you working on?
pulsein using pio
awesome! dht folks will love that
I have it mostly working for DHT and irremote - just cleaning up the edges.
@fossil gorge I've started looking into the same thing you're working on but for a different reason. And there's a catch now. That I don't know if it's even possible to handle.
Which thing is that? Pylint/Pre-Commit?
Yes
Here's what I now need from it.
I need it to run Pylint on the example files separately. So, separate Pylint runs for each file. It's doable with it in the github workflow build.yml file, but I'm struggling to figure out how to do it using pre-commit.
The build.yml change is this: (find examples/ -name \*.py) but pre-commit doesn't work that way.
So like it is now, with different rules disabled/set for examples/*.py and adafruit_*.py?
Sort of.
There are ways around it, no worries ๐
And it should be 1 call per example?
Yes. It's a workaround for the now-functioning duplicate-code check.
Checking each file separately means it doesn't compare them.
Ah, I see
I want this ONLY on examples.
Because they should be similar, that's fine. Lib files, less so.
Gotcha. Makes sense
And here's the other catch. I need this.... ASAP.
Ok
Because if we can get it working, I'm going to have Dylan patch all the libs. Because this check is breaking all my builds.
Tsk tsk tsk. Bad Pylint, BAD!
This was always the plan, but maybe not so quickly. Thank, Pylint. ๐
Let me dig into it a bit.
Thank you! I have done so and am at a loss.
I think I can come up with a somehting
I have a setup I can test.
Ok. Is it running a specific version of pylint that's causing the issue?
Actually, I should explain it to you so you can test it locally.
So I can repro on my end as well
2.7.0 should do it.
If you clone the Adafruit_CircuitPython_DisplayIO_Layout library, and let the latest Pylint run on the examples/, it will fail appropriately. Unless you force it to iterate over each file, in which case, it should not fail.
Got it. I'll work off that repo to make sure we're working off the same data
It's not a complicated setup. I've been editing the pre-commit-config.yaml file locally and running pre-commit run.
Thank you so much
Good to know I was at least on the right track there!
Run pylint examples/*.py to make sure you've got the fail version, if you're unsure.
Sounds good
anyone working on rotaryio for rp2040?
Might be away for a bit, since kids apparently want to be fed more than once/day ๐
But shouldn't be long, and i'll be on that
No worries! Life comes first!
Just throw some snacks in a bowl at the table ๐
Here is the notes document for Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the meeting - itโs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1u7_1iSfVo1LGNRU6WGSMYAr9Dp6VvEqK8UMHlco8oVA/edit?usp=sharing
CircuitPython Weekly for March 1, 2021 Here is the notes document for Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the m...
Realizes he already has some folks to hug-report, realize he forgot to make the meeting document .. yay
๐
Some of us progressively fill the document so that they can forget or if they don't have time to update before the meeting, it is not empty.
This adds I2SOut and PDMIn support via PIO.
StateMachines can now:
- read and read while writing
- transfer in 1, 2 or 4 byte increments
- init pins based on expected defaults automatically
- be stopped and restarted
- rxfifo can be cleared and rxstalls detected (good for tracking when
the reading code isn't keeping up)
Fixes #4162
I'm supposed to do it right after the previous meeting, so it's there for you to do exactly that @thorny jay
#4251 includes the new init code. Sorry for blocking this!
Yup just countio right now
kk, I want to make sure we're not working on the same things
microdev is doing uart, davep is doing pulsein
cool, yeah I'll usually ask here first to see if anyone is working on it
๐
Yes, but you needed a break after the meeting, so you forgot. You are fully excused. ;-)
Anyway, I have a big gap in "making" anything since a few weeks... except for watching YouTube video.
you wouldn't necessarily think so, but it does take a lot out of you (me) to run the meeting. A break right after it is much needed.
A break you didn't get because of newsletter training.
Initially we thought we might have to make local changes to allow ulab to work with circuitpython but v923z has been very responsive to all our needs, keeping the changes in his repo. It is working out very well!
If youโve got improvements to that library feel free to open a pull request ๐
I have been very swamped with life and work the past few months and havenโt been able to drive that where I want it to be but Iโm always happy to burn midnight oil on prโs.
I wonder if we should remove or make private the unused adafruit fork of ulab: https://github.com/adafruit/circuitpython-ulab -- it just confused a user as seen in the thread of https://github.com/adafruit/circuitpython/issues/4250
Just to keep you informed @idle owl, I'm at least 60% sure I'm onto something that works
@fossil gorge Oooh I hope so!
You've got PR
It was supposed to be a Draft, but I flubbed on clicking. Again
If there's anyone around who wouldn't mind giving it a quick sanity check to make sure it all looks correct, I would be much obliged
https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/pull/6
I looked it over and seems good, I can put a review on it but I didn't actually test it
Given the the changes, in theory, it tested itself, no? Looking at the build action outputs, the previous commit still had the GH action, and it failed with the known/expected error. However, removing that call from the GH action, it works.
I just want to make doubly sure it's really calling pylint on the files correctly
And maybe one day, I can learn to type "pylint" on the first try, instead of "pylin_g_"
Oh yeah, forgot it would be self-testing as such. Yeah I see the pylint run and the lack of pylint in the main test lists
wanted me to merge it too?
I tested pre-commit on your PR and it seems to work as I would expect. I added a line to long error to an example and it caught it.
Adding countio to RP2040. This build uses the PWM IRQ that does not seem in use in the PWM module. If the PWM module started to use it there could be a conflict.
ugh somehow I managed to push commits I didn't want to again
Thanks @gloomy shuttle. Appreciate the double-check
No bueno. That tends to happen a lot to me
I mostly just amend my initial commit anymore to avoid pushing new commits
@fossil gorge That's amazing! Don't commit it to the DisplayIO_Layout library. Or rather, don't PR it to that. Let's get it into cookiecutter first. I'll have Dylan run a patch against all the libraries with the update.
Also, we can apparently remove bad-whitespace because Pylint finally handed that over to other formatters.
I need to make sure we don't need to remove it to avoid it saying "invalid argument" or some such.
Wait, how does that work using a local thing remotely?
As in, will it still run when someone PRs to the lib?
I'm asking in the PR. ๐
I'm looking for guidance on the variations of function definitions MP_DEFINE_CONST_FUN_OBJ_KW options along with using MP_ARG_REQUIRED in the argument parser. It seems like the n_args_min value specified is the minimum number of positional arguments required? I'm confused how to use this.
My goal: I'm trying to enforce that two inputs are required, but I don't want to require them to be positional. Can anyone give hints how to use this?
I've tried different permutations, but keep getting "function missing 1 required positional argument".
I'll make the changes to cookiecutter, which should hopefully be straightforward since the changes should be in files that are static and don't change during the execution of cookiecutter.
Thanks! It's time for me to head out. I'll take a look in the morning.
Perfect, thank you!
You're welcome. Have a good night, and you'll have a PR that looks forward to meeting you in the morning! ๐
in adafruit_bus_device/I2CDevice.c the readinto function has two keyword arguments (and one positional) can that help?
Let me go look.
Hmm.. so the positional argument is the buffer and the other two (start, end) are the optional keyword arguments. Then why do you specify 2 for the n_args_min?
is "self" from like the python class maybe the other one?
I mean I may have done it cause it worked and that's what I saw
Ok, maybe that's my problem. I'm pulling a function out of the bitmap class and trying to put it in standalone module. I used to call my_bitmap.rotozoom(....) and now it's going to be rotozoom(my_bitmap, ...). Now it isn't a method of "bitmap". Maybe that's my issue...
@fossil gorge feel free to ping me if you need someone to test cookiecutter tonight ... I'll be around
That's awesome of you, thanks @idle wharf
For some reason I think that's what the "extra" one represents
Oops. also I probably made an error in the mp_arg_parse_all arguments.....
I didn't change that when I pulled it out into a separate module.
Thanks @blissful pollen for the example, that helped a lot. There are a lot of ways to make it wrong, but only one set of proper incantations. Thanks for the pointers!
no problem and I totally get what you mean
If you want to give it a preliminary try @idle wharf, PR's updated. I still have another change I would like to make, but what's there should handle the current situation we're trying to work around.
https://github.com/adafruit/cookiecutter-adafruit-circuitpython/pull/109
I'm going to close this PR and start a cleaner one with the new module addition.