#circuitpython-dev
1 messages Β· Page 372 of 1
Hi @jweaver85, I think you can accomplish what you're trying to do with Tasko or your own event loop & circuitpython's async/await support today. Should look something like:
import tasko
[...]
# Scheduled at a high rate so that the button is responsive
asyc def updateAlgorithm():
[unchanged, maybe have one of these per animation instead of spreading them across time? or loop them in this function]
# Scheduled at high rate to keep brightness button responsive
async de...
I would just like to note, that sometimes you don't want a complete traceback, but just the last one or two lines of it, so that you can scroll the error in a similar way as the microbit does it.
@jaunty juniper Hi - I had staff try out your fix for M1 Macs, which I incorporated into adafruit-board-toolkit 1.1.0. It did not work for them. I'll pass you the logs -- I have not had a chance to study them in detail yet.
instructions I gave
mu log
dmesg
@ArmstrongSubero nice work! next up is a PR, do you need a hand creatinng one?
FYI tested this last nite with RP2040, very successful!
@kevinjwalters both thunderpacks are the F411CE, we don't support the STM32L series. The F401xE chips do have 512kB of flash, but we reserve 64 of it on the Meowbit for the UF2 bootloader, and the build itself takes up 367kB out of the 384kB remaining. Building with ULAB enabled shows an overflow of 56kB.
The first line in the meeting doc has last weeks date in it. I'm going to go ahead update it to 17th
wait, 512 - 64 is not 384. Let me check out the linker file.
does UF2 firmware loading work from an ipad?
Oh, it's the dumb STM32 flash sector thing. STM32 has irregular flash sectors, and it's crucial for startup that the ISR vector table goes at the start of one. The bootloader takes up the first 64 bytes, but then the firmware ISR table has to reserve a whole 64 byte sector because there are no smaller ones left. We can manually pack libraries in there alongside it to free up space in the firmware sectors, which Micropython often does, but that's a trial and error process and wasn't done in th...
@ionic elk 64 bytes or 64k bytes?
64kb
whoops I will edit
Anyway yeah on the meowbit the first 4 16k sectors are bootloader, than the ISR is in the 64k one, and the firmware is on the following 128k ones
the design choices on some of the STM chips are so bizarre
the irregular flash is weird, yeah
but they do tend to have a lot of it for the price, so I guess it worked for them?
I think the newer lines like the L4 and G series have more of a standard page approach
But yes it's irritating that every single STM32 chip family has a totally different flash structure. F1 F4 F7 H7 L4, all of them are different and every time I add one I have to write a whole new driver in the flash files.
trade off of engineeering time and heartburn vs price π
that's ST, cheap, very capable, always annoying
@hierophect Sounds murky, thanks for taking a look. I was just pondering getting some code from the CLUE to work on the Meowbit as my friend's daughter has one.
Anyone have any pointers what I'm missing to build circuitpython these days following the steps on https://learn.adafruit.com/building-circuitpython/build-circuitpython (on ubuntu 20.04)?
make BOARD=circuitplayground_express V=2
GEN build-circuitplayground_express/genhdr/mpversion.h
python3 ../../py/makeversionhdr.py build-circuitplayground_express/genhdr/mpversion.h
GEN build-circuitplayground_express/genhdr/devices.h
install -d build-circuitplayground_express/genhdr
python3 ../../tools/gen_nvm_devices.py ../../supervisor/shared/external_flash/devices.h.jinja build-circuitplayground_express/genhdr/devices.h
Traceback (most recent call last):
File "../../tools/gen_nvm_devices.py", line 23, in <module>
typer.run(main)
File "/usr/local/lib/python3.8/dist-packages/typer/main.py", line 859, in run
app()
File "/usr/local/lib/python3.8/dist-packages/typer/main.py", line 214, in call
return get_command(self)(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/typer/main.py", line 239, in get_command
click_command = get_command_from_info(typer_instance.registered_commands[0])
File "/usr/local/lib/python3.8/dist-packages/typer/main.py", line 425, in get_command_from_info
command = cls( # type: ignore
TypeError: init() got an unexpected keyword argument 'no_args_is_help'
make: *** [../../supervisor/supervisor.mk:57: build-circuitplayground_express/genhdr/devices.h] Error 1
try pip3 install -U click
wait, 8.0 is out, you might need to pin it to 7.1
like that if 8.0 doesn't do it pip3 install -U click==7.1.2
the issue is that installing requirements doesn't seem to update click to the version required even though it's a requirement of one of the requirements
@jaunty juniper I've updated to 7.1.2 (I had 7.0) and running the make again
I don't see anything in there that helps, can we have ioreg -l (with board(s) connected) and the output of python3 -m adafruit_board_toolkit._list_ports_osx from inside the venv to narrow down the cause ?
I will ask, thanks
<@&356864093652516868> The CircuitPython Weekly Meeting is in 1.5 hours, at 11amPT/2pmET. If you plan to participate, please include your status updates and hug reports in the notes doc. Otherwise, if you're simply listening in, no need to do anything but show up. Hope to see everyone there! https://docs.google.com/document/d/1KY5czjOS8X8uZRGZpW3zT8RYCaMnOEZyUEC5GdTpzdw/edit#
Google Docs
CircuitPython Weekly for 17 May 2021 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canβt make the meeting and would still like to participate, add ...
@tulip sleet Do you know off the top of your head of a library that has tests in it? As in a tests directory with tests included.... I know we have a few and I'm struggling to find it.
Really don't want to initiate the entire library bundle and grep it.
Nevermind! Brent came through.
halbert@tuna:~/repos/adafruit/Adafruit_CircuitPython_Bundle$ find . -name tests
./libraries/helpers/datetime/tests
./libraries/helpers/requests/tests
./libraries/helpers/midi/tests
./libraries/helpers/motor/tests
./libraries/helpers/ble-radio/tests
./libraries/helpers/simplemath/tests
./libraries/helpers/debouncer/tests
./libraries/helpers/imageload/tests
./libraries/helpers/pioasm/tests
π You did what I didn't want to do.
Thank you!
I linked datetime and requests to the person who was asking.
well, I always have a clone of that repo, but using find might be new for you
My clone is way out of date, and not everything is initialised. So the directories don't all have all the files.
git pull on that repo takes a while all the time; many changes all the time
Sorry for the delay @jaunty juniper it took it a while to build but it's working again now, thanks for the quick fix :)
i'm not getting a BOOT folder with this .bin:
https://learn.adafruit.com/adafruit-funhouse/install-uf2-bootloader#step-1-download-the-tinyuf2-combo-dot-bin-file-here-3089838-5
instead, it looks like the shipped demo?
@gilded cradle For the Project Bundle, I've had someone suggest including a .gitignore in any bundle that includes a secrets.py file, so if folks are using Git/GitHub to back up their code, they don't accidentally commit/push their credentials. I'm not sure if that's possible, or something to consider, but the case they made was solid. I don't know where to file an issue for discussion.
Not a bad idea
@ember iris Hey! Keith is who suggested it.
you beat me to it so I can't quite call jinx, but the spirit of jinx is there π
Still not a bad idea π
I'd like to listen in on the circuit python chat today, is that possible? I can't go off of mute for the time being if that's ok
You can absolutely listen in!
yeah that is totally fine.
Join the CircuitPython voice channel and remain muted.
If you want to participate, let me know, we have to add you to the CircuitPythonistas role, and you'll want to add your name to the notes document.
I added a hug report, but it's text only for that reason if that's ok
That's absolutely fine!
Just listening today
Lurking
I moved your hug report to alphabetical order, in case you're looking for it. π
Sure!
Thanks! Wasn't sure if it was core first then community, or alphabetical
lurking
Lurking
i'm suppressed so I can't do a mic check.
Hi Rose!
Hi!
ππ½ π¨π·
ππ
:=
The PyCon Sprints Discord: https://discord.gg/X9D5V5Z9kY
It's all Anne now! π
:gasp:
I'll take it.
Yes, Thank you Kattni for your help as always!
(oops! knocked over my water bottle)
hope you didn't hit your keyboard
nah, it got lodged between the desks.
That's a tongue twister for sure
@gilded cradle Would you mind a few questions about using Blinka on Micropython -- In the Weeds?
Sure @solar whale
@tulip sleet in your cherry picking for 6.3 do you have something for the Pimoroni Pico Lipo? https://twitter.com/biglesp/status/1393549517484613632
gesundheit π
sorry -- forgot which computer had audio....
no problem @solar whale
i chained my audio to two machines with an XLR Y splitter.
Oh yeah, that was really helpful. @still zephyr Thanks for tagging me on all the prs I said I'd review but forgot about
Hi everyone, I am trying to debug circuitpython (https://learn.adafruit.com/circuitpython-samd-debugging-w-atmel-studio-7/get-ready-to-get-ready), but I have an overflow, is there any special configuration?, thanks
with flag DEBUG=1
I submitted an issue for this in the forums
@steel granite using DEBUG reduces optimization and might increase the flash size, and on some SAMD21 boards the flash margins are very tight
so you might need to remove some modules you aren't using and rebuild
The bin file in the .zip is "older" ( assuming 4-27-2021 is "old" π )
3084048 Defl:N 269997 91% 04-27-2021 08:09 4f6ace47 funhouse_tinyuf2_combo.bin
on small boards you will need to turn off several larger modules to make room ; also you are using a really old compiler. See the Building CircuitPython guide for info about updating your toolchain.
you know, I've never checked, what are the biggest "default" modules
I have removed several modules, any recommendation of which modules?
ok, I'm going to update my toolchain
I think you are wanting to see this when ( double ?) clicking reset on the funhouse, right? ( I'm not either )
There is a key matrix library already...
I shouldn't be glad to hear you managed to replicate the RP2040 issue, but I'm so glad you managed to replicate the issue @tulip sleet
For keypad.
we were going to work on a native C module, did you mean we have one?
@hollow gazelle yep
this will be a native C one that will monitor button pushes in the background, like the gamepad and gamepadshift modules
but will definitely look at the python one, thanks
i am not familiar with it
@ladyada Thank you! I'll do a PR in about a week, I want to do some more testing first π
@tiny sapphire mentioned that they couldn't get to HOUSEBOOT back on 5/5, and similar question was / response was mentioned @idle owl , who said "I ran into this. I was told to press reset once, and when the NeoPixels turn purple, press reset again to get to HOUSEBOOT. I thought it didn't have the right bootloader on it or something, but it was simply a button rhythm issue." - I'll test this now
@ArmstrongSubero a draft PR is a good place to start - it lets other people check things out but keeps it from being merged if there are other things you want to make sure are added. I have a STM32F746ZG and worked on the F4 AnalogIO previously so if you decide to post a PR I'd be happy to give it a test.
thank's to @idle owl - the press reset the second time when the lights were purple, got me to green leds on the funhouse, and HOUSEBOOT showing up as a drive!
PyCon 2021 Sprints Discord: https://discord.gg/X9D5V5Z9kY
You're quite welcome! Glad it worked!
@hollow gazelle thanks. same here. hmmm...guide should maybe be updated.
Partial results of my touchio script: code.py output: Touch on: A0 Touch on: A1 Touch (no pulldown) on: A2 Touch (no pulldown) on: A3 Touch (no pulldown) on: D0 Touch (no pulldown) on: D1 Touch (no pulldown) on: D10
@hollow gazelle that trick is mentioned here:
https://learn.adafruit.com/adafruit-funhouse/circuitpython#step-3089490
but that other page is still confusing
I keep wanting to use Blinka in PyCharm and/or Visual Studio Code so that I can have live completion... π
Hug report to Jeff for suggesting I add the no pulldown bit back into the script. The original version of it had it, then I made it "fancier", and dropped that feature. But we realised there may be boards that have both types of pins, like CLUE.
I guess maybe a blinka-stubs project.
@ruby atlas we have circuitpython-stubs
TIL!
@gray mantle - let's ask Learn Dev
we need it pushed to pypi automatically though
Get with me
Creating a virtualenv for this project...
Pipfile: /Users/rhooper/Devel/sprints-2021/Pipfile
Using /usr/local/bin/python3.9 (3.9.5) to create virtualenv...
β Creating virtual environment...created virtual environment CPython3.9.5.final.0-64 in 494ms
creator CPython3Posix(dest=/Users/rhooper/.virtualenvs/sprints-2021-u85AtMf2, clear=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/rhooper/Library/Application Support/virtualenv)
added seed packages: pip==21.0.1, setuptools==56.0.0, wheel==0.36.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
β Successfully created virtual environment!
Virtualenv location: /Users/rhooper/.virtualenvs/sprints-2021-u85AtMf2
Installing circuitpython-stubs...
Error: An error occurred while installing circuitpython-stubs!
Error text: Collecting circuitpython-stubs
Using cached circuitpython-stubs-2019.5.26.tar.gz (12 kB)
WARNING: Discarding https://files.pythonhosted.org/packages/6a/1b/61bbcb3680ac60d25b28ad4354603aee7507e16cc81dbe36f8c370f71412/circuitpython-stubs-2019.5.26.tar.gz#sha256=ae7b40b34c81b1ab3da8547615124d7c7d67660f35a7571b65643a9d415968d4 (from https://pypi.org/simple/circuitpython-stubs/). Requested circuitpython-stubs from https://files.pythonhosted.org/packages/6a/1b/61bbcb3680ac60d25b28ad4354603aee7507e16cc81dbe36f8c370f71412/circuitpython-stubs-2019.5.26.tar.gz#sha256=ae7b40b34c81b1ab3da8547615124d7c7d67660f35a7571b65643a9d415968d4 (from -r /var/folders/jv/6jpqf9ln0hsfkh45qtr9yxmw0000gn/T/pipenv-jwbahtln-requirements/pipenv-wyspsquu-requirement.txt (line 1)) has inconsistent version: filename has '2019.5.26', but metadata has '2021.5.17'
ERROR: Could not find a version that satisfies the requirement circuitpython-stubs
ERROR: No matching distribution found for circuitpython-stubs```
Looking at repo/filing an issue π
I think it's pretty old
you can make stubs in the top of circuitpython to build them
I don't think we've been able to get the stubs deployed to PyPi successfully. You can install them somewhat manually in PyCharm though if you want to use them in there.
what was the issue @lone axle ?
Firmware
atmel-samd based boards.
Code/REPL
Not applicable
Behavior
Not applicable
Description
- There are many board which does have a USB port to run REPL terminal.
- It would be great to provide DEBUG UART interface instead for such boards.
Additional Info
When I gave it a shot I could not figure out how to get pip to actually install the files. I was able to get pip install to run but the stubs weren't present to site-packages.
welcome to packaging in python. (insert xkcd)
All the sequence should not be in the "core" I believe.
Given the ubiquity of using LEDs with CircuitPython, could LED core become a native module like ledio?
Kitty!
Yep, in stereo. Just as I unmuted.
I had to simplify some of the code to remove colour and function that were not used.
I tried looking into how other projects with stubs do it. But it's tough because most other projects I could find the main project is python code. But for circuitpython there is not python code behind it, but C instead.
I think typeshed is an example
Yes, French keyboard is much wanted... and there was a PR or variant.
adafruit-circuitpython-animations
adafruit-circuitpython-animations-lite
That involves supporting two versions of the same stuff, we're not really set up to do that.
Having a Core and Animations separate, is a different thing.
Nice! thanks for the pointer, I will take a look into that one and see if we can mimic something they are doing to get the pyi files to install with pip.
Toga does some clever packaging. Tho they utilize pip
https://toga.readthedocs.io/en/latest/#:~:text=Toga is a Python native,such as Android and iOS.
I made the changes in existing code to support DEBUG UART on atmel-samd based boards.
CircuitPython 7.0.0-alpha.2-586-g0ac107b73-dirty on 2021-05-17; ATSAME51J20A custom board
I would like to submit my changes, but I would to clarify some doubts before doing this:
- There is generic part which is relevant for all atmel-samX based boards. But there is board specific part which currently resides inside of asf4_conf directory. The issue is that this configuration is really b...
I made this video at one point that shows the how to make stubs and how to load them into PyCharm: https://www.youtube.com/watch?v=RAVvRniZWHc
What is your boot.py? That would be the easiest.
I've just copied the sample you gave in this thread in the first post https://github.com/adafruit/circuitpython/pull/4689#issue-626883902
but it outputs an error in boot_out.txt
Adafruit CircuitPython 7.0.0-alpha.2-584-g25a44cb77 on 2021-05-15; Raspberry Pi Pico with rp2040
boot.py output:
back trace (jΓΌngste Aufforderung zuletzt):
file "boot.py", line 48, in <module>
ValueError: out_report_length must be 1-255
suggested labels:
- atmel-samd
- enhancement
Thanks everyone!
Thanks everyone
Thanks all!
Thanks everyone
Thanks All, have a great week
that was bizarre - machine froze and discord started repeating 3 seconds of audio over and over
what platform were you on?
linux
@lone axle Multi-word library names, creating library files with spaces instead of underscores in cookiecutter, apparently.
native app, not browser for discord
@jaunty juniper I will have access to an M1 Mac soon, will get you more info
Added patch for review, before delivering
atmel-samd_uart.generic-part.patch.zip
@lone axle
I mean it's irrelevant here, it will be packages. But still, probably worth looking into.
uh oh, just to confirm you put "led animation core" as the answer to library name right?
and we want it to come out as adafruit_led_animation_core.py
1 - Adafruit
2 - Community
Choose from 1, 2 [1]: 1
github_user [adafruit]:
author_name: Kattni Rembor
company [Adafruit Industries]:
library_name: LED Animation Core
library_description []: Core files for CircuitPython LED Animations.
library_keywords []: led animation
library_prefix [adafruit]:
adafruit_pid []:
requires_bus_device []:
requires_register []:
other_requirements []:
pypi_release [yes]:
sphinx_docs [yes]:```
Correct, it should be all underscores.
I will check into it tonight. I think there are some spots where it does replacements with underscore. I may have broken that behavior accidentally.
Ah fair enough. Thanks for all your work with it!
@hierophect np I'm swamped today so I'll do one tomorrow.
Have you forked adafruit/circuitpython on GitHub? Do so and you can create multiple branches in your fork to handle all these changes. A GitHub pull request is the best way to submit code for review.
If this UART port only needs to exist when the CircuitPython VM is running, you should be able to implement it in a port and device-independent way. You can call the common-hal UART routines to set up the connection and then have serial.c and maybe other places direct output and take input...
The multiterminal module did something like this in the past, but is not currently used. (I think I may have told you about this already.)
This will break SO MANY GUIDES. Sigh. Need to figure out a "legacy" backwards compatibility plan here.
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/1QHyjj8WWI7cAWNM1gpuEVwcTM__C_wxOdurLUAZmHtM/edit?usp=sharing
Google Docs
CircuitPython Weekly for May 24th, 2021 Here is the notes document for Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the ...
i am still thinking about whether some kind of library subsetting would be helpful in the long run. There are other examples, such as sensor libraries that have a minimal and a full version
Hmm.
I mean, this library is already well divided up into packages, meaning it wouldn't be hard to determine what's needed based on imports.
But I don't know whether that's a feature they would even entertain.
well, we already tell people to do it by hand (delete what you're not using), so automating that is making it easier
myabe a library has "components", and you can say which components you want
Would it be possible to make an LED Core library that is redundant, and then slowly remove the core elements from the led animations library, that way the transition can be more slowly manage and doesn't break everything at once?
and maybe there are required and optional components
I somehow broke the boot.py file which makes the file system read-only.
Adafruit CircuitPython 7.0.0-alpha.2-584-g25a44cb77 on 2021-05-15; Raspberry Pi Pico with rp2040
boot.py output:
OSError: [Errno 5] Input-/Output errorI think it should be the other way round: If something is wrong with boot.py, the filesystem should be always writeable so you are able to fix the error.
Renaming boot.py via REPL didn't work but formating the drive resets it completly.
...
This is an example of the sme sensor with a different functionality, so I agrree, I think it would be easier to maintain with lighter libraries https://github.com/adafruit/Adafruit_CircuitPython_BNO08x_RVC
And to add KeiththeEE comment, we could archive the old librry, we did that we the DHT library and people still use to this day the old one.
Ah that is a good point. I was looking at it from a workload per unit time perspective
Possibly. I'm thinking about making the Core library never show up in code. Treat it only as a dependency, so everything is still imported the same way it is now, but you have to include the Core library on CIRCUITPY. That's the breaking change.
In this case, the question will be, what would be folks complain less about as a user?
That is a huge consideration, yes.
if we need to change I will help to change whatever is needed, but for me the user is the key factor here
Hmm. The stubs seem to generate fine. Now to try using 'em.
aha, installing requires git.
and the git command fails
okay i think I can file a bug and fix now that I know what's up.
Have you forked
adafruit/circuitpythonon GitHub? Do so and you can create multiple branches in your fork to handle all these changes. A GitHub pull request is the best way to submit code for review.
Right! I did it this way. Created a branch atmel-samd in my fork.
Works on ATSAME51J20A custom board. This pull request does not include asf4 configuration, which is board specific.
When I'm listening to this weeks meeting and find a youtube tab in my browser where I hadn't finished last weeks meeting π
Hah! Sounds like something I would do.
thanks - I missed that!
It's not like the 'normal' double-click. ( and the important part - about pausing to hit the second reset when the LEDs are purple - is at the end, instead of noted - perhaps even there, the text should be expanded to note the importance of waiting till the LEDs are purple:
Launch UF2 by double-clicking* the Reset button (the one next to the USB C port). You may have to try a few times to get the timing right.
About a half second pause between clicks *while the DotStars are purple seems to work well.
on the other hand something is still missing on https://learn.adafruit.com/adafruit-funhouse/install-uf2-bootloader
as it only mentions the one click of RESET before HOUSEBOOT and the "half second pause between clicks" almost seems to conflict with the first sentence in Step 4.
@gilded cradle what do you think about rewording that page to say
Click RESET button to launch the bootloader. The DotStars should turn purple, then press reset quickly again. The LEDs should turn red, then green. If you get it right... " (You'll see a new disk drive on your computer with the name HOUSEBOOT.)
@hollow gazelle look again. @gilded cradle just did some updates.
but the first two sentences still say "Click RESET button to launch the bootloader. You'll see a new disk drive on your computer with the name HOUSEBOOT."
after doing just the first click, one is unlikely to see the drive if the funhouse_tinyuf2_combo.zip bin was installed, since the app launches.
The confusion and pain has locked the wait for purple into my mind, but others will likely be confused
@tulip sleet what's the nrf board I gotta get again
Circuit Playground Bluefruit
kthx
Hi
Ok, I think it's worded a bit better now.
Hey, I recently discovered sys.stdout.buffer, which is present on a Feather NRF52 express but not on a Feather M4 (on 6.x or 7.x) I'm not sure what that's for and why it's different ?
I spent some time searching for a github repository where the learn guide for https://learn.adafruit.com/adafruit-funhouse/install-uf2-bootloader might be found ( to create and issue / pull request ), but I think I'm miossing some knowledge about how learn.adafruit.com is constructed. ( Is there some intro document that might help, or is the page in question hidden from the public? )
The editor requires special access. If you have suggestions about the wording, feel free to submit them as guide feedback.
Pulseout for RP2040. Testing was only done using a logic analyzer to look at signals; if someone has a pulseout device to test that would be excellent.
is there a special place to get CP7 .mpy files? ( or should I stick with .py for CP7 )
MpyError: Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info.
Just installed latest code: Adafruit CircuitPython 7.0.0-alpha.2-586-g0ac107b73 on 2021-05-17; Adafruit FunHouse with ESP32S2
and bundle 6 https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20210514/adafruit-circuitpython-bundle-6.x-mpy-20210514.zip
I didn't really expect bundle 6 to work, so I wonder if I should be browsing around to
https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases
to manually fetch adafruit-circuitpython-bundle-7.x-mpy-20210514.zip
from the auto release?
I believe the bundle is up to date with mpy's compatible with alpha 2
that 7.x release from the repo
(and circup, though circup doesn't detect invalid mpy files and will not update them if the library version is the latest)
Download the 7.x mpy from the bundle GitHub repo. Should be up to date.
@solar whale, a search for Blinka now loads the Raspberry Pi Blinka guide first.
@gilded cradle excellent! Thank you!
Thanks, using the released bundle-7.x .zip file brought me to success, where I could run the example code from https://github.com/adafruit/Adafruit_CircuitPython_FunHouse
I heard something about writing a keypad driver. Here's some PIO code I wrote for a 4x4 matrix if it's helpful:
.side_set 4 opt
; A 4x4 keypad driver.
nop side 0b0001 ; Setup to read first row
.wrap_target
start:
mov y, x ; Store last isr value
in pins, 4 side 0b0010 ; Read all columns and select next row
in pins, 4 side 0b0100 ; Read all columns and select next row
in pins, 4 side 0b1000 ; Read all columns and select next row
in pins, 4 side 0b0001 ; Read all columns and select next row
in null, 16
mov x, isr ; Setup for button check
jmp !x, start ; If ISR is zero (no buttons pressed), jump to start
jmp x!=y, pressed ; If ISR is not equal to last value, jump to to push
jmp start
pressed:
push ; Push ISR
.wrap```
NRF isn't returning the correct global object in testing, will resolve tomorrow morning.
I tested disabling CDC and MSD on a QTPy M0, using touchio pins. Works great, thank you!
Gist here: https://gist.github.com/todbot/707e4e3d393313cf31cdab56bf9d4255
@tulip sleet can you get a capture with chip select too?
Can do later
the clock line looks really inconsistent
Led does not turn on
was tested onAdafruit CircuitPython 7.0.0-alpha.2-573-g49bad0797 on 2021-05-14; Adafruit Feather M4 CAN with same51j19aNeopixel only turns green on bootoader mode.
I think this was broken before this change. The M4 CAN has a neopixel power pin that the core doesn't know how to turn on. On some boards with turn it off and on with board_init and board_deinit but I don't see that code for the M4 CAN.
@WarriorOfWire
Thanks for this suggestion! I was able to get the async functions running (almost identical to the code you provided). Part of my issue was self inflicted, I wasn't keeping track of the previous state of the button (ie, long press causing a strobe light effect because there were only two ... ['rainbowwalk', 'off'])
The async polling works great!
Thanks for adding this! RP2 has fallen off my radar. Just a couple questions. It looks good overall. Thanks!
Is this alarm pool statically allocated? I think I disabled it to ensure that the higher layers of the sdk didn't trample our memory allocations.
// Turn pwm pin off by setting duty cyle to 1.
Thanks for fixing this up! Two minor comments. Good otherwise.
(nitpicks)
if (receiver_buffer != NULL) {
self->buffer = receiver_buffer;
} else {
Please only include the active version.
I don't see these pins in my copy. Have you pushed the latest files?
Yup! Thank you @simontorres
@slender iron I can only get two QSPI signals at a time. What would be a good trace to do? CS & SCK, MOSI & MISO?
because I am just holding some needles against the pins (two needles stuck in a cork)
In sdk/src/common/pico_time/time.c I see:
'''
// To avoid bringing in calloc, we statically allocate the arrays and the heap
PHEAP_DEFINE_STATIC(default_alarm_pool_heap, PICO_TIME_DEFAULT_ALARM_POOL_MAX_TIMERS);
'''
Will this be a problem?
Good point!
I beleive it is what I mean, right?
void common_hal_busio_uart_never_reset(busio_uart_obj_t *self) {
for (size_t i = 0; i < MP_ARRAY_SIZE(sercom_insts); i++) {
const Sercom *sercom = sercom_insts[i];
Sercom *hw = (Sercom *)(self->usart_desc.device.hw);
// Reserve pins for active UART only
if (sercom == hw) {
never_reset_sercom(hw);
never_reset_pin_number(self->rx_pin);
never_reset_pin_numbe...
Thanks for fixing this up! Two minor comments. Good otherwise.
Thanks for quick response!
Actually, I have done this intentionally.
I know the rest of the code is written in different manner, but still I believe it is valid point.
Should it be described somewhere here?
https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md
https://en.wikipedia.org/wiki/Yoda_conditions
common-hal/busio/UART.c: In function 'common_hal_busio_uart_construct':
common-hal/bu...
@tulip sleet Is it possible to run mpy-cross on multiple files at the same time without typing them all out? As in, run mpy-cross on a package directory.
no, it only takes one at a time, unfortunately
there is code in the bundle builder and in the frozen-libs builder to handle this
$ mpy-cross ble*.py
multiple input files
Ew. Ok.
see, it complains
That's a bummer. Thanks for letting me know though so I didn't try to fight with it.
I'm working on refactoring the LED Animation library and want to know whether I made the Core lib tiny enough. But ugh. So many mpys still.
it would be simple to write a shell or python script to invoke it multiple times on a directory or a list of arguments.
@idle owl ^^ that script should do what you want
Ahhhh!
Thank you!
also tossed in a definition for the AREF pin which is technically an analog pin!
After the #4689, the Spresense port stopped working. EP descriptor for CDC and MSC set max packet size to 64. For USB_HIGHSPEED this should be 512.
@tulip sleet I... can't figure out how to make it work. First I copied it to the lib directory and finally got it to run, but it fails with mpy-cross: command not found so I thought ok maybe it's supposed to be run from within the circuitpython repo, and I tried that, and same thing.
you need to put mpy-cross in your PATH. Or you can change line 38 to point directly to mpy-cross.
oh ok
for instance, I have this link in my ~/bin directory (which is in my PATH): lrwxrwxrwx 1 halbert halbert 53 Jul 26 2018 mpy-cross -> /home/halbert/repos/circuitpython/mpy-cross/mpy-cross
so that whenever I run mpy-cross, it picks the most recently built one in my circuitpython repo (I actually have several circuitpython repo directories, but that's the main one)
It worked!
I could put /home/halbert/repos/circuitpython/mpy-cross/ , but this is easier
I copied it into the lib directory and changed 38 to cmd = "./mpy-cross -v -v %s -s %s %s -o %s" % (
Thank you!
if that's where you have mpy-cross, great!
@lone axle @mental nexus hihi when you're around next please take a look at https://forums.adafruit.com/viewtopic.php?f=4&t=179310 - ill also tag on github
I am seeing this same glitch on my FunHouse (not as bad) so can help test if anyone needs help
@kmatch98 & @FoamyGuy i think y'all did some hacking on dirty rectangle checking for circuitpy? we're seeing 'speckles' left over on the funhouse demo, it has a lot of text updates!
https://forums.adafruit.com/viewtopic.php?f=4&t=179310
Excellent, thank you! I thought there might be an issue with Spresense given the significant changes in USB, but I hadn't had a chance to test it yet.
Have you tested turning off any devices in boot.py? I hope I handled the endpoint assignment properly given your fixed endpoint assignments, but that is another thing to test.
Oof. I mean, it physically fits on the boards now, but you still can't use more than two animations at a time.
I guess that's better than nothing.
And I may have found a bug in using adafruit_pypixelbuf.
I wish we had NeoPixel frozen into all of the M0 non-Express boards. No idea if it would really help here, but maybe.
I'm sure some animations are better then none. I'd think if you're using a small board you probably don't want a lot usually
You'd be surprised π
But yes. I agree, even being able to run one at a time is good.
Better than at the moment, where the lib doesn't even fit.
I'm finding I can't use PyCharm to edit code.py though, because it's telling me it can't create a backup of the file, and refuses to update the file. I had to open it in Atom to edit it.
That's probably a Bad β’οΈ thing.
What boards are they usually trying to target the animations at? Just trying to think what else could shrink stuff in that library (not sure if I'll think of any)
Ok, so lately it's been M4 (SAMD51) or "better". In theory it fits on an M0 Express board, but if you want to run a lot of animations, you need RAM, so ... But folks want to be able to use a Trinket or whatever to run NeoPixels and do animations. And as of now, it requires writing up all the animation code in code.py and not using the LED Animation library.
I see this uses the portalbase library. I took a quick look at the add_text and set_text functions. It has its own functions for displaying text and doesnβt use the bitmap_label or label libraries. Maybe something in the custom add_text and set_text didnβt have all the updates from the bitmap_label and/or label libraries.
Iβm away from my computer now but if this is still open can take more detailed look this afternoon.
I'm trying to make it work on QT Py M0 (because that's what I have sitting here). I got it going on Neo Trinkey with two animations, but Neo Trinkey has a special build, so it's not as good of an example.
The M0 non-Express boards require both neopixel and adafruit_pypixelbuf because we don't have _pixelbuf enabled in the CircuitPython builds for those boards.
So already more space and so on is taken up on those boards to use NeoPixels (or DotStars, same thing)
Hmmm yeah so more a RAM problem (which comes up quickly). Maybe it wouldn't be helpful but there may be some more rarely used parts of the base animation class that could be trimmed. But then reduces functionality again π
Right. That's what I'm trying to figure out.
If I get a chance later I can glance through the base class again (less familiar with the pixelbuf stuff). See if I remember anything from writing my animations that I may have seen but realized is less used
I'd appreciate that. No idea where I'll be with it later, but ping me first if you like. So we're on the same page still.
For sure. I like blinking lights so LED libraries are fun !
I'm a huge fan as well!
I can't even get comet to run alone on QT Py M0. It's too much.
Blink runs, so it's not the library that's the issue.
It's RAM that is the issue too right now flash storage? Just checking as I did solder the extra storage to my QT Py M0
You can use the basic QT Py M0 build, and it ignores the flash space.
I didn't Haxpress this one up, so it's basic.
I think it's more a RAM thing at this point.
Though like I said, I can't even edit code.py in PyCharm.
so both issue are present at the moment.
yeah I figured storage is a problem, though reducing code size should fix that too by default - usually π
True.
Ooh, comet runs without using AnimationSequence.
And yes, I found a bug in adafruit_pypixelbuf. Just found it again.
I need to test it on a board that doesn't need pypixelbuf to make sure it's not a neopixel failure.
Not sure it would be much but is the "peers" functionality used often? I did doing more advanced animations but I don't think I saw it in any examples
I have no idea! I'd need to check the Learn repo, really.
Though the plan is to make it all seamless.
So it doesn't really matter.
That feature can go into "Advanced" or whatever.
Hi! Hopefully this is the right channel. I've been trying out CircuitPython for STM32F411 'BlackPill' but I can't get USB-HID working.
It's listed as having usb_hid, but I can't import it. (I am using the bin for release 7 alpha 2)
JP made the point that maybe we should simply make it a cutoff that you need an M4 board or better to use the LED Animations library. That we shouldn't make it harder to use on bigger boards to cater to the smaller boards. I don't entirely agree, but I see his point from a usability standpoint.
grumbles
Yeah I'm wondering if some can be pulled out or like how the Portal library works where no one uses the "Basic" animations unless you are on a constrained board... if that makes sense?
Seamless in the sense that the code will work, but you'll have to import another library to make it work.
I think that makes sense, if I understand it correctly, that's what I'm trying to do
Yeah that's what I thought you were. I do like that idea. So the M4+ users its easy mode. But if you want to run it on a real lightweight board here it is
This channel or #help-with-circuitpython works. I'm not sure why you can't import it though.
Even for M4+, you'll still have to import a new library over what you had to import before. π
I mean, we break things. It happens. Better now than in 6 months when the number of projects using it doubles, I guess.
True and if it coincides with a major version change too that makes things easier to take
Good point. Hadn't thought about that.
The module doesn't seem to actually be included in the build, if that's possible
@gleaming agate That's entirely possible. I'm wondering if we removed it for some reason. Thing is, it shouldn't show up in the docs in that case - the docs are generated from the core, I thought.
I don't know why we would have removed it, unless we were running into build failures and had to remove something. That would be something Scott or Dan could answer.
@tulip sleet may have removed it with the usb descriptor changes
ahhh yes. Seeing some relevant github discussion https://github.com/adafruit/circuitpython/issues/4752 that wasn't coming up for 'stm32f411'
I ordered a Feather RP2040 and a pico a few days ago so I will just have to be patient for digikey to ship my order
I'm not even seeing it. Where did you find it?
Ohh right.
That's the first reference to it
Forgot about that.
@dhalbert this applies to imxrt port as well. For highspeed bulk endpoint size must be 512
I'm not even sure I remember how it's used. It might have been the predecessor to future functionality.
No... hmph.
You can use it to say have a solid background or blink, and then put a rainbow on top of it
Ah right
so run multiple animations simultaneously. I can't even remember if I chose to use it in the end
Very strange behavior in the images.
It looks like portalbase is using Label internally in add_text / set_text.
I will be able to dig in a bit more this evening. Hoping to try to isolate the issue into a smaller example maybe without portalbase if possible.
One of the things that JP pointed out was the idea of having a "core" set of animations in a library, and then the rest available as separate libraries would be a bit awkward. Like he would have to check documentation every time to see what he gets built-in, versus what he needs a separate library for.
I don't now how to address that reasonably. But it's a valid point.
From a maintainability aspect it isn't great, but would it make sense to have a "lightweight" package for M0s that is just standalone. Maybe even kinda like how CP is a fork of MP so you could pull some code across?
But really the two libraries stand on their own
I don't quite follow
Unfortunately, we're not super keen on maintaining multiple versions of libraries.
It creates extra work and when it gets forgotten, causes major issues.
Rather then trying to have them linked together in any meaningful way just have LED_animations and LED_animations_M0... maintainability is a pain though
yeah..
I mean folks are doing that already, but not everyone is savvy enough to know how to gut a library to what they need.
Sigh.
It's like that triangle, supportability, ease of use and features and we are trying to pick all 3 π
Yeah. Agreed.
Would it be possible for LED_animations_M0 to be a strict subset of the larger library?
That is still maintaining two sets of the same code, unfortunately.
I don't know of any way to automatically do that. Or how to have it know what subset of things to update.
As the library continues to grow, we'd have to keep track of what needs to be merged into the subset.
I'm doing a truly Canadian thing and walking to Tim Hortons for lunch now though I'll be back around later this afternoon
I see what you mean. Even if it's as simple as "ifndef M0_version" to cut out bits of code, you still have to build and test 2 versions
Have a good lunch!
Exactly.
Though I see where you're going with it.
If there was a way to simply generate two bundled versions of it, I'd be into considering it.
But I don't know of a reasonable way to do that.
Without basically maintaining two libraries.
(bbiaf, also making lunch)
Has there been any progress on this front?
In 6.2.0 I still cannot find a way to use the oboard RGB LED on the Xenon.
@tannewt, if I want to deinit the pin I'd need to know which object to execute the method on (e.g. status_rgb_led_r.deinit()).
But how would I find out which are the correct objects to use?
@dhalbert nevermind, object problems were just a testing mistake. I've tested this and it works across all 4 possible sleep modes on all platforms, NRF/STM/ESP. Should be good to go.
@ionic elk please review https://github.com/adafruit/circuitpython/pull/4743
@ScruffR I think it'll be fixed by https://github.com/adafruit/circuitpython/pull/4743 because it doesn't use the status led during user code execution anymore.
Although it doesn't solve the issue in CircuitPython, I think it's worth mentioning this Arduino library: https://www.onetransistor.eu/2020/03/usb-multimedia-keys-on-arduino-stm32.html
This library worked with my STM32F411 using the stm32duino core, which also appears to explicitly support the F405 Express you have @Gigahawk .
@tulip sleet want to chat here?
sure, one minute, will get a drink of water
@ruby atlas thanks for the "spot instance" tip. it's much cheaper than buying more ram
@slender iron ok, thirst quenched
@tulip sleet does it happen on power up or reset?
I have a 128 winbond I'm going to test with
it happens on power up. several clicks of the reset button can sometimes bring it back. And when you first load the .uf2, it's OK.
kk
but you don't have a "bad" one, is that right?
The first batch of qt py rp2040's are fine. The datecode pictures I posted are helpful. Even if the datecode is a red herring, as Limor said, I think there is some sample variation, and if you have a later chip, that would be the one to try.
I am going to put some SWD wires on the qtpy; I just need to find out which is which
eh, maybe not; they don't come out to pads :/
i will try the pin toggling instead
my itsy rp2040 is also fine
@slender iron I have been testing
One thing I am noticing is that the REPL white light will stay on after restarting, and will remain on if the board enters light or deep sleep
oh ya. I meant to fix that
It happens with other signals in isolated cases I am trying to quantify
what do you mean other signals?
I have noticed it happen with a green LED. But I haven't recreated it yet
where are the LED signals documented?
do we have it documented in the repo?
I didn't change anything
code.py done without error is one green flash
with error is two red
safe mode is three yellow
hmmm
we probably should have it documented somewhere, right?
so green, red, yellow, and white for repl, and that's it, nothing else? What's the blue blink?
I think we have a guide page for it
I've seen a blue thingy before
blue may be the bootloader
that shouldn't happen any more
will it blink blue at all?
there is a 1.5sec delay before writing boot_out.txt if it will change, to make sure the filesystem power is stable. So you usually see it blue for 1.5 secs (in the old RGB scheme) when the version number changes due to new commits, etc.
and no more colored flashes for exception type, at all
correct
Ok, other weirdness. When waking from true deep sleep, it plays the safe mode triple blink
Two more pins I think you'll want. Thanks for updating the files!
I think you'll want D13 and an alias LED for it too.
Want to add the buzzer too?
does it show a safe mode message in the serial connection?
my logic looks ok
no
well, actually, this only happens in true deep sleep so it's a little hard to check. But it's clearly waking up properly on my timealarms so it can't be safe mode proper
what port?
I'm checking out the logic now. Also have question (will post on github) about removing the board_init when waking from fake sleep, don't we want that to align with deep sleep for stuff like display init? or does it actually cause problems?
stm
feather f405
I can check on another, it's just what I had plugged in
board_init is done after the loop still I think
is it doing the three yellow blinks once after deep sleep resumes?
Ah, I see, I didn't read the logic all the way through, you really moved things around
that's not the steady state. it does that on start up for when you can press reset to stay in safe mode
(we shouldn't do it after a deep sleep wake up though)
Oh, yeah, that's it. Yes, probably turn it off for deep sleep wakes
Does CircuitPython have a screen dump feature now? Would that help a little to narrow down where the problem lies? Ah, I think this is what I was thinking of, it's actually a Bitmap dumper: https://circuitpython.readthedocs.io/projects/bitmapsaver/en/latest/api.html
actually it should skip it
wait, so is the triple yellow only for signifying when you can trigger safe mode? Or does one also happen when you hit it by accident?
line 61 of safe_mode.c
like a hard crash
it should blink yellow every 5 seconds when in safe mode
and it does two sort of shorter yellow blinks when it starts into safe mode, right?
I see no periodic 5s blinks though
if your code is running, then it won't blink
no code, just sitting in safe mode.
I see a triple blink, hit reset, see two slower blinks, then it stays off.
hrm
It's also a little confusing to have the "entered safe mode" sequence be the same color as the "hit now to trigger safe mode" sequence
the only difference is how fast the LEDs blink
I like the consistency
if you think it's fine, it's fine.
If this is an issue with the SPI writes to the screen, there's another ESP32-S2 mystery in #3835 about glitches perhaps related to timing for NeoPixel protocol
@slender iron I am working backwards. I toggled a pin on in main(), and it never got there in the bad case (my LED lights when it does work). Now instrumenting stage2.c.jinja, but there's not much room in there. I didn't get the pin high yet, working on that (calling the gpio functions takes too much room).
@slender iron Ok, repl fix looks good, thanks! If you can fix the deep sleep safe mode blink skip, and the safe mode 5s issue, it looks good to me. I really like how it simplifies all the microcontroller pin files.
Also, CI is cancelling all my builds of the alarm API changes
ya, I saw that too
github is in rough shape
like, in general? or just today
I mean the only reason it's testing at all is I just pushed a fast forward merge with main so we can probably just merge it, the last build was fine and there aren't any changes since then.
just today: see https://githubstatus.com
you can probably remove the quad enable piece
looks green to me but I assume it wasn't earlier
still says it's cancelling my checks but maybe it isn't actually? I might just push a whitespace change
think it's ok to not have a REPL led state?
as in, not have it turn on at all when the repl is on?
right
I just switched the code so board_init is only done when we need it
and leave it up to user code otherwise
Yeah, having the LED be up to user code as much as possible makes sense.
this change makes the user responsible for any power enable pins too
If we were to keep it, I would at least change the color - white is what happens to the Neopixels when they glitch out a lot of the time so I try not to use it in my sketches
I think I'll remove it
@slender iron I think that's reasonable, just my vote but yeah
(that's true about white too)
It should get turned off though, right?
what do you mean
I was going to suggest that repl be purple or something, is what I meant
π
Firmware
Adafruit CircuitPython 6.2.0 on 2021-04-05; FeatherS2 PreRelease with ESP32S2
Code/REPL & Behavior
CPython allows combining comma and float string format specifiers:
Python 2.7.17
>>> x = 1234567.55
>>> print("{:9,.1f}".format(x))
1,234,567.6
CircuitPython ignores the comma with a float (ignore the precision issue)
Adafruit CircuitPython 6.2.0 on 2021-04-05; FeatherS2 PreRelease with ESP32S2
>>> x = 1234567.55
>>...
@foamyguy, thanks for the correction about using bitmap_label.
I modified the code to run on the PyPortal and am unable to replicate the issue.
As @kevinjwalters suggests, is it possibly an SPI writing issue? Looking at the image, it looks like text is being written in the locations where text is never requested (for example to the right of "Slider" or left of "SENSOR1").
->>>> If the SPI speed is adjustable, can someone with the FunHouse hardware try the exampl...
hmm @makermelissa can you reproduce the issue? maybe we need to slow down the TFT display?
I have it fairly reliably glitching on my funhouse, I will try to replicate it and look at the SPI speed later today.
The default_bg=0x0F0F00 of is useful in this case as it also reveals the mostly-black pair of vertical lines on the left side is suspicious and also makes it look like it's not just some minor errors in font rendering.
I am not sure I understand your comment correctly.
Let me try to explain my idea.
common_hal_busio_uart_never_reset()reserves the HW module (SERCOM) and correspending pins in order to avoid reseting of them it later on for some reason.common_hal_busio_uart_never_reset()is called, for instance, fromserial_early_init()during initialization phase. The allocated UART objectdebug_uartis passed as argument value tocommon_hal_busio_uart_never_reset();
supervisor/sha...
I was just checking if max_size is used anymore on displayio.Group. I had a feeling it had gone dynamic. I noticed the docs say: "max_size (int) β Ignored. Will be removed in 7.x." - What does "removed" mean there? Does that mean supplying it as an argument will cause an error? There's a lot of existing code using max_size. https://circuitpython.readthedocs.io/en/latest/shared-bindings/displayio/#displayio.Group
@slender iron I am trying to turn a pin on in _stage2_boot. Identical code works fine in main() and DOES turn on the pin. It is pruned down to the minimal register settings. Is there any reason you know of why using a GPIO pin would fail in _stage2_boot?
When _stage2_boot finishes, does it exit to the reset handler or jump directly to CPy?
i have spent like an hour on this -- frustrating.
worked fine in main()
#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h"
#include "src/rp2040/hardware_structs/include/hardware/structs/iobank0.h"
#define PIN (29)
#define PIN_MASK (1ul << PIN)
#define A0_ON \
iobank0_hw->io[PIN].ctrl = GPIO_FUNC_SIO << IO_BANK0_GPIO0_CTRL_FUNCSEL_LSB; \
sio_hw->gpio_oe_set = PIN_MASK; \
sio_hw->gpio_set = PIN_MASK; \
while(true);
// This must be the first defined function so that it is placed at the start of
// memory where the bootloader jumps to!
void __attribute__((section(".entry._stage2_boot"), used)) _stage2_boot(void) {
A0_ON;
uint32_t lr;
asm ("MOV %0, LR\n" : "=r" (lr) );
it only fits because the while(true) causes the rest of the function to be dead code (which is fine for my purposes right now)
@tulip sleet reset jumps to cpy's reset handler
so maybe the stage 1 bootloader is frotzing with something that is breaking GPIO for me
if it's not twiddling from stage2 it may not be executing it at all
but if I put A0_ON in main(), the LED lights, that's the weird thing. hmm, i think i got it maybe: the UF2 bootloader loads the UF2, and goes directly there, the first time?
so that's why it's not entering stage 2?
maybeeeeeee
and why things work the first time the UF2 is loaded?
the first load also means everything has longer to start up
but stage2 never gets successfully loaded from flash
current behavior is that CPy starts after UF2 is loaded. A subsequent power cycle doesn't work. Occasionally pressing reset multiple times makes it come up
so if I do a microcontroller.reset() from CPy it may not come up
hmm
weird
the flash does need an exit command I thinkkkkk
you can drive a pin from the IOBANK directly
without needing to use SIO?
ya, OUTOVER and OEOVER
I can try that too
I doubt it'll help but it might
lemme just try the reset first
(section 2.19.6 in my copy of the datasheet)
microcontroller.reset() and storage.erase_filesystem() both come back to the REPL
so this is just a first-power-on problem
i am surprised by that
if you wait a while when it fails do you get to the bootloader?
like how long?
10 seconds?
i'll see; i don't think so
I think that's what it does if all the loads fail
no, it's just sitting
hrm
I"ll try the OUTOVER and OEOVER, but I think you're right, it's not actually getting to _stage2_boot
the ds says its only 5 ms to full capability
I think it should go to the bootloader if stage2 isn't loaded right though
lunchtime for me
π₯ͺ
of course I'll let you know if I find out anything else
@slender iron This works in main, and again is not lighting up in _stage_2_boot:
#define A0_ON \
iobank0_hw->io[29].ctrl = \
(IO_BANK0_GPIO29_CTRL_OEOVER_VALUE_ENABLE << IO_BANK0_GPIO29_CTRL_OEOVER_LSB) | \
(IO_BANK0_GPIO29_CTRL_OUTOVER_VALUE_HIGH << IO_BANK0_GPIO29_CTRL_OUTOVER_LSB); \
while(true);
OEOVER makes me think French.
"OEOVER the sea to Skye"
I can't get my pico to work after programming it with a jlink without having to physically remove the power cable and plug it back in - I have to restart Jlink and GDB every time, so it's kind of a pain when debugging. Does that happen to anyone else? Is there a way around it?
I assume it's because Jlink restarts it into the bootloader, but it gets stuck there for some reason
Adafruit (Kattni Rembor, Tony DiCola) wrote and provided the Adafruit_CircuitPython_74HC595 driver library that can be used to add more digital outputs to a CircuitPython compatible board using the 74HC595 8-bit serial-in parallel-out (SIPO) shift register IC.
I have been working on a complementary project to add more digital inputs using the 74HC165 8-bit parallel-in serial-out (PISO) shift register IC. I copied and reversed/modified the original adafruit_74hc595.py library into a 74h...
back. I think you really need to get a full capture of the SPI
i will have to do some tiny wire on the RP2040 pins; the flash pins are barely accessible. Maybe I can try 4 sewing needles.
I will try disabling stage2 completely (like put a while(true) at the beginning and see if I go to CPy and do a reset without ever hitting it
π
maybe you should order a few fresh qt py's to see if you can get a flaky one
Limor was going to try a few as well; maybe she can pre-select one for you
sure, or you can send me one
i only have the one
kk
@slender iron you are the most knowledgeable person to work on this, so i can send it if I get stuck
getting clk, cs and mosi would be a good start
those three will show you the commands being sent
i sent a clock and mosi trace last night, it did not include cs, but there is nothing else on the bus
@tulip sleet I have a fix for clicking reset into safe mode on the rp2040
cs is good for ensuring the decoder starts at the right place
i will get that started
What is it?
the memory that stores the value for safe mode now gets reset by the button
so I moved it
Huh. Fair enough.
extern uint32_t __scratch_x_start__;
void port_set_saved_word(uint32_t value) {
__scratch_x_start__ = value;
}
uint32_t port_get_saved_word(void) {
return __scratch_x_start__;
}
in supervisor/port.c
in ports/rp2040
nice
so you were right π it was completely broken
I knew that one wasn't a me-problem. π
is there ram that is not reset by the reset button?
hmm how big is it?
That's massive. Relatively speaking.
and maybe it lasts through deep sleep, hmm
@slender iron no, if I disable stage2 completely, it does not start CPy after loading the UF2. But perhaps the ROM bootloader leaves things in a strange state when entering stage2
ya, perhaps. I don't think stage2 resets everything
i am trying to turn on the LED as the very first thing, and then I infinite-loop, so there's nothing else that is happening
and does the led turn on?
is it an external led?
yes, and I also checked the voltage on the pin
can you verify the pin number is right from cp?
the identical code works in main() to turn on the LED, GPIO29, A0. I set to to never reset and removed it from pins.c
I literally copy/pasted the code
hrm
exactly π
try another pin?
sure
you know it's in stage2 because it hits your while loop right?
want to screenshare and walk me through it?
sure, hold on
Couple things I have discovered:
-
Changed the SPI baud rate ranging from 30Mhz to 60Mhz - no effect
-
I can see the vertical lines draw on the screen while the background is filling in (used 0x0F0F00 as a BG color). The glitch always seems to be a black line with bright white pixels in a few locations. As the display is rotated 270 by default this is really is a horizontal line on the physical display.
-
Labels drawn after the background overwrite the "glitch".
Given this it s...
[adafruit/circuitpython] New comment on issue #4777: Adafruit\_CircuitPython\_74HC165 Driver Library
hi sure, we accept any/all drivers into the bundle that are cookiecutter'd then submit it as a submodule - if you need help with that you can open an issue on the bundle repo :)
@slender iron Is there an open-source alternative to a j-link? I searched the chat and can't find a mention of something specific, but I feel like you're aware of something.
black magic probe is one. any stlink would work too
you can use rp2040's "picoprobe"
Ok
Added ADC and DAC support for STM32F746ZG. Tested on STM32F746ZG Nucleo. ADC supported on pins A0 to A5 and DAC on default pins.
@hierophect I did the PR.
I replicated the issue on an ESP32-S2 Saola with a generic ILI9341 display (320x240) running either CircuitPython v6.2 or 6.1.
I disconnected from my PC and ran with directly from a power adapter and same display glitch was observed.
Note: It takes a while for it to get severe, so you may need to wait several minutes for it to show up distinctly. While running, I observed that some of the redraws of the text are only partially refreshed, but then were overdrawn correctly when the next ...
Firmware
Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather STM32F405 Express with STM32F405RG
Code/REPL
arr = [1, 2, 3]
print(arr) # [1, 2, 3]
print(arr[1:]) # [2, 3]
print(f"asdf{arr}") # asdf[1, 2, 3]
print(f"asdf{arr[1:]}") # should be asdf[2, 3]
Behavior
Traceback (most recent call last):
File "", line 1
SyntaxError: invalid syntax
I'm using an M1 Mac for compiling, following the Markdown pages. I was successful in compiling the "/ports/atmel-samd" ports, specifically the "circuitplayground_express".
However, when I attempt to compile to any board within "/ports/nrf" I encounter an implicit declaration compiling error with ulab.
../../extmod/ulab/code/ndarray.c: In function 'ndarray_object_is_array_like':
../../extmod/ulab/code/ndarray.c:364:8: error: implicit declaration of function 'mp_obj_is_type'; did y...
Thanks, and good to know :+1:
I'll be waiting for 7.0.0 then as I'm not desperately needing the onboard RGB LED right now. Enough other stuff to do first :blush:
@dhalbert I tried these two functions and they worked:
storage.disable_usb_device()
usb_cdc.enable(console=False, data=False)
Do you know why the tests are not working?
anyone can send me codes for game development
but this is a part with a game i need codes for game development with coding
all the source code is available there
Other fstring tickets: #4780
Other format tickets: #4776
Do you know why the tests are not working?
GitHub Actions has had a lot of trouble in the past day. https://www.githubstatus.com/ looks OK now, but if you click on Incident History, you'll see an extended period yesterday when it was not doing well.
MIDI also needs this same fix, so I will push a commit for it as well.
@dhalbert this applies to imxrt port as well. For highspeed bulk endpoint size must be 512
Thanks -- it is port-independent code and will be applied across all.
Excellent, thank you! I thought there might be an issue with Spresense given the significant changes in USB, but I hadn't had a chance to test it yet.
Have you tested turning off any devices in boot.py? I hope I handled the endpoint assignment properly given your fixed endpoint assignments, but that is another thing to test.
Update: I tried slowing the SPI bus down even further and noticed the rate of corruption lowered. At 5Mhz after running all night there are no problems on the screen.
The display seems to draw at the same speed as when the bus was set at 60Mhz but I haven't done any timings. At the moment I'm at a dead-end as to why this would fix the problem but it would be a potential short-term fix if required.
The line I changed to 5000000 is: https://github.com/adafruit/circuitpython/blob/8c0f3...
so, to implement https://github.com/adafruit/circuitpython/issues/4638 there's a list of STEMMA QT boards https://circuitpython.org/downloads?features=STEMMA+QT%2FQWIIC any idea of how to find boards with non-QT stemma I2C ports ?
I can't come up with a search that pulls them all, but I think it was only done for a short span of time... PyPortals, PyBadges, PyGamer
@jaunty juniper I now have access to an M1 Mac to test on. Your code looks like it's fine -- it's something wonky with mu and maybe not importing the proper version of the library, even though I updated it in Mu's venv.
my work here is done then π flies away
i hope so -- thanks very much!
@gamblor21 good find.
I replicated this success with an ESP32-S2 Saola with an ILI9341 display, by changing to baudrate=5_000_000 in the displayio.FourWire setup:
spi = busio.SPI(clock=board.IO1, MOSI=board.IO2, MISO=board.IO3)
display_bus = displayio.FourWire(
spi,
command=board.IO4,
chip_select=board.IO5,
re...
it's kind of weird to add STEMMA_I2C to a sparkfun board π¬
Please replace all of this with #include STM32_HAL_H
Just a couple of notes about includes and style stuff, since you said you were still working on this - let me know when you feel this is ready for some hands on testing and I'll give it a shot.
Does the LL use prevent you from using #include STM32_HAL_H here (that's a macro for <stm32$(MCU_SERIES_LOWER)xx_hal.h>)? It's been a little while so I don't remember if LL files get included with that. if STM32_HAL_H doesn't work, please simplify these if statements to use CPY_STM32F4, CPY_STM32F7, CPY_STM32H7 instead of repeating for every MCU variant.
ditto for #include STM32_HAL_H
- Updated pinout to include servo pin access
- Add SoftDevice version to Bluebird mpconfigboard.mk
I pushed a change, though there was git strangeness. I had to push twice.
Note also that we are using automated C code formatting now, and it indents the #ifs. You can set this up for yourself by doing:
$ sudo add-apt-repository ppa:pybricks/ppa
$ sudo apt-get update
$ sudo apt install uncrustify
$ pip3 install pre-commit
$ cd <your repo clone>
$ pre-commit install # only need to do this once
From this point on, it will run some checks before each commit, reformattin...
I'm referring to the outer preprocessor if #if (1). It is selecting between the two implementations and picking the first. Therefore, it's the version you tested with. I'm ok with you using the other version. You just need to remove the outer preprocessor #if and ensure that the second implementation works as expected.
What does your git status show? My guess is that your ulab submodule isn't synced up.
master is no longer used. main is the main branch. I tried to switch the PR but it looks like you'll need to rebase your commits onto main.
any objections to me deleting the master branch on github? we've been on main for a while
none. only reason would be to retain any work there i guess. but that's all been safely moved, right?
ya, main should contain everything it has
No, please do it. I keep getting history that links to it and it messes with me every time.
(and much more at this point)
"Why are there only 6 boards in here?! oh right, master."
π
That's my plan with the libs. Delete it.
yah, things that might still be referencing it could break, but they should. and when they do, can update.
I'd rather it error and force folks to move to main than to deal with the nonsense of folks submitting to the wrong branch.
^^ yah
Are the issues really that fundamental? They seem to accept in that thread that some amount of development work could provide a solution. Unfortunately, it isn't clear what that work entails.
@twilit kiln was selected as a GSoC student under BeagleBoard.org mentorship this year and is looking to tackle this problem under the scope of his project.
We have talked about it with some zephyr people in addition, in live conversations. It's a big job and this was a stumbling block. We thought perhaps we could use the zephyr BLE stacks, etc., but it was faster to use, say nRF SoftDevice instead to get what we wanted at the time.
If @twilit kiln is interested in working on it, that's great -- I was just warning it was not a casual project at all. @slender iron would you have some comments here too, like getting in touch with the right zephyr people?
@slender iron has talked to the zephyr folks personally; I have not.
Out of curiosity and not knowing what's going on, what was the move from master to main about?
I know the zephyr folks have been working on a pinctrl api. I'm not sure what the current state is.
mhelm would be the best person to ask probably. they did the micropython port
circuitpython is more tightly coupled to tinyusb than micropython is
though the spresense port doesn't use tinyusb
Ah, history... got it. thanks
Can you please tell me where should I start working from exactly, because honestly speaking it is looking a bit overwhelming, so if I could get an idea from ground up it would be very helpful.
there isn't a simple answer
a good place to start would probably be a video chat between @latent sapphire @twilit kiln and myself. I can ask mhelm for tips too
That would be great.
You could get acquainted by looking at https://learn.adafruit.com/building-circuitpython and then looking at the "Design and Porting Reference" here: https://circuitpython.readthedocs.io/en/latest/README.html. It's not necessarily completely up to date but is largely accurate.
Thank you @tulip sleet will surely have a look.
Much of what you may need to deal with are build system issues, not necessarily simple porting issues.
@idle owl do you know if our neopixel examples and guides talk about NEOPIXEL_POWER?
for the boards that require power enabled to the neopixel
I think some of them do. I'm uncertain about across the board. Let me check one.
No maybe not.
Thanks for the idea to look at my git. The issue was seemingly due to switching to the "6.3.x" branch, as I was following this guide:
https://learn.adafruit.com/building-circuitpython/build-circuitpython
I switched back to "main" branch and it now compiles successfully. Thanks!
@tulip sleet I'm co-mentoring @twilit kiln for Beagle GSOC. I've also got friends/co-workers in Zephyr space. Hopefully we can come to some path forward.
@hoary moat great! want to facilitate a video chat?
Isn't it enabled by default in CircuitPython?
currently on some boards yes. I think I'm going to change that though with my status led rework
@slender iron I can certainly help faciliate... networking is my strongest skill π
yup, I'm turning that off π
No it's not mentioned because it's seamless at the moment. That would mean changing a lot of things including templates, I think.
Oi. Ok.
It is what it is. But it will end up being a pain for me.
so turning it on and leaving it isn't very power efficient
@twilit kiln there is a MicroPython port to Zephyr, which can serve as an example for some things. I don't know how complete it is. The ESP32-S2 and Spresense (cxd56) ports in CircuitPython would also be interesting because they're on top of an RTOS, unlike the other ports which are bare metal.
Tested on a QT Py RP2040 with a "slow" double-click. Worked first try for me even without visual feedback. Thanks!
Oh, yes sure! I made the changes in the code.
@slender iron are you around. Topic DPS310 Memory reduction improvement. just I think it would be effective if I explain here and we can go back and forth π if you have some time
yup!
good idea π
so, if you use only the code in the _init__ that could load the sensor for thee QTPy
is the same
ok nice!
however, as we discussed we do not want separate libraries, so I need to packaged with another file that contains all the features (rate, mode, etc)
but when I do that, it does not work in .py version
so basically I have the init with the basic configuration + another file
but it does not load when I have it like that, do not understand why t gives memory error If I am not loading the second file in the import
what is the import you are using?
I really would appreciate if you would also look at the:
microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)
I use from adafruit_dps310 import DPS310
maybe the basic version needs to be in a basic.py file
meaning I am using the class from the new init file
good point
so we do two files as always?
from adafruit_dps310.basic import DPS310 maybe?
@jposada202020 Please test the latest artifacts. The M4 CAN has a power enable pin for the neopixel that should now be handled.
@hierophect I've fixed the STM safe mode blinks too. It didn't have the reset reason implemented which caused CP to wait for safe mode reset after each deep sleep.
@slender iron I believe the MagTag wants NEOPIXEL_POWER brought down to enable power (while everyone else wants it up)
I'm picking up this PR as a way to get back into nRF work.
As long as we're not bloating the lib.
so i'm trying to get circuipython running on the new arduino nano rp2040 and have a question about flash. it's using the AT25SF128A which is listed here: https://github.com/adafruit/nvm.toml/blob/main/flash/adesto-tech/AT25SF128A.toml - but when i try to insert it into mpconfigboard.mk it doesn't build. i get GEN stage2.c.jinja {'sku': ['AT25SF128A']}...shared_value = nvms[0].get(key, default) IndexError: list index out of range
i tried to see if there was like an array of flash for the rp2040 chips and maybe that one just wasn't there since it looks like it was added for an imx board, which was building for me, but couldn't find anything. this is also my first time doing this so apologies if i'm missing something obvious
[adafruit/circuitpython] New branch created: pb\-pins
@still zephyr You around?
I'm not super familiar with this area but I don't see that flash chip in my CP repo, is the NVM submodule in CP not up to the latest?
yes π
There's a lot going on in this PR: https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer/pull/21 including a comment in the code that is... unnecessary at best and inappropriate at worst... and a LOT of pylint: disablehappening.
That doesn't even get to it using libraries that CircuitPython can't use.
I see, no problem
I feel like turning it into an example might be an ok idea, specifying it for Raspberry Pi.
ok I will propose that, and verify the code also
Otherwise, like kmatch said, we have to translate it all to CP-compatible stuff.
I agree wwe have other libraries with examples for Raspberry pi, so I think this is the better way
Alright. I haven't heard from the original author since ages ago, so I think you would need to switch it to an example to get it added to the repo.
No problem I will comment and do that
Thank you!
You are welcome π
i was having trouble finding the location of the list in the repo. where is it?
yeah it isn't showing for me either actually. the imxrt1010_evk does build with it listed though
Not sure if you can update the submodule itself or just copy/paste the needed chip in there to test? changed the branch a submodule points to is beyond my git experience!
okay thank you! i'll try that out. fwiw i left the pico's flash in as a test and did get the arduino blinking with circuitpython π
That's awesome! I just saw your tweet about this right before I saw your question. Good luck, feel free to ping me with any questions
thank you!
you can git checkout main in data/nvm.toml, and do git pull, which should pull it to the latest commit.
thank you! i will try that πΊ
that worked!
I don't know why it's slightly out of date, but a PR to bring it up to date would be great.
You don't need to do more than you did. When you commit that change in circuitpython, it will pin that commit as the submodule's chosen commit.
okay awesome, thank you so much! i'm going to try to get this all set this week
[adafruit/circuitpython] New branch created: pb\-pins
thanks for adding support @candid sun !
no problem! i'm excited πΊ
@tannewt oh, whoops. I will take care of that and make a new PR to main. Thanks!
Tested on
Adafruit CircuitPython 7.0.0-alpha.2-608-gd134e2af8 on 2021-05-19; Adafruit Feather M4 CAN with same51j19a
Results
REPL : NO light
Init : 3 Yellow - 1 Green
Code Running: 1 Green every 5-6 sec
Code Error: 2 Reds
Bootloader: Green all the time
any suggestions for the name of NEOPIXEL_POWER when inverted? maybe NEOPIXEL_POWER_INVERTED
That's about as clear as you're going to get with it. Though without context, that wouldn't mean much to me. Why is it inverted? (I mean, I know now, but I'm saying in general... if we hadn't talked about the pull downs, even I would have been confused.;)
But I guess we can teach folks what it means.
Document it. Or leave it to me to document it.... since that's usually how it goes π
not sure if it would be more clear but NEOPIXEL_POWER_OFF ?
I don't think it's about on and off, I thought it was with relation to the pull direction... Maybe I'm still confused.
its a matter of what setting turns the power on
there is probably a pull to set it when we don't drive it
this is for consistent naming of the pin, like LED, so people can use it programmatically across boards?
I checked the Arduino ESP32S2 library and noticed the default SPI bus is set at 1Mhz. I didn't have time to do any extensive testing (there doesn't seem to be a public method to change the bus frequency in Arduino). But may explain why it seems normal on Arduino but not on CP.
@dhalbert Please do a final review on this. I tested it on a Clue and read the RSSI changes with nRF Connect on my phone.
Yeah this wasn't ready for a PR but I did it on request lol. It was just a dirty hack to get it up and running. Give me about a week and I'll add full support and testing, I'm also working on porting a few built-in libraries that are missing and adding them to this board as well.
NEOPIXEL_POWER_ENABLE_LOW ??
NEOPIXEL_POWER_ON_WHEN_LOW
NEOPIXEL_POWER_LOW
NEOPIXEL_POWER_HIGH = NEOPIXEL_POWER
NEOPIXEL_POWER_ACTIVE_LOW
On 6.2.0 on a Feather nRF52840 Express using the singleton from board.I2C():
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather nRF52840 Express with nRF52840
>>> import board
>>> i2c = board.I2C()
>>> i2c.try_lock()
True
>>> ["{:2x}".format(x) for x in i2c.scan()]
[' 8', '23', '76']
>>> ["{:02x}".format(x) for x in i2c.scan()]
['23', '76']
>>> ["{:02x}".format(x) for x in i2c.scan()]
['23', '76']
>>> ...
@lastthyme I don't think this is what you are wanting to do.
TThanks! This is a very old bug. It has been true since 5.0.0, probably ever since we started supporting I2C displays. shared-module/busio/__init__.c needs to unlock the board.I2C() object, as it already does to to the board.SPI() object.
@gilded cradle I went through the guide to install Blinka on a Raspberry Pi Pico and ran into a few issues. I had some files already on the system and when I went to copy everything over, I started getting "management Errors" in Thonny. I think it was running out of space. The aadafruit_blinka src folder is over 1 Mbyte itself! I finally got it to work by deleting everything and reinstalling. The bme280 example runs fine. But if I try to copy more files to the Pico I get the "management error" again. SO just to test, I went into the adafruit_blinka/board folder and remved everything except the raspberrypi folder and the pioc_u2if.py file -- It still works!!
If I try to look at the file system with uos.statvfs("/") I still get odd results `(4096, 4096, 352, -53, -53, -0, 0, 0, 0, 255) but it is better that with all the the files loaded ( the -53 was -139) I'm confused as to what teh negative numbers mean for free space....
I just wanted to give you a heads up. I'll put this in an issue and keep poking around at it.
@tulip sleet do you know what it means to get negative values in response to statvs? when testing with micropython on a Pico I get uos.statvfs("/") (4096, 4096, 352, -53, -53, -0, 0, 0, 0, 255) Does that make any sense to you?
I think it means there is a bug π
That was my thought -- thanks for confirming.
There are a lot of files copied to the system > 200
I think micropython on the pico might be using littlefs, not FAT, because it does not expose a drive.
ah -- good point -- Do you know how large the file system should be?
you could file an issue on micropython
I'll do a bit more testing then I will -- thanks
We were doing the same @solar whale π I found another issue, using another sensor.
@gilded cradle for your info:
Traceback (most recent call last):
File "<stdin>", line 10, in <module>
File "/lib/adafruit_adt7410.py", line 94, in __init__
File "/lib/adafruit_adt7410.py", line 130, in _read_register
File "/lib/adafruit_bus_device/i2c_device.py", line 125, in write_then_readinto
File "/lib/busio.py", line 147, in writeto_then_readfrom
File "/lib/adafruit_blinka/microcontroller/rp2040/i2c.py", line 55, in writeto_then_readfrom
AttributeError: 'I2C' object has no attribute 'writeto_then_readfrom'
that I don't know -- there is not an obvious constant. Something is 1408 *1024, but I'm not sure if it's the filesystem or the space reserved for firmware
@still zephyr did you get the "management Errors" in Thonny?
yes I did, I did the same as you, erase some boards
OK -- good to know.
@tulip sleet ok -- but likely 1-2 Mbytes so running out of space makes sense with all the Blinka files.
@still zephyr I found that when that error occurred, the files being copied were truncated.
ohh ok I will try again starting from scratch tonight and post my results again, thanks @solar whale
I'll try and ADT7410 if I can find it π
I could try another, but that is obviously the first in my box π
found it! will test in a few minutes
Cool Thanks π
@still zephyr Same error here
Thanks π
@still zephyr I created an issue for the file system issues on Blinka https://github.com/adafruit/Adafruit_Blinka/issues/472 just to track it.
Thanks @solar whale
Ooh -- I was alos able to remove all byt rp2040 and pico_u2if from the microcontroller folder -- lots of files
@dhalbert Thank you for the information! I will use it next time.
Did I dupe an existing issue? I had a quick look and couldn't find anything obvious.
Did I dupe an existing issue? I had a quick look and couldn't find anything obvious.
No, I just mean it has lain undiscovered for quite a while.
Unrelated to the issue here, there's a strange address 0x08 (device?) in there which appears on first query and not afterwards. I've got it attached to a Pimoroni Enviro+ FeatherWing which has an LTR-559 (0x23) and BME280 (0x76) and nothing else AFAIK...
@mew-cx How far did you get with this?
>>> ["{:02x}".format(x) for x in i2c.scan()]
['08', '23', '69', '76']
@slender iron What build of CircuitPython do I need to test with to verify the NeoPixel PR?
@ArmstrongSubero it's no problem - my review wasn't intended to put pressure on you, I just wanted to let you know about those include macros and the tools scripts in case they could help you out. Take as much time as you need.
I have an Itsy RP2040 and a MagTag
@idle owl from here: https://github.com/adafruit/circuitpython/actions/runs/858645842
Thanks
@slender iron Tested, merged and released. Do you want me to approve the CP PR as well? Or does that need more testing?
I just pushed a new version so it may need one final test
@slender iron Purple, then three yellow flashes on MagTag. I can't get into safe mode though if I'm supposed to be able to.
Is it supposed to do anything beyond that?
Blink-wise
press boot instead of reset in the safe mode window
Ah keen. Ok.
LED sounds correct
Now it's blinking yellow every so many whatever.
the ESP32-S2 "reset" actually turns power off
Running in safe mode! Not running saved code.
You are in safe mode because:
You requested starting safe mode by pressing boot button at start up.```
Tested final change on MagTag. LEDs are acting as expected - purple, three yellow blinks on startup, and blinking three yellows when in safe mode.
π
@idle owl did you test on itsybitsy 2040 ? it should then close https://github.com/adafruit/circuitpython/issues/4448 (and 4451)
It shows yellow, but I can't get it into safe mode. @slender iron I tried reset and boot each. Is there some trick for the Itsy RP2040 to get into safe mode?
So ostensibly that issue can be closed because it was specific to the LED showing up yellow, not safe mode. Safe mode should probably be another issue if it's still a problem. The LED does show yellow on startup on Itsy.
QT Py RP, same thing. LED blinks yellow as it should, but I can't get into safe mode.
Is that still in another PR?
oh there's another PR fixing safe mode on 2040 that was just merged I believe
@idle owl the build I pointed you to may not have the fix
OK!
the PR has a pending CI build that should
Then yes, @jaunty juniper we can close that issue.
(I fixed it separately)
I realised that after I asked again.
np π
This is resolved by #4743. It can be closed when that PR is merged. Tested on both Itsy and QT Py.
Is GitHub having problems again today?
when is github not having problems
been loading ok for me
Apparently, yes
https://www.githubstatus.com/
Welcome to GitHub's home for real-time and historical data on system performance.
Thanks π
Adding CircuitPython support for the Arduino Nano RP2040 Connect. Have tested all digital and analog I/O, I2C, onboard LSM6DSOX. Uses the AT25SF128A external flash.
Based on the notes from @gamblor21 on the funhouse and my testing on the Saola, this suggests that changing the default SPI baud rate to 5 MHz or less will solve this issue for all ESP32-S2 boards.
Is there one file we can update to make the default SPI baud rate consistent across all the ESP32-S2 boards? If someone points me in the right direction I can make a PR.
Running in safe mode! Not running saved code.
You are in safe mode: something unanticipated happened.
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.```
Did not request π
Ouch.
This example dumps into the hardfault handler every time.
Setting up the NeoPixel causes it.
on NeoKey Trinkey.

No, setting up the NeoPixel after setting up other things causes it. Need to troubleshoot this further.
Setting up the NeoPIxel after setting up the keyboard causes it.
@kmatch98 Is this a workaround or a fix? How fast do other non-ESP32-S2 boards send over SPI to the screen like Gizmo or CLUE?
This should go into safe mode with a "too many USB devices" message, but instead if you look at usb_hid.devices after it runs, it prints a few and then hangs.
import usb_hid
usb_hid.enable((
usb_hid.Device.KEYBOARD,
usb_hid.Device.KEYBOARD,
usb_hid.Device.KEYBOARD,
usb_hid.Device.KEYBOARD,
usb_hid.Device.KEYBOARD,
usb_hid.Device.KEYBOARD,
usb_hid.Device.KEYBOARD,
usb_hid.Device.KEYBOARD,
usb_hid.Device.KEYBOARD,
)
)
anyone want to test pwm on imx? https://forums.adafruit.com/viewtopic.php?f=60&t=179036
I suspect this is a workaround, but maybe a fix is warranted. I'm not well-versed enough to understand how to fix. If there is urgent timing for deploying a temporary solution, then maybe a workaround is a start?
In the code, the displayio.FourWire for the FunHouse defaults to 60 MHz. I don't see this in other boards (without displ...
Firmware
Adafruit CircuitPython 6.2.0 on 2021-04-05; FeatherS2 with ESP32S2
Code/REPL
import time
import board
import displayio
time.sleep(5) # give time to connect serial console after reset
spi = board.SPI()
display_cs = board.IO1 # board.D9
display_dc = board.IO3 # board.D10
display_reset = board.IO33 # board.D5
epd_busy = board.IO38 # board.D6
displayio.release_displays()
# 2C EPD does not hang on `display.re...
correct, there's a busy pin, its waiting for the busy people to change which it wont. its not a bug - dont do this :)
well, we should probably time out on busy failure - wanna find where it does the busy wait and have it bail after some time with an exception?
@idle owl hi - i need to refer to something about how to get into safe mode. I think you wrote that up already, could you point me to that, and I'll link to it?
tnx
I thought I did too, but I'm not finding it. I think I started to but didn't because it was broken on some boards. And the page it was going to be on isn't published anyway, it's still only a template. This is all that's on there.
In fact I'm almost certain that's where it was going to go.
And because it didn't work everywhere, I didn't continue to add it.
thanks anyway - I was specifically looking for "do a slow double-click reset" kind of a writeup. I won't bother to write it myself now. It's in a caveat section about not locking yourself out
when/if we get around to this I'll link to it
Looking at the core, the busy_state of the busy pin defaults to True, and the difference between 2C & 3C behavior is explained by that and the library inits:
- SSD1675 does not specify a
busy_state, so the core uses the defaultTrue - IL0373 specifies
busy_stateasFalse
Also (learned) EPDs can use either the busy pin or the refresh time parameter to determine when it's OK to refresh, i.e., the busy pin isn't required. And indeed, if the 3-color IL0373 is set up in CircuitP...
Sounds good.
Iβve got four CM4 modules nowβ¦ all I need is a couple Piunora @crude blaze π
I looked it up under Windows device manager
If USER_SAFE_MODE is set, message was NULL, so it would also print the "hard crash" message.
@tulip sleet should we have a de-init for PinAlarm pins?
Obviously it isn't useful for deep sleep, but in light sleep, there's no way to reclaim a pin that's been used for a PinAlarm - it retains the claim and pullup settings indefinitely.
you're right, it's necessary
I just noticed it in my RP2040 testing. There's a common trickyness across all ports in terms of how they handle entering deep sleep, where exiting the VM resets pins they might be using for PinAlarm - ports have to decide whether to have those pins in never_reset, or whether to store what pins are used and re-initialize them before deep sleeping.
In implementing that, I noticed that the port_reset and alarm_reset functions are actually the only way a pinalarm will ever be reset to default state.
for deep sleep, the pins don't need to be set up until sleep happens, so I wouldn't put them in never_reset
In that case the PinAlarm module needs to store information about all pins that have been initialized, along with all pull and trigger information, so they can be re-initialized right after the VM ends
Will this work with ESP32SPI for wifi?
When avoiding never_reset, you literally turn them all off and then have to turn them all back on again, but without the original alarm objects available. It's an option, but it does feel awkward to me.
I have a similar problem in dynamic USB: I have to remember HID device objects after the VM exits. So I ended up just creating a small static table of out-of-heap objects: you can have up to 8 HID objects and that's it. It's not a lot of RAM: the objects are small
it... "should" :) ill try it out when i get one
The alternative is that you add pins to never_reset, and it doesn't reset them at the end of the VM, but you keep track of what pins are in PinAlarm and have alarm_reset take care of them with reset_pin_number before the next vm
This prevents needing to store pullup and trigger information, but it means light_sleep can't use reset_alarms anymore because it will delete pullup information (that's where I noticed that pinalarms can't be deinited)
I think the flow for the second option is a little more understandable? But I'm totally open to input here.
in both cases, I'd say defer doing anything to the pins until just before sleep
It doesn't really matter where you do stuff to the pins
an alternative would be to have light-sleep and deep-sleep PinAlarms
it's about storing the information about the pins
the pinalarm objects aren't that big, so a limited supply of non-heap objects is OK, I'd say.
Right now for the RP2040 I'm using a different reset function for PinAlarm for light/deep sleep and it seems ok
I can swap over to storing all the pin information in big static arrays, it just grates me that we're turning all the pins off just to turn them back on. Seems like what never_reset is built to prevent.