#circuitpython-dev
1 messages · Page 389 of 1
❯ pre-commit --version
pre-commit 2.10.1
seon@iMac ~/c/p/espressif s3_support ⁝ ✱ ?
❯ pre-commit install
pre-commit installed at .git/hooks/pre-commit
I have it installed. Maybe I need to update it ?
woah, when I run that I get a stack of errors
After walls of errors, I get this FileNotFoundError: [Errno 2] No such file or directory: 'uncrustify'
also ModuleNotFoundError: No module named 'polib'
ya, I have those installed
Do I have to build uncrustify ?
I think it's commonly in a package manager
ahh, no pip, but brew
yup, have polib installed now and am brewing a cup of uncrustify atm
☕
❯ pre-commit run -a
Check Yaml...............................................................Passed
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
Translations.............................................................Passed
Formatting...............................................................Passed
elapsed time 14s
all set now I hope
👍
Updating a macropad to RC2 from the site made the board not mount (and make the mouse stutter).
When I plug the board or reset, the safe mode blink happens, then nothing. Not even the screen shows anything.
Putting RC1 back, and power cycling restored it to normal.
Trying recent builds, I narrowed it down to #5341. Reverting it in RC2 fixed the issue.
On a Raspberry pico, RC2 does not show or run the code when plugged in, but comes back and seems to run ok after pressing reset. The fi...
@jaunty juniper I did do a smoke test of a Feather RP2040, but perhaps did end up press reset.
I wonder if the screen init makes it different on the macropad ?
or whatever else is different
well it doesn't work right on the Feather either. If I power-cycle the board, it does not come up until I press reset
my smoke test did not involve power-cycling
If I had to guess, I would say that a USB interrupt is not getting serviced on initial power up
I reproduced this on a Feather RP2040. On power-up, nothing is seen. I wrote a blink program in code.py and it did not start. Pressing reset usually causes the board to come up, but I had to switch USB ports after a second power-cycle, so I think the USB behavior is upsetting Linux.
I tried adding an explicit check for !tud_task_even_ready() before the __wfi(), which is what the code did before #5182, and that did not help.
@tannewt Since this is a show-stopper, we could just revert #5341, and I'll make an rc.3 quickly. Let's talk about what to do next.
I can confirm this issue is present on another RP2040 board I am working on (not yet in the list but loaded a Pico uf2 as a first test - received the PCBs before dinner...).
Remember that other high speed protocol devices exist, such as LoRA or the HC-12 module. Cheap and effective, not secure but you can always add that on top in software.
@BetterAutomations All of which require an antenna of some length that you may not be able to bury in the prop. The arduino libs work, but it's a lot easier to figure out what you wrote in python when you have to make changes a year later.
CircuitPython version
Adafruit CircuitPython 7.0.0-rc.2 on 2021-09-15; S2Mini with ESP32S2-S2FN4R2
Code/REPL
import board
import digitalio
from adafruit_debouncer import Debouncer
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
pin = digitalio.DigitalInOut(board.D2)
pin.direction = digitalio.Direction.INPUT
pin.pull = digitalio.Pull.UP
switch = Debouncer(pin)
led = digitalio.DigitalInOut(board...
Hypothesis: we do a gc after each import, so I wonder if something HID-related is being gc'd that should not be.
I tried reproducing this on a Metro ESP32-S2, using board.IO5 for the button and board.LED for the LED. Otherwise everything is the same. Libraries are all the latest versions. There is no boot.py, and keeb.py and code.py are as described above.
I do not see this problem with rc.2, including when restarting from a power-cycle or a ctrl-C, ctrl-D in the REPL.
Further testing: no problem with rc.2 .uf2 instead of .bin. @Neradoc can also not replicate on TinyS2 or Feather S2.
Reverts adafruit/circuitpython#5341 to fix #5354 for now. We'll do a more detailed diagnosis after 7.0.0.
Discussedin terms of scheduling with @tannewt.
Closing to resubmit to get an artifacts build.
Reverts #5341 to fix #5354 for now. We'll do a more detailed diagnosis after 7.0.0 final.
Discussed in terms of scheduling with @tannewt.
Thanks for the PR @mscreations. I have one suggestion, I think it might be better if autoreload_enabled is done as a property.
Thanks for the PR @mscreations. I have one suggestion, I think it might be better if
autoreload_enabledis done as a property.
We don't have module properties, so it would need to be moved to supervisor.runtime (the sole instance of Runtime). We could then have a single autoreload property to query or set. But it would be a breaking change. We might consider moving other things to there as well if we made this change.
@tulip sleet do you think we should do an rc.3?
I am all set with rc.3 release notes and posts. Just waiting for my merge and then the label.
great! thank you
I did test it 🙂
I'll be out for a bit in an hour-ish but around generally
I am out early for a while, 1pm your time.
I just need to push some buttons in a couple hours.
kk, let me know if you need me to do anything
sure, np
Merging PR #5341 caused issue #5354 so it was reverted in #5357.
Automated website update for release 7.0.0-rc.3 by Blinka.
Completely understood. I restored the pycubed board defs. @tannewt Do you prefer the redundant (but labeled) pycubed_v04 board def be removed?
Yes, please remove the new v4 def and leave the existing one.
Completely understood. I restored the pycubed board defs. @tannewt Do you prefer the redundant (but labeled) pycubed_v04 board def be removed?
Yes, please remove the new v4 def and leave the existing one.
Done. 👍
I think I did add parentheses around the second 'sizeof' to silence this warning locally. Want to make a PR for it?
You may be able to use sleep memory to store state across the runs of different programs.
Nice work! Sounds like you are ready to make a PR.
Generally we don't pre-initialize any individual pins. The one exception I could see is the power enable pin that you may want to turn on in board_init and off in board_deinit. However, this will prevent code.py control of it which some people usually want.
For I2C, SPI and UART we usually have default busses that are available as board.I2C etc. This requires entries in the board table and definition of the DEFAULT_* macros like here:...
Each commit causes a set of builds, so I am cancelling the older ones just to save build time.
Is it worth implementing something in the core, perhaps in board, that indicates the polarity of the on-board user LED? Some convention perhaps like the NeoPixel power control pin. Most are active-high (True turns it on), but there are some active-low in the field. Or should this fall to user code?
@tulip sleet it just came to my attention that the "paralleldisplay" module isn't actually importable due to mistakes I made 😕 not sure how I missed it. It doesn't affect boards that activate a parallel display in their board file, or old code that uses displayio.ParallelBus, so the impact is low .. nothing that should stop an RC from becoming 7.0.0. PR incoming.
i am sure we will have 7.0.x 🙂
or 7.1
it might have worked by accident before the conversion to MP_REGISTER_MODULE, if it wasn't that way in the first place(?)
Some code that should have been in a C file was in a header file instead. It's a wonder it built at all.
Thanks for handling the releases, Dan!
yw! lotta waiting around
I'm working on trying to convert the espressif ParallelBus to use the i2s peripheral. Their nomenclature for the pins seems different than ours, I wonder if it's just naming or is actually incompatible .. can anyone help me translate? They have "cs", "wr", and "rs", while we have command, chip_select, write, read, and reset. a compatble (with circuitpython) silk has rd (circuitpython read), wr (circuitpython write), c/d (circuitpython command) and cs (circuitpython chip_select).
"rs" seems to be "c/d", because i2s_lcd_write_cmd switches its level
This feature would also be useful for detecting if a nrf52 keyboard should enable BLE or USB HID.
Ye I'm gonna try it, but I haven't received it yet. I was just asking if it's even possible. Thanks for the help guys.
One question. Looks great otherwise. Thanks!
Why delete this? Does the second MemoryError need to be prefixed or the first renamed?
Please verify that the handling of ulab is correct. ulab is a submodule, so I am not sure that it works to name files within the submodule.
This also misses other files that influence how the docs build, such as (top directory) conf.py, the "*.inc" files in docs/templates, tools/extract_pyi.py (which influences how source files are extracted into pyi files which feed into the docs), requirements_doc.txt, etc. Those are just the ones I thought of off the top of my head.
(The extreme di...
oh and of course all the board files and docs/shared_bindings_matrix.py
anybody else get this in a PR run?
the CHANGED_FILES environment variable has a VERY LENGTHY value, and apparently runs up against a Linux limitation
(on my desktop system, it seems that a single environment variable setting NAME=value must not exceed 131071 bytes)
CircuitPython version
7.0.0-rc.3
Code/REPL
#
Behavior
github actions fails in my fork:

Run python3 -u ci_changed_board_list.py
Error: Argument list too long
The value of CHANGED_FILES is very lengthy.

the ringbuf code could be made better
we inherited the 16-bit stuff from MPy. I think it would make more sense to parameterize it by type, but not so easy to do in C vs C++
I'm thinking if we did do it, I'd do a 32 bit packed type -- 16 bits of timestamp, which can be extended to the 28 bits as long as you manage not to go 30s between keyboard polls.
(29 bits? whatever. just a bit of slightly tricky math)
or I was going to use two integers, using a time_ms() directly and then the event info
The buffer is not all that big. As you mentioned, reducing the code size is more important
<Event: key_number 1 released> queued at 321635, dequeued at 322220 [+585ms]
<Event: key_number 2 released> queued at 321635, dequeued at 322230 [+595ms]
``` when mashing a bunch of keys at once
this will probably need simplification before it fits on constrained boards.
well let's see what CI says 😕
you can get the macropad pretty far behind when it's e.g., typing in the digikey URL but that's no surprise. otherwise, when you press just one key at a time it's almost always dequeued within 2ms and often in <1ms (prints 0ms)
of course if the scanning loop is 32ms then the 1ms time it spends on the queue is small potatoes
are you using get() or getinto()?
get(), it's just the basic macropad program
(I'm sure it generates all kinds of heap garbage too, so there'll be gc pauses as well)
https://learn.adafruit.com/macropad-hotkeys this program
CircuitPython version
Adafruit CircuitPython 7.0.0-rc.2 on 2021-09-15; Adafruit Metro ESP32S2 with ESP32S2
Code/REPL
No known minimum reproducible example.
Behavior
Spurious microcontroller.ResetReason.SOFTWARE during operation, but there is no microcontroller.reset() in either boot.py or code.py.
No unusual serial activity prior to rebooting. No tracebacks detected after restart.
I can't reproduce it on demand, only observed once i...
I checked again for my BrailleHID descriptor and it still failes in
/lib/adafruit_ble/services/standard/hid.py
Where
reports = {} get_report_info(collection, reports) if len(reports) > 1: raise NotImplementedError( "Only one report id per Application collection supported" )
CircuitPython version
Adafruit CircuitPython 7.0.0-rc.1-65-gcddbfffb3-dirty on 2021-09-13; Adafruit PyPortal with samd51j20
Code/REPL
import board
import displayio
import array
display = board.DISPLAY
width = display.width
height = display.height
scale = 20
g = displayio.Group(scale=scale)
display.show(g)
bufsize = 2 * (width if display.rotation in (0,180) else height)
for y in range(0, height, scale):
# buffer = bytearray(bufsize)
...
Tested & no problem with rc.3 .uf2 (using board.BUTTON instead of board.D2)
@ThomasAtBBTF I did not realize that check was in the BLE library. Did you just try removing it? I think it might just work without the check, but I'm not sure.
any ideas on how to resolve this?
espidf/__init__.pyi:30: error: Cannot resolve name "MemoryError" (possible cyclic definition)
espidf/__init__.pyi:30: error: Class cannot subclass "MemoryError" (has type "Any")
//| class MemoryError(MemoryError):
//| """Raised when an ESP IDF memory allocation fails."""
//| ...
//|
that just looks ... wrong
import builtins; class MemoryError(builtins.MemoryError): ... ?
which analysis tool shows that error? It (the diagnostic) seems incorrect to me.
>>> class MemoryError(MemoryError): pass
...
>>> MemoryError is originalMemoryError
False
>>> issubclass(MemoryError, originalMemoryError)
True
``` this is perfectly good Python, it refers first to the built in MemoryError, but then stores a new MemoryError in the module level, so after that the name refers to the subclass.
it is from this ci run https://github.com/microDev1/circuitpython/runs/3632617000?check_suite_focus=true#step:8:181
the espidf docs were not getting built previously as the ports/espressif/bindings wasn't included as a source for docs in the Makefile
OK I'd raise the issue with mypy then and see if they really intend to error on this valid python code in a pyi file
errrr maybe it's mypy
yeah it's from the invocation of mypy --strict right?
trying without the --strict now
without cyclic one of the two diagnostics still occurs
.. verified that my proposed workaround is accepted by mypy (the import builtins one)
is re-naming it to IDFMemoryError(MemoryError) a better option?
not right this second, as it's an incompatible API change.
okay... will leave it for 8.0.0 then, thanks 🙂
This patch casts the delay argument to mp_hal_delay_ms() from mp_uint_t to uint64_t when scaling from milliseconds to ticks to avoid 32-bit integer overflow when time.sleep() is called with a duration of greater than 70 minutes.
I couldn't find another way to pass the info from one step to another.
I think this is more a bug in the base branch detection. It determined that this was a new branch so it diffed against your main branch which may not be up to date. There is likely some setting we could tweak to change this.

Either solution is fine with me.
Is there a way to search across all the libraries for issues with the good first issue label? Or does it need to be searched individually on each library?
Ah, I overlooked the sort dropdown. Yep that is perfect. Thank you 🙂
it's only updated once a week right ?
No it's updated daily.
ah 👍
Two more minor things. Thanks!
In py/circuitpy_mpconfig.h put an ifndef that defines this as 0. That way we ensure that the correct files were included to have this defined.
#if CIRCUITPY_BOOT_COUNTER
"pycubed_v05",
"pycubed_mram_v05",
I believe with the latest commit almost everything that influences docs build has been added to the search pattern.
I agree with you about the difficulty of determining a perfect search pattern and with the current implementation there might still be some corner cases but those should be pretty rear.
I commented this as it as was causing docs build to fail while I was testing something else and forgot about it. Fixed now.
@idle owl would it make sense to make an effort to sweep through the libraries and find any public functions that are missing type hints and / or parameter and return types in their docstring comments and open "good first issue"s for them? I don't know how many will turn up but I figure it might make good fodder for hacktoberfest.
@lone axle That would be excellent. That's exactly what I was hoping for.
I bet there's enough to make it worthwhile. That's the kind of thing I was hoping we could find and get issues filed.
I will tinker with it a bit this weekend. I'm thinking there may be a way to run a script against the whole bundle and find them.
That would be great. Thanks for looking into it.
I'll leave it to @tannewt to perform the final review. Thanks for addressing my specific low level concerns by changing the patterns, but I remain pessimistic about techniques like this being "right" and the initial round of changes are also causing me pain in my fork (#5359) and probably in others' forks, to the extent that actions is not useful anymore but just always errors.
Adding new board running a RP2040. This one's a 60% keyboard!
Pending approval of PID from openmoko which should be pretty quick.
I'm trying to change the advertised name of a BLE Keyboard but it keeps showing up as "CIRUCUITPY8728". When connecting to Windows10, the "Complete" and "Test" names (see code below) flash once before showing the "CIRCUITPY" name. In iOS 14 not even those appear, only the "CIRCUITPY". I'm running CircuitPython 6.3 on a Feather nRF52840 Express. Thanks!
import adafruit_ble
from adafruit_ble.advertising import Advertisement
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.standard.hid import HIDService
from adafruit_ble.services.standard.device_info import DeviceInfoService
import usb_hid
hid = HIDService()
from adafruit_hid.keyboard import Keyboard
from keyboard_layout_win_sp import KeyboardLayout
from keycode_win_sp import Keycode
k = Keyboard(hid.devices)
kl = KeyboardLayout(k)
device_info = DeviceInfoService(software_revision=adafruit_ble.version,manufacturer="Adafruit Industries")
advertisement = ProvideServicesAdvertisement(hid)
advertisement.appearance = 961
scan_response = Advertisement()
scan_response.complete_name = "Complete Name"
advertisement.complete_name = "This is a Test"
ble = adafruit_ble.BLERadio()
if not ble.connected:
print("advertising")
advertisement.complete_name = "This is a Test"
ble.start_advertising(advertisement, scan_response)
else:
print("already connected")
print(ble.connections)
BLE hosts like Windows, iOS, and macOS, do a lot of caching of names and the like. You may need to "forget" the device to get the host to change the name it has cached.
Adding new board running a RP2040. This one's a 60% keyboard!
Pending this PR for merging into CP main repo; which is itself pending allocation of a PID.
Thanks @tulip sleet I've tried that. Also: turn Bluetooth on/off (on Windows & iOS) and rebooting my board. No change
@tulip sleet I found this on readthedocs under _bleio.adapter : name:str
name of the BLE adapter used once connected. The name is “CIRCUITPY” + the last four hex digits of adapter.address, to make it easy to distinguish multiple CircuitPython boards" it's the name returned by ble = adafruit_ble.BLERadio() and then ble.name so it seems it's Adafruit's default?
oh right you set ble.name to what you want the device to be seen as
if I understand correctly the advertisement name will be set to it, unless you override it with something else, in which case the advertisement is used by the host before pairing, and the ble.name is used once the device si connected
yes, sorry, just try that. I didn't read your code carefully.
But it would be a breaking change.
Good point, it can be considered for 8.0.0 then.
OK, since @durapensa is having no problem with the same board I guess we can safely assume this board is probably naff. Sorry to waste time on this.
@slender iron @atomic summit I made some modifications to your S3 work.
I started porting C3 on top of your work but ran into problems as idf master is unstable and is changing actively which makes building something on top of it difficult.
So, instead I split the refactoring and switch to IDF_TARGET changes from S3 and idf master update.
Sure, but S3 requires bleeding edge, so I don't have much of a choice
So what IDF tag are you staying on for C3? C3 is buggy like crazy - how can you not be on latest master?
Is 4.3.1 stable enough for you?
Yes, so now I can continue with adding C3 support using idf v4.3.1 and you can continue S3 with master
With this split there shouldn't be any merge conflicts in the future
I'll PR with the refactoring and switch to IDF_TARGET changes to main. You can pull the S3 and idf master update changes from a separate branch.
You will have to reset your local branch to the nearest common commit between your local branch and adafruit/circuitpython/main due to changes to commit history.
Moving forward there shouldn't be any merge conflicts.
Openmoko's PID request got merged.
PID used in this PR matches allocated PID.
so, I was rebasing my branch for BREAD 2040 locally with latest main branch but when i did git add -A I get:
warning: adding embedded git repository: ports/esp32s2/certificates/nina-fw
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint: git submodule add <url> ports/esp32s2/certificates/nina-fw
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint: git rm --cached ports/esp32s2/certificates/nina-fw
hint:
hint: See "git help submodule" for more information.
should I be concerned?
perhaps I need to init the submodules
that was it
main has renamed ports/esp32s2 to ports/espressif, delete the old one if git doesn't do it
ah well maybe the submodules were not moved (or whatever git something something)
removed the esp32s2 subdirectory
hopefully that doesn't break anything
do we not need to update build.yml anymore with new board names?
nope
CircuitPython just got a BLE workflow, so esp32 support is now possible.
This is to add the BREAD 2040 CircuitPython support.
Current PID PR opened on Pid.codes for 0x4DF1
Precommit passes but did list a type_of warning. I'm not sure if that is a big concerned, but all the checks pass.
darn my mac and git adding things to commits that don't belong.. ugh..
Going to re-fork CircuitPython and add these files again. my computer added things that don't belong in this PR.
A step towards supporting more espressif soc's. Related to #1629, #3778 and #4363.
@ornate breach regarding your PR, a rebase should fix things up
it was rebased against main
for some reason when i rebase it just... messes everything up. happens basically every time I add a board 😛
do git reset --hard HEAD~2
i already deleted and reforked lol, not a big deal. I saved a copy local of the files I need to add
i'm just lazy, don't worry. xD
np...🙂
These changes look good to me. I tested the latest commits successfully running locally..
I think we should leave the commas for a future PR, I'll reach out to the person that added this file initially and see if they have any insight into why it is that way or if there is any reason not to remove them so that it conforms to the JSON spec.
Looks good to me, I tested this running locally. The download page looks good to me, and all links that would be expected to work before merging do work properly.
Tested locally, makes mcufamily search/filter inclusive all 234 boards displayed.
Okay, good by me. Commas cleanup & board additions in #763
New PR to add Oak Development Technologies BREAD 2040.
PID PR pending here for PID 0x4DF1
Passes pre-commit locally and builds as expected.
Alright, much better
@slender iron @atomic summit follow up from my previous message... I made the PR and have uploaded the idf update and S3 stuff to a separate branch
PR - https://github.com/adafruit/circuitpython/pull/5367
Branch - https://github.com/microDev1/circuitpython/tree/s3-port
Update the error message in bitmaptools_readinto() to match the code.
Can anyone explain to me how callbacks work on the SAMD port in CP? All the callback examples online eventually throw their interrupt handler into a function named RTC_Handler. Now the CP port also has a RTC_Handler function, I just don't understand when it's being called?? Is it something to do with the RTOS?
The default RTC_Handlers defined in asf4 are declared to be weak, which means they can be overridden by a non-weak declaration, which will take precedence. I am not sure that answers your questions
Almost! So would RTC_Handler() in port.c be the appropriate place for me to put an RTC compare check and dispatch callback for samd deep sleep?
(thank you :))
which SAMD sleep mode are you using for deep sleep?
BACKUP with RTC running. I'm leveraging @pearl hare's insight from our CP deep sleep gist here: https://gist.github.com/hierophect/edb6279bf14e98a4f8ad181e3d4dcd8b#gistcomment-3877697
I don't think you will get an RTC interrupt. I think you will get a reset where the reason for resetting is that you're waking up from BACKUP.
deep sleep starts from a reset. You look and see why the reset happened, and then continue from there
It says "interrupt", but you will check this register to see that the reason was an RTC wakeup
I see your point. But examples I've found put that check+callback into the RTC_Handler function. Like this ex: https://forum.arduino.cc/t/understanding-the-mode-0-and-mode-1-timer-on-the-samd51/662655/2
Hi fostac, Here’s an example of how to use the SAMD51’s RTC in mode 1, calling the RTC_Handler() interrupt service routine every 10 seconds and toggling the LED on D13 (or LED_BUILTIN). It also puts the microcontrolller into deep sleep during intervening time, this is disables the USB and requires a double press of the reset button to recover f...
it won't go into the RTC_Handler
that example is going into STANDBY mode
not BACKUP. Standby preserves the RAM. BACKUP does not. It starts from a reset.
Their definition of "deep" is not our definition
I see. So maybe HIBERNATE is the way to go (allows all or partial RAM retention)
But still: "Hibernate and Backup modes will do a system reset once the exit interrupt is triggered. "
no, our definition of deep sleep is that your program restarts, so no reason to retain RAM. It's as if you pressed the reset button, but you get this extra little piece of information that the RTC caused the reset.
we might need to retain a little state; typically there are a few registers in the RTC that can be used for that
yes understood, but the STM port still assigns a callback associated with the deep sleep alarm: https://github.com/hierophect/circuitpython/blob/3f92ca82f09901d0122141be3dc250f3c8087659/ports/stm/common-hal/alarm/time/TimeAlarm.c#L110
Are you saying that since the samd will automatically reset once the exit interrupt is triggered, this isn't needed?
@maholli the handler may be there to satisfy coding rules, but it does reset. You can stash away some information for the next run though
The STM and SAMD are pretty different on how they do this, I think, so it may not be a very good example. Pin alarms are fairly different, for instance, I think.
Ahhh ok. ty!
@tulip sleet ok I had been focusing on timealarm to keep things simple. So based on Stefan's insight in the gist comment, we get 16 bytes of general purpose registers to store info as well as a preserved TIMESTAMP register. So it looks like I'm back to using BACKUP
yeah, so with BACKUP, you can specify "tamper pins"
yep Stefan's write-up explains that as well 🙂
that is what we expected to use for deep sleep. Only a few pins are possible.
nRF may also be a source of examples, but it's different in other ways. It has very good low-power RAM retention. So I'm not sure we used the no-RAM sleep there.
Well it seems like I just need to pick a spot in the samd port to check whether we just woke up from deep sleep (checking the compare value) and then have it call
STATIC void timer_callback(void) {
woke_up = true;
}
Maybe attaching the callback to common_hal_alarm_woken_from_sleep?
https://github.com/adafruit/circuitpython/blob/f9b40d417adabac96c868ae828eadf3849dffbca/main.c#L494
I am not sure that's correct, that's for a light sleep wakeup. You need to implement common_hal_mcu_processor_get_reset_reason() properly for the SAMD, which currently just returns UNKNOWN as the reason. Look at the STM get_reset_reason impl.
YOu don't really need to do anythng after the reset. It's up to the user program to query the wake_alarm, and that will look at the RTC registers and the wakeup reason at that point.
that I can do since I'll have that RTC->COMP[1] to get information from.
well I want to make sure I fulfill Lucian's intent with this TODO: https://github.com/hierophect/circuitpython/blob/3f92ca82f09901d0122141be3dc250f3c8087659/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c#L111
I think I get it now & have a path forward. THANK YOU @tulip sleet ♥
@tulip sleet If I understand the git history correctly I think you may have originally added the bootloaders.json file for circuitpython.org. I'm curious if you have any insight about whether it would be harmful to remove the trailing commas from that file in order to bring it in line with the JSON spec. A user has submitted a PR here with that change: https://github.com/adafruit/circuitpython-org/pull/763 I can test it out and leave a review, but wanted to see if there is any reason off the top of your head that it would be undesirable to make that change.
that is fine, I didn't realize when I wrote the file that it was not to spec
(I am sorry to hear that the JSON spec does not allow trailing commas.)
yeah turns out it's old and clunky 🤷
agreed 🥲
json follows the "be loose in what you generate, but strict in what you accept" philosophy
ok I removed "disable=undefined-variable" from adafruit_tlc59711, but I have unrelated :
adafruit_tlc59711.py:337:17: E1101: Module 'struct' has no 'unpack_from' member (no-member)
adafruit_tlc59711.py:346:8: E1101: Module 'struct' has no 'pack_into' member (no-member)
adafruit_tlc59711.py:635:15: E1101: Module 'struct' has no 'unpack_from' member (no-member)
adafruit_tlc59711.py:868:12: E1101: Module 'struct' has no 'pack_into' member (no-member)
how do you deal with that ?
maybe pylint is set up to use a very old python version
it is using pylama, which we don't use
anymore
I can't remember that we ever did in general
I'd rip all that out and make the setup.py and .github stuff consistent with a modern library
it's possible that the person who worked on the longstanding PR may have used it and not removed it from the PR. This library is the one that had the PR open for a very long time.
ah that's over my head
may be easiest to run cookiecutter to generate a new repo and then copy setup.py and pre-commit / pylint configs from it into this repo.
I can give it a try a bit later if you are stuck.
Also if you want to PR the change to add self. to fix the undefined-variables by itself I can review that and we can get it merged in order to get the version on PyPi working. Then we can get the infrastructure stuff in a follow up.
or the constants could be moved out of the class. The advantage of that is that the _constants with const() will then be substituted at compile time and not take up room in the dictionary
that was the whole reason to use const(). It's not really useful inside the class
Ah, that is good to know.
I was wondering about that, const() doesn't work on class properties then
actually, I'm not sure it has to be at the global level. The MPy documentation is not that clear
checking on it
easy enough to try
I have to be afk for dad taxi duty, back later 🙂
by the way, the original code:
adafruit_tlc59711.py:292:33: E0602: Undefined variable '_CHIP_BUFFER_BYTE_COUNT' (undefined-variable)
adafruit_tlc59711.py:335:36: E0602: Undefined variable '_CHIP_BUFFER_BYTE_COUNT' (undefined-variable)
adafruit_tlc59711.py:362:28: E0602: Undefined variable '_BC_CHIP_BUFFER_BIT_OFFSET' (undefined-variable)
adafruit_tlc59711.py:368:28: E0602: Undefined variable '_BC_CHIP_BUFFER_BIT_OFFSET' (undefined-variable)
adafruit_tlc59711.py:374:28: E0602: Undefined variable '_BC_CHIP_BUFFER_BIT_OFFSET' (undefined-variable)
adafruit_tlc59711.py:399:28: E0602: Undefined variable '_FC_CHIP_BUFFER_BIT_OFFSET' (undefined-variable)
adafruit_tlc59711.py:405:28: E0602: Undefined variable '_FC_CHIP_BUFFER_BIT_OFFSET' (undefined-variable)
adafruit_tlc59711.py:411:28: E0602: Undefined variable '_FC_CHIP_BUFFER_BIT_OFFSET' (undefined-variable)
adafruit_tlc59711.py:417:28: E0602: Undefined variable '_FC_CHIP_BUFFER_BIT_OFFSET' (undefined-variable)
adafruit_tlc59711.py:423:28: E0602: Undefined variable '_FC_CHIP_BUFFER_BIT_OFFSET' (undefined-variable)
adafruit_tlc59711.py:443:28: E0602: Undefined variable '_WC_CHIP_BUFFER_BIT_OFFSET' (undefined-variable)
adafruit_tlc59711.py:450:28: E0602: Undefined variable '_CHIP_BUFFER_BYTE_COUNT' (undefined-variable)
adafruit_tlc59711.py:450:55: E0602: Undefined variable '_BUFFER_BYTES_PER_COLOR' (undefined-variable)
adafruit_tlc59711.py:453:28: E0602: Undefined variable '_BUFFER_BYTES_PER_COLOR' (undefined-variable)
adafruit_tlc59711.py:454:28: E0602: Undefined variable '_CHIP_BUFFER_HEADER_BYTE_COUNT' (undefined-variable)
Eeek. The pylint disable was hiding a bunch of them.
It's weird to me that the class worked on microcontrollers. I did some of the testing for that PR and I am pretty certain that it worked on the microcontrollers I tested on.
I don't know, class properties do require self
testing with mpy-cross on a 5-lines class, global const takes 30 bytes less than global no const, class properties have 2 bytes of difference
CircuitPython version
Adafruit CircuitPython 6.3.0 on 2021-06-01; Adafruit Feather RP2040 with rp2040
Code/REPL
"""minimal working example of bug"""
import json
x = 5e6 # 5e5 works
old_d = {"number":x}
print("old_d", old_d)
jstring = json.dumps(old_d)
print("json string: ", jstring)
new_d = json.loads(jstring)
print("new_d", new_d)
Behavior
code.py output:
old_d {'number': 5e+06}
json string: {"number": 5e+06}
Traceba...
so I was somehow running pylint 2.6, but now that I updated to latest it didn't solve the struct issue but I get 20 "consider-using-f-string" 🤦
Oooooh, that one is going to be rough for me. I still auto-pilot to .format() instead of f-strings.
I disabled it 😛
ok, so pre-commit uses pylint 2.7.1 which solves my f-strings issue, but still complains about struct, except not when running the CI on my fork, so... I think I'll PR that for a start.
If possible, please test with the latest 7.0.0 release candidate.
If possible, please test again with the latest version, 7.0.0-rc.3 or newer. It appears it was fixed somewhere along the line.
Adafruit CircuitPython 7.0.0-rc.3-dirty on 2021-09-16; Adafruit Macropad RP2040 with rp2040
>>> import json
>>> json.loads('{"number": 5e+06}')
{'number': 5e+06}
@tulip sleet I finally tracked down the problem with #5355 to hosed windows usb drivers. Still mysterious why it only happens when code is run from code.py and not manually, but its definitely an issue on my machine.
Thanks, that's really strange. What version of Windows are you running?
So these are non-Adafruit drivers?? You don't need any drivers for CPy.
I think it was only autoinstalled drivers. Never did anything manually
Do you happen to have a Cura driver?
Which drivers did you fix or remove? What was the fix?
Not fixed, but its something specific on my machine.
I suspect its something to do with the ST drivers that I needed for stlink
Why do you think it's drivers?
Same machine fine on linux and also on my windows 10 notebook. And I have had issues with usb on this box before
This one has had several different winusb versions installed at various times in order to get stlink working.
It may be utility programs like a backup program or a disk utility of some kind. It could be some kind of timing-related issue. We have seen various problems with that kind of thing. But if you figure it out let us know. Also if you have ever installed some HID drivers for unusual devices that might be an issue. Still, it's quite oddd.
Well, this machine is due for a bigger SSD anyhow, might do a fresh OS install.
@slender iron I made draft release notes for 7.0.0 final, for release soon. This is a re-tagging of 7.0.0-rc.3. The GitHub release page would not let me specify the 7.0.0-rc.3 commit as the commit for this release (it only lets you do "recent commits"), so I created a 7.0.x branch, which it will let me tag as 7.0.0.
... Hmm actually I could have tagged it from the command line or from the web interface: https://github.community/t/create-releases-for-old-commits/872. Oh well. But it's not bad to have a branch.
Hi, we created the board definition files for the upcoming Melopero Shake RP2040 development board.
Looks good to me.
I tested the changes locally and verified a handful full of devices still show proper bootloader information on their downloads page.
Thanks for this cleanup and the additions @durapensa
So I can successfully deep sleep a samd from within circuitpython but only with the RTC in MODE1 and using PER (counter period). When trying to use MODE0 with CMP (compare) the interrupt never seems to fire? Not really sure atm
@tulip sleet Lucian refers to a sleep(PM_SLEEPCFG_SLEEPMODE_BACKUP_Val); function within his roughed-in atmel-samd/common-hal/alarm/__init__.c. Do you know what sleep function he's thinking of? I can't find it anywhere, so I'm doing all the register twiddling manually.
I think it may have been a convenience routine he never wrote or something like that, or basically pseudocode.
bummer. thank you 🙂
Looks good to me.
I tested the changes locally and verified a handful full of devices still show proper bootloader information on their downloads page.
Thanks for this cleanup and the additions @durapensa
Thank you
I pushed another commit which cleaned up the bootloader doc a bit. There was some redundant text and I also normalized the formatting.
Closes #5362
Tested on PyPortal with the following code:
import board
import displayio
import array
import ulab
display = board.DISPLAY
width = display.width
height = display.height
scale = max(width, height)
g = displayio.Group(scale=scale)
bitmap = displayio.Bitmap(10, 10, 1)
palette = displayio.Palette(1)
palette[0] = 0xFF7F00
tilegrid = displayio.TileGrid(bitmap, pixel_shader=palette)
g.append(tilegrid)
display.show(g)
bufsize = 2 * (width if display.ro...
@slender iron so basically I am ready to make the 7.0.0 final release We talked about possibly doing it today (Sunday) or tonight, but I could also do it Monday.
@tulip sleet thanks for getting is setup! I'm fine with today or tomorrow. I won't be around to support it until tomorrow
@lime trellis I know the samd51 has 8k backup ram that should be usable for sleep memory
yeah i'll look into that once I have it working properly
@analog bridge @atomic summit igrr told me that they are close to branching 4.4 and that master shouldn't change much before then. I'd prefer to work directly towards that but not merge it into our main until 4.4 is branched upstream.
Thanks - I will do it later tonight, or first thing tomorrow, so there's not a big window of reduced support.
sounds good! it'll be nice to have it stable
no worries... I have got a PR out updating idf to stable 4.3.1. Work on S3 can continue with idf master separately.
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
ninja: Entering directory `build-microdev_micro_c3/esp-idf'
[1/1] Performing build step for 'bootloader'
ninja: no work to do.
QSTR updated
esptool.py v3.1-dev
Merged 1 ELF section
1476864 bytes used, 620288 bytes free in flash firmware space out of 2097152 bytes (2048.0kB).
0 bytes used, 8192 bytes free in 'RTC Fast Memory' out of 8192 bytes (8.0kB).
16 bytes used, 8176 bytes free in 'RTC Slow Memory' out of 8192 bytes (8.0kB).
0 bytes used, 32768 bytes free in 'Internal SRAM 0' out of 32768 bytes (32.0kB).
0 bytes used, 294912 bytes free in 'Internal SRAM 1' out of 294912 bytes (288.0kB).
Also, I finally got CircuiPython
building for esp32c3 🚀
time to test if it actually boots or not 🤞
Going to ask @tylerdcooper for this one.
Example:

These changes look good to me. I tested the latest commits successfully running locally..
I think we should leave the commas for a future PR, I'll reach out to the person that added this file initially and see if they have any insight into why it is that way or if there is any reason not to remove them so that it conforms to the JSON spec.
CircuitPython version
Adafruit CircuitPython 7.0.0-rc.2 on 2021-09-15; FeatherS2 with ESP32S2
Adafruit CircuitPython 7.0.0-rc.2 on 2021-09-15; Adafruit MagTag with ESP32S2
Adafruit CircuitPython 7.0.0-rc.2 on 2021-09-15; LILYGO TTGO T8 ESP32-S2 w/Display with ESP32S2
Code/REPL
No minimum reproducible example at this time.
Behavior
This is more of a placeholder issue since it's not reproducible on demand.
These are intermittent hardfaults tha...
Merged @dhalbert's commits, local testing is okay.
Probably the guide by @makermelissa at https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website should be updated to reflect adding an entry with board_id & family to bootloaders.json (and optionally a value for bootloader_id if the board can be flashed/reflashed with a UF2 bootloader living in an adafruit repo).
I think it's worth discussing some design goals here. Monitor will potentially be subjected to a firehose of wifi frames, even with filtering by channel, type (mgmt, data, etc), subtype (Beacon, Probe Request), etc. Limitations of RAM and processor speed will both probably come into play.
Espressif's esp-idf example allows saving to SD or I think somehow viewing over JTAG, but I think this may not be a common use case for CircuitPython users, who may want to see what's happening now an...
please update the VID/PID to one that you have permission to use
https://github.com/raspberrypi/usb-pid
socket – TCP, UDP and RAW socket support
Warning
This module is disabled in 6.x and will removed in 7.x. Please use networking libraries instead. (Native networking will provide a socket compatible class.)
where is the new socket compatible class located?
I think I am supposed to just use "import socketpool"
OK finally got around to working on this.
I've made progress and can put a SAMD into deep sleep from circuitpython. However, I'm stuck getting fake deep sleep playing nice.
Since https://github.com/adafruit/circuitpython/pull/5048 is closed, I've attached the relevant files so others can potentially help from here: common-hal.zip
- cloning https://github.com/adafruit/circuitpython/pull/5048's commit and re...
@daring surge yes, #help-with-circuitpython is the best place for questions of usage. For Airlift (ESP32 as wifi co-processor), use the adafruit_esp32spi library. For ESP32-S2 boards, use the built-in modules: socketpool, wifi, ssl, and ipaddress. Some examples here: https://github.com/anecdata/Socket
@crimson ferry Thank you! your examples are excellent
\o/
Automated website update for release 7.0.0 by Blinka.
on its way 🙂
Congratulations!!!
6.3.0 was released June 1, 2021; 6.0.0 was released Nov 16, 2020.
Super excited for 7 🙂
It's the first prime-numbered release of CircuitPython since 5!
1 is not a prime number
https://en.wikipedia.org/wiki/Prime_number#Primality_of_one it's ... complicated, historically? but usually excluded (neither prime nor composite) in current systems.
if 1 was prime, factorizations wouldn't be unique
of course you can always come up with a system that is different, it's math, after all, nothing is set in stone
yay, downloading!
@idle owl when you have a moment sometime check out this issue: https://github.com/FoamyGuy/missing_type_issue_maker/issues/2 and let me know if there are any changes that would be good to make before running a script to make similar ones on all libraries that contain function definitions with missing type information. It was created from a template so I can make any necessary modifications to the template before any "real" ones get created.
Do new board require adding entries to bootloaders.json? If that's the case, I'd rather have the data in the board file to make adding new boards as easy as possible. I thought the bootloaders.json was something automatically handled by scripts in circuitpython.
@lone axle It's worth noting that type annotations are not quite zero cost. They enlarge mpy files, because the bytecode for try/import/except is included, and because the strings typing, List, etc., are included.
Using the style try: import typing except: pass and then writing out the type annotation as typing.List[int] reduces the overhead, because then the string List is not included in the mpy-compiled file.
The difference is 50 bytes [no annotation, no import typing], 86 bytes [import typing], 108 bytes [from typing import List, Tuple].
To my surprise, attempting to measure extra RAM usage at runtime didn't show any. All variants (including the one with no typing) increased RAM usage after a gc.collect() by 224 bytes.
If a built in typing module were available [with no content], the un-guarded import typing variant is 63 bytes. but we can't provide a typing module in 7.0.0 anymore so that would have to wait to be viable.
None of that is to say NOT to do this, but maybe concentrate on modules that people are probably not using on non-express boards where they don't have much storage space available
Interesting! thanks for the heads up, I had not considered any of that. I can amend the example code in the issue to use the import typing variant to reduce it as much as we can.
I wonder if it would be worthwhile in the long run to move to having .pyi files that are for documentation only distributed along side the library code instead of intermixed within it. If I understand correctly that could result in the same benefits from IDEs without adding any overhead to the libraries themselves.
I don't know which is the right trade-off, but after I checked into what the costs were I wanted to share that info.
having to say typing.List everywhere feels like a drag
I could also incorporate some sort of "exclude list" logic to the scripts to be able to skip libraries that we think the benefit of typing does not outweigh the cost of the extra size.
having to maintain a parallel .pyi file feels like a drag
Do you know if doc string comments in library code add any overhead? perhaps there would be a way to derive the .pyi files from docstrings similarly to how the core works if I understand that mechanism correctly.
from typing import * ?
from typing import * with exception guard is 89 bytes and eliminates the need to say typing.List but probably gets you a pylint diagnostic
having to put extra infrastructure in place before we invite people to contribute type stubs seems like a drag
true and probably not possible to pull off before hacktoberfest which was my original inspiration for trying to get these created as "good first issues"
Make sure not to do the circuitplayground lib and call it good?
I'll add a topic for in the weeds as well and we can see if anyone else has concerns for any other libraries. It will take me another few days to finish up the scripts that I intend to use to create them anyhow so we do still have a bit of time to get input from folks.
Once typing is "in", can we add code to the repos to check it like we check pylint, to make sure it stays complete?
Yeah I think we could. I'm using a tool called mypy to find instances that are missing it. I haven't tried it but I suspect it could be used from an actions task.
@mental nexus hey long shot question -- when you implemented parallelbus for esp32s2, did you investigate using the i2s peripheral for lcd interfacing? I have been trying to do that, but it's not working for me...
@lone axle I think that's what we do in the core
I feel like I haven't heard from kmatch in awhile, hope it's OK to ping
iirc kmatch mentioned getting into a new job and having a bit less free time to devote toward circuitpython. Still around to some extent though, they helped me out with some documentation for something a few weeks back.
ah, i hope the new job is good for them!
?serverinfo
I re-tested locally with the latest commits and everything looks and functions good to me.
@makermelissa adding info to bootloaders.json is a "soft requirement" perhaps. If it's omitted I believe it doesn't cause any serious errors that prevent the device page from working correctly. But it would cause the device not to show up under the appropriate MCU family filter / search that this PR adds and it would cause the bootloader section of the downloads page not to get included so it may b...
I didn’t look at i2s or direct LCD interfaces. I just did the 8080 ParallelBus to match what was already there for the other M4 chipset. Got some other work so I’m not active doing any CircuitPython development right now, but feel free to ping me anytime. Sorry I’m not any help on this one.
bootloaders.json is a manually edited file, so far as I know; the only way to match up CircuitPython build board_id with the UF2 build board identifier is manually, that is, with build directories found in /adafruit/uf2-samdx1, /adafruit/Adafruit_nRF52_Bootloader, and /adafruit/tinyuf2 (stm, esp32s2, etc.).
Many boards that have UF2 bootloaders built for them however do not have bootloader_id entries ...
I’m working helping someone grow their vintage audio repair business so I’m heading up the learning curve as an audio repair tech. Luckily have a good mentor to nudge me up the learning hills and over the bumps!
Hi, the allocation PID: 0x1005, VID: 0x2E8A is reserved for us, the reason why the Melopero Shake RP2040 is not yet on the list is because we are waiting for the launch (which is imminent).
We just asked the Raspberry Pi to activate the PID with our product's name on the list.
In the meantime, we may provide you with an official PID assignment document if needed.
Thank you.
@mental nexus I either missed that news or forgot it when it was fresh, that sounds like a really interesting line of work!
Thanks, doing software development has been fun but I had missed some of the hardware aspects. This audio business is a lot of variety, with a lot of hands on electronics and some mechanical work. But I’m always keeping my eyes on the widget work for CP.
@makermelissa adding info to
bootloaders.jsonis a "soft requirement" perhaps. If it's omitted I believe it doesn't cause any serious errors that prevent the device page from working correctly. But it would cause the device not to show up under the appropriate MCU family filter / search that this PR adds and it would cause the bootloader section of the downloads page not to get included so it may be a bit tougher for folks to find information about updating the bootloader.I'm not ...
I did the bootloader PR in #446. I made it a separate file because it was not easy to generate the bootloader info automatically from the various bootloader repos, which don't have board names consistent with the CircuitPython names. Moving to some per-board data files would make sense, but it was more work at the time than a single file.
Also at the time there was also some urgency to provide a spot to download bootloaders because of some significant bootloader bugs.
I'll take a look at this today or tomorrow. I may be out part of today. I've added it to my list.
Happily lurking today, enjoy 🙂
Is there a list of supported baudrates for busio.I2C in v7.0.0? Having trouble finding one that works with the SC-30 sensor that needs 50kHz or lower (25kHz on the CLUE board).
@errant grail we discovered that basically the samd hardware didn't ACTUALLY furnish those low baudrates, and turned it into an error instead of giving a random, much higher baudrate
(without changing more about how the serial peripherals are clocked)
oh, that's nrf52840 so those rates may work there
Thanks @onyx hinge !
if (frequency >= 1000000) {
config.frequency = NRF_TWIM_FREQ_1000K;
} else
#endif
if (frequency >= 400000) {
config.frequency = NRF_TWIM_FREQ_400K;
} else if (frequency >= 250000) {
config.frequency = NRF_TWIM_FREQ_250K;
} else {
config.frequency = NRF_TWIM_FREQ_100K;
}
``` clue supports just these ~~4~~ 3 baud rates
... back to the drawing board
lurking
>>> import 😼
hello 😼😼😼😼😼
``` wow really?
The European Astro Pi Challenge is an ESA Education project run in collaboration with the Raspberry Pi Foundation. It offers young people the amazing opportunity to conduct scientific investigations in space, by writing computer programs that run on Raspberry Pi computers on board the International Space Station!
brings new meaning to descriptively named variables
my dog is barking at the truck!
@idle wharf you can see both sides, you just need to buy a 2nd macro pad:)
(Kattni is under the weather and eventually took our advice to take a nap)
Self care for the win!
🐴
@onyx hinge In my experience, when it works in debug, but not normal optimization, it is due to an uninitialized variable -- your mileage nay vary 😉
I'm not sure if I understand all the way, but I wonder if it would be possible to pass that information from one step to another by writing it into a file in one and reading it in another?
when running on a fork, can we make it compare the branch with adafruit/circuitpython main ?
Have to run -- have a good week, 👋
I need to get going 👋
Thanks everyone 🙂
Thanks Scott!
Thanks all!
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/1rS5p7xF_UUpumitnW2mV-B3IL7vB6e7V2HIAkk7Zo9E/edit?usp=sharing
CircuitPython Weekly for September 27th, 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 attendin...
Hey @tulip sleet that bit you added, was that a new addition with 7?
yes, very recent, maybe between the time you copied the files and submitted the PR
Alll boards now have that
This implements #5105 but I am not sure of how much space it takes (for small boards), am I doing strings right ?
Additional line in boot_out.txt (there happens to be a boot.py)
Adafruit CircuitPyt...
Oh cool, I’ll note that on my next PR. I’m open sourcing some RP2040 boards I won’t get to manufacture with my company but I still want the availability of circuitpython 🙂
Looks good, and looks simpler than what we thought initially. Just one doc q or change.
//| def __init__(self, key_number: int=0, pressed: bool=True, timestamp: Optional[int]=None) -> None:
The code and the documentation suggest the default is None, not -1. Did you mean for -1 to be used sometimes?
Please provide a comparison link to the changes (your branch vs main) rather than requiring local modifications.
Please provide a comparison link to the changes (your branch vs main) rather than requiring local modifications.
I'd suggest modeling the API after the BLE scanning API. It has similar issues of getting a lot of inputs and needing to filter early.
Looks good to me! Thank you!
@tulip sleet looks like readthedocs should probably have something done for version 7
so that 7.0.x is a version that can be chosen, and maybe the default
Thank you @microDev1 and @unexpectedmaker!
Looks good. Thanks for sticking with it!
nice, thank you !
oh yes, I forgot to do that. I should add a "Stable" release checklist to the internal build page
Congrats on the CP7 release everyone!
Please provide a comparison link to the changes (your branch vs main) rather than requiring local modifications.
Updated the comment to reference a proper commit change log. Thanks for the reminder.
A cleaned-up version of #756 (supersedes that PR), including discussed migration of family & bootloader_id to board.md files per @makermelissa's suggestion.
bootloaders.json now contains only bootloader port (family) & version information, and no longer contains board information.
Tested locally such that _includes/download/board.html points to the correct downloads for CircuitPython & UF2 bootloader, and search/filter works as in #756.
I'm a little confused why the "split MCU stuff" based on IDF_TARGET was done differently to how I laid it out... Seems like a wasted opportunity to not have the framework in there now for S2/S3 if the change was being made and merged anyway. It woulds have made moving to S3 much easier.
I was referred here from help-with-circuitpython. I’d like to add the keypad module to a feather M0 express. I am in the process of building CP following Dan’s guide. I’m building on a Mac. I downloaded and installed the ARM tool chain. I made a disk image. I changed the .mk file to include the keypad module. I ran the make command and I’m getting the error: no such file or directory: ‘arm-none-eabi-gcc’ Empty preprocessor output. What did I miss?
How did you install the arm tool chain?
Did you use this? https://formulae.brew.sh/cask/gcc-arm-embedded
Did you install directly from ARM or through homebrew?
you are likely missing "/path/to/gcc-arm-none-eabi-10/bin/" in your $PATH
I found when installing through downloading from ARM didn’t yield the same result as using brew
Directly from ARM following the link from the guide. I installed the version that was in the guide
Try using the brew install. usually it sets up your paths that way
Not always but I’ve had better luck installing through brew
In the back of my mind I knew it had to do with PATH
yeah just add wherever you unzipped the bin to your PATH
oh well if you used the installer, find where it put it I guess
sudo ln -sl <download for> <path_dir>
I just prefer to know where the files are, inside my "build-circuitpython" directory, and add the path
Apple developer docs recommend using brew last I looked but either way works fine. I think brew adds it to your paths by default
I’ll try the brew way because I still get the error when I tried the other way
I’m not 100% sure, it was almost a month ago the last time I installed a tool chain on Mac
But last time I installed arm tool chain was brew
I probably should update my arm tool chain at some point
Got it to build. Thanks for help. @ornate breach @jaunty juniper
Providing a means to generate a simple list of "device X was present for Y seconds" is probably enough to get started. By passing in filters of channel, mgmt packet type and optionally (?) a minimum signal strength or minimum packet count found before storing is enough. This would further minimize the amount of data passed back to the CircuitPython level can be minimized.
Example : [A:72,B:12,C:99,D:2 ... ]
What do you think?
Makes sense to me. I'm still trying to get my arms around the idf example, and how to translate that to common-hal. Seems to me that:
- sniffer start sets up a work queue, creates the sniffer task, sets up the sniffer callback for incoming frames, sets up the filters (frame type and channel in this case), and enables monitor mode
- the sniffer callback receives one frame at a time and adds it to the work queue, if enough memory is available (I don't know what happens if the callback can't...
I forgot to move the stubs upload action with the recent docs split, this fixes it.
@tulip sleet "report_ids (int) – Sequence of report ids used by the descriptor. If the report_descriptor does not have a report ID, use 0." -- if there is no report id, do I use the tuple containing just zero, (0,) or do I use the empty tuple? https://circuitpython.readthedocs.io/en/7.0.x/shared-bindings/usb_hid/index.html#usb_hid.Device
Thanks! an earlier version was going to use MP_ARG_INT in which case None can't be passed so you need a sentinel value. However, it worked out better code wise to deal in objects instead, so None could be used.
Use a (0,) tuple. The report-length tuples will both be of length 1 as well. The lengths all have to be the same.
There are several errors in the doc there. I forgot to change the :param int ... to a Sequence. I should PR some doc fixes
thanks for noticing it's unclear
This is great! Tested on a MacroPad.
We'll need to update the Learn Guide sooner or later to describe this and say when it started showing up.
@onyx hinge there seems to be something wrong with the stubs build on the merge: https://github.com/adafruit/circuitpython/runs/3664325768?check_suite_focus=true
ah never mind https://github.com/adafruit/circuitpython/pull/5376
@tulip sleet oh yeah, thanks for merging that
that merge should get the timestamps in
yay! I'm looking forward to using it as a way to timestamp the WWVB (time broadcast) signal in my clock. with it maybe I can use just one microcontroller instead of two.
Can anyone tell me what reason there would be to use supervisor.ticks_ms() over time.monotonic_ns() ?
Does time.monotonic_ns() decrease in accuracy over time like time.monotonic() does?
mostly because long ints are required for it, and they are not available on all ports
and since there is no C-python API for a ms int counter that wraps, that's how we deal with that
Ok, so on platforms where the time.monotonic_ns() command is available, it works just as well as supervisor.ticks_ms() ?
supervisor.ticks_ms() is available on all boards, and creates no run-time allocations. however, because it wraps around you have to use wrap-aware routines to add or subtract with ticks. (this is in the library adafruit_ticks) If monotonic_ns works for you, no need to change. but if you were on a board without monotonic_ns, you should now have ticks_ms.
(and if you need to work with circuitpython 6.3, adafruit_ticks provides a compatible version of ticks_ms)
(but with precision limitations on boards that didn't have monotonic_ns)
@iron bloom I have been doing something similar for the Xiao. You can use the example here: https://github.com/jpconstantineau/circuitpython/blob/board-xiao-kb/ports/atmel-samd/boards/seeeduino_xiao_kb/mpconfigboard.mk
Hos something changed in audiocore? I am trying to play a .wav file and I get this error ```>>> f = open("/sounds/water-high.wav","rb")
audiocore.WaveFile(f)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Data chunk must follow fmt chunk
I did not have a problem with my .wav files. Try another .wav file.
Here's one^
Thanks -- that works -- must be a bad file...
How to obtain CIRCUITPY_CREATOR_ID & CIRCUITPY_CREATION_ID for a BLE-only board?
We have just been using the USB VID/PIDs so far, so you could assign one that will never see USB. @slender iron may want to comment on his thoughts on this.
C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
new lint gripe
i'm gonna shush it unless it actually needs attention?
it's a PR to a repo that hasn't been touched in a while. but the .pylintrc looks inline with others.
we should probably turn that off in general, since f-strings are not turned on for the smallest boards, due to space (they are enabled by MICROPY_CPYTHON_COMPAT right now)
seems like a good idea
maybe it's just the repo?
pre-commit is failing on existing examples that aren't part of the PR
@jaunty juniper and @onyx hinge Thanks for clarifying!
that warning was added between 2.7.2 and 2.11.1 of pylint
in 2.11.0 even
the warning equates to a fail though, for the ci
pylint (examples code)...................................................Failed
oh yeah the version is not pinned in the examples
are we missing some flag-setting file? I thought we had a way to customize some of this
You can edit .pre-commit-config.yaml
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']
@tulip sleet edit to add new disable?
yes, though, I don't know whether we want to do a sweep for all of these at some point.
that file is from cookie-cutter, I assume
wasn't that there something about the version in the CI that is not pinned ?
i think pre-commit doesn't allow us to pin the version??
there is something pre-commit won't do...
am i just the lucky first person to run into this?
the precommit yaml is inline with other repos
@analog bridge https://github.com/creationid/creators
then creation id is up to you
i just added the ignore so i can move on:
https://github.com/adafruit/Adafruit_CircuitPython_DS18X20/pull/23/files#diff-63a9c44a44acf85fea213a857769990937107cf072831e1a26808cfde9d096b9R33
it passes now
@onyx hinge I thought had a PR you closed that was experimenting with more argument types (UINT, etc.), but I cannot find it. I was interested in possibly reviving part of it. Do you have a pointer? Tnx.
@tulip sleet let me look ..
The first time I added a bunch of stuff to mp_arg_parse_all, all untested. that's this branch
and never got around to using it
the next time I made a stab at guessing which would lead to the most savings (and was greppable!) and added just those .. but came out without savings. that branch is https://github.com/jepler/circuitpython/tree/arg-parse-2 and didn't have the uint stuff
the intention was that something like MP_ARG_UINT, {.u_ulo=0, .u_uhi=65535} would set the inclusive range of the value. what to do about optional values was unclear.
@onyx hinge Even if there are no savings, I think it saves writing boilerplate. it could be simplified to not have low/high, etc. Thanks, I will look at these in more detail.
Thanks! I feel like there must be savings to be had ... but I wasn't finding it, so I went on to other things.
To some degree it should loop through pretending to deep sleep because main will loop until an alarm was actually detected. It'll only sleep between interrupts: https://github.com/adafruit/circuitpython/blob/main/main.c#L533
At a glance this looks good, but I want to test this locally before approving.
okay.... so, the format is 0xCREATOR-ID_CREATION-ID or is it the other way around?
239a is Adafruit's VID, so it looks CREATOR comes second
I see PR#3 requesting creator id and there scott suggests to use the first part for creator id
😕 I cannot explain the inconsistency, so we'll leave it to @slender iron 🙂
Please don't change the image file names of the existing board. That way they should all match board ID. It's ok to change title and name.
creation ids and creator ids are 32 bits
- each
the top two bytes set to zero is reserved for usb vids
The MCU family is showing undefined. I think the fix may be to add an if statement to the code logic, but I'm not entirely sure.

hmm... so something like 0x6d44_0000 is a creation id
it could be either part
a full one would be 0x0000239a:0x00008021 is for metro m4
because creation ids are a superset of usb ids
okay now I get it
I named it confusingly because I use "creation"
for the overall and for the "creator" administered piece
so all 0x0000xxxx are reserved for usb vids
and 0x00xxxxxx is for any other ids we may subset
(ble has assigned numbers for example)
👍
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Saola 1 w/Wrover with ESP32S2
Board ID:espressif_saola_1_wrover
Code/REPL
import wifi
Behavior
If the code.py tries to import the wifi module, the device will go to safe mode
Auto-reload is off.
Running in safe mode! Not running saved code.
You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file an is...
Are you using the .uf2 or the .bin version of CircuitPython?
I started with the .uf2 of 7.0.0 and then the .bin of 7.0.0, same issue. Further testing has been done with the .bin versions from https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/espressif_saola_1_wrover/en_US/ using the https://adafruit.github.io/Adafruit_WebSerial_ESPTool/ site to write the firmware bins.
I did a clean install of 7.0.0 on the MagTag and the FeatherS2 yesterday. Install sequence: command line erase_flash, command line install TinyUF2, install (drag) CircuitPython UF2, install libraries and .py files, ctrl-C & return in console to enter REPL, EJECT Volume, hard reset, then let it run.
Saw 1st hardfault on one of these devices this morning.
I did a clean install of 7.0.0 on the MagTag and the FeatherS2 yesterday. Install sequence: command line erase_flash, command line install TinyUF2, install (drag) CircuitPython UF2, install libraries and .py files, ctrl-C & return in console to enter REPL, EJECT Volume, hard reset, then let it run.
Saw 1st hardfault on one of these devices (the FeatherS2) this morning.
Do you have a USB breakout connected to D19 and D20? Could you try erasing the flash and then loading the .bin, or did you try that already? If you switch between the .uf2 and .bin, you need to erase the flash in between.
Yes, I have a USB breakout connected to D19, D20, 5V and GND. The initial update to 7.0.0 was done by using the process described in https://circuitpython.org/board/espressif_saola_1_wrover/ to Install/Update the UF2 bootloader with the Adafruit WebSerial ESPTool. First the Erase, then writing the combined.bin and once the USB drive SAOLA1BOOT shows up, copied the adafruit-circuitpython-espressif_saola_1_wrover-en_US-7.0.0.uf2 on it and once it's back up the "Hello World" prints normally, but...
Please don't change the image file names of the existing board. That way they should all match board ID. It's ok to change title and name.
Fixed 😄
A user thought that an unstable release was not available for their board because the download buttons were gray. They thought they were grayed-out and did not even try to click on them. I wonder if we should pick a somewhat different color. The current color is #999999.
@jwcooper You may have a UX comment.
+1 we've encountered this with students as well!
This is working for me, not using the WebSerial tool. (I am not having a lot of luck with the WebSerial tool for some reason.)
$ esptool.py --chip esp32s2 -p /dev/ttyACM0 -b 460800 erase_flash
esptool.py v3.1
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-S2
Features: WiFi, ADC and temperature sensor calibration in BLK2 of efuse
Crystal is 40MHz
MAC: 7c:df:a1:00:7d:cc
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Erasing f...
BTW, I am testing with an ESP32-S2-Saoloa-1_V1.2, as labelled on the bottom of the board. Is your board version different?
I've been trying to track that down, and it should be resolved now (fix in next push).
This enables non-consecutive pins and higher effective clock rates. It successfully drives the 2.8" TFT LCD in parallel mode (but so did the previous code).
My testing board is an Espressif Kaluga and the code is
import board
import displayio
import paralleldisplay
_DISPLAY_D0 = board.IO8
_DISPLAY_CS = board.IO2
_DISPLAY_CD = board.IO3
_DISPLAY_WR = board.IO4
_DISPLAY_RD = board.IO5
_DISPLAY_RESET = board.IO6
_DISP...
@lone axle Oh! I only just now figured out that what you sent me is an example issue that would be filed on a repo. I thought I was going to be going through your script. 😄
So, I don't understand the typing thing, if I'm being honest. So I'm not sure whether anything needs to be added to it or not from a technical standpoint. I think it's worth including in the section about reading out to us via Discord, that folks can also comment on the issue, but we would have to put in a more concerted effort to keep track of issue comments if we suggest that.
I wonder whether newbies can tag circuitpythonlibrarians or not?
Need me to try and find out?
@ember iris Yeah, please do. Find any open issue on a library, and try to tag CircuitPythonLibrarians in a reply (you don't need to send the reply).
Needs to be a reply to an existing issue for proof of concept, though I assume being able to there means it would work in a new issue as well.
Using: https://github.com/adafruit/Adafruit_CircuitPython_SCD4X
Presuming all I should need is, @CircuitPythonLibrarians , the preview tab does not auto link to librarians, and typing it in doesn't autofill either
Ok, yeah, that's what I figured.
Thank you.
No problem, it seemed like something nice and quick to check. Glad I could help!
I know even when it doesn't autocomplete individuals, it tags them when sending. But I'm unsure of how it works with groups.
Please tag the group, as you typed it out above, in a reply to this issue, and send the reply: https://github.com/adafruit/Adafruit_CircuitPython_TestRepo/issues/37
I always forget about the TestRepo I made until I need it. Such a good move on my part.
Huzzah!
My inbox has been flagged.
Now has it been flagged because you opened the issue and the text was present, or was it flagged because of the tag?
Hmm.
You make a good point.
I need another person to tell me if it showed up to them.
@onyx hinge Are you around to check something?
Kind of late for jepler to be around. Should have tagged someone else. Apologies.
@idle owl hi!
I was just wrapping up but I can give you some time
Please check your email to see if you got tagged on the TestRepo issue.
That Keith just replied to
I need to make sure that someone outside the org tagging CircuitPythonLibrarians works.
I don't see anything that says TestRepo in my recent email
I'm in CircuitPythonLibrarians yes
Do you have it setup to email you when that group gets tagged?
not sure. I do see review requests.
Because Keith is right, it emailed me because I generated the thread.
Ok, then I think the tagging of the group doesn't work.
Maybe it's a setting. Looking.
A visible team can be seen and @mentioned by every member of this organization. So, it's built into it to not be taggable from outside the org. Ok.
I still have the same crash when writing with esptool.py
# hold BOOT, click RST, release BOOT
PS C:\circuitpython7\firmware> esptool.py --chip esp32s2 --port COM12 -b 460800 erase_flash
esptool.py v3.0
Serial port COM12
Connecting...
Chip is ESP32-S2
Features: WiFi, ADC and temperature sensor calibration in BLK2 of efuse
Crystal is 40MHz
MAC: 7c:df:a1:0e:e1:3c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Erasing flash (this may ta...
@idle owl I was just looking for the current details about that .. I found a lot of people complaining back in 2014/2015 when the team mention feature was first introduced!
I checked the team settings to see what was there.
So it's by design.
it's not mentioned here https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#mentioning-people-and-teams which is the general area where I was looking.
Hmm.
https://docs.github.com/en/organizations/organizing-members-into-teams/about-teams "Organization members can send a notification to an entire team by mentioning the team's name"
"About Teams" gets more into it.
yeah that matches what you found
Alright, welp. Thank you @ember iris and @onyx hinge for the assistance there, but if I had researched it, I would have found out eventually that it won't work.
Thanks, the undefined option is gone for me now. However, it looks like the filters on the Blinka page have stopped functioning.
It's vague enough that I wasn't sure exactly how it would work, a test was a nice and quick proof of concept
More specifically, the clicking the Filters button doesn't bring up any filters.
@lone axle I'm tempted to say folks can reply to the issue and tag you and me on it, and one of us can tag CircuitPythonLibrarians to get more folks involved with assisting new folks. But if one or both of us ends up out for some reason, things will languish. So I guess Discord is the best option. I do wonder whether suggesting the #circuitpython-dev channel makes more sense than the help-with channel. But I'll leave that up to you.
I then found out that I had wired two input pins into GPIO4 and 5 from a 5V device(measured 4.0 V and 4.8 V on the pins ). When I moved that external component from 5V to a 3.3V source, everything started working again. So problem solved! Unless someone wants to dig deeper into why it actually crashes starting from a certain CircuitPython version.
I don't know why, but the pin voltage ratings are no more than 0.3V above Vdd, and operation is undefined above those. It could that there was...
I didn't test that! ;-) Nice catch.
Fix was: rather than add conditionals to assets/javascript/downloads.js, just make it happy by supplying it with empty mcufamily data from blinka.html.
I do think #circuitpython-dev does make more sense. I'll swap that over. And good thought as well about letting them know they can respond to the issue directly. I do think that's a good thing to add. I can mention to tag both you and me. I'll keep an eye on my github inbox and anything that I'm not able to respond to within a day or so I'll follow up and tag librarians so a larger team can see and offer help.
Issue comment chains may be nicer in some cases anyhow because it will be easier to follow the full context of the discussion if it has more than one back and forth.
Exactly. Thanks much!
I just had another thought as well, I'll add a link to the contributing with git and github learn guide to the template as well so if they are brand new they have some resources to learn how to do it.
Let's just switch it all to the standard purple links. The ordering should be obvious enough that the top section is the latest release.
I can submit a PR tomorrow, unless someone beats me to it.
- Fixes #764.
Change unstable and unrecommended download links to purple, to avoid confusion that the links are not functional.
I left the markers in, in case we want to change the link colors again, in the future. Also, I did not change the language dropdown away from gray.

A possible alternate syntax that does not require the changed files list to be an environment variable.
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
# Enable listing of files matching each filter.
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
# Paths will be formatted as JSON array
list-files: json
#...
we could fit all of circuitpython in the 1mb L2 cache on the raspberry pi 😄
no one even have to jump up and down on it to make it fit? 🙂
@slender iron are you around?
ya, for a little while longer
need to ask about ble workflow
cats are hungry 🙂
okay I'll keep it short
Does ble workflow require the whole _bleio module to be implemented completely?
Can I get away with implementing a subset of _bleio features to achieve file transfer?
@jepler See if this revised doc for usb_hid.Device() is clearer.
its 4.3
Thanks
Courious: is the description in line 56 & 56 really describing the code in line 61 & 62 & 63 correctly ?
Courious: is the description in line 56 & 57 really describing the code in line 61 & 62 & 63 correctly ?
No! That's why we have reviews :slightly_smiling_face: . I've fixed it and pushed again.
Hi,
I'm trying to figure out how to make an emulated USB keyboard (using a neokey 1x4) wake the computer it's attached to. I've verified the QT PY RP2040 is getting power and behaves normally when the computer is on, but it seems to go haywire when the pc is asleep and i press a key (windows 10).
Is this possible to support somehow with the current libraries?
Transferring to https://github.com/adafruit/circuitpython, as this is a core issue.
@hathach What would we need to do to make USB wake work? I assume we are not doing USB at all when we detect that the host has gone away (disconnect or suspend, I guess, I'm not sure which). Thanks.
Thank you! I didn't spot any remaining problems.
Just a pointer to what perhaps does it... It's arduino code example on Tinyusb: https://github.com/adafruit/Adafruit_TinyUSB_Arduino/blob/master/examples/HID/hid_composite/hid_composite.ino#L87
@hathach to confirm if that's the API to implement for the wake up.
Perfect.
@dhalbert tud_remote_wakeup() is API to do this, however there is a few requirements, all is implemented by hid example for your reference https://github.com/hathach/tinyusb/tree/master/examples/device/hid_composite
TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUPbit must be set in the configuration descriptor https://github.com/hathach/tinyusb/blob/master/examples/device/hid_composite/src/usb_descriptors.c#L111- MCU DCD port remote wakeup and suspend detection must be implemented, which is tru...
So now that 7 is stable, do we need to continue supporting 6.x in the Project Bundle?
Nevermind, we're going to continue.
@onyx hinge I am in need of your git fu. I had typed this all up to say that everything might be fine and I would waste your time, but it is not fine, and I am now stuck in a rebase that I'm basically ready to delete the branch and start over fresh.
@idle owl give me a second to switch gears!
ok, if you're certain
I hate rebase.
I don't even know what I changed before this. It's for the rainbowio update.
But apparently the Great Rename caught some of those files, and now it's borked.
is there still a way I can help out?
I need to face my rebase demons.
So yeah.
(Sorry, also helping Trevor with a wiring situation on Slack)
Do you want to see what it says, or..?
@idle owl sure, starting with the error messages you're seeing would be handy
or if not error messages, inscrutable git messages 🙂
@onyx hinge ```From github.com:adafruit/Adafruit_Learning_System_Guides
- branch main -> FETCH_HEAD
CONFLICT (rename/rename): Rename NeoKey_Trinkey/CircuitPython_NeoPixel_Example/code.py->CircuitPython_Templates/status_led_one_neopixel_rainbow/code.py in HEAD. Rename CircuitPython_Templates/status_led_one_neopixel_rainbow.py->CircuitPython_Templates/status_led_one_neopixel_rainbow/code.py in f91018fd (Initial rainbowio update.)
Auto-merging CircuitPython_Templates/status_led_one_neopixel_rainbow/code.py
error: could not apply f91018fd... Initial rainbowio update.
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Recorded preimage for 'CircuitPython_Templates/status_led_one_neopixel_rainbow/code.py'
Could not apply f91018fd... Initial rainbowio update.```
@idle owl yeah it looks like git is confused, because it thinks that adafruit's main branch has renamed a file one way, and your branch has renamed it another
I think that may be incorrect, but git doesn't actually know what files are moved, it just tries to infer it based on having similar file content
@slender iron ^^^
I don't recall dealing with this kind of situation before so I don't have canned advice to parrot for you
Doubt it. I don't think I ever pushed it.
And now I'm trapped in this rebase so I don't think I can push.
git rebase --abort should put you back
oh!
Fancy.
It's old. Because we had to wait.
I think you may be best off just re-doing it 😕
Ouch. If that's your assessment, it must be bad.
Oki.
Thanks for looking into it with me.
This is fine.
I think the content of all your files is right, so you may just want to copy them out, start a fresh branch, and copy them back in
like, don't make yourself perform the edits again
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Macropad RP2040 with rp2040
Code/REPL
import usb_cdc
usb_cdc.data.write(bytes("test"))
Behavior
Nothing
Description
Code previously worked in CircuitPython 7.0.0 Alpha 5, but haven't tested versions in between.
Additional information
No response
@onyx hinge I'm looking through the learn articles for the OV2640, but I can't find a wiring diagram anywhere, do you know one that has it by any chance?
@stuck elbow https://learn.adafruit.com/capturing-camera-images-with-circuitpython/raspberry-pi-pico-wiring and adjacent pages maybe?
oh, there is wiring for the pi pico, I can work from that, thanks
which microcontroller are you using?
also make sure to check out the section "Adapting to other <microcontroller family> boards" section
the wiring is the same for both
I can't see that section?
@analog bridge it is all "peripheral" so you can ignore scanning
Unrelated, is it possible to have 2 I2C board objects?
so board.I2C() and board.I2C1() ?
Or is the way it's done under the hood make that impossible.
it's possible
I did a test implementation of board.STEMMA_I2C for the QT PY 2040, but shelved it because I had too many other things
That's what I'm referring to 😄
it's the 3 commits on this branch: https://github.com/Neradoc/circuitpython/commits/nera-board-stemma-I2C
I may have gotten a little too eager on this. It wasn't outputting because the version of the macropad library I had was older. Updating fixed it.
Can anyone test https://github.com/adafruit/Adafruit_Protomatter/pull/41
Saw your ParallelBus promo just now. 👍
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Raspberry Pi Pico with rp2040
Code/REPL
code.py
import usb_hid
from adafruit_hid.keyboard import Keyboard
kbd = Keyboard(usb_hid.devices)
boot.py
import storage
storage.disable_usb_drive()
Behavior
Traceback (most recent call last):
File "", line 4, in
File "adafruit_hid/keyboard.py", line 65, in init
File "adafruit_hid/keyboard.py", line 113, in release_a...
@mental nexus it has been a pleasure to build on your work
I tried this on a Dell Optiplex 3020 running Windows 10 and could not reproduce the problem. It may be a slow USB startup. What is your host computer and what version of Windows is it running?
Try inserting a time.sleep() of a few seconds at the beginning of code.py, before the Keyboard() instantiation, and see if that makes a difference for you.
My computer is a HP Pavilion p6320y running Windows 7 Home Premium. I tried a 10 second sleep just for good measure but the error still occurs.
Do you have a Windows 10 computer to try?
I don't have a Win 10 computer unfortunately
Hey @tannewt! Thanks again for all of your help here! We're pretty close to ready for a PR and should have it up in the next few days. I did have a related question for you: Once we get that up and merged, what's the process for getting the port listed on CircuitPython.org? I can start running down any content you all would need for that in the meantime.
Not sure if this is still the way
https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website
Want to add your CircuitPython or Blinka board to CircuitPython.org? Here's how.
Now I'm thinking of The Mandalorian.
@bsatrom You make a PR to circuitpython-org repo, check out this guide for details: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website
It may be helpful to look at the changes from a previous PR as well: https://github.com/adafruit/circuitpython-org/pull/768
Reference issue #71 in Adafruit_CircuitPython_BusDevice
Enables SPIDevice to be used for devices which requires CS to be active high.
Adds a new boolean parameter cs_active_value.
Linked PR raised against Adafruit_CircuitPython_BusDevice
Also fixed a bit of formatting.
The changes look good to me but I have not had a chance to test them out. I will look at the library PR as well to see how they compare. I set the workflow to run to make sure it builds.
General Q: for an issue that's been closed on a CP library, is a preferred to start a conversation on the same topic on the closed issue or to open a new issue?
Please open a new issue. You can reference the old issue within the new one if you feel it's relevant. Thanks!
Whoops, I'm on it, thanks!
@lone axle do you know there was ever documentation written about using the stubs with pycharm?
No worries if you replied to another issue. You can still file a new one. Comments on closed issues are more likely to get lost!
there is not that I am aware of. I've started planning out a video that covers that and other tips to get the most out of pycharm but haven't recorded it yet.
Excellent, thanks. I just discovered this awesome "reference in new issue" button on GitHub that fixed it in one click
When I set it up, I searched Discord in the #help-with-circuitpython channel where FoamyGuy explained it last and managed to get through most of it. Still needed help though.
Great!
if you are looking to use the stubs though I do know how. Now that they are deployed on pypi it's much easier.
pip install circuitpython-stubs --pre
should install them and then pycharm should automatically start using them.
looks like maybe we need to look into how to get a release version deployed to pypi, it's showing pre-release on the latest ones still even though 7.0.0 is has a release now. This would have been the first real release since they got properly deployed to pypi.
You need to change the actual files back too.
The esp32-s2's i2s mode (#5378) can use 16 bit displays (it takes a large number of pins!) but some changes seem to be needed to how commands are sent out (at least for rm68120 in the espressif hmi devkit)
- Commands have to be sent as 2 bytes instead of 1 byte
- non-image-data is mostly sent 8 bits at a time, so it needs to be padded or whatever
It feels like this has to be known at the Display level, since the ParallelBus shouldn't be putting any interpretation on e.g., the 0...
Is there no separate release action that runs for the core circuitpython project like there is for the libraries?
@lone axle I think @tulip sleet would know best about that..
it looks like no to me. There is no release.yml like there are on the libraries.
I think the if statement for the pypi upload action is preventing it from uploading a release version: https://github.com/adafruit/circuitpython/blob/bb2dbf4aa3c88616e03d34f630d98730e6547e51/.github/workflows/build.yml#L245
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit'
If I understand correctly it will be false because the branch is not refs/heads/main for releases.
the actions run from the 7.0.0 release shows that the upload stubs to pypi step was skipped: https://github.com/adafruit/circuitpython/runs/3651069692?check_suite_focus=true
What would I run on a freshly cloned CircuitPython library bundle repo to initiate every library to download every repo? That's a thing, right?
I need to be able to grep over the library and example code.
I think these two:
git submodule sync --quiet --recursive
git submodule update --init
Ok I knew it was submod something, wasn't sure what specifically. Thanks!
SO MUCH SCROLLING. 😂
Looks like it's working. Thank you!
for grepping all of them it's this:
git submodule foreach "git grep search_term; true"
Hah I was about to say to Jeff I would ping him tomorrow about how to do that. Thank you so much! Replace search_term with my search term presumably? What if I need to search a string? 😕
yep for replacing search_term. you mean a string with spaces or quotes or something like that?
for spaces this works:
git submodule foreach "git grep 'esp32_cs = DigitalInOut(board.ESP_CS)'; true"
I'll see if I can figure out double quotes
You need to change the actual files back too.
Darn! VERY sorry for the oversight & making you catch that. Incorrectly assumed the build check would catch it.
ah, incase you end up needing to do quotes it looks like they can be escaped with slashes:
git submodule foreach "git grep '\"\"\"Use below for Most Boards\"\"\"'; true"
ahhh excellent.
@gamblor21 I've no idea why one translation (Japanese) failed for one board (pyb_nano_v2) - any idea how I'd find out?
it looks like it should borrow the if for the "upload stubs to S3" just above it ?
Ah, yeah I think you are right. That one has some extra logic for release and publish, I think that would do it.
I have a branch that uploads the stubs to pypi under a name prepended with "foamyguy" that I was using to test out the actions when we were working on them. I'll get it updated to current and test out that change.
I was also looking into not running the build for the tag push action, since it also runs a build for the realease part (each release causes 2 builds), a push to create a tag has a github.ref value like "refs/tag/7.0.0" (instead of "refs/heads/main" or "refs/head/some_branch"), so I'm thinking that adding the same list of conditions on builds themselves could work, minus github.repository_owner so forks can run CI, but I'm not sure at all
There are actions in its build.yml that run on release.
neradoc pointed me to a condition that runs on the release event. I've just pushed a test to my fork to see if it will upload release versions to pypi (under my own name, not the official one) waiting for the actions to run now.
okay, that worked. I have a stable version on PyPi now. I'll PR the change.
I don't know how common it is for other peoples fork to make releases (I suspect not very) but I noticed the stubs S3 upload doesn't have the condition for adafruit github user. So my fork attempted to upload, and doesn't seem to have printed any sort of error but I don't have AWS keys so It would have had to fail I assume.
The 7.0.0 release actions skipped the step to upload the stubs to PyPi so we've ended up with only pre-release versions that are on PyPi.
This changes the condition for PyPi stubs upload to match the ones used for the S3 stubs upload so that it will upload a stable version when the next release is made.
I tested these conditions in a branch on my fork. The actions run that did complete the upload suc...
can we do a manual upload to pypi? The stubs for 7.0.0-rc.3 are identical to 7.0.0 final
it's the same commit, just with a new tag
I'm not sure how to do it manually. twine inside of the actions is the only way that I've ever uploaded anything to pypi. Maybe running the twine commands locally with a stubs build and proper environment variables could work but I'm not certain.
looks like that should work. This page outlines the process: https://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56 and they do show creating the dist and then running twine locally to upload it.
i have pypi credentials to do this, hold on a second while I try to build
ok, I did make stubs, but not sure how to make the package
@lone axle what is equivalent to python setup.py sdist for this?
I think make-stubs generates it. that should have created a circuitpython-stubs directory. Inside of there should be a dist I think. So full path: circuitpython-stubs/dist/
I did check-stubs and I got a minor error:
string>:1: error: Argument 2 to "readfrom_into" of "I2C" has incompatible type "bytes"; expected "Union[bytearray, memoryview, array[Any], ndarray, RGBMatrix]"
Found 1 error in 1 file (checked 1 source file)
<string>:1: error: "I2C" has no attribute "write"; maybe "writeto"?
Found 1 error in 1 file (checked 1 source file)
(The above two tests are expected to show type errors)
not sure about the last message?!
I'm not certain what those are about but I think the actions in github show those as well.
ok, we'll just ignore that, hold one while I try a twine upload
I think we are home free
I don't know how test that
I think pip install circuitpython-stubs but I do think it also takes a moment to actually make it there.
ah, it does show in the release history, but it's down a little bit in the timeline (which makes sense)
I just mean when I install it, how do It test it?
Inside of pycharm and look at a script that uses something from circuitpython to see if it recognizes the classes and offers up type hints and things like that is the only way that I know how
One more trade-off to consider. Processing is faster in C than Python, which argues for doing more packet parsing in C and returning more fields as opposed to a raw packet. But that reduce the duty cycle of packet capture.
On the other hand, doing more packet parsing in Python will make the capture more "chunky" in that we'd be grabbing some packets quickly, then processing that chunk more slowly while we miss capturing more packets.
I don't know, maybe it's a parameter and the code can...
verifying the files that ended up in site-packages may be a different way, but there will be a lot of them (one for each built-in module) and I'm not sure there how to tell that 7.0.0 is specifically what you have.
I don't use pycharm, though I did install it once or twice. Do you? That's all I mean, does it work with an editor.
Anyway, there is now a non-pre-release package there. It did install successfully, though I had to uninstall the very old 2019 version first
I see them in BBEdit too, since it uses LSP
can you try the latest release I just uploaded? That would be great, thanks.
There are some very strange releases listed there:
we never tagged anything even close to that way, it must be some generated version number
yep, tested on my end and it looks to be working as expected. 🎉
it did "Successfully installed circuitpython-stubs-7.0.0" after I first uninstalled as it was talking about some "circuitpython-stubs-7.0.1.dev64" version ("circuitpython-stubs-2019.5.26.tar.gz") and the completion and stuff works, no idea how one would test that it's 7.0.0 specifically
somehow they can be "Yanked" I believe there is a much older one that shows that status. I'm not sure how to do that though, I've never done it.
I built it at the 7.0.0 tag, so it should be correct
I do think the versions are generated automatically somehow (not certain where or how) were there any commits after rc3? perhaps it assumed those belonged to a (not actually existing) rc4 until the 7.0.0 release was made and then it started doing the 7.0.1dev ones.
it does not use semver, it uses python's idiosyncratic numbering
there is no longer any way to remove a release; they say it's a bad idea, just publish a new good release. So we did that, so no cleanup to do. Thanks for figuring this out and glad we got a good version out
Thank you for doing the manual release! I'm stoked to have a stable build up before 7.0.1 whenever it may come.
BTW, with @FoamyGuy's help I did a manual 7.0.0 release of circuitpython-stubs to pypi.org.
@gamblor21 One translation (Japanese) failed for one board (pyb_nano_v2) -
Too little flash!!!- does this mean that there should be an exclusion for this language on this board (I can see some others are already skipped:Note: Not building languages {'cs', 'el', 'hi', 'ko'})?
The build was short of space. This module does not have to be in the core so add the line:
CIRCUITPY_BUSDEVICE = 0
to the file ports/stm/boards/pyb_nano_v2/mpconfigboard.mk right at the end. This will rem...
@michthom We don't exclude language builds for a particular board. Instead we shrink the build in some way so it accommodates all the languages available. The excluded languages you see are excluded for all builds, because their translations are very incomplete.
@tulip sleet The text is unclear, but it is desired that mypy detected those problems. It is being called in a way that simulates checking flawed user code for type problems... I'd love for it to be clearer.
@slender iron I've pulled my hair out for two days trying to get a samd RTC compare interrupt to fire for pretend_deep_sleep. I can get CMP to interrupt during deep sleep, so I can't figure out what I'm doing wrong.
Can you give me a sanity check on the code below?
void common_hal_alarm_pretending_deep_sleep(void) {
if (!SAMD_ALARM_FLAG) {
SAMD_ALARM_FLAG=0x01;
RTC->MODE0.COMP[1].reg = (uint32_t)port_get_raw_ticks(NULL) + (3*32)<<4; //3 seconds in the future
while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COMP1)) != 0);
RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP1;
RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP1;
} else {
if (RTC->MODE0.INTFLAG.reg & RTC_MODE0_INTFLAG_CMP1){
timer_callback();
}
}
}
I've confirmed common_hal_alarm_pretending_deep_sleep is being repeatedly called (and the REPL says it's in fake sleep), it just never wakes up. I've tried everything I can think of so any insight would be a huge help
Hello, is this also a place for discussing problems with Micropython porting?
@neat epoch it depends on the specific question, so just go ahead and ask and we'll either answer you here or direct you to take it over to #help-with-circuitpython. (or tell you we don't know but we hope you'll figure it out 😉)
Ok 🙂
I currently try to port MP to a MCU we use at work. I got it to compile and run, and implemented the utime functions.
I now don't understand how to make the utime module importable. If I import utime I get an error.
I can compile it as a built-in module, but that just means that it's "imported from the start"
ah if you're literally asking about micropython, then you're better off asking in a place for micropython, like their forum.
but to try to answer, I'm pretty sure that "utime" is designed to be a "built in" module only, not one importable from the filesystem. There are some modules in micropython that are designed to be either way (I think framebuf is one of them?) but that option only exists for a few specific C-coded modules.
Ok. I just saw that e.g. examples for esp32 showed import time in their code listing
@gamblor21 Hopefully this is ready for a new build test now.
Great news from Ladyada in the 'Python on Hardware weekly video 150' (https://youtu.be/PoHNOxbInqw) about hardware interrupts and/or threading and/or asyncio improvements potentially coming to CircuitPython 8!
The wonderful world of Python on hardware! Episode 150 (September 22, 2021). This is our weekly Python video-newsletter-podcast! Ladyada and PT review the Python on hardware news & highlights of the week.
The news comes from the Python community, Discord, Adafruit communities and more. It’s part of the comprehensive newsletter we do each week. ...
Ah, found my error after another hour of staring and comparing :D
I put the module into the BUILTINS instead of BUILTIN_MODULES
@gamblor21 Looks like all of the espressif builds failed but at a common point - installing the IDF tools, so I'm presuming this is nothing I can fix in my code?
@gamblor21 Looks like all of the espressif builds failed but at a common point - installing the IDF tools, so I'm presuming this is nothing I can fix in my code?
Yeah I'm not sure why those failed. The build that previously failed now passed.
Espressif builds are failing with the current cache key.
The espressif build failure is due to esp-idf cache key. Please do a merge from upstream after PR #5386 is merged.
The espressif build failure is unrelated to this PR.
Can someone with more pylint experience take a look at https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/pull/72 for me. There was a failure unrelated to the PR in the examples. I'm not sure if the fix the author put in is the proper way or not.
The rest of the change itself is fine - just was waiting to approve until this is resolved.
i ran into that
i got around it by ignoring
which may not be the correct approach
not sure if this is a new check due to pre-commit using a new version of pylint and as a result the CP config needs updating?
I'm not sure myself. Do you recall the ignore command? I can pass that on.
i tweaked the pre-commit config yaml
which i wouldn't recommend for them
let me read through the discussion a bit more....
^^ for ref. and scroll back above that.
hmm thanks may be worthwhile to just suggest that change, doesn't seem too bad. My python level is low so I'm not sure
the code in the test files is completely wrong
which py file?
*test files
the examples?
yeah sorry simpletest I mean
yah, that's their hack to get around the pre-commit gripe.
print("".join([f"{x:02x} for x in result"]))
should be
print("".join([f"{x:02x}" for x in result]))
yep
their original code was probably fine. and they got to that by trying to get around the pre-commit thing.
yup the examples were not even part of the PR but was causing the checks to fail
It isn't. It is tied to a core PR (since busdevice exists in both) but neither is
ok. want to reply saying it's on our end? and just wait and we'll get back to them.
@tulip sleet who maintains the CI stuff?
I believe I remember seeing conversations a while ago about pinning the pylint version in the examples check to avoid that kind of things ? or maybe there was an problem doing it ? I don't know where it went
which CI, the libraries?
it went no where. convo was around same time i was asking about this.
I'll reply to the PR saying the CI is being looked at related to this.
@tulip sleet i think it's pre-commit in this case. it's the same "hey! you should consider using this really cool f string thing" gripe i ran into. which causes CI runs to fail.
(I'm talking weeks ago)
affects all libs i think?
it's a nuisance, since some builds of CPy don't accept f-strings
we might fix that in the long run, but not at the moment. I would just put in a # pylint: disable= for this particular thing right now. Yes, we can pin pylint to a particular version, but we don't want to do that in the long run.
or your suggestion of adding it to .pre-commit-config.yaml
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name,consider-using-f-string $example; done)']
but that would require pushing the update to all repos
we can make that change one at a time to the repos, as necessary, or we can have Dylan do them all, as usual
I think this is a @idle owl library manager q
ok. yah. if possible, i think better to fix it globally, instead of adding yet more # pylint: disable= sprinkles to code
let's undo the most recent change, and add the consider-using-f-string as you suggested above
to .pre-commit-config.yaml ?
yah
I'll summarize that all in the PR for the author
@blissful pollen can you make the change to .pre-commit-config.yaml also?
actually...could just have them make the changes and let it be part of the PR
That was my thought, if they're uncomfortable with it I can take a look
and that way it's also pass their local checks
you can link to the file i changed...one sec...
have them just copy-pasta that in to their local version and commit changes as part of PR
and also revert the example .py's back
Commented and let them know. If they have issues I can help out with the change.
cool. thanks.
Thanks everyone for the assistance. A lot of python/pylint is still an area I am not strong in so I wanted to ensure I wasn't giving bad advice myself.
@idle owl ping me if you want more background info about this new pre-commit CI thing. i wrangled with it on a PR a few days ago and now someone else is also.
Indeed I would like more background info. We should not be tweaking individual pre-commit files to get around failures.
We either need to make a decision about everything, or fix the issue on the failing libs.
@idle owl yep. that's just happening near term to get people through.
i think the problem is basically just a new check that's shown up in the latest pylint
related to print statements, string formatting, and a "consideration" to use f-strings
the answer could be as simple as adding a new ignore for this?
We don't support f-strings, do we.
here's the PR where i ran into it and did what-should-not-be-done:
https://github.com/adafruit/Adafruit_CircuitPython_DS18X20/pull/23
Yeah I have that pulled up
yah. not fully.