#circuitpython-dev
1 messages · Page 300 of 1
righto
click ok, and click the 3 dots in the datafile section
choose the bootloader-feather_m0...bin file
let's erase the whole chip to make the fuses be 0xffffffff so they'll get repaired
so after you choose the data file, click Erase Chip
That popped up a window ran some progresses and then closed
did not seem like any errors
IN the log you might need to scroll it to see if there are any errors
then click "Program device", which will load the bootloader
check for errors there too, you'll need to move the horizontal scroll bar to see
Ah scrolling in log I see:
Selected file: path/to//bootloader-feather_m0-v3.9.0.binConnecting to J-Link...Connecting to target...Erasing...Done
ok, now disconnect the jlink from the header and double-click
single-click will probably work too, because the user program has been erased
(worked for me)
same results with double and single (only blinks yellow LED once)
are you disconnecting the J-Link ribbon cable from the box header breakout?
no reason to use wall power at all, just leave it on the hub the whole time
I will try again with it in the hub the whole time
before you do that, plug in the j-link back in, and let's look at memory. Run JMem.exe
i mean do move it to the hub, but don't repeat the programming yet
Okay, jmem open
could you screen shot?
click ok
actually no, choose ATSAMD21G18 first in Target device
sorry
then screenshot the first page of the memory dump
Also choose Fixed Speed (4000)
(I am getting core dumps without that)
click ok
type 1CC0 in the Go to file and you should see the version string on the right, it should be 3.9.0
then Go to 2000, and it should be all FFFF's
go to 804000 to see the fuses
Looks like they did get set back
Not sure how most of this works, perhaps my unplugging from wall power before clicking reset could've been a problem?
i don't think that's true, but you can certainly skip that.
the fuse settings are still causing infinit resets
but the bootloader itself is in good shape
we can go back to JLink.exe and try writing it again. We could also try writing it with gdb if that doesn't work
ok, I'm trying it on mine, and the writes aren't really happening, that's a problem. so wait a bit and let me try it with gdb
Okay will do
is this the only computer you have? do you have an RPi or some other Linux machine?
I do have many other computers including RPi and a Linux laptop
could you fire up the Linux laptop and download and install the J-Link software there? What kind of Linux?
have you done CircuitPython builds already? DO you have the arm gcc toolchain isntalled somewhere?
I did recently complete some basic circuit python builds. It was on a Debian VM inside of this win7.
I think the other Linux ones I have are Debian as well. I will check
Debian 9.5 on another machine I'll try it there.
it appears that JLink.exe does not know how to write to the fuses properly; it requires some special commands different than a regular write to flash
segger software download is here : https://www.segger.com/downloads/jlink/JLink_Linux_x86_64.deb
Then do sudo dpkg --install on the .deb
aha, I found a trick way to write the fuses:
mem32 0x00804000, 1
mem32 0x00804004, 1
w4 0x4100401c, 0x00402000
w4 0x41004000, 0xa505
w4 0x00804000, 0xD8E0C7FA
w4 0x00804004, 0xFFFFFC5D
w4 0x41004000, 0xa506
you can do this with JLink.exe. (from https://electronics.stackexchange.com/questions/438386/samd21-how-do-i-write-to-nvm-fuses)
this would be easier than setting up gdb unless you're mostly there
(it's sending raw commands to the flash write hardware to do the work)
It took me a minute to get discord up to get the links. So I am here now on the linux machine but with nothing installed yet. I'll try that way first
(with the trick you found, back on windows)
it poped up some progress bars really fast on the last one. disconnecting the jlink ribbon now
still the same, yellow LED when press reset but never red
alright, i'm going to take a break for a couple hours. you can too, or ping me when you have the toolchain installed
(family matters call)
we are close, but these tools are not great
Okay. Thank you for all your help. I'll work on getting that set up and I have some other things I can work on for a while, including dinner.
i may modify the bootloader a bit to be less strict about when it thinks the fuses are busted
@lone axle this version of the bootloader should fix your fuses. Try doing the loadfile and verify, and then disconnect and reset as before.
if it doesn't work, disconnect the board so it doesn't wear out the flash trying to fix the fuses
or you can use JFlashLite to flash it, at 0x0. that's less tedious
@tulip sleet I had unplugged the feather when I stepped away a moment ago. Just came back and plugged the feather back in (to the USB hub) and I have pulsing red now without touching reset button at all.
Oh, and FEATHERBOOT
Everything working as in intended now as far as I can tell. Thank you!
@crude blaze do you have meson experience?
@solar whale Success!!
Waiting for packets...
Received (raw header): ['0x2', '0x1', '0x0', '0x0']
Received (raw payload): bytearray(b'Startup message 0 from node 1')
Received RSSI: -30.0
``` 📻
@lone axle that's great! I'm confused why it's working, or did you use the new bootloader I sent you?
The best way to make sure the fuses are OK is to now update the bootloader with itself: https://github.com/adafruit/uf2-samdx1/releases/download/v3.9.0/update-bootloader-feather_m0-v3.9.0.uf2. Copy that to FEATHERBOOT and wait for FEATHERBOOT to reappear.
I can't be sure, but I think the trick that you found for writing the fuses did actually work but at least in my case not until I unplug / replugged as opposed to using the reset button.
It was plugged into an externally powered USB Hub at the time (not sure if that matters).
So I did not use the new bootloader you sent.
When I came back and plugged it in (was about to try the bootloader you sent) I was met with pulsing red on first power up.
@tulip sleet Okay I've copied this update-bootloader uf2 onto FEATHERBOOT and it has reappeared.
Thank you so much!
thanks for your perseverance. I was going to write up how to write the bootloader using the JLink tools, and this has been very informative.
it also gives me some hints about writing some fuse-fixing code in a future version of the bootloader
you're welcome and thanks again
Is it possible to use the BOSSA tool to write the uf2 bootloader onto the other one of these (that I didn't mess up the offset on the first time)
@lone axle you can use the https://github.com/adafruit/uf2-samdx1/releases/download/v3.9.0/update-bootloader-feather_m0-v3.9.0.ino Arduino sketch. Just compile and upload it in Arduino, and it will replace the bootloader. Using bossac won't work due to the boot protection fuses.
Ah, neat I'll use this arduino sketch
it was broken until this release, but I rewrote it and I think it should work for you.
Hmm, what if It's already running CircuitPython
you'll have to reload circuitpython, and save your CIRCUITPY contents beforehand
I've got everything I need from it.
Will Arduino be able to see it when it's in Circuit Python mode? Or do I need to go to the bootloader or something?
CircuitPython can respond to the upload request from Arduino. Or more simply, double-click to get the Arduino bootloader, make sure the port is chosen in Tools->Port, and then upload the sketch
My arduino IDE is pretty ancient I'm going to install a newer one
@tannewt
Thank you so much! Will try it tomorrow!
Have you done any measurements with and without your PR?
An alternative may be to use a TI TPL5100 for deep sleep of the complete circuit.
What is your opinion?
Cheers,
Volker
@tulip sleet I got this output in arduino:
Sketch uses 19476 bytes (7%) of program storage space. Maximum is 262144 bytes.
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] Mar 5 2016 17:46:52
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : true
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.818 seconds
Write 19732 bytes to flash (309 pages)
[====== ] 20% (64/309 pages)
[============ ] 41% (128/309 pages)
[================== ] 62% (192/309 pages)
[======================== ] 82% (256/309 pages)
[==============================] 100% (309/309 pages)
done in 0.138 seconds
Verify 19732 bytes of flash with checksum.
Verify successful
done in 0.022 seconds
CPU reset.
An error occurred while uploading the sketch
SAM-BA operation failed
that's probably just an upload issue. Double-click to get the pulsing bootloader, and then look in the Tools->Port menu to see which one is the board, and select that one (it should have a check mark). Then try again.
oh, wait, it looks like it worked
is the bootloader still there?
the "error" is that the board reset, which is supposed to do
Actually yep it seems like it did work. I double clicked and it came up to FEATHERBOOT
Thanks again
@lone axle glad you got it working!
I will try out the ack ones tomorrow.
Playing with it so far makes me interested to try to make a basic text message app where the two devices ill be able to type and send short messages to each other.
When building Circuit Python in WSL for the FOMU, I am seeing a bunch of undefined reference errors. I'm following the basic instructions from here:
git clone https://github.com/adafruit/circuitpython.git
cd circuitpython
git submodule sync
git submodule update --init
make -C mpy-cross
and when I do a make:
cd /mnt/c/workspace/circuitpython/ports/litex
make BOARD=fomu
I see these errors:
...
I'm trying to send keycodes from the Gemma M0 to a Linux host. I wanted to configure three buttons to send F13, F14, and F15. While this works just fine:
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
kbd = Keyboard(usb_hid.devices)
kbd.press(Keycode.A)
kbd.release(Keycode.A)
This fails to send anything at all:
kbd.press(Keycode.F13)
kbd.release(Keycode.F13)
I notice that when using evtest to try to ...
These errors don't look familiar to me. Are you using the Fomu toolchain or your own RISC-V toolchain?
Although I had the riscv32i for the tinyFPGA and ULX3S soft SoC for LiteX, the Circuit Python here for the fomu wanted the 64 bit riscv64-unknown-elf-gcc, so I built it from riscv/riscv-gnu-toolchain.
I assume I should be using the fomu version, instead?
The answer speaks by itself :
"Forget circuitpython, our ArduPy will make you feel the magic of programming again."
But I don't agree.
@crude blaze do you have meson experience?
@slender iron sorry, very little. I probably wouldn't be of much help
The circuitpython repository includes the following submodule:
[submodule "extmod/ulab"]
path = extmod/ulab
url = https://github.com/v923z/micropython-ulab/
The trailing slash on the repository URL causes a failure when trying to clone it:
$ git clone https://github.com/v923z/micropython-ulab/
Cloning into 'micropython-ulab'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access...
The repository URL for extmod/ulab had a trailing slash, causing
errors when trying to clone it.
Closes #2762
The HID descriptor reported by circuitpython erroneously limited the
maximum keycode to 101, which prevented circuitpython from sending a
number of otherwise valid keycodes.
I've tested this change on my Gemma M0 and it works as expected.
Closes #2761
Prior to this change, the report descriptor (decoded using hidrd-convert -o xml) included:
<usage_maximum>keyboard_kb_application<!-- Keyboard Application (65h, selector) --></usage_maximum>
After this change, it includes:
<usage_maximum>keyboard_kp_hexadecimal<!-- Keypad Hexadecimal (DDh, selector) --></usage_maximum>
Thanks, you beat me to it. I was going to look at setting a country code, too (which is not done in this descriptor), because on the Mac the keyboard shows up as "unknown" the first few times. I may add a commit for that before merging.
Thank you. Please change the 101 in the two comments to reflect 0xDD.
oops, need to fix comments first
Oops! I have corrected the comments.
OK, thanks! Never mind about "unidentified keyboard": it's not the country code. I checked some commercial keyboards.
I'm curious what git versions were affected by this. Locally I have git version 2.20.1 and did not observe the problem:
$ git clone https://github.com/v923z/micropython-ulab/
Cloning into 'micropython-ulab'...
remote: Enumerating objects: 103, done....
I'm interested in #2762 because there was a weird unexplained problem with the ulab submodule when I worked on actions@v2
I also figured out something else about actions failing due to tags
The answer is YES, the Fomu toolchain works great! Thank you @tannewt for that tip!! I used the linux_x86_64-v1.5.6.tar.gz.
gojimmypi:/mnt/c/workspace/circuitpython/ports/litex
$ make BOARD=fomu
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
/opt/fomu-toolchain-li...
wonder if this matters, seen while using pip to install dependencies of circuitpython's build: ```botocore 1.15.39 has requirement docutils<0.16,>=0.10, but you'll have docutils 0.16 which is incompatible.
awscli 1.18.39 has requirement docutils<0.16,>=0.10, but you'll have docutils 0.16 which is incompatible.
and no, that wasn't the secret answer to whatever is wrong with ulab 😢
oh wait maybe I didn't rebase my branch as I thought
huh I thought maybe using a github action with a Dockerfile that installs all dependencies would speed things up, but in fact it rebuilds the docker image everytime. https://help.github.com/en/actions/building-actions/dockerfile-support-for-github-actions
When creating a Dockerfile for a Docker container action, you should be aware of how some Docker instructions interact with GitHub Actions and an action's metadata file.
And in fact this run has weirdness for multiple submodules, it's not ulab that is special
@lapis hemlock can you make a pull request to circuitpython with all the ulab improvements? I can walk you through it if you would like. Maybe Monday before or after the meeting.
@jepler Turns out it's not a git version issue, but it's a side effect of my git configuration, which has this:
[url "ssh://git@github.com/"]
insteadof = https://github.com/
That transforms http:// access into ssh:// access, and while git@github.com:v923z/micropython-ulab is a valid url, git@github.com:v923z/micropython-ulab/.
@lapis hemlock can you make a pull request to circuitpython with all the ulab improvements? I can walk you through it if you would like. Maybe Monday before or after the meeting.
@onyx hinge Absolutely! In return, you've got to merge the latest PR inulabitself😉 I'm not working on Monday, so I am flexible.
@lapis hemlock can you make a pull request to circuitpython with all the ulab improvements? I can walk you through it if you would like. Maybe Monday before or after the meeting.
@onyx hinge I guess, your question was triggered by this issue https://github.com/adafruit/circuitpython/issues/2762, which, in the meantime, has been resolved.
fwiw - I have @tannewt 's Circuit Python working on my FOMU! :) I have a blog about it here. In short, I used the fomu toolchain on WSL with the LiteX port of Adafruit's Circuit Python.
Aha, that would do it. I'm glad you were able to diagnose and fix the problem, thanks much!
In order to get tags, including in submodules, we use our own fetching procedure on top of checkout@v2.
A problem occuring in about 1% of jobs was that some submodules inexplicably did not have an "origin" remote configured. "git submodule sync" configures the "origin" remote in those cases. No cause for the problem was determined.
Besides keeping up to date on actions/checkout, @v2 is supposed to fix a bug where "re-run" of a pull request would fail checking out the code. This appea...
maybe I got it this time. 🤞
newby here, just got a m4 airlift lite, trying to move from arduino. Can't find any libs or simple examples to send/receive email, like umail or maybe wifinina. Where do I look? I'm doing IoT home apps to send alerts etc when a monitored condition happens. Thanks.
@wary ember You'll want the ESP32SPI and Requests libraries, for starters, for HTTP requests, TCP sockets and the like. They're in the library bundle here: https://circuitpython.org/libraries. There are not currently higher-level libraries for email that I'm aware of (I do a request to my server to send email etc).
Total noob here; I have a Metro M0 on order but who knows when they'll ship it. Meanwhile trying out Mu and starting to learn CircuitPython. But my question is this: does the Metro M0 have to be plugged in to computer USB port to work? I'd like to develop a compact little box that does a few tricks that I can carry around and not have tethered to a computer.
No, once the code is loaded, it can run standalone (as long as it doesn't require the serial interface to be up)
That's one of the really nice things about these little CircuitPython boards, you can program them and then include them in stuff like props to do their thing.
Perfect! That's what I was assuming. But somewhere in the docs for the board it says "no EEPROM" and that made me wonder. Because of course storing the program so that it stays in there even with the power off does use EEPROM. But I'm an engineer who has used EEPROM's since the 1980's. I guess nowadays in the Arduino world EEPROM refers only to an area where parameters can be changed without changing the underlying logic of the program.
Yeah, I remember UV EPROM. Now it's mostly NAND flash, often with a bit of emulated EEPROM.
BUG?: I am unable to import the nvm module in 5.2 on the metro m4, I grabbed it from microcontroller but is the lack of the nvm module intentional?
If you just want the nvm module, you need to do:from microcontroller import nvm
@timber mango that is an instacne of a bytearray from the nvm module is it not? i'm curious if not being ale to import nvm as a module is intentional.
wow.. is that a public github issue you could link to or was that via email?
That's a public post on a seeed forum. see by yourself:
https://www.tindie.com/products/makerfabs/circuitpython-pewpew-m4-kit/ This yours? @stuck elbow
@zinc maple yep. The Pew Pew M4 (and original Pew Pew) were created by de∫hipu
@zinc maple yes
@tannewt I think I fixed all the issues you raised, except for this one. For some reason there's not a spot to reply inline, so ...
Protocols vs common_hal: Protocols take mp_obj_t as the first argument, while common_hal takes a type-specific object pointer. On reflection, I prefer getting the compile-time type checking that the protocol function pointer is of the right type, even if it means introducing an intermediate function to do the casting of the argument. (I think I did it with ...
nvm is listed as a core module, though it is part of microcontroller. The doc should make clear you cannot import nvm, etc.
@idle owl I am going to cookie-cutter a couple of new libraries. cookie-cutter looks up to date with black, etc. Is it fine to use as is now?
Thinking about it, I feel like reading from the flash would have the potential to be problematic, because it means reading doesn't represent the actual contents of the flash. It'd also break the implementation from the Atmel and NRF ports which both have read relaying the actual physical state of flash. @dhalbert what do you think?
@tulip sleet Should be yeah. Will still require running Black on a few things as we couldn't quite get it all proper with the template bits in it.
thanks! I'll run a whole-tree black before committing anything to the new libs
The atmel-samd port doesn't have that flush, but it doesn't have a cache for internal flash, so the cache flush routines do nothing. A call to supervisor_flash_flush() should probably be added in the atmel-samd code to prevent a bug from cropping up if we did add a cache.
I added the flush to the nrf port in #1661 because the reads were ignoring the cache, which was a bug. In retrospect I guess I could have read from the cache instead. There's a background task that flushes the cac...
I guess the advantages in each direction would be
- read from cache) performance improvements, especially between rapidly interspersed read/write/read/write commands
- read from flash) avoids errors if a read is done to verify physical flash state, such as checking for shutdown readiness or something.
Note that on the H7, the flash sectors are so huge that the filesystem will never carry over between them, so the background flush is the only time the cache will ever get written to disc.
The huge flash sectors really point toward reading from the cache instead of flushing, since a write is expensive and wearing.
Good afternoon all you wonderful code slingers -- happily lurking today 🙂
we need a lurking emoji
Hey all, weekly reminder about tomorrow's CircuitPython Newsletter - subscribe at adafruitdaily.com, send news, projects, etc. to me on twitter @anne_engineer or email anneb@adafruit.com. I don't monitor Discord for CP news (yet).
Lurking
I'm lurking while doing the newsletter
Lurking
lurking today
Listening in today
Hey Nina!
👋
omg, yes
purple gang represent
lurking
👍 to getting pinged
speaking of notes where the notes at?
@ionic elk It's also pinned to the channel. https://docs.google.com/document/d/1brXruQuOrHT1cdZ6Do-4O9wlcwYZDUV8MIQPYe_1gdo/edit#
We are happy to announce our newest PSF Fellow Members for Q1 2020! Q1 2020 Al Sweigart Website , Twitter , GitHub Alexandre Savio...
lurking
Yea @ivory yew !!!!!!!!!!!!!!!!
@ivory yew 🎉✨
👏 @ivory yew! 🎉
Thank y'all. To celebrate, I want 30 minutes of Scott trying to pronounce slavic names.
Congrats @ivory yew!
Lurking and no notes! Sorry, did nothing this week. While feeling much better and totally recovered from Covid, I could not get started doing anything.
@ivory yew From me, too!
💜
FLASH is working. The OrangeCrab has 16MB of FLASH, for now I've allocated the last 8MB to CircuitPython. https://t.co/VpKCKlvujZ
where is the :1000: emote? 😄

i really should get some Nitro. haha
lurking for status update
Watch as Scott tries out the latest version of TinyUSB on the brand new ESP32-S2. Hang in there through the bumps and crashes to see it work! Then, Scott goes over things to think about when bringing CircuitPython to the ESP32-S2.
Visit the Adafruit shop online - http://www...
Apologies for the late arrival. If i dont get it typed in in time, Group hug to all!
enjoyed the Tiny USB for ESP32 S2
while True:
hug(@jepler)
is there an esp32-s2 dev board available?
@tiny oriole Are you text only?
for the moment. possibly not for the weekly update though
had a work conflict for the first part
@tiny oriole No worries, got it in the notes
thanks!
@solar whale There was on in the video from the desk of lady Ada. But the stock was at zero for me.
Go ahead and read it sorry
thanks -- will keep check the video and keep an eye out
I think I've got the mic settings straightened out. I will give it another try for status reports.
@onyx hinge mute
@spice crypt Are you lurking?
good to hear your voice @raven canopy
I have to drop off! Thanks folks, this was awesome. 🙌
No worries! Thanks for joining us!
how do I set "lurking"
By telling us 🙂
@onyx hinge the "perks" of tele-work. 😄
Just post the word Lurking here in chat
lurking
Do the recent changes to CP github workfow (like checkout v2) require or recommend any changes to users doing local builds
@solar whale no, shouldn't. if you want to build the new litex port you need to install a new compiler though, because it's based on RISC-V instead of ARM.
Do you have a link to the RISC-V toolchain that is needed?
@solar whale the build uses https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz even though it is using ubuntu.
Have to drop early today. Great sitting in for a bit again. Have a great week all!
@old smelt Thanks for joining us!
@tiny oriole i was glued to NWS last night. we were on the tail end of that system... 😬
yeah, i got a rando text from my Spotter friends yesterday telling me to look over at radar and was greeted with a system so large you could see a pretty well defined eye on the radar.... which for those of you not familiar with NWS Radar, being able to see a tornado signature is usually a matter of "knowing what to look for"... seeing what is called a "debris ball" signature, let alone a debris ball with a clear eye, is extraordinarily rare.
Ok, go ahead and read them, sorry
@tiny oriole I was watching the MS saga through a friend;s website. Saw the major Tornado as it went by his house to north.
The trick to seeing it is to look for winds on the boundry between the red areas and a greeen areas.
they will be going in opposite directions
@slender iron I have the 32x16 and 64x32 so yours will be a little different. but m4 feather + that wing is the quickest way to get a working display.
yay! belated hug for getting the "current" sphinx working, I missed that going by
@tulip sleet how often does background_tasks call the flash flush?
Describe the bug On some jobs (apparently in a non-deterministic way) commands such as apt-get install fail with the following error: Get:1 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu b...
Or run: black --target-version=py35 .
Black commit-hook: https://black.readthedocs.io/en/stable/version_control_integration.html#
tannewt turned into a robot
it got better
@lapis hemlock do you want help making a pull request to update ulab in circuitpython? If so, would you like to do it now or at some other time?
@onyx hinge are the issues "ulab can give erroneous results when sorting 2D arrays", and "ulab can give erroneous results with expressions like a[a<1]" new? (5.2 release notes https://blog.adafruit.com/2020/04/09/circuitpython-5-2-0-released/)
Thanks Scott and all!
thanks
@lapis hemlock do you want help making a pull request to update ulab in circuitpython? If so, would you like to do it now or at some other time?
@onyx hinge I am free now.
Thank you!
@lapis hemlock they were in 5.1 and 5.2, I noted them because those were fixed in ulab master branch but we didn't take those fixes .. and still haven't.
@lapis hemlock they were in 5.1 and 5.2, I noted them because those were fixed in ulab master branch but we didn't take those fixes .. and still haven't.
@onyx hinge OK, thanks! So, what have I got to do now? With the PR, I mean.
@lapis hemlock so I think we want to take all the changes in ulab master branch into circuitpython masater branch
@tulip sleet Is there a BLE driver/example that does serial / UART over GATT. For some hardware, there seems to be a TX and a RX UUID/characteristic that I need to write to/read from. Would you have any code that drive BLE hardware that behave like that?
What has changed? In the past it used to happen automatically, didn't it?
@lapis hemlock so in a git clone of circuitpython, you'd cd extmod/ulab; git fetch origin; git checkout origin/master so that the ulab submodule is pointing at the head of the master branch
@lapis hemlock no, it didn't happen automatically in the past
while I was working on the initial pull request into circuitpython, I was regularly updating
anyway, after that, you can run whatever local tests you want, then git add extmod/ulab, commit, and create a pull request in the usual way against adafruit/circuitpython
There are a number of steps but it is a fairly mechanical process
OK, I can do that. I am cloning at the moment.
thanks, I appreciate it. I think right now is a good time to do a merge, it'll go out with this next set of stuff that we'll call 5.3
What does this mean ```You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 1f17bdb4f Merge pull request #2765 from jepler/checkout-v2-subomdules
hmm I already left out a step 🙂 so let's back up a moment.
@dhalbert @tannewt Ok, all suggestions implemented. Please check out internal_flash.c for revised cache reading system.
check out the "master" branch again, go back to the top level, and git submodule update --init. Because I left this step out, the git checkout command actually changed the main circuitpython tree, not the ulab tree
I could tell that because of the commit message, which was a circuitpython commit message and not a microlab one
@thorny jay maybe these? https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/master/examples/ble_uart_echo_client.py and https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/master/examples/ble_uart_echo_test.py
@tulip sleet any issues going to 20.04?
As for that message in general .. there's a distinction in git between checking out a local branch git checkout master and checking out other things like tags and remote branches git checkout origin/master. That's simply what it says when checking out a thing that is not a local branch. Usually, in submodules, you have a specific commit checked out, rather than a local branch. So I don't think about it much, and I'm not surprised when I see that message. I think you could git checkout master; git pull and get about the same effect as git fetch origin; git checkout origin/master except you would not see that message
@onyx hinge Do we have to merge the last PR from ulab before going ahead?
I can give it a quick look before we proceeed
OK.
HEAD is now at 12d2c91 Merge pull request #92 from v923z/transpose is the state before the PR.
This doesn't seem right. ```>>> ulab.numerical.argmin([1.2, 3.4])
1
Thanks @lone axle , I need to check the implementation of adafruit_ble.services.nordic UARTService .
This seems weird too ```>>> ulab.numerical.argmin([1])
1
ulab.numerical.argmax([1])
1
It seems that serial over BLE has not been standardised. But many old protocol were serial and ported to BLE.
This doesn't seem right. ```>>> ulab.numerical.argmin([1.2, 3.4])
1
@onyx hinge Indeed. That was a stupid indexing error. I have pushed a fix.
Sorry for the confusion!
github is done with the checks.
Here is the notes document for Monday’s CircuitPython Weekly meeting. 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/1YIp-LKPdIzsN2LN4yRo4FzxzTTnLuFeDOJPboQKDVhc/edit?usp=sharing
@lapis hemlock I still see some weirdness and put more details in the pull request. I need to step away and go grocery shopping now.
@lapis hemlock I still see some weirdness and put more details in the pull request.
@onyx hinge Too bad. I will try to find out what the problem is.
feel free to ping me tomorrow, after 1200GMT is good for me.
thanks for keeping at it!
OK, will do.
@thorny jay @lone axle pointed to what I would point to
the Bluefruit Connect applications all use BLE "UART"
@solar whale I have not seen any significant 20.04 problems, but I regularly get "System Problem detected" popups. I am using the cinnamon desktop and haven't taken advantage of any new mainline UI updates. I was hoping I might see fewer USB hangs, but if anything they might be slightly worse. It's nice having newer default python etc. but it's not miraculously better.
Thanks -- I'll try it soon.
@onyx hinge I think I have sorted it out. And thanks for the test script! Next time I will have to implement the hug function with infinite recursion, like so: ```python
def hug(whom):
while True:
hug(whom)
hug(@jepler)``` Though, I don't quite know what happens in such cases. It might break my computer. 😆
you must have fixed the bug in my test script too
Yes, I have. Was that intentional?
no
Such a shame! It would've made for a good prank.
there was no poisson d'avril this year
We can merge it, then, right?
I just did
Thanks! Do you want to proceed with the circuitpython stuff?
I can stay for a couple of minutes, but not longer than half an hour.
I have pulled in the changes, this is my status now: HEAD is now at 22813d6 Merge pull request #91 from v923z/argmax
that looks right
right. do you have a fork of circuitpython yet? Or, if you have a micropython one, that works.
I can fork CP.
you create a branch, "git add extmod/ulab", push the branch to v923z/circuitpython, and create the PR using the web interface
@tulip sleet Can you take another look at this please? It's the last Black PR. https://github.com/adafruit/Adafruit_CircuitPython_CPython/pull/11
"git add", "git commit", push
If I try to fork CP, I end up on my https://github.com/v923z/micropython-property
if you use "git gui" it can show you a summary of the ulab commits that are being added
yes, that's more or less expected. Because circuitpython is forked from micropython, github doesn't create any new forks when you do that
(I think it's not ideal, but they have reasons for doing it that way)
OK, then I would have to add ulab to that.
you started by cloning adafruit/circuitpython, right?
That's correct.
and now you need to put the changes up to your fork, which is https://github.com/v923z/micropython-property
Is it OK, if I simply copy my ulab directory to https://github.com/v923z/micropython-property/extmod and then push it to github?
Not really, because you need to start with the circuitpython master branch, not something from micropython
Let's do it this way. git remote add v923z git@github.com:v923z/micropython-property.git ; git fetch v923z. That should print something that looks successful.
In your circuitpython clone
Do you want all the bells and whistles?
not if it looked succesful
It didn't complain, but I don't quite see anything familiar.
you can paste it if you're not sure
remote: Counting objects: 100% (3722/3722), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 13303 (delta 3716), reused 3719 (delta 3716), pack-reused 9581
Receiving objects: 100% (13303/13303), 6.54 MiB | 4.91 MiB/s, done.
Resolving deltas: 100% (9759/9759), completed with 1019 local objects.
From github.com:v923z/micropython-property
* [new branch] cross -> v923z/cross
* [new branch] dynamic-native-modules -> v923z/dynamic-native-modules
* [new branch] esp-extra-scripts -> v923z/esp-extra-scripts
* [new branch] iabdalkader-cc3k-update -> v923z/iabdalkader-cc3k-update
* [new branch] make -> v923z/make
* [new branch] master -> v923z/master
* [new branch] parse-bytecode -> v923z/parse-bytecode
* [new branch] reentrant-gc -> v923z/reentrant-gc
* [new branch] travis-clang -> v923z/travis-clang
* [new branch] travis-esp8266 -> v923z/travis-esp8266
* [new branch] travis-stackless -> v923z/travis-stackless
* [new branch] travis-testing -> v923z/travis-testing
* [new tag] v1.10 -> v1.10
* [new tag] v1.11 -> v1.11
* [new tag] v1.12 -> v1.12
that's great
I am glad that you are so excited.
those are all the branches you created previously and pushed to micropython-property.git(as well as some tags of micropython versions)
we'll get there
let's see .. did I have you create a branch in your circuitpython clone? If not, let's do that now: git checkout -b update-ulab
Done.
at some point I hope this gets close to the familiar pull request workflow you already knew well enough
if you didn't git add / git commit (or your favorite way of creating a commit, such as git gui), do that next.
extmod/ulab
OK.
[update-ulab 965ef48a3] added ulab
1 file changed, 1 insertion(+), 1 deletion(-)
git push --set-upstream v923z update-ulab
This is weird: ```
ERROR: Permission to v923z/micropython-property.git denied to deploy key
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
that is weird. we just ran right past the edge of my git knowledge 🙃
do you usually use "git@github.com" when you pull/push things for ulab generally?
want me to just complete the pull request process this time around and we can worry about it some other time?
I am fine, I don't mind, if you want to work on this for a bit.
But if I am wearing you out, then...
I'm not sure how to proceed, I'm unfamiliar with this message
also I can't reproduce this locally to look for resolutions to the problem
We can let it drop, if you want to.
for now anyway, I'll put in a pull request so we actually get these bug fixes and improvements you worked on in the past, and then next time there are some accumulated changes you'd like to see in CircuitPython we can revisit it.
In the long run we'd like to have you be comfortable creating a pull request to circuitpython with ulab improvements (or other stuff 🎁)!
What I don't quite get is, why this failed with this: fatal: Could not read from remote repository.
Everyone should be able to read that repository.
the "git remote add" command I had you run must have been wrong, except that when you did a "git fetch v923z" it looked like success to me. I'm confused.
So am I.
This has about 15 enhancements and bug fixes, mostly from @v923z. It removes the two "known problems" we mentioned in the 5.1.0 and 5.2.0 release notes.
I'll let you go for now. Have fun with your projects, I look forward to hearing about them when they're sufficiently ready.
I will keep you posted. 👋
@onyx hinge How come ulab fails on circuitpython, but passes with micropython?
uh oh! I don't know (yet)
nothing interesting. ```$ ../ports/unix/micropython -X emit=native ../extmod/ulab/tests/argminmax.py
NotImplementedError: native yield
But yield has been in micropython for ages, I am pretty sure it is also in circuitpython.
I know you split off at v.1.94, but that is not too old.
"-X emit=native" means, roughly, turn all python code into native (in this case, x86_64) code. it's not the default.
Let me know if you want me to re-write the test script.
so in that case we just need to skip it. (It still gets tested in circuitpython without -X native). There are many tests that have this flag set.
Or that.
ah, tests
OK, so there is nothing I have to do on my end.
nope
OK, then see you!
👋
The CircuitPython TFT display libraries are basically write-only to init the drivers. Is it possible, and desirable, to add some kind of read status back from the drivers so that CircuitPython code can verify the presence and function of the attached display?
@gilded cradle https://forums.adafruit.com/viewtopic.php?f=60&t=164335
This is generally a feature I like in peripherals, but atm this is driven by my 240x135 (ST7789) going blank after a couple of days. The 2.4" and 3.5" displays don't do that. If I ^C ^D, it will start displaying again.
@gilded cradle https://forums.adafruit.com/viewtopic.php?f=60&t=164372
thanks @ionic elk and @gilded cradle for the forum follow ups
folks who are waiting for a PR review from me will have to wait until tomorrow. I'm barely through email now
will be grocery shopping for a bit in the morning too unless I go tonight
Be careful out there!
they're orchestrating things well. I'm not worried about it
i scored toilet paper today. the benefit of not going at night, like i usually do. 😄
I'm on the waitlist here: https://blog.whogivesacrap.org/home/goodnews/stock-updates
they send a big box so we've got plenty left
Changes look ok. Needs a CI poke.
@caternuson yup! Looks right to me.
@volkerjaenisch Ya, I've done enough to confirm that it enters sleep. If I remember right its 4x or 5x less current when idle.
An external chip will be much lower power because it can completely turn off the power. The SAMD21 does have lower power modes but they won't match an external chip.
@olivier-boesch We'd be happy to help you add support to CircuitPython. Just let us know when we can!
This approach is fine with me.
Do you want to speed it up further? You could pack the value into one uint32_t at the start and then fill the memory. That would reduce the number of memory operations.
Complicating things, I think it was based off an old ref rather than master. Rebased and force-pushed, which will give Actions a fresh crack at it.
Looks like you were using a riscv64 compiler that didn't have either the 32bit ABI enabled, or multilib. If you were building gcc from scratch it can be a tricky to get all the build options correct.
Do you have that compiler still installed? Might be worth checking some options? For reference this is my gcc
riscv64-unknown-elf-gcc --help=target
The following options are target specific:
-mabi= Specify integer and floating-point calling convention.
-march=...
@gregdavill yes, I had built the RISC-V from scratch, using the basic setup (no special --with parameters) see also my blog on this topic
I still have it installed, although the @im-tomu pre-compiled binaries are listed first in my path. Here are details on that scratch-built one:
$ /opt/riscv/bin/riscv64-unknown...
the "upgrade ulab in circuitpython" PR had more loose ends than I expected, in a way I'm glad that I hit a snag working with v923z to do it.
I see your build has --disable-multilib in the configured with section. This means there is no newlib built for rv32i, which CircuitPython.fomu depends on.
I think if you were to try re-compiling gcc with --enable-multilib argument in the configure command it should work.
I was just peeking at your guide for how I can test this. I think we want these all to be kwarg-only args because they are either numbers, pins or lists of pins. Reading the code doesn't help with what is what. The current positional arguments can be required and have no default.
I'd also take in the height even though it's implicit in the address pins. It can make the framebuffer smaller than the available address pins and can also validate enough address pins are given.
Ok, I'm fine with the wrapper functions.
One comment on the API. I glanced at your Learn guide draft and had thoughts. Is there a library I should look at too?
Thanks!
No, I was hoping that it'd help the CI issues.
I wouldn't say never. I can see a world where we actually suspend everything but the RTC. In that case we'll want to save the offset through the RTC and up date it to correct time.
I don't ever plan to interface it through a date API though. It doesn't make sense given most RTCs are counters and not clocks.
I need to update this to Sphinx < 4
One comment. Will test and finish the review tomorrow.
No need for this. CFLAGS has these values and is included above.
Yeah, I can make them kw-only.
I can make it so that height, if specified, is checked against the expected number. I'm not sure of the use case of creating a 16 line display on a 32 line panel, though.
however, the raspberry pi lib for driving these displays (I think that's the one) can drive multiple displays wired in "zigzag" fashion. In that case, the relation between the WxH of the screen is decoupled from the true width of the display. Protomatter C library doesn't support t...
There is a wrapper module, but it's not uploaded anywhere yet. It may just end up committed in the guide repo at this time, because I'm not sure there's time to get it into the library package on the timeline in which we want the guide to appear.
Looks like I can't get the current content at this computer I'm at, but it's close to this:
import displayio
import _protomatter
def protomatter_display(
width,
depth,
rgb_pins,
addr_pins,
clock_pin,
latc...
should rename "depth" to "bit_depth". The 4 value was just in the Arduino example, gives 4096 colors (16 effective levels per primary).
This removes CIRCUITPY_MINIMAL_BUILD and adds config options to get circuitpython building on Fomu.
It also adds required functions such as mp_hal_delay_us and the os module, which are necessary for doing a non-minimal build.
I'm looking through the circuitpython source, and I see this function cpu_get_regs_and_sp(regs) that gets called a lot. It assumes there are 10 registers.
- This isn't the case on RISC-V, which has 30 registers, and
- The
regsargument doesn't appear to ever be used.
Could this be replaced with a functioncpu_get_sp()? Or is the register list actually used somewhere that I'm not seeing?
@jepler https://github.com/v923z/micropython-ulab/pull/96 fixes a bug in the dot function, in case you want to pull it in.
@half geyser cpu_get_regs_and_sp(regs) gets called two places, when the stack is allocated, and in gc_collect(). You're right, it seems like it doesn't use regs; perhaps it used to check the register contents for pointers to gc. Could you open an issue? Thanks.
I think I left this in back when I had mtune, which I think failed as a linker parameter
The cpu_get_regs_and_sp(regs) function appears to be used in two places, and the regs argument is completely unused. Additionally, the regs argument is hardcoded several places to be 10 elements long, which doesn't work for platforms such as RISC-V which has 31 general registers.
Unless this function has other uses I'm not aware of, we can increase portability and remove unused code by renaming this function cpu_get_sp() and removing the argument.
Updated to include v923z/micropython-ulab#96.
@slender iron I was watching your livestream about ESP32-S2 support in micropython, and had a couple of pointers/ideas on integrating with the ESP-IDF.
@sour lynx that'd be awesome! I'm not sure where to start since we use make and the idf uses cmake
Right... some time in the future, if you start using CMake in circuitpython, it will be possible to import all the IDF stuff as a CMake library, as in this example: https://github.com/espressif/esp-idf/blob/master/examples/build_system/cmake/idf_as_lib/CMakeLists.txt.
I was considering it but I'm not sure it'll improve things much for us
Until then, there is an alternative: create a "hello_world" project with IDF, and build it with the IDF build system. Then add a CMake target to dump the CFLAGS and LDFLAGS of the main component into some file. Then you can read this file and use the CFLAGS and LDFLAGS with make.
ya, I was considering that using a tinyusb example
The idea is that you write a Makefile which calls CMake to build this simple IDF project. This produces all the static libraries of IDF components. An extra rule in CMakeLists.txt saves the compiler and linker arguments to some file, which your makefile can read.
I think @atomic summit prefers how loboris did his fork: https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo
that sounds like a good approach
yes, although that was based on GNU Make build system (which was used in IDF 3.x and before)
i think you could do something similar with CMake
Let me try it locally and see if it works...
@tannewt OK, pushed those changes. I think the last remaining question is the treatment of the upper bounds for the dirty area.
This? (current code)
self->dirty_area.x2 = self->width;
self->dirty_area.y2 = self->height;
or this?
self->dirty_area.x2 = self->width - 1;
self->dirty_area.y2 = self->height - 1;
I'm not sure it's getting many changes now
do you have any pointers for integrating with freertos? that's the other thing I'm wondering about. right now we don't have an rtos at all
I'm not sure it's getting many changes now
@slender iron Yes, this fork has been dormant for a while...
Regarding FreeRTOS, you probably need some "main" task where the interpreter runs, this is the easy part.
heh, ya and it's micropython code is old too.
do you recommend the idf as a submodule or is there another way we could pin ourselves to a version of it? I know there is a docker for CI
A submodule is not a bad option. Keep in mind that if you want your users to be able to rebuild circuitpython with a slightly different IDF commit (e.g. to try out a fix we have released), they will need to manually change the submodule commit.
OTOH, submodules give better control over the specific revision than the docker image. We only tag docker images for release tags and the tips of release branches, so if you want a specific commit on a release branch, then the docker image might not exist for that commit. Note that you can still used the docker image for the respective release branch. Just git checkout the right commit of IDF inside the docker image, before building.
cool. we try to avoid things shifting out from beneath us.
The docker image is useful also because it comes with all the tools and python packages already installed; you can also run install.sh in your CI job, but this might take longer than fetching the docker image.
I do want to make sure I set it up so that we can easily update versions
ya, we need to explore that for our other toolchains too. our arm install is non-trivial
are you using github actions for CI?
We don't have pre-made Github Actions for IDF projects yet, although one team member is working on it.
But the docker image is pretty close. Let me show an example...
docker image is enough. mainly just asking about the provisioning
we're always looking to speed up our builds
👍 nice!
This runs on a slightly different image, igrr/idf-qemu, but the only difference from espressif/idf is that there is Qemu added to the image.
right
ok, so I'll 1) add idf as a submodule 2) write make rules to build the idf using cmake and output the flags and 3) link those libraries into the main build
any idea if the IDF works with LTO? we use it on arm for small builds
No, unfortunately LTO doesn't work at the moment because we place certain functions into IRAM (for reasons) and LTO can accidentally move them to Flash.
oh interesting!
however Flash size is usually not a concern with ESP chips (since you have plenty of external flash), so the gains are not so important for the app
we are looking at enabling the LTO for the bootloader though, since it has to fit into RAM.
we use it for the way we do translations now but we can fit both the english and translations into flash
I thought there was a ROM bootloader. is it just part of the loaded image?
we're keen on having a uf2 bootloader
There is indeed a ROM bootloader (a.k.a 1st stage bootloader), and the bootloader in flash (a.k.a. 2nd stage bootloader). The ROM bootloader is always there — and it always allows flashing the app over UART or USB (CDC/DFU). The bootloader in flash doesn't handle flashing. It is mainly responsible for:
- OTA updates — switching between copies of the app, when the app self-updates over Wi-Fi.
- security features, such as flash encryption, secure boot, rollback protection — although you will likely not use these in circuitpython
There is an overview of how IDF manages flash layout in the remaining space after the bootloader: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html
You don't have to use partitions, you can access flash at any address directly, but it recommended to establish partitions for your data storage, such as FAT.
The minimal number of partitions you need for a functional application is probably 2: one for the application itself, another for "NVS", a non-volatile storage library which IDF uses, for example for Wi-Fi credentials storage.
we usually do it through linker scripts at the moment
but we're pretty new to having circuitpython on an external flash chip
(though we do have the filesystem on internal flash in some cases)
I see. The flash memory on the ESP32 is not directly mapped into the address space. That is, it can be mapped by the MMU, but since MMU is configurable, there is more than one possible mapping. This means that theoretically you can store the application at any 64kb-aligned offset in flash, and the MMU will map it into the spot in the address space for which the application was linked.
This allows having two "slots" for the application in flash, and use them on a round-robin basis for OTA updates. The application runs from one slot, downloads a new version into the other slot, then restarts, asking the bootloader to switch to the new slot.
The application is linked in the same way, regardless of where it will be flashed. The MMU deals with mapping the application into the correct location in instruction and data memory.
There are some notes at https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/general-notes.html, which you may find helpful. The address values are slightly different for the ESP32-S2 (we haven't updated the page yet), but the logic is the same.
(except that there is only one CPU)
cool cool! thanks for all of the pointers
I'll likely stream when I work on it next so folks can give feedback. 🙂
I've gotta head to the store now
thanks!
Issue #1639 Application exception output to serial (over USB) appears truncated due to buffering issue
Increased size of #defined CFG_TUD_CDC_EPSIZE to 128 from tinyusb default of 64.
Reproduced issue 80%+ of the time by running in REPL on CircuitPlayground Express:
raise AttributeError('abcdefghij' * 12)
Note that there is certainly some timing/host driver issue involved, since running the same code when
connected to a Linux instance on the same system never reproduced the code.
...
I’m still interested in working on this, especially since I am currently furloughed from work. Happy to have collaborators!
Looks like the original code was correct with x2 and y2 setting judging by comment describing x2 in https://github.com/adafruit/circuitpython/blob/master/shared-module/displayio/area.h#L33-L39 ...
Unix port isn't building to run the tests.
Current version looks correct. Thanks!
One nit pick. Looks good otherwise. Thanks!
I'm not sure what the right answer is. I think for correctness we need to collect pointers in the registers so that we don't gc something we're still using. However, that may lead to use hanging onto stuff we no longer need.
Thanks for taking a look at this @DavePutz !
I'd rather not change this size. I think it's hiding the issue rather than fixing it.
Our code should be able to chop a larger buffer into multiple tinyusb calls here: https://github.com/adafruit/circuitpython/blob/master/supervisor/shared/serial.c#L60
Maybe TinyUSB is incorrectly reporting a count back?
@tammymakesthings what do you need to get started? I'm sure we can find folks to help.
folks may be interested in my reply here: https://forums.adafruit.com/viewtopic.php?f=60&t=164439&p=807845#p807845
talking about longer term plans
@onyx hinge hey, I'm trying to get protomatter going
@slender iron ahoy
import _protomatter
import framebufferio
import board
pm = _protomatter.Protomatter(32,
3,
[board.D6, board.D5, board.D9, board.D11, board.D10, board.D12],
[board.A5, board.A4, board.A3, board.A2],
board.D13,
board.D0,
board.D1,
doublebuffer=True,
framebuffer=None)
fb = framebufferio.FramebufferDisplay(
pm, width=32, height=32
)
print("hello")
looks plausible, assuming you didn't pull the latest changes to make all args kwargs-only
this isn't doing anything for me. is the next debugging step a logic analyzer?
no error, no LEDs?
I've got a feather m4 and 32x32 display
nope
Adafruit CircuitPython 5.2.0-47-g5466ddcfd on 2020-04-13; Adafruit Feather M4 Express with samd51j19
downloaded it from github
didn't see your kwarg changes pushed
is that the right pinout for the feather?
Author: Jeff Epler <jepler@gmail.com>
Date: Tue Apr 14 10:02:08 2020 -0500
Protomatter: Make all arguments kw-only, add rgb count and optional height checking
yes that pinout matches what I've been using
kk
ouch the typos in that commit message 🤢
besides looking for pulsing with scope or LA, another option would be to try the arduino protomatter demo.
usually I just get a messed up display then, not no-display
bingo
it's possible that going straight to console mirror doesn't work, I don't think I tested that
oh really!
no blinka but I see a >
I have had missing blinka too
but I have really not concentrated on seeing the REPL..
@slender iron ok the push for that commit failed to build due to a spurious network error.... intersphinx inventory 'https://circuitpython.readthedocs.io/projects/register/en/latest/objects.inv' not fetchable due to <class 'requests.exceptions.HTTPError'>: 502 Server Error: Bad Gateway for url: https://circuitpython.readthedocs.io/projects/register/en/latest/objects.inv
but I'll try the re-run button
is only half the panel working?
you could pass in a framebuffer of b'\xff' * 32 * 32 * 2
to get all white
and not construct a displayio
I'm not sure my power supply can handle that
and there may be bugs if you try to use it that way, I haven't since the very beginning
(I know there are bugs, but you can see pretty lights and usually not hit them)
Turns out display ruler was already on the drive
are the colors wrong?
or just translating weird
ok that's what's in the file. looked weird, I'd never seen it before
deliberately lo-fi?
oh for pity's sake, re-run doesn't work because I'm still branched from the point where checkout@v1 was used.
that's an old version
for eink
rebase time!
color looks wrong
blinka's eye is yellow
there are two color conversions, first from the internal colors to RGB565, and then to (in your case) RGB333. Double conversion isn't ideal, and it may be causing color artifacts(?)
looks a lot like the blinka I see
ya, the bottom right of the eye should be dark blue
tries to find the original image
is that the only pixel out of place?
All the LCDs swap the byte order of RGB565 vs what I use
is this drawing going through some path which .. doesn't?
.rgb888 = 0x0736a0,
.rgb565 = 0xf501,
red seems weird
this looks pre-swapped (from the palette of built in blinka)
in displayio_colorconverter_convert I added code to swap(-or-not) color values when going to the RGB565 colorspace
originally, everything was swapped there
right, so you changed the default
but this kind of palette that the internal blinka image has, contains pre-swapped RGB565 colors, and those are getting out
so would it be anything with a palette?
displayio_palette_get_color
so I must have standardized rgb565 to bgr565 actually
whatever to call it, the LCD panels clearly like it
well the LCDs can swap them in their init code
this branch will break palette colors for current LCDs
I had trouble just getting them all the same
though the built in blinka bitmap will not show it
I took the swap out of displayio_colorconverter_compute_rgb565 and moved it up a level (and made it conditional)
but the way displayio_palette_set_color uses it, means it'll stop swapping the color around for LCDs that need it, giving wrong results
right
and the reason that the built in blinka is different is, all those values were precomputed so they could be in ROM, so they're right for LCD and wrong for Protomatter
Do you see the "right" place to put the swapping?
the simplest things is probably to reswap in protomatter
if we change the built in blinka then we have to change all other display init
that may be the best thing right now.
it sucks that it's bgr but I had a bunch of trouble getting it all uniform
I'm sad about doing so many more memory references for every refresh
can you do the swap at the same time as the RGB333? then atleast it stays in a register
alternately, I could move the swap down into protomatter C library where it would just be a register op, but that puts another pull request on the timeline and we have a timeline
(jinx)
🙂
don't let a timeline compromise your work
dislikes clocks
for now we can hack it in cp if you like
there are so few pixels it won't really matter
I think it's possible to merge this on schedule and then not drop the ball on fixing the stuff that was less than perfect.
¯_(ツ)_/¯
it's not the end of the world to have it
I doubt anyone will notice
there are plenty of other places to optimize
the imx framebuffers may force us to face this
ya perhaps
Hey guys! I am loving CP so far... but I wonder what is the preferred way to track CP code in a git repo? Obviously dont want the repo to live on the microcontroller drive... so I'll need to hold it on y machine and move it over in a build step. Anyone have a preferred method of that with VS code before I just knock something together with build tasks / gulp ?
@pseudo pebble I think that ladyada uses git on the fs 🙂
I usually just copy files back over when I'm done
@onyx hinge does palette just need to look at the swap bit in colorspace too?
mmmmaybe, but how does that fix the rom'd palette?
if you show me what you were thinking about, I can show you what I was coding but haven't tested yet. it's probably better..
I was busy writing a big apologetic comment which is never a good sign
the colorspace is dynamic from the display right?
I think that's right
so we 1) default it to swapped and have the cc and palette swap on out
and 2) change the rom representation to rgb565
right, 1) is half-done, maybe we just need 1.5.
I don't think we need to undo what you've done
palette also needs to swap
I have a program that uses OnDiskBitmap only at this point
blinka looks good on pygamer, so does an OnDiskBitmap
OK, that's pushed
kk. will look
on pygamer anyway, an in memory bitmap also looks right
I just set the 0th palette entry to red, green, and blue and each one was right
cool. I think we handled all of the cases
I feel silly for not knowing blinka looked all wrong
the purple was .. pretty close honestly
easier to see on this display
Issue #1639 Application exception output to serial (over USB) appears truncated due to buffering issue
Added code in serial_write_substring() to split large writes into chunks to help avoid buffer overflows.
A limit of CFG_TUD_CDC_EPSIZE was used, since that is the limit used in tud_cdc_n_write_flush() from lib/tinyusb/src/class/cdc/cdc_device.c.
Prior to the fix there was a reproduction of the issue about 80% of the time using
>>> raise AttributeError('abcdefghij' * 12)
After the f...
okay, I am hungry enough to eat a 🌮
thanks for the testing! It's fine, I planned to totally front load this week for Protomatter's sake...
kk, cool
I'll be back this evening if you have more to tell me on whatever medium, also to deal with stuff that comes from guide moderation
👋
kk
Once I powered the panel it worked great! :-D
Feel free to merge after the CI is happy.
I thought TinyUSB did this already. @hathach can you take a look at this?
@tulip sleet can you review https://github.com/adafruit/circuitpython/pull/2754 tomorrow?
@maholli We did have single-channel SPI_FLASH_FILESYSTEM available, which uses supervisor/shared/external_flash/spi_flash.c. I'm guessing you were not able to use that, but you could say why?
looks like CircuitPython is still using the Contributor Covenant
@onyx hinge What res is that neopixel screen you're working on? It looks very cool.
@simple pulsar it's 64x32. And it's not neopixels, it's this other thing. Sometimes called HUB75. https://www.adafruit.com/product/2277
that's the specific one I've been working with, Scott's got a 32x32 variant, and there are others
I only ask because I've been messing around writing a program that generates test card images. I just tried it at 64x32 and it's not quite tuned for such a low resolution!
interesting!
It was inspired by a misbehaving CLUE board/display discussed in there: https://forums.adafruit.com/viewtopic.php?f=19&t=163189 - I just posted the 240x240 bundle which looks a lot better.
Once I powered the panel it worked great! :-D
Feel free to merge after the CI is happy.
@simple pulsar that's neat, I can almost see Limor in the tiny one after seeing the full size
I tried to test this on my Nucleo boards by dragging and dropping the .bin onto the NOD_* drives that appear. The F767 copied ok but I get nothing on the other USB port where I'd expect CIRCUITPY to appear. The H743's .bin is 402.7mb so Mac won't let me copy it over. Should I try using GDB to load with the H7?
Be kind and please review the Code of Conduct. Comments like this are unacceptable.
Remove this if you don't need it.
It better reflects our standards and also addresses chats. History of how it evolved from the Contributor Covenant is here: https://github.com/adafruit/Adafruit_Community_Code_of_Conduct/commits/master
@tannewt @ladyada Checks are green now, but since I had to "make translate" I need a fresh review before it can be merged.
@Dan Halbert#1614 -> @danh#1614
@ladyada sorry, slip of the mouse, didn't mean to dismiss your review
Looks like this may be wrong in all the Codes of Conduct, I spot checked just one at random (https://github.com/adafruit/Adafruit_CircuitPython_CharLCD.git) and it's wrong there too.
ack, i never noticed that; but it doesn't matter much
@tulip sleet It's actually quite simple to patch the CoC on the libraries without creating a lot of havoc. Please submit the fix to the Adafruit Community Code of Conduct repository and we can pull it from there.
@tulip sleet It's actually quite simple to patch the CoC on the libraries without creating a lot of havoc. Please submit the fix to the Adafruit Community Code of Conduct repository and we can pull it from there.
@idle owl not worth doing separately; I'd wait until you have to do another pan-library edit
its only like 5 tiny steps. grab copy, stick it in a repo, commit, git format-patch, submit a PR, then run it... (ok. 6 tiny steps.)
it's very unworth it to generate all those PR emails
i don't think anybody has tried to contact me via the old username
its only one PR. the patch is applied as a direct commit.
one pr per library?
nope. one PR to adabot. the libraries are direct. (except NeoPixel, or any failed patches)
ah, I see; i was thinking about the black PR's, but those were complicated
yeah, can't patch those since a single diff won't compute.
anyway, I submitted a pr to the code of conduct repo; thank you
should be splitted using the tud_cdc_write_available() that will make sure the internal FIFO is not overflow and still make the best use of it.
@DavePutz could you please tell me how to reproduce the issue, I will try to see if there is a bug within tinyusb stack.
CircuitPython 5 seems to have broken the playing of audio files within the stage/ugame-library (https://learn.adafruit.com/circuitpython-stage-game-library/overview). WAV-Files sound strange and too slow on a pygamer or pybadger (for example with this game: https://github.com/python-ugame/vacuum-invaders). There was no such problem with CircuitPython 4.
Thank you,
Joachim Geyer
I asked to report it here, because Stage simply passes audio to the audioio module, and doesn't really do anything by itself, so it seems like an audioio problem. However, I didn't have time to verify it myself.
Going back to the CLUE with the misbehaving screen, there's a bit more data on it which can be gleaned from the new images on: https://forums.adafruit.com/viewtopic.php?f=19&t=163189&p=807915#p807915
It's almost like it has a crazy high gamma / brightness setting and saturates at very low levels. Is there a chance the initalisation is failing? Or that a default value is relied upon and this is a variant of the screen with an unhelpful default?
Trying to get a better idea of micropython vs circuit python. I keep seeing videos about the esp8266 but that is micropython is it not? Am I understanding that circuitpython is build and maintained by adafruit?
@simple swift I believe the esp8266 can use micropython (but I'm not certain). Circuit Python is a community project that Adafruit created and supports heavily by sponsoring some of the lead developers. But it's not exclusively maintained by Adafruit, there are also many non-adafruit folks working on it. And there are roughly just as many non-Adafruit devices that now support Circuit Python as there are ones made by Adafruit themselves.
@lone axle great answer thank you. Is it reasonable to assume circuit python is getting more support than micropython?
I am perhaps not the best person to speak on it. Personally I am way more involved and familiar with Circuit Python than Micropython. But I don't think I would say that micropython is lacking support really. They are continuing to make improvements the core and have produced a few new versions of the flagship PyBoard devices.
There is a fair amount of carryover as well. For instance one of the newer features within Circuit Python is called ulab (micro-lab) which is a numpy-like module that allows quick math operations. I believe that was working with Micropython before it was more recently brought in to Circuit Python. So it's an example of improvements to one leading to improvements in the other.
It's nice to see: instead of a fork that keeps diverging, it's a fork that stays somewhat parallel and improvements in one get propagated to the other.
Ah ok thanks again so much to learn I just want to have my python app start talking to hardware
The STM32F405 Feather can run Micropython.
I prefer Circuitpython though because the hardware support for sensors and such is better.
@slender iron is there a specific method to avoiding merge conflicts with translations? It seems like I'm having to constantly go in all these files and change that one line that conflicts every merge
but I don't see them in other PRs that often
@ionic elk ya sit tight. On my phone. Will send shortly
Having a failure in the... unix port too now? A recent merge maybe?
.. getting the information from the underlying framebuffer instead.
@ionic elk when merging git checkout --ours -- locale/*
then make translate
the first line gets you back to the merge version
basically reruns your addition (I think)
good trick
I should make sure it's preserving the master version
Dan mentioned it might be beneficial to just get rid of the PO Created_date line altogether since it's the only thing that conflicts
which seems reasonable to me
@slender iron I'm pleasantly surprised at how well OnDiskBitmap performs in this protomatter demo, fwiw. Portions of about 9 20x20 tiles from an OnDiskBitmap are visible at a time, and I'm getting "lotsa" FPS refresh rate.
I'd prefer common_hal function calls for these. That means the struct details are contained within common_hal rather than shared-bindings.
I like the removal of the _! Just a couple of API comments.
I think width and height should be on framebufdisplay instead or additionally because displayio.Display has them.
RosiePi Lives! (shoutout to all of you video content creators...this stuff is tedious)
https://www.youtube.com/watch?v=nN3rocc4dSQ
RosiePi - a physical test platform for CircuitPython. Demo utilizes a Raspberry Pi 3B+, running Ubuntu Server 19.10. There is no CircuitPython board connected in this demo, for brevity. With a board connected, RosiePi will build the CircuitPython firmware at the commit specifi...
Hi,
I was able to reproduce it about 80% of the time using a
CircuitPlayground Express
connected to a Windows 10 system using Teraterm. I ran from the REPL:
raise AttributeError('abcdefghij' * 12)
This should return
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError:
abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij
When it fails it only returns
Traceback (most recent c...
@slender iron when you get a sec could you check out this unix port CI failure? https://github.com/adafruit/circuitpython/pull/2735/checks?check_run_id=589252573
@ionic elk your commit (unintentionally, probably!) updates the "ulab" submodule which is probably the cause of this https://github.com/adafruit/circuitpython/pull/2735/files#diff-f08a2dcbca771712247d5e774c01ec57
@onyx hinge again?? I thought I fixed that... is this another failure of my git fu?
I'm not touching the submodule
I don't blame anyone for having trouble with git, especially where submodules are concerned.
does it get changed on merges or something?
during a git fetch upstream and git merge upstream/master event?
When it comes to submodules, it feels like there are a number of gotchas. It's hard to guess which one you got got by
Also thanks for pointing it out I would not have guessed. The only way I can seem to get it to be correct is to manually navigate to the submodule and checkout the version I see on github...?
If you don't update your submodules with git submodule update, they will continue pointing at whatever ref they were at, when you pull, change branches, rebase, etc.
I run git submodule update --init --recursive every time
If you then use a bulk commit command like "git commit -a", it will record the ref that was checked out and include it in the commit
then my story doesn't apply to your workflow
@ionic elk is your version of git up to date? it's possible something is fixed
I have 2.25.1
the unintended change came in as part of a89928c13c748b7f25bd4e734cfe487b0020a25d "Implement requested changes"
2.24.1
that should be good enough
what i see is that sometimes (all the time?) a merge from upstream doesn't roll forward the submodule commits; is that the essence of the problem here?
@onyx hinge I'm just so puzzled by that because I run a git status after every git add . so it weirds me out that a submodule would be affected without me knowing
I use this alias:
alias gitsubupdate='git submodule sync --quiet --recursive && git submodule update --init'
i have dropped --recursive on the second half because it seems to mess up tinyusb sometimes
@tulip sleet the essence of that being that I need the submodule sync first? because it's not coming in with the merges?
--recursive brings in a bunch of tinyusb submodules we don't need
and yeah I also get issues with tinyusb a lot, I'll try your version
@ionic elk speculating about what caused the problem aside, do you know how to resolve the problem, or would you like a hand?
I just went ahead and manually checked out the submodule to the master version and committed it, and it's resolved the file difference
we'll see if it makes the Unix problem go away too
since the errors were about ulab I think the odds are in our favor
Well, thanks all for the help!
you're welcome
at $OLD_JOB some days it felt like I was simply on call to help developers with their submodule problems. Only 22% joking.
@tulip sleet What sommersoft said. It doesn't generate PRs. But we can wait. I'll look at your PRs in a bit here.
In the interest of time, this only renames the user facing parts, a cleanup PR to rename internally will come later on.
This also has the changes from #2774
User facing names:
>>> import rgbmatrix
>>> rgbmatrix
<module 'rgbmatrix'>
>>> rgbmatrix.RGBMatrix
<class 'RGBMatrix'>
Constructing and using:
matrix = rgbmatrix.RGBMatrix(
width=64, height=32, bit_depth=3,
rgb_pins=[board.D6, board.D5, board.D9, board.D11, board.D10, board.D12],
addr_pins=[board.A5, board.A4, board.A3, board.A2],
clock_pin=board.D13, latch_pin=board.D0, output_enable_pin=board.D1)
display = framebufferio.FramebufferDisplay(matrix,...
Ok, so it is windows only issue. It sounds like this tinyusb issue. There is a pending PR in the stack repo https://github.com/hathach/tinyusb/pull/260
I will try to reproduce first then get back to you. One last question, does this happen to the latest CPY version 5.2 right ?
PyCon 2020 videos are starting to arrive. 4 so far..
https://www.youtube.com/channel/UCMjMBMGt0WJQLeluw6qNJuA
@onyx hinge github actions seems to be stuck at the moment. queued jobs are not being run. I'll keep an eye out
@tulip sleet I appreciate it, thank you!
I'll be AFK for lunch soon but I'll keep an eye on my notifications on all the systems
Hi,
Yes, this reproduces on CPY 5.2. Also, I rewrote to use
tud_cdc_write_available() but that still fails in the same way.
-Dave
On Wed, Apr 15, 2020 at 11:40 AM Ha Thach notifications@github.com wrote:
Ok, so it is windows only issue. It sounds like this tinyusb issue. There
is a pending PR in the stack repo hathach/tinyusb#260
https://github.com/hathach/tinyusb/pull/260I will try to reproduce first then get back to you. One last question,
does...
Why have three attributes that are always the same value?
So that they can be queried from the object properties by a FramebufferDisplay.
other framebuffers in the future will presumably have different values in these properties
Do we expect Python-level framebuffer objects? I was thinking this could be fetched through the underlying protocol instead of the python api.
In my latest CI check failure I appear to have lost bool support on some boards?
@onyx hinge any chance this is related to new protomatter changes?
They aren't my boards, it's a bunch of SAMD ones
nevermind I think it's another submodule issue
Hi, Yes, this reproduces on CPY 5.2. Also, I rewrote to use tud_cdc_write_available() but that still fails in the same way. -Dave
Thanks, I will try to reproduce it tomorrow to see if it is usb stack bug :)
No, but python code that writes a framebuffer directly without FramebufferDisplay would need the values too. I can add it to the protocol, or move it if you feel strongly
I went ahead and removed the properties but we can revert that commit if it becomes useful in the future.
Closing this, as the responses to @tannewt 's review went in #2775 due to the way I used git. See you there.
@onyx hinge I tried to restart #2774; it cancelled some but not all of the jobs and now is in some kind of limbo. If we can get #2775 to build all the way through, I'll approve that and we can close #2774 as subsumed by #2775
@tulip sleet thanks. I had pushed to 2775 the responses to the 2774 review comments anyway, because I wasn't paying attention.
thanks
Hey folks... I screwed up... I meant to order 10 esp32-s2 wroom modules from <@&453561466486915072> and instead ordered the raw chips. Does anyone working on esp32 support want these?
I'm getting a linking error when building the uf2 bootloader for winterbloom_big_honking_button from master:
section .binfo LMA [0000000000001ff0,0000000000001fff] overlaps section .relocate LMA [0
000000000001e90,000000000000205f]
same with others, hrm.
@tannewt Looks like we're all set on CI! Anything else you'd like to see wrapped up?
Looks like you need to merge in master. ulab changed but github's merge doesn't look smart enough to update the submodule. Not sure why it only broke fomu though.
@jepler please take a look next time you have cycles.
I still have to test it. Please reply to my top level comment from last time about what I tried.
Still seeing actions hanging for #2775 -- https://github.com/adafruit/circuitpython/actions/runs/79242680 "62 completed and 38 queued jobs" 😦
2020-04-15 20:50:49 (99.3 KB/s) - ‘gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2’ saved [116802378/116802378]
hmm the one job in progress spent 20 minutes downloading this file DSL-slow
2020-04-15 20:25:08 (97.0 MB/s) - ‘gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2’ saved [116802378/116802378]
1/1000 the speed of this other download of the same asset
"checkout" took 10 minutes
and then suddenly all the rest of the jobs started and finished
@onyx hinge I was wondering if we were being rate limited due to the new GitHub pricing (better for us), but sounds like not.
This makes the colors used by the stage library compatible with those
used by the displayio library.
I'm not sure to which branches I should make this pull request.
@slender iron what branch were you having frequencyio issues on? 5.x, master, lower_power?
k. starting to dig in...
@slender iron I missed your top level comment, sorry! I'll work on that first thing tomorrow.
my b
Minor bug on Pyportal Titano
Pyportal Titano
UF2 Bootloader v3.9.0 SFHWRO
Model: PyPortal M4 Express
Board-ID: SAMD51J20A-PyPortal-v0
Adafruit CircuitPython 5.2.0 on 2020-04-09; Adafruit PyPortal Titano with samd51j20
The Docs for adafruit_pyportal say
# Backlight function
# Value between 0 and 1 where 0 is OFF, 0.5 is 50% and 1 is 100% brightness.
The backlight seems to be totally extinguished between 0.0 and 0.4.
Very dim at 0.45, increases linearly as expected from 0.45 to 1.0.
So, if you follow the examples in “Making a PyPortal User Interface with DisplayIO” and set the backlight to 0.3, you end up with a dead screen, rather than a dim screen as the example would imply.
I didn’t see any open issues that seemed to apply to this.
--- Graham
Just tried this on 5.2.0, with a Feather M0 piping PWMOut into a Metro M4:
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.2.0 on 2020-04-09; Adafruit Metro M4 Express with samd51j19
>>> import frequencyio
>>> import board
>>> import time
>>>
>>> freq = frequencyio.FrequencyIn(board.D0)
>>> while True:
... print(freq.value)
... time.sleep(1)
...
0 # Feather freq out: 500Hz
0
0
0
0
0
0
1087 # Feather freq out:...
Has anything changed with respect to the original request, i.e. a non-blocking input() or sys.stdin.read() function? Or is there another way for bi-directional communication via USB?
Is supervisor.runtime.serial_bytes_available (doc) useful to you? It returns the number of bytes that are queued to read.
uf2 on stm?
@ionic elk yes. so the process is the same for all boards
@slender iron something I need to take care of or something you're working on atm?
not urgent. just something I'd like to see
may see if @gentle bronze wants to help with tinyuf2
Ohhh right you mean the UF2 bootloader doesn't support H7s right now
does it support any stm?
sure, the F4s
UF2 is enabled for the Feather
and any other F4 board that it can reasonably fit on (ie ones with external flash)
I may have messed mine up with jlink
I see you meant "misses" as in "I miss it lets bring it back" not "this got missed"
ya, I miss it
@dhalbert yes, that is very useful. It returns a boolean, though, not the number of bytes. So a non-blocking read func has to look like
def non_blocking_read():
i = ""
while supervisor.runtime.serial_bytes_available:
i += sys.stdin.read(1)
return i
or is there a better way?
Did something in a post-5.0.0 version of CP break this? ```
# ...
# logbox is a displayio.TileGrid(terminalio.FONT.bitmap`
logterm = terminalio.Terminal(logbox, terminalio.FONT)
print("Testing", file=logterm, end='\r\n')
Worked for me built with current #2685 .
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.1.0-117-ga6fb0beaa on 2020-04-15; Adafruit Metro M4 Express with samd51j19
>>> import frequencyio
>>> import time
>>> import board
>>> freq = frequencyio.FrequencyIn(board.D0)
>>> while True:
... print(freq.value)
... time.sleep(1)
...
0 # Feather freq out: 500Hz
0
0
0
1000 # Feather freq out: 1KHz
1000
1000
1000
1000
210...
Found a thread to pull on... Looks like Grand Central D6 doesn't have a TC, which should be throwing an error.
{ MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PD20) },
https://github.com/adafruit/samd-peripherals/blob/master/samd/samd51/pins.c#L824
#ifdef PIN_PD20
PIN(PD20, EXTINT_CHANNEL(10), NO_ADC, NO_ADC,
NO_TOUCH,
SERCOM(1, 2),
SE...
I did a rebase onto master. Let's see if that fixes it.
The issue was the micropython config was missing MICROPY_PY_REVERSE_SPECIAL_METHODS. This has now been added.
@dhalbert I started with SPI_FLASH_FILESYSTEM, but the SAMD51 was crashing before CP could start (The SPI flash device is on the QSPI pins such that I have successfully used the board with a native QSPI device occupying the footprint).
My initial tests were using #define SPI_FLASH_MOSI_PIN etc... in the mpconfigboard.h file as you described. I got GDB running to debug and found it was failing when attempting to configure the QPSI pins for SPI. A quick sanity check showed any [existing ...
Yes, that's the best way for now. Sorry, it would be nicer if serial_bytes_available returned a count.
@DavePutz I could reproduce it on my local machine. Will try to troubleshoot it. We will move back to the #1639 for discussion since this PR is already closed.
I could reproduce the issue with detail instruction from @DavePutz, will try to troubleshoot it and post update here.
This should return
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError:
abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij
When it fails it only returns
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError
The rest o...
@hathach That's good news. I've seen this happen on a CLUE board running either 5.0.0 or 5.1.0 recently but only a few times.
BTW, there's another issue with problems writing to the console. It doesn't sound like it's directly related to this and may well be outside of tiny usb component but worth having a quick look at #2686
I'm sorry, it seems that is an issue with Stage after all. Looks like the timings have changed, and now the 64-byte buffer that I used for playing the sounds is not enough. Doubling it to 128 bytes fixes the sound. I will make a pull request.
I looked at why standard SPI would not work, and it's because the QSPI MOSI/MISO, and SCK pins cannot share a common SERCOM, per the datasheet pin mapping table. So you have to use the QSPI peripheral, which is fine, though more work. Thanks, proceeding on to review.
Thanks for adding this feature!
My comments are pretty much about whether you are special-casing your particular chip in the SINGLE case. The SINGLE flag should be able to work with any flash chip. If you need special handling for the MRAM chip, then there should be flag bits set in the chip description struct that say what to do.
Have you tested these changes against regular dual and quad QSPI boards? It would be good to make sure there isn't a regression.
LD_FILE is no longer being used in atmel-samd. Instead, there is an LD_TEMPLATE_FILE, which gets filled in with various values. So you can remove this line from mpconfigboard.mk here and in the pycubed board file.
@tannewt I've been looking into the issues with startup on each board this morning. It looks like the H7 issue is contained to the .bin file - it loads just fine over GDB, which is why I didn't notice it, so you could try that for testing in the short term.
I'm not sure yet why the .bin is so bloated. It has to be something with the linker/port.c allocations - similar posts from other STM32 projects suggest this happens when data is accidentally mapped to RAM or other discontiguous memory...
BTW, there's another issue with problems writing to the console. It doesn't sound like it's directly related to this and may well be outside of tiny usb component but worth having a quick look at #2686
Thanks for the link, it seems to be a different bug. Let's just fix this one first to see that could fix the other as well.
@slender iron hi, when you're on, could I talk to you about BLE advertisement prefixes? I'm confused about their length fields.
Nothing is jumping out at me in the codebase. I've walked the register settings against what the Grand Central should have from ASF4/samd-peripherals; can't see anything that would be set incorrectly.
I don't have a GC, so I can't verify the registers; would be my next step if I did have one.
DigiKey has them in stock, so I may just pick one up. Having that many GPIO could surely come in handy for something. 😄
I'm inquiring in GitHub community forum re stalled actions: https://github.community/t5/GitHub-Actions/Multi-job-check-actions-stalling-with-many-queued-jobs/m-p/54274
In the past day or two, we are seeing a number of multi-job check actions stalling, with many subjobs that seem stalled as queued and never move from queued to running: https://github.com/adafruit/circuitpython/actions/runs/79784291 https://github.com/adafruit/circuitpython/ac...
but maybe I should contact support directly .. ok, I did
@tulip sleet on my laptop now but not at my desk
can wait
spook is being slow about eating his breakfast
and now vin is on my lap...
master is good. We'll do a pre-release from it shortly.
I wasn't intending to work today, but I did spend time looking into whether we can enable "1 == array" in ulab. It requires code in micropython which isn't in circuitpython. There's not "just one" cherry-pickable commit that adds the core code necessary, so I think we'll have to put it off until/unless we put in the time to merge micropython into our tree again.
@lapis hemlock ^ you may be interested (but dismayed) to know
I'm glad you figured it out. We (deliberately) decreased the frequency with which background tasks could run, in 5.0, to be no more often than 1ms. Of course, other things like GC pauses can make the interval >>1ms anyway, unless your code very carefully has no heap allocations.
@tulip sleet at my desk now
@onyx hinge looking at your protomatter pr now
🔍
are there two? 2775 does have height in RGBMatrix's constructor
One question. Good otherwise!
I thought we added height here. Did it get lost in the PR shuffle?
@slender iron ok, just finished lunch if you are free
yup!
I wasn't intending to work today, but I did spend time looking into whether we can enable "1 == array" in ulab. It requires code in micropython which isn't in circuitpython. There's not "just one" cherry-pickable commit that adds the core code necessary, so I think we'll have to put it off until/unless we put in the time to merge micropython into our tree again.
@onyx hinge I am open to any reasonable alternatives, e.g., if you conditionally want to switch off1 == arrayincircuitpython, or I could factor out the code for this into a separate function, and then we could attachequal: https://docs.scipy.org/doc/numpy/reference/generated/numpy.equal.html. At least,circuitpythonwould then have a workaround. Unfortunately,==andequalare not exactly the same thing innumpy...
@lapis hemlock we can also just live with the limitation for now
@lapis hemlock we can also just live with the limitation for now
@onyx hinge The snag is that it is not simply a limitation, but the function behaves entirely differently in the two environments.
Ok, this should be worth another (hopefully final) look.
Ya, I think 0x10000 is more correct. No one should rely on the difference. The interrupt latency is worse I imagine.
Right, SysTick counts down for us and COUNTFLAG is set on overflow.
Yes, delays must be short. It is expected that code will call delay_ms for longer durations. While we do allow interrupts, we deliberately don't do background stuff in order to keep the delay more accurate than delay_ms. I think the main use of this is in bitbangio.
Do you mean WEEKDAYSEL? I think it should always be date because we don't want to alarm based on the weekday.
If you mean subsecond, I think we do want it ALL always.
Ah, I understand now. I had a wrong guess about what the flag meant, and didn't verify it.
@tannewt fix is in for the F767, it was a startup file issue. Tested it again with my testbench and it seems all is well if you'd like to take a crack at it. Going back to poking around with the H743.
@slender iron analyzing the .bin file from the H7, it's normal right up to the end - it's just got 3.2 billion extra zeroes.
@ionic elk ya, I'm looking now too
there's nothing actually at the end, though, you could chop it all off and it'd be fine
it's the .dtcm_bss section that is the issue
imx gets around it by explicitly including sections in the bin
ah
-j includes a section explicitly
the stm makefile includes all sections it thinks it needs
I see, this binary -j .flash_config -j .ivt -j .text -j .ARM.exidx -j .data -j .itcm -j .dtcm_data $^ $@?
right and it doesn't include dtcm_bss
haha, gross: https://stackoverflow.com/questions/6252812/what-does-the-aw-flag-in-the-section-attribute-mean
I just swapped in $(Q)$(OBJCOPY) -O binary -j .isr_vector -j .text -j .data -j .itcm -j .dtcm_data $^ $@ and it works/has a reasonably sized bin
its the "progbits" that causes it to end up in the bin
any reason I shouldn't just plop a flag in there and swap it?
+1 just include the flags to be explicit
could you clarify?
include the -js
the line above looks right
ok, I gotta exercise. will keep testing after lunch
Still don't totally get what you mean but I'll put something together and just push it so you can suggest what you're thinking of
Sorry still learning this makefile stuff
I think you are thinking what I'm thinking. change the objcopy lines to list the sections to include
Ok new fix is in
@tannewt both H7 bin and F7 reset fixes should be in now.