#circuitpython-dev
1 messages · Page 255 of 1
audiosource.RawSample and audiosource.WavFile? Mixer doesn't quite fit there, does it? 😄
@cerulean pawn I do know the speeds can be off a little bit, I prepared a small table that showed the frequency errors I expected . https://github.com/adafruit/circuitpython/pull/2000/files#diff-91d90d4c5b3b63bdcbfca203d293a5d0R48 claims that a 22025Hz sample would end up being played at 22038.5Hz (assuming the accuracy of the 16MHz underlying clock of the PWM)
The Atmegatron uses analogue circuitry in the form of a steep 3rd order Chebyshev filter to maintain the high end, while still filtering off the modulation frequency. https://soulsbysynths.com/atmegatron/
8 BITS ∞ POSSIBILITIES The Atmegatron is a revolutionary synthesizer that takes classic 80s Chiptune sounds and adds powerful new features. Musicians will love it because it is quick and easy to create and manipulate amazing sounds. The Atmegatron can do everything from bri...
also, this would be "fragmenting" by not having a common home, but couldn't WavFile be turned into wave: https://docs.python.org/3.4/library/wave.html#module-wave
@raven canopy I like audiosource. I've been thinking about a synthio to handle envelopes and such too
hehe. conversely, i also like audiocore, because including Mixer makes more sense that way vice audiosource. (Mixer doesn't seem like a "true" source to me...since it has source children.)
@slender iron if you're picking up stm32s, just want to emphasize again how nice the DIS_F412 is! QSPI Flash, 1.5" touchscreen TFT, I2S audio codec, microphone, built in debug. We should be able to test most CPy features on it.
@ionic elk I already ordered but added to my cart for next time
I actually laid out a number of different names for this. The justification I had for this name is that it's the appearance of the board as a drive when plugged in, and follows the naming convention for the Nucleo boards, which also appear as NUCLEO_FXXXX. Plus it's the fastest to type. But some other 'standard' options are:
- 32F412DISCOVERY (ST Manual)
- STM32F412DISC (micropython)
- STM32F412G-DISCO (schematics)
- stm32f412zg_discovery
Let me know if you're set on the last one or if ...
I was thinking the same thing. If you'd like that in this PR I'll get right on it.
Haven't migrated everything to the appropriate clocks files yet! It's an ugly artifact of my early experimentation I've been meaning to get rid of, sorry. It was handy to have everything in one place right at the start but it's well past its welcome now.
If it isn't a big deal, I'd rather leave Processor to the next PR, since it's connected to USB operation. It'll be easier to just have everything together there.
How would you see the skeleton define structured?
I got this to hang twice, but only after running for hours. Getting permission to post code here.
@tannewt note where it's hanging: I'll examine more variables but want to post this now before it gets lost.
Backtrace:
Program received signal SIGTRAP, Trace/breakpoint trap.
shared_dma_transfer (peripheral=0x43000000, buffer_out=<optimized out>, dest=<optimized out>, src=src@entry=0x0,
buffer_in=<optimized out>, buffer_in@entry=0x0, length=<optimized out>, tx=<optimized out>, t...
I'm back if there's more to be said about audio.
on a grandcentral..I am using the example for the sd card..https://learn.adafruit.com/adafruit-grand-central/pinouts
I keep getting the following error..
OSError: timeout waiting for v2 card
thesd card is a 64 GB card formatted fat32
ohya.. using CP 4.1.0 RC1
doing the cardsneed to be formatted for 512 sectors?
dev, dont forget its on its own SPI port
I;m using the sample code for it I thought.
argh...
the example should work right? or are you saying I need to set some special pins @meager fog
right that is what I am using
is 64GB just too big?
I used that because it is what I have laying around
@slender iron I have reproduced https://github.com/adafruit/circuitpython/issues/2005 but only after several hours of running. Adding stacktrace info to the issue, it looks like a DMA issue. unfortunately we've lost a lot of the variables due to <optimized out>, but I got the contents of the DMA descriptors. If you have time to look and want any other values, I can retrieve them. I'll do another build with optimization turned off and run it overnight again.
I found a 32GB SDHC card andused SDformatter.. same issue
dev, you could try it in arduino
Another interesting tidbit would be the sercom registers which should be clocking the dma.
(gdb) p peripheral
$19 = (void *) 0x43000000
(gdb) p *(Sercom*) peripheral
$20 = {I2CM = {CTRLA = {bit = {SWRST = 0, ENABLE = 1, MODE = 3, RUNSTDBY = 0, PINOUT = 0, SDAHOLD = 0, MEXTTOEN = 0,
SEXTTOEN = 0, SPEED = 0, SCLSM = 0, INACTOUT = 0, LOWTOUTEN = 0}, reg = 131086}, CTRLB = {bit = {SMEN = 0,
QCEN = 0, CMD = 2, ACKACT = 0}, reg = 131072}, CTRLC = {bit = {DATA32B = 0}, reg = 0}, BAUD = {bit = {
BAUD = 0, BAUDLOW = 0, HSBAUD = 0, HSBAUDLOW = 0}, reg = 0...
@tulip sleet I don't have the brainspace to context switch now
np, I'll run it again with better debuggin on.
kk
Are you using an open source library for the FAT in Circuit Python?
@signal root it is this https://github.com/micropython/oofatfs
used by MicroPython and by CircuitPython
- some API rename e.g tud_hid_generic_report --> simply tud_hid_report
- more callbacks for msc scsi Test Unit Ready, Start Stop Unit
- usb descriptor is not get using callback instead of struct variable for better dynamic support
uint8_t const * tud_descriptor_device_cb(void);
uint8_t const * tud_descriptor_configuration_cb(uint8_t index);
uint16_t const* tud_descriptor_string_cb(uint8_t index);
uint8_t const * tud_hid_descriptor_report_cb(void);
@hierophect once this ...
Oh wait, I guess I should have asked this in the help with section.
@prime flower, @graceful heart let me know when you guys chat about the WSGI lib
@pastel panther np! @graceful heart would you be available sometime this next week to chat?
Yeah, maybe we could set a time some time to meet and chat about it?
sounds good to me
What timezone are you in @graceful heart ?
East coast
I'm on the west cost but I'm generally available whenever
@graceful heart Are you available to chat between 6PM and 7PM EST tomorrow? I could do later too.
Yes, tomorrow or today would work at those times
@graceful heart Tomorrow works better for me, I have a meeting during that time today. Thanks for the PRs, they're incredible.
Great! @pastel panther does that time work for you? And of course, happy to contribute :)
I just learned that someone made a game jame game for PewPew! https://www.epicgamejam.com/games/game-ego
The values "optimized out" will be presumably sitting in registers? What's the info register output when it's stuck in shared_dma_transfer?
The values might have been in registers or sometimes on the stack, but at the point in the code where the values are no longer needed, the compiler will reuse those locations, so they are not preserved and would get overwritten for other uses. I'd have to look at the machine code to see if they're accidentally still available. But I can usually go back in the stack and see what was passed down.
length should still be around in a register at https://github.com/adafruit/samd-peripherals/blob/83a4759d186574d8034435cd2303def85e4ed793/samd/dma.c#L192 as it's required later as a return value https://github.com/adafruit/samd-peripherals/blob/83a4759d186574d8034435cd2303def85e4ed793/samd/dma.c#L213 ? I was curious about this just because, as you noted, pixels has as a strange value.
Resumed work on _pixelbuf to harmonize it's API with pypixelbuf. Naturally I have a crash on CPX that I don't have on the Metro M4. I guess I should grab a Metro M0 and a 10-pixel neopixel strip 😃
(which undoubtedly won't crash)
(ooh i think i fixed my crash!)
FROZEN_MPY_DIRS += $(TOP)/frozen/feather_m4
i used this in my board.mk but it will not mpy all stuff in folders "adafruit_seesaw" and "adafruit_bus_device" only the "init.py" is being frozen
is there another way to use the "FROZEN_MPY_DIRS"?
length is probably fine, 0x400 appears in BTCNT.reg and sounds plausible.
I'm wondering if https://github.com/adafruit/circuitpython/issues/1992 could be related to this in some way? I'd imagine the circuitpython interpreter has little interest in the 16bit values and yet they have a profound effect on triggering the bug. Stranger still, I believe when it happens a "fix" is to append a single extra 16bit value. It's very visual on x-y oscilloscope output as the looping image starts p...
It's possible that a bizarre workaround for this is to do a single
rawdata.append(0)
on the end of the data. This doesn't make sense as for 2 channels one would expect the array to always need to be even in length!
@slender iron did something change with frozen libs?
@upbeat plover not that I know of
@slender iron was the winning suggestion audiocore?
I have an existing clone which is giving me this error. I am at the tip of origin/master. Can someone tell me the recovery procedure? ```$ git submodule update --init --recursive .
error: no such remote ref 1dabc2df8ed1acaf0c483b58d757ba72e8b42090
Fetched in submodule path 'lib/tinyusb/hw/mcu/st/stm32lib', but it did not contain 1dabc2df8ed1acaf0c483b58d757ba72e8b42090. Direct fetching of that commit failed.
Failed to recurse into submodule path 'lib/tinyusb'
@onyx hinge core is fine with me. try git submodule sync too
@dry vortex thanks, submodule sync was it. Will file away..
great!
it syncs the .gitmodules file to the .git/ copy
I prefer the last version with the part number (third) as a close second. The first two don't find the board on DigiKey and it's not clear how to modify them to. The third works straight away and the fourth works if you remove the underscore. So, merging now. :-)
OK, yay, the renaming wasn't as hard as I thought. Testing performed: build and check everything imports on a metro m4 express. Pushed, will PR it later this evening as its own thing.
hmph, failures on travis. sparkfun_lumidrive, pca10056, feather_nrf52840_express -- maybe all the nrf boards?
and feather_radiofruit_zigbee
and maybe that whole clan
well, I see the problem, don't care to stay up late enough to see the outcome on travis
@upbeat plover the frozen module logic expects a repo at each directory. It may not work if the modules are too deeply nested. Try to imitate the directory structure of an existing board with frozen modules
What lib is used for the USB flash storage on M0/M4 chips?
@signal root you asked the same question last night, I thought? Are you asking a different question?
Does oofatfs include the mass storage component?
Or just the file system component?
When I say mass storage the USB to SPI bridge?
it's the filesystem part; the SPI or QSPI (or internal flash) part is implemented by our own code in CircuitPython. Are you looking for an Arduino solution? See this brand new library: https://github.com/adafruit/Adafruit_TinyUSB_Arduino which includes USB mass storage support
that uses the SDFat library underneath
Noice :)
I'm writing my own javascript platform, wanted to take cues from micro/ciruitpython
I flashed micropython on to the m4 saved a file and used arduino_spiflash to load it 😃
I'm binding arduino calls to in the JS
see circuitpython/supervisor/shared for common code, and then see the supervisor code in each port/ we support for the device specific code
So that TinyUSB may be perfect
ok! It's brand new, so let us know if you have issues
I mean this is pretty exciting if you can build your own platform with a couple of arduino libs
yup! supporting USB storage on Arduino is a great thing
i've gotta sleep, but check later if you have questions.
Thanks @tulip sleet
yw!
I'm using platformio and I don't think the platform has USB Stack enabled
got it building 😃
Got a filesystem saving to SPI! Boom! I am super shocked at how quick I've got everything up and running!
Reproducible on a Feather M4 too including the bizarre_workaround.
When nrf pwm audio is introduced, it will be called audiopwmio. To enable code sharing with the existing (dac-based) audioio, factor the sample and mixer types to audiocore.
INCOMPATIBLE CHANGE: Now, Mixer, RawSample and WaveFile must be imported from audiocore, not audioio.
Testing performed: On a metro m4 express, I imported both modules and (without a speaker attached) played a RawSample out the A0 pin
what does this mean?
it means I got microchip to fix their stupid bad datasheet that destroyed me
this is what it used to look like
two 9s
I remember some of the "which is reality" traffic, congrats! 🎊
thanks
this is the perfect ending to my ridiculous story
I remember showing it to people and them not seeing it either, which is the scariest part lol
so glad it's fixed
I guess most people use atmel studio or arduino or whatever so it's not that big an issue
but it's egregious if you're writing your own hal
I wanna frame this darn datasheet
Your efforts will save a bunch of people a bunch of head scratching, time and frustration.
Bad datasheets are part of why I punted Microchip PIC for Atmel AVR back in the day (Microchip has improved since, which is good since they also absorbed Atmel).
yeah I guess it was atmel that had the good ones
but they're atmel now so ¯_(ツ)_/¯
maybe the hashtag should say atmel but too late
or maybe I'm playing on the irony that america is about as great as microchip
who knows
Back in the PIC days, there were two programmer protocols, one semi-documented, one proprietary. I couldn't afford the Microchip programmer, so I bought the Warp13 one instead. I didn't use DOS, so I used the open source command line tools. Then new chips came out and the Warp13 didn't have enough memory to support both protocols, so it then only supported the undocumented proprietary one 😠 so I could no longer use it if I wanted to work with the newer chips. That's when I surveyed the microcontroller landscape and settled on AVR, with it's wonderful inexpensive STK-500 programmer/dev board, fully documented specs and protocols, and wide open source support.
Now with CircuitPython, I don't need to deal with programmers, protocols, or any of that. I can program a CircuitPython board with pretty much anything that supports a standard USB serial port.
the microcontroller landscape has really improved as well
pretty much nobody uses the undocumented and closed-source ones anymore
Even TI learned their lesson.
I'm looking forward to seeing what RISC-V does
I'm still cherishing the forlorn hope that there will be open source FPGA support for other than legacy chips.
The Arduino people said they'd democratize FPGA programming, but they're not there yet.
someone will, eventually
probably by that time everybody switches to proprietary quantum computers, though
it's a red queen race
There's a reason I still play with vacuum tubes and relays.
@main meteor - I'm interested in a more detailed conversation about open-source FPGA development. Out of scope for this channel, but if you would be open to a 1:1 discussion sometime, I'm all ears.
or we could pick it up in another channel/topic area
I'm on travel today so will be in and out
Not urgent. Whenever you have some time.
I've been wanting to learn Verilog, I want a FPGA but the ones Adafruit sell are not quite what I'm looking for. I like the TinyFPGA a lot but I want a little more.
I'm a full-time Python programmer, and I just started on electronics... I am super duper impressed by CircuitPython's "first five minutes" experience! It's actually way better than CPython's, hahaha 😛 Just plugged in the board, edited the demo file, messed with the code, saw the changes, boom. It's incredible not to have to install any tooling to get to that first step.
Thanks for doing this! I removed unneeded headers from shared-bindings/audioio/init.c and looks good otherwise! We'll need to fix example code when we release a 5.0 beta. We should also get the mixer changes in since we're changing things.
I like 2 a lot! Would it be possible to link folks to a particular row and have the modules then link out to their docs? Should we make a separate page for each?
@sommersoft failing fast is interesting actually! That makes sense since it'll have to be run anyway.
@C47D We definitely do want to fail. It's just a question of when. I'd suggest adding the sys.exit back and adding the missing boards to .travis.yml so the build passes.
Thank you both!
Previous version used a "directly commit changes" to update _data/libraries.json. For good reason, this continually failed since each commit needs a review.
Adabot has been changed to instead submit PRs when updating libraries.json; similar to how release updates work with _data/files.json.
Thoughts about splitting the helper library list out a bit more into sub-categories? https://circuitpython.readthedocs.io/projects/bundle/en/latest/drivers.html#helper-libraries
such as: Helper Libs -> IoT, APIs (Hue, LIFX, Adafruit IO, Azure IoT), Display (Button, shapes, text, framebuf, image load, slideshow), Testing (board test suite, possibly a unittest down the line), Audio,
@prime flower I personally have no objections. I think it would dovetail with this idea well (for which i've spent a few brain cycles wrt to implementing "easily"): https://github.com/adafruit/Adafruit_CircuitPython_Bundle/issues/140
It's awesome that this list is auto-updated: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/master/circuitpython_library_list.md However, it's not as useful the manu...
Or just additional organization within that general category similar to how Drivers are organized.
@raven canopy I just clicked 5 helper links at random, and none of them had github topics.
i think we'd need to sweep that list
i'm not sure a single library has one. its not an easy task to update 160+ pages. but...Python is a wonderful too when combined with the GitHub API. 
i only pointed it out since there seems to be some drift in how things are organized/categorized.
yup - i agree. if we get this generating automatically, and categorically, we could add a "supported hardware" list to https://circuitpython.org/libraries
CircuitPython Organization
which is then search-ible like boards, sort by category
the PyPI ones would be easy, honestly:
keywords = read_setup_py()
github_api_update.topics(keywords)
though, the keywords may not be the best candidates.
they're good for specifics but not broad categories, most of the ones i skimmed thru
Would it be possible to link folks to a particular row and have the modules then link out to their docs?
I'm sure there's a way. With the Jinja parsing available, might be able to work up some HTML selection box magic. My HTML is lacking; but the internet is vast and full of info. 😄
Should we make a separate page for each?
At minimum, it may be best to make the support matrix its own page. With 60+ (and growing) boards, it will be a long list. I'm actually already in WIP-mode t...
@tulip sleet thank you for tip with frozen modules, i used CPX for example and now everything is working as expected
@upbeat plover Great!
I compiled with -Og to get better debugging, but I then ran for 24 hours with no failure. I changed back to -Os and got an identical backtrace to the one above, sometime during overnight testing (I set it going and went to sleep).
@tannewt I've fixed both requests, I added all the missing TRAVIS_BOARDS to travis.yml
@pastel panther @prime flower Just got home, free to chat whenever
@graceful heart I need to wrap some stuff up and gather some thoughts but I should be good to go at 7
oh ok, cool.
time.monotonic() is a floating point number of seconds, right? On a trinket m0 express, that's 30 bits? Won't that hit precision barriers within a few months?
ah, I guess people have been thinking about this already, it's mentioned in passing in some github issues
i see, there's monotonic_ns() for some boards
I think the only board that isn't building properly is trinket_m0_haxpress:
Build trinket_m0_haxpress for zh_Latn_pinyin took 17.81s and failed
make: Entering directory '/home/travis/build/adafruit/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
-184 bytes free in flash out of 253440 bytes ( 247.5 kb ).
24664 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).
Too little flash!...
So if I want to run 10 steps per second on a stepper motor forever, I should use monotonic_ns() and compensate for wrapping around sys.maxsize?
status: creating audiopwmio in shared-bindings / shared-module and adapting nrf pwm audio to use it
- Fix terminal clear after first successful code.py run.
- Fix transmitting too many bytes for column constraint with single
byte bounds.
@bitter hearth In case you've not read it already, time.monotonic() discussed in https://forums.adafruit.com/viewtopic.php?f=60&t=141785
@simple pulsar thanks, the thread identifies the issue but I don't see it resolved there 🤷
It does point out that I should look at the C source for .monotonic() though...
I only want an accurate dt within a second of the last time I checked, so I think I can just subtract the last common_hal_time_monotonic() from the current one and use that... just have to do it in C instead of python
@pastel panther @graceful heart I'm in the vooice chat when you're ready
@prime flower im mid reflow
ok!
Are there CircuitPython C libraries that aren't built as part of the core? I'm clicking around the library bundle and not finding any
guess I should be in the "help-with" channel
@bitter hearth I don't think you can "dynamically" load a native code module that is not part of the core, like you can import a .pyd on windows python...
ah, okay, thanks
aahh heck, there goes that
@tannewt While this is unfinished due to pause/resume being missing, I think the renaming and the bulk of the work is done.
@raven canopy what is the right way to run adabot so it adds the environment variables to travis for new repos? python3 -m adabot.circuitpython_libraries -v validate_travis
haha. been too long since i ran it...had to look it up: -t/--token -v "validate_travis"
kk
While I'm looking at audioio/audiocore documentation to appease travis, I noticed a lot of blocks that say Sample must be an `audiocore.WaveFile` or `audiocore.RawSample`.. In general, do these sites also permit a Mixer object?
@raven canopy how is that different from ADABOT_GITHUB_ACCESS_TOKEN?
@onyx hinge ya, I think they should
@slender iron OK, I guess I'll just add audiocore.Mixer to the list everywhere I find those two
oh, hm, can you give a mixer to a second mixer?
@slender iron different? i may have misunderstood your question...
@onyx hinge I think so
It seems like it might be an unusual use, but my expectation from the code is that it would work
@raven canopy the flag is confusing me. when true, it prompts for a password
im having an issue with circuitpython-stage my game doesnt display... I can hear the sounds from the game but all that is displayed is Blinka in top-left of black screen
@stuck elbow is this a know issue or have i done something wrong
@upbeat plover what version are you running?
Adafruit CircuitPython 5.0.0-alpha.0-45-gd99d3bd47-dirty on 2019-07-25; Adafruit Feather M4 Express with samd51j19
totally possible I broke it
@slender iron which env var are you wanting adabot to set? -t and validate_travis will set the token for Travis in GitHub for the repo and create the GITHUB_TOKEN on Travis.
it -t used for more that setting GITHUB_TOKEN?
nope
https://circuitpython.readthedocs.io/en/4.x/shared-bindings/audiobusio/I2SOut.html refers to audiobusio.RawSample. Is this wrong?
ok, it seems weirdly named to me. I expect something like --prompt-password
@onyx hinge probably
its easily changed... 😄
yup, will do
I wonder if there's a board with I2SOut but not audioio. Now, such a board wouldn't have audiocore.. but it wouldn't have had audioio before, so surely somebody would have noticed it was broken.
oh yeah, now i remember. i used -t/--token because -p/--print exists. otherwise i would've done -p/--prompt.
but "is" will be "was" soon, nrf will have audiocore + audiopwmio
I think that no, nrf doesn't have audiobusio, but from datasheet it does HAVE both pdm for audio in, and i2s for in AND out
@raven canopy kk, will probably just not have a short version
actually leave t as the short
the nrf port on my laptop has audiobusio... PDMIn just doesn't work. 😄
@raven canopy do you mean you have a work-in-progress ? Or that nrf has it, and I'm overlooking it?
WIP
OK, I hope that the audiocore stuff doesn't get in your way (on the whole I think it should help)
it shouldn't hurt. and being able to play what my mangled filter is trying to do, instead of copying the REPL output and trying elsewhere will help. hehe
@slender iron FYI, you know https://github.com/adafruit/circuitpython/pull/2011 has travis failures, right? [moved from wrong channel]
nope, will look later
i assume not urgent due to upcoming weekend
makes sense since I changed the constructor C api but not the direct calls to it 😃
nope ssd1322 driver won't work but that's ok
I'm camping all weekend anyway
'night all. I'll check my pull#2000 for travis errors in the morning, probably I got something wrong while fixing docs or enabling audiocore based on audiobusio too
(I'm just scared of pause/resume and making work to avoid it)
night!
I tweaked a couple small things to get it to build and then this should be ready. Thank you so much!
Thank you for the rename! This is very close. One more name suggestion and a build to fix. (Looks like builds that disable audiobusio.) Thanks!
Could you rename this to PWMAudioOut or PulseAudioOut too? That way it'll print differently than audioio.AudioOut.
Is it possible this isn't working when CIRCUITPY_AUDIOIO = $(CIRCUITPY_FULL_BUILD) is late bound?
Nice work! I agree piping this to circuitpython.org would be nice. We could use it in search so we get a grid of all boards with a particular module.
Separate listing page sounds good to me too.
writeto will now always output a stop bit and writeto_then_readfrom
has been added to do a write -> no stop -> repeated start -> read
sequence. This is done to match the capabilities of Blinka on Linux.
Code broken by this change will have been broken on Blinka anyway.
To fix, if stop=False then use writeto_then_readfrom otherwise use
writeto then readfrom_into.
I tweaked a couple small things to get it to build and then this should be ready. Thank you so much!
The explanation must be something like that. I'll dial back the cleverness here.
Thank you for the rename! This is very close. One more name suggestion and a build to fix. (Looks like builds that disable audiobusio.) Thanks!
This is going to break a lot of stuff. Would it be possible to have the writeto_then_readfrom added for one release, and then remove the stop parameter in the next, to give more time for users to update? Otherwise I will have to maintain two versions of all of my libraries.
I wonder if there are pathological I2C chips for which we still want fine control of stop. Blinka is constrained by the underlying Linux support, and we don't need to match its foibles if there are cases where it's limiting.
@ladyada do you have a comment here?
@raven canopy fwiw I ended up dialing back the cleverness of when to enable audiocore, so you'll just want to toss CONFIG_AUDIOCORE = 1 in your .mk after all.
clever code rarely is
MICROPY_VM_HOOK_LOOP was provided in MicroPython vm.c to allow tasks to be run at safe points (between bytecodes) in the VM. It is defined in CircuitPython as run_background_tasks();, and we use it many more places when we're busy waiting for an indefinite period and need to service background tasks. It's also guarded by #ifdef, rather unnecessarily.
Let's create a new macro and redefine the old:
#define RUN_BACKGROUND_TASKS run_background_tasks()
...
#define MICROPY_VM_HOO...
the I2C FRAM needed repeated-start for reading the device id but not for data. https://github.com/adafruit/Adafruit_FRAM_I2C/blob/master/Adafruit_FRAM_I2C.cpp#L109
most chips specify they want a stop but will work fine with repeated start, so we default to repeated start in the register library and it works just fine.
https://github.com/adafruit/Adafruit_CircuitPython_Register/blob/master/adafruit_register/i2c_struct.py#L86
i prefer we keep stop in and throw an exception for linux w...
Well, if a chip wants a stop, then that's fine — you can do that simply with a second transaction. The problem is when you want to do a repeated start, without the stop. writeto_then_readfrom is one case of that, but there are three other combinations (write-write, read-read and read-write) that can potentially be used by some chips. I think I only saw write-write myself in the wild (write the register address, do a repeated start, and write the register value).
But I think it would be...
I'm going to watche/listen to the CircuitPython Deep Dive but where is the stack for the CP interpreter? Is there any guarantee that it can't clash with other users of the SRAM or detect if it does? I ask because the data buffer + length ends up in SRCADDR and that's 0x2002fd40 which is fairly close to end of (M4 192k of) SRAM at 0x2002ffff.
Yes, we have stack checking: https://github.com/adafruit/circuitpython/blob/master/py/stackctrl.c#L55. The VM interpreter does a check at opportune times, and there's a 1kB safety area. Most routines don't allocate large chunks of stuff on the stack.
anyone around that can help me? I am having problems with getting the bootloader folder to show up on a trinket - i have followed these steps and the usb driver will install and show the usbtiny device but when I double press the reset switch no folder appears on my pc for me to load a uf2 file.. im on windows 7 x64 and also tried a windows 10 pc with the SAME results https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting
In this commit:
- new pin layout for Robo HAT
- two boards included (SAMD21 and SAMD51)
- added build linker file for SAMD51 with external flash + crystalless
- updated names to reflect m0 and m4 chips
- updated travis.yml
Should not impact on other boards AFAIK.
There's two variable length arrays (presumably on the stack?) at the end of this highlighted piece of code: https://github.com/adafruit/circuitpython/blob/master/shared-module/displayio/__init__.c#L24-L63
I've not yet figured out exactly what the code is doing but buffer_size has potential to be 128 which means a 4*128 = 512 allocation on stack for buffer[] plus whatever mask[] size is.
Is it worth checking some MP_MAX_STACK_USAGE_SENTINEL_BYTE (0xEE) are still present where e...
One other observation, displayio_display_begin_transaction() is called three times in https://github.com/adafruit/circuitpython/blob/master/shared-module/displayio/__init__.c#L78 but the one highlighted is the only one that doesn't check return code.
https://blog.japaric.io/stack-overflow-protection/
Describes how to put the stack at the bottom of RAM (with heap at the top) providing an automatic way to check overflow. Requires linking twice.
Thank you for auditing this code!
@tannewt Take a look at these issues:
I've not yet figured out exactly what the code is doing but
buffer_sizehas potential to be 128 which means a 4*128 = 512 allocation on stack forbuffer[]plus whatevermask[]size is.
mask[] can actually be quite large. It could be pretty much the size of the whole display. So suppose it's 320*480, that makes mask length 4800 + 1. @tannewt Note how large this can get.
I set a breakpoint in the s...
@sommersoft @tannewt np, always happy to help :)
Don't merge yet (if Travis passes). As I was preparing an updated screenshot, I noticed some logic failure...
This was easier than I thought!

The current example code for the Peripheral class currently throws a NameError.
So...downside of this: Sphinx on Travis runs in a Python2.7 environment. Took me a minute to spot the "real" error.
Easy answer is to revert back to using a file. Other option: get us building on current version of Sphinx.
I put in a pull request about two weeks ago, fixing some typo class bugs in the Adafruit_CircuitPython_SI5351 driver. It was approved and merged the same day. But, it has never shown up in the Adafruit_CircuitPython_Bundle distribution. Is there something else I need to do to get it into the bundle?
@lunar crown the library needed a new release. i took care of it, and it should be in the bundle by monday at the latest.
@heady raft you have a classic tiny85 trinket not a trinket m0, it cannot run circuitpython (its a very old board)
@raven canopy TNX
Can I just say Great Job who has already ported over the boards to the CircuitPython.org website. I started porting over my board but it is already there 😄
Thank you!
In this pull request:
- added robohat m4
- updated robohat m0 to reflect name changes in circuitpython
This is another SAMDG2118A design with built-in 9V motor controllers
that are designed to be used with Lego PowerFunctions devices.
geda cad files for this design are at
https://github.com/keith-packard/snekboard
Signed-off-by: Keith Packard keithp@keithp.com
@gilded cradle I have to round the backlight float or it gets wacky. Without rounding it skips around like it should be 0.96, 0.92, 0.88, ect. but it does stuff like this 0.9645, 0.9189, 0.8548
from minitft_featherwing import wing
import time
# Turn off backlight
wing.backlight = 1.0
time.sleep(0.1)
while True:
for i in range(25): # fade on
wing.backlight = round((wing.backlight - 0.04), 2)
time.sleep(0.05) # slow down signals to seesaw
for i in range(25): # fade off
wing.backlight = round((wing.backlight + 0.04), 2)
time.sleep(0.05) # slow down signals to seesaw
@upbeat plover Is it hurting things that the numbers aren't exact? One alternative would be to write (for the "fade on" case), wing.backlight = i / 24 so that the backlight changes from off (0.00) when i=0, to full on (1.00) when i=24 on the last loop.
(or maybe (i+1) / 25 .. recalling that range() likes zero, so range(25) goes 0, 1, ..., 23, 24, which is 25 numbers, but doesn't actually include 25)
@tulip sleet when I update my clone of master I get this error Synchronizing submodule url for 'tools/uf2' Synchronizing submodule url for 'tools/usb_descriptor' error: Server does not allow request for unadvertised object 1dabc2df8ed1acaf0c483b58d757ba72e8b42090 Fetched in submodule path 'lib/tinyusb/hw/mcu/st/stm32lib', but it did not contain 1dabc2df8ed1acaf0c483b58d757ba72e8b42090. Direct fetching of that commit failed. Failed to recurse into submodule path 'lib/tinyusb' do I need to do something different -- I update with this ```git submodule sync
git submodule update --init --recursive
git submodule foreach --recursive 'git fetch --tags'
@solar whale I encountered the same thing recently. tannewt recommended me to "git submodule sync", and I think that fixed it.
Thanks -- did not seem to help for me ...
drat, I was hoping I had the answer
and now that I read what you said, you already had tried that
trying a clean clone
@solar whale I saw similar issues, but a clean clone fixed it
even my super duper:
alias gitsubupdate='git submodule sync --quiet && git submodule update --init --recursive'
did not fix it
ok -- happier after clean clone
obviously we need to add more arguments to that command
maybe a couple of --force and --hard will help?
@upbeat plover, you could always add a new property or function if that helps. I just didn't want it breaking existing code.
@marble hornet what was the reason you converted 0-255 to 0.0-1.0? you were first one to do so in https://github.com/hexthat/TFT-FeatherWing-Lib/blob/master/lib/adafruit_mini_tft_featherwing/tft_featherwing.py
It takes longer to execute the code and creates even more math down the line.
@gilded cradle its not even correct the way it is now
wing.backlight = True
turns off the backlight not on
FYI -- this is a breaking change for the CircuitPlayground Express CPX library
fwiw, I think that it would be possible to keep the classes in audioio either for a limited time (like, would appear in both places in 5.x, and be only in audiocore in 6.x) or even forever. The "price" would be just a few dozen bytes in the dictionary of audioio. I'd be happy to double check this and submit a pull request if that's what @tannewt would like.
Meanwhile, I would also be happy to help out with some import logic in cpx to adapt to either circuitpython version, if that w...
Pull request #2018 adds support for SnekBoard, which is a SAMD21G18A board with 9V motor controllers for use with Lego Power Functions motors and sensors. I'll need a 'real' USB VID/PID before this pull request should be merged.
@upbeat plover I used a float because it is closer to a percentage and It felt more intuitive
And how often is brightness set: once or twice?
And while 255 is used for colors that is a paradigm people learn when they start doing display programming but display brightness is a paradigm you many people are familiar with before they start embedded / display work
Thanks for the pointer, sorry I missed that part of the documentation. I've also opened issue #2019 to get a PID assigned for this board. That should be resolved before this pull request is merged.
Here ya go!
Keith P Snek VID 0x239A PID 0x004D # bootloader
PID 0x804D # arduino
PID 0x804E # circuitpython
awesome, thank you - i assigned you some VID/PID's for your usage!
@jepler its not a problem for me -- I have already implemented the changes I need for the test I was doing. I just wanted to make sure it was a known issues since it is likely to cause some problems for users.
@upbeat plover, I wanted it to be between 0-1.0 to be consistent with the neopixel and dotstar brightness values. We could check the parameter type passed in and if it's bool, set the value to 255 (skip the calculation) andFalse to 0. We could potentially take anything over 1 and use it as a raw value and anything between 0 and 1 to be the percentage. Only confusing value would be a value of 1 since it may mean full brightness and may mean nearly dim. That's why I suggested a new property or function.
who wants core docs built with Sphinx 2.1.2 (current)? cause, i have 'em building locally. 😉
sadly, i barely understand how i've done it. 😆
Thanks so much! I've updated the code, and also submitted a pull request for the uf2 bootloader project https://github.com/adafruit/uf2-samdx1/pull/78.
@raven canopy sounds great! if you want to do a PR that would be fine.
how do i build older version of CP? im stuck on 5.0.0
checkout an older tag
@tulip sleet due to changes in an existing PR, its getting tagged on there: https://github.com/adafruit/circuitpython/pull/1985
just battling Travis. the usual "works local, never on CI." game. 😄
also just noticed earlier, Travis finally has Bionic available.
Because what I always need is another distraction, I was going to look at changing how lis3dh.shake (the method which checks if the device is being shaken) works. Where do I put the file so that it will override the one that is frozen in? (note: can't actually start on this right now, the cpx is at home and I'm still in ohio -- just gathering information)
you can force the import location, iirc
from .lib import lis3dh
can't remember if the . relpath works in cirpy...
Makes sense, I'll try that first.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: __main__
``` well that doesn't seem happy.
Looks like maybe putting it just directly in the top level could do it
try without the .?
is there a meeting tomorrow? I might be able to at least listen in, if I can find some free wifi at the right hour
should be. i don't remember any cancellation notice.
I'll try to check in
@onyx hinge yup! we're meeting tomorrow
Hi all, we'll have our normal CircuitPython meeting at 11am Pacific / 2pm Eastern tomorrow here on Discord. Everyone is encouraged to join. Here is the meeting notes doc for it: https://docs.google.com/document/d/1Nf7-76XfJN_4uTwfvHyRNtHLUNHfL_-U6BjF6ZzAlGk/edit?usp=sharing <@&356864093652516868>
@slender iron i'm going to merge the "check travis builds new boards" PR, if you don't have anything further? its gonna raise a few conflicts on open PRs, but thats easy to deal with.
This will definitely be a useful check! Thanks again @C47D.
a1db6c4 [Draft] Add check to travis to make sure new bo... - C47D
b279d6b [travis new boards check] We now have two lists... - C47D
ae41bb3 [travis new boards check] sort both lists of bo... - C47D
fc15941 [travis new boards check] Exit with failure if ... - C47D
22c265b [travis check new boards] Reduce code logic to ... - C47D
sounds good. thanks @raven canopy
Hi there!
I just made a few small changes to pins.c. These should not conflict with existing boards.
Please let me know when this is likely to be merged in
😄 Thanks!
@raven canopy how do I go about resolving conflicts about TRAVIS in my pull request no. 2014 ? I would imagine this could be an issue impacting all other boards.
@craggy galleon According to github help, you can resolve the conflicts using the web interface, which will help by showing you areas that have been changed both by you and other contributors. https://help.github.com/en/articles/resolving-a-merge-conflict-on-github
do you have that button when you look at your pull request?
@onyx hinge I know where the conflict is. The issue is that every PR for a new board updates the same file (.travis.yml). I am just wondering if there is someone who manages it / resolves them.
Do you have any experience with fixing these types of merge requests?
@craggy galleon Yes, though I haven't personally done it via the github web interface
do you want to try to walk through the steps together?
Sure! That would be great!
My concern is that someone else's PR will go before #2014, then the same process would need to be followed.
I think that your change was just to add a new board or board(s) to those lines, right?
That's right. 😃
In that case, the way I would do it personally is to just delete the lines from "<<<" to "===" which represent your changes, and re-add your new board(s) to the TRAVIS_BOARDS lines that remain.
Also delete the ">>>" line
Yeah sure - that sounds easy enough. Give me a minute and I'll do that now.
Should I double check which boards have changed?
Well, by starting with the side that was marked "master", you know you are starting with the most up to date list. So I think you can be confident and just add your new board
it is a very simple case, just not quite simple enough for git or github to be able to do it automatically
OK, let me pull up the pull request again
Travis CI is just checking I didn't break anything. Thanks Travis! 
the github page is loading slowly for me, but yeah it looks good
congratulations, you now know how to resolve a merge conflict!
Thanks @onyx hinge !
also, thanks for your work on circuitpython. I'm sure somebody will be along soon to (hopefully) approve your contribution!
Hi @tannewt,
I will not be able to work on this on short term, but I will try to fully understand the problem and solution. Fuzzing sounds like fun, I have not done it before, I gues I can build CP for Unix and fuzz it there.
@onyx hinge @craggy galleon thanks for getting the conflict worked out! it's an unfortunate situation when the PRs get stacked up like that, but its unavoidable. (I was this close to working them myself last night, but I'd rather the PR owners know what's happening so to keep their branches up to date.)
@c47d I'm not sure how I would apply fuzzing to this particular class of problem, but there's a blog post I wrote on how to apply fuzzing to find crashing bugs in circuitpython: https://www.unpythonic.net/2018/03/26/Fuzz-testing-CircuitPython.html
@jepler Thanks, i will take a look at it on lunch time :)
I am interested in implementing some version of low power sleep for the nrf52840. From looking through the code it bit, it seems like there are timers and loops that need to be run continuously for CircuitPython to function as expected which complicate the issue.
My first goal would be to implement a new module to sleep on command. A secondary goal would be to merge the low power code in with the time.sleep function.
Could someone give me some pointers on where to start, what things to ...
We currently use the SysTick timer in all our ports for general timekeeping (msec ticks and smaller): see ports/nrf/tick.c. SysTick is available on all M0/M4 processors: it is not manufacturer-specific. SysTick is based on the processor clock; when the processor sleeps, its clock is turned off, so SysTick will stop working.
So tick.c et al would need to be changed to use the RTC instead. The RTC can be set up to run all the time, even during sleep. There are similar RTC peripherals on ...
hmph, trying to connect to the audio meeting from a Panera, but I'm getting "no route". Must not comply with their policy.
@drowsy geyser can you say something over the voice channel for a minute? I'm trying to figure out whether I can listen this way or whether I need to switch over to tethering
(I won't be talking, but I did put my hug report and progress report in the document)
@onyx hinge I can't really - open office space. 😃 I'm ostensibly working.
newsletter DRAFT for folks who want a sneak peek of what is coming out on tues, and what will be in some of the notes/etc. for the weekly here in a few mins 😃 https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2019-07-30-draft.md
@drowsy geyser I understand how that is
Hi all!
ah here come some people
o/
Howdy.
← lurking
Lurking.
lurking
low power sounds like fun to hack on
Lurking today. Hugs, though, to Jerry, LadyAda, and Brentru for analyzing and fixing the "gamepadshift" error on PyPortal with the latest firmware and bundle.
deep sleep at the least would be super-useful
years ago, "jeenode" did a blog for years about this sort of thing. he was doing sensors.
hi scott
Oh, so I guess I'm text-only instead of lurking. 😃
PyOhio - Kattni's Keynote!
https://twitter.com/EWDurbin/status/1155111965053915137
https://twitter.com/WillingCarol/status/1155165692934574081
Every community should be lucky to have someone as caring and inspiring as @kattni. I'm so glad that you are part of the #python, @CircuitPython and open learning community at @adafruit. #PyOhio2019 https://t.co/iQwL8CiYfP
STM32 support snakes its way to CircuitPython!
https://blog.adafruit.com/2019/07/28/stm32-discovery-f412zg-and-f411re-support-snakes-its-way-to-circuitpython-stmicroelectronics-st_world-circuitpython/
8/8/2019 is CircuitPython day!
https://blog.adafruit.com/2019/07/29/diy-light-painting-wand-using-circuitpython-by-iayanpahwa-circuitpython/
Scott wil be on ASK AN ENGINEER and we have some cool surprises next week!
In the news:
The MagPi Magazine: Control servos with CircuitPython & Raspberry Pi <-- MakerMelissa!
Issue 21 HackSpace magazine: CircuitPython storage
stemma and stemma QT - easy connections!
https://youtu.be/_Cu7UOcGL14
https://learn.adafruit.com/introducing-adafruit-stemma-qt?view=all
STEMMA is not an original idea, we’re working within an ecosystem of many other plug and play systems. We started STEMMA in 2014, and intended to be compatib...
excellent idea!
Snekboard v0.2 Update: Snek sneks its way to CircuitPython
https://keithp.com/blogs/snekboard-0.2/
snek is a cool language in its own right
Made with Mu - A HyperCard inspired GUI framework for beginner developers in Python
https://github.com/ntoll/pypercard
https://twitter.com/ntoll/status/1155567530876055552
Here's the code for the "classic" Celsius/Farenheit converter GUI example... it's actually only 44 lines of Python..!
PyperCard should be quick, simple and easy to make work. Also, in time it should work on Windows, OSX, Linux, Android and iOS. :-...
Help name our Pygantic PyPortal :)
List of names in the newsletter:
https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2019-07-30-draft.md
just lurking
Whoop I don't know if this is a big deal but we might not want to use Nucleos as the STM32 pics in the news issue! They aren't supported and aren't on the schedule as they lack critical USB components.
We're focusing exclusively on the Discovery line
Speak up Brent
Links if you need em
https://www.st.com/en/evaluation-tools/32f412gdiscovery.html
https://www.st.com/en/evaluation-tools/32f411ediscovery.html
@turbid radish Just adjusted my mic - factory is loud 😃
@ionic elk - noted, thank you!!
I think Kattni is out the next 2 meetings still
😃
@gilded cradle I think so, but I haven't caught up with her after her keynote.
@drowsy geyser did you have hug reports to give?
@slender iron Yup, hugs to Jerry, LadyAda, and Brentru for fixing issue #46/#47 on PyPortal (the gamepadshift bug).
what I think I overheard about videos is that everybody organizing pyohio is going to take a deep breath before getting the videos online so be patient
they really knocked it out of the park, they deserve hug reports too
I put that FeatherWing in Awesome Feather
Word of the day: Orthogonal
"Medicine Man" product claims.
It's a floor wax and a dessert topping: https://www.nbc.com/saturday-night-live/video/shimmer-floor-wax/n8625 (from 1976)
Nothing for me
@tulip sleet I won't get the paraphrase right, but Greg Svoboda (who gave the other keynote) quipped that when he learned hexadecimal, people told him, "you'll never need to know that". Well, when he learned bluetooth, he needed hexadecimal.
that got shown off at pyohio
hm, the "regular" gcc that is in debian isn't in raspbian? https://packages.debian.org/buster/gcc-arm-none-eabi
Thanks, team. Keep up the fantastic work!
Thanks everyone!
so happy to sit in on the meeting today thanks to pyohio and a travel day. I'm going to try to shift my regular schedule to enable me to come more often.
@onyx hinge arm-none is for bare boards. We'd recommend using the download from the arm site. The ARM toolchain developers seem to no longer be doing any packaging themselves
The hardware concept for the Waveform Gen FeatherWing's CPy library/driver
@onyx hinge @tulip sleet I wasn't aware Buster had ver7-q2; it may be an option now. But I doubt they'll do any better at keeping the package rolling with version changes (Stretch is still on ver5). That is why I was following the new "download straight from ARM" approach. They only offer 64bit, or source...
and, I'm still a bit noobish at this level of knowledge
no, the version in buster won't see updates unless there's an actual security problem discovered. buster-backports might. I understand why the project would standardize on a particular one so that everyone seems the same results as travis, but in practice the debian buster compiler has been working for my nrf stuff
and then the part where I'm noobish is how / when things get from debian into raspbian, sooo
Looking at that package, they have an armh version, so it should get rolling released on the RPi.
I'm still not sure that arm64 ( Debian renamed from aarch64) will run it. I'll most likely be learning/fighting with dpkg. 😁
One suggestion for the board module list. It also needs to be updated for a .travis.yml conflict. Otherwise, it looks good and I'm excited to see CircuitPython on the Snekboard. Thanks!
You'll want to remove this entry since the pins for the default SPI bus are commented out above. Right now, it's not smart enough to know it'll be None.
@slender iron Looks like @simple pulsar is already aware of the MIDI running status issue. https://github.com/adafruit/Adafruit_CircuitPython_MIDI/issues/8
something changed in audioio that broke stage
File "stage.py", line 166, in play AttributeError: 'module' object has no attribute 'WaveFile'
@upbeat plover in the 5.0 master you have to import it from audiocore now
@upbeat plover pull request please? :)
@stuck elbow PR done almost did typo and do "audioiocore" but i caught it and did "audiocore"
should the audioio/core changes be made so thay are "backward compatible" try/except?
im still having issue where ugame stuff doesnt show, just blinka top-left and black-screen, everything works fine 4.1.0-rc.1
@upbeat plover is that an nrf?
feather_m4_express with minitft_featherwing
@solar whale why do i need both audioio and audiocore? AudioOut is only in audioio
@stuck elbow the PR has the sound working now, but now both audioio and audiocore are imported
audiocore contains the source of sounds now (aka RawSample, WaveFile and Mixer)
"When nrf pwm audio is introduced, it will be called audiopwmio. To enable code sharing with the existing (dac-based) audioio, factor the sample and mixer types to audiocore." Is this so if you dont need everything you can just import AudioOut if thats all you need?
it's so that ports can support audiocore without audioio. (the nrf doesn't have a dac)
Nice! Is this ready for re-review and merge?
@jepler My preference is to just move it. If you leave it in the old place there is no reason to update code. That being said, could someone post a sample import that is backwards compatible for folks? Thanks!
random Q, would the adafruit_is31fl3731 benefit from being part of displayio?
it'd certainly be interesting!
lotsa similarities to the oled stuff
16x9 isn't a lot of pixels
not at all, would the fonts have to be redrawn?
the builtin is smaller than that but it wouldn't fit much text
I kinda assume we'll want some sort of scroll for displays that small including the charlcds
So, yes it looks like we should check we have enough stack left.
mask's size should be limited by buffer_size because it holds one bit per pixel of the current area (clipped.)
Yup, the volatile is debugging leftovers.
I'll likely rework the begin_transaction stuff with the e-paper work I'm starting. As it is now, the first check causes a chip select blip that we don't need.
i did PR for CPX so it works with 5.0.0 how do you sperate stuff for like a 5.x bundle?
I realize this is super nitpicky but please rename the files and function names too from audioout to pwmaudioout. Future us will thank you for the consistency.
One more naming consistency nitpick then it should be good to go. Thanks!
@tulip sleet https://github.com/adafruit/circuitpython/pull/2011 is ready for review when you have a chance
Fix terminal clear after first successful code.py run.
Fix transmitting too many bytes for column constraint with single
byte bounds.
@tannewt did you see any issues with the DMA descriptors? The above issues are interesting, but I don't think that code gets called anyway in this case, where it hangs waiting for the DMA to finish.
This makes sense to me but we do actually allow for different stack bounds: https://github.com/adafruit/circuitpython/blob/master/shared-bindings/supervisor/__init__.c#L111
We could remove that if we like. I doubt we want to get in the business of moving the top of the stack on the fly.
@slender iron Great! going out soon but will review later tonight or tomorrow morning
k, np
I doubt the dma_descriptors are corrupted by the stack because they are on the other side of the heap. However, it's worth looking to see what is placed next to it in memory.
It is weird that DRE is high on the Sercom since it should trigger a DMA burst to fill it. This could happen if the DMA wasn't ready when DRE was triggered I think.
I wonder if it's related to the DMA issues @ladyada and @PaintYourDragon saw with the nintendo emulator and eyeball code.
We should be able to get this in shortly! Just one comment about the linker script. Thanks!
I don't think you need a new linker file so please reuse the existing one.
We run most M4s crystal-less now I think. The crystalless linker script is only needed with CALIBRATE_CRYSTALLESS on M0 which stores crystal calibration into flash.
@crowecawcaw I'd recommend starting without usb and just loading code over a debugger. USB is timing critical and will be unhappy if the background task isn't called. Once you get it going off of usb then I'd start by just disabling sleep when on usb. Later, if needed, we can make it work with usb.
@slender iron it's a perfect time to nitpick me, I'm at the airport and it's an alternative to looking at flight delays
🛫
It is ready for a re-review.
👍
Untested, but I believe you would want to write, for any or all items that you wanted from audiocore,
try:
from audiocore import RawSample
except:
from audioio import RawSample
At this point, RawSample will be available as an unqualified name. You could also write (untested)
try:
import audiocore
except:
import audioio as audiocore
At this point audiocore.RawSample will be available as a qualified name.
When I'm at home, I have a CPX...
@ladyada It's not clear to me that we need fine grained control of stop. Looking at the FRAM, the device ID read looks like the standard write (address 0xf8 has data direction 0 for write), no stop, repeated start, read (0xf9 is the same address with direction bit high) that we'll now have with the composite call.
I'm all for not limiting ourselves to what Linux can do. However, in this case I think Linux does everything that I2C devices need and by aligning our APIs through implicit con...
I think this PR is fine and maybe release notes too. I'd tweak the except line to be except ImportError: to ensure it's only due to the module missing.
Yup! Looks good to me. Thanks!
No problem. I would want to test this first though.
LD_FILE = boards/samd51x19-bootloader-external-flash.ld
or a very low res game
oh travis you're so very particular
@slender iron this documentation building problem was caused by the rename; is "one more rename" (so the end user will refer to audiopwmio.PWMAudioOut) necessary, or what do you see as the resolution? /home/travis/build/jepler/circuitpython/shared-bindings/audiopwmio/__init__.c:12:toctree contains reference to nonexisting document u'shared-bindings/audiopwmio/AudioOut'
it looks like an assumption about class names vs C source filenames to me
that's going to get tricky even if it builds, since shared-bindings/audioio/AudioOut.c also uses the class name AudioOut. RTD doesn't have "branching" for the ports...
wait. nevermind. thought just completed. they'll live under different modules...
needs to make dinner so brain functions properly
@onyx hinge I think its a toctree issue
Yup! Looks good to me. Thanks!
@onyx hinge make sure to pull changes. I tried to fix the last bits
we think it only happens when you have two running DMA tasks. it was extremely sporadic and hard to repro so i patch-fixed it by detecting the 'DMA lockup' and kicking
https://github.com/adafruit/nofrendo_arcada/blob/master/nofrendo_arcada.ino#L136
im ok with it for 5.0 :)
Looks great! I'm excited to use newer sphinx too. Thanks!
f1256c0 add script to gather module support matrix info... - sommersoft
4342383 add jinja extension; update shared-bindings/ind... - sommersoft
9ccebb0 run support matrix script on travis - sommersoft
42ed841 fix late-night directory snafu - sommersoft
7378744 update regex module use to be python3.5 compatible - sommersoft
egads... that table has no wrapping. 😬
found fix #1! hehe
but, it all still works as intended, so i'll take that. 🎉
@slender iron thanks, I'll try to resort the urge to force push the branch
Do we need to test this with an FRAM breakout or do we know it will work?
@slender iron is there an update to the ssd1306 lib for displayio? Or did I misunderstand? I don’t see a recent update.
I wonder if there's a way to generate the board list within a a Travis job instead of having to manually maintain it
Even if the balance was not quite ideal
i had that too. even thought about having a log file in S3 to handle load balancing.
Ooh that would be way beyond anything I had thought of
i mean, at 700+ assets to build, its not a small task we're asking of Travis. its going to take time.
i plan on deep diving on why the Polish builds take like 8000% more time to build. i'm thinking its more to do with its completeness as a translation, but it'd be interesting to try and trim the PL build times. (that % number is wholly hyperbolic...)
Yeah in that light 50 minutes is pretty fast
Were you involved in making the translations work?
i was not. i don't even understand it fully. 😄
I haven't looked but want to someday to understand it
Our else join you in perplexity
i think its just a matter of inline-ing from the .po reference files. strong think though.
As in it literally makes new source files?
Sign up for the next newsletter, shipping in less than 24 hours - Celebrating 2 years, and 6,000 subscribers! Sign up now "Python for microcontrollers" https://www.adafruitdaily.com
@ladyada @tannewt This is in the errata: is this relevant?

While this is "initially" done, there is a slight problem. Which actually isn't new to us.
The generated table does not wrap the text: https://circuitpython.readthedocs.io/en/latest/shared-bindings/support_matrix.html#support-matrix
After some searching, this is primarily a sphinx-rtd-theme issue.
There exists a workaround, which is already implemented in docs/static/customstyle.css. However, it doesn't seem to work for ...
@onyx hinge that's the point where i lose understanding. hehe
At some point maybe this should turn into a struct, which you could initialize with slot names, and then pass a pointer to the struct, to save passing so many positional arguments. Maybe it could be static. Doesn't have to be now.
Looks good! Just cosmetic comments, which don't need to be fixed now. I'll let you merge.
pixels_per_byte * self->colorspace.bytes_per_cell could be computed just once. We'd hope the compiler would take care of this.
So this makes a negative shift, I think? A comment or example would help the reader.
@solar whale it's a separate library so rpi users aren't stranded
it looks like the translation procedure produces a very big function which linearly searches through the list of all original strings and returns the related translation. It must be depending on the optimizer to find at compile time which one of the strings is actually the result. However, it seems like the size of the translation is always the same no matter the target language
.. in translate.c, inline __attribute__((always_inline)) const compressed_string_t* translate(const char* original)
@pulsar ferry were you serious about "pt" translation taking longer to build? I didn't duplicate that finding here, not even 10%
though I'm not using the sanctioned gcc version, I'm using whatever's in debian buster
@onyx hinge not pt. pl. its always around a minute. e.g.: pca10056 takes <3 seconds for every language, and pl takes 52 seconds.
though, i just realized that its the first language to get built for each board. i vaguely remember a "don't rewrite po files" speedup recently.
hehe
discord was autocorrecting me. hilarious.
could be related, but i was seeing 0x3 in chstatus which would be BUSY + PEND

only when reading other people's autocorrect misadventures.
.. and now bad airport wifi is about to cut me off unless I pay
so bad it made me say a cuss, sorry 😦 😦
goodnight @raven canopy thanks for encouraging me to understand how CP does translations a little better!
it shoud be fine, if you need a stop, you'd implement as two commands instead of one...
@onyx hinge night! enjoy the air travels!
that's the best part. only good part? something like that. 😄
it is amazing that when it works you can go all the way across this huge country in just a fraction of a day
Right. They even complain that they don't have Trio's "nursery" concept. (Well, they could use the "anyio" wrapper, which does provide the equivalent.)
It'd be interesting to rewrite the same code in Trio and compare the pitfalls.
When I read that article I found it quite pro-asyncio, despite the inflammatory title: "I do believe asyncio is quite user-friendly, but I did underestimate the inherit complexity concurrent programming brings."
In fact, I think it supports the stance that you should not try to build a simpler system - asynchronous code is difficult, as the author says: "whether you use asyncio, Twisted, Tornado, or Golang, Erlang, Haskell, whatever".
Tested - Done. Going to remove the extra linker script
In fact, I think it supports the stance that you should not try to build a simpler system - asynchronous code is difficult
Sure, but it doesn't have to be that difficult.
Writing something like the Happy Eyeballs algorithm takes 50 lines in Trio but 500 in "native" asyncio. That should tell us something. As should the fact that the people responsible for asyncio plan to evolve it into a Trio-ish direction as quickly as possible.
@tannewt requesting review 😎
Hi !
I am having more issues with timers and CircuitPython using a SAMD51G19A this time.
I have been doing some testing and discovered that the CircuitPython is reporting that all timers are being used. I have done a table check and think this might be wrong or not using all the available channels. - happy to be told otherwise.
From the Datasheet
| Servo | Pin | TC | TCC | TCC |
|---|---|---|---|---|
| 8 | PA08 | 0.0 | 0.0 | 1.4 |
| 7 | PA09 | 0.1 | 0.1 | 1.... |
Could you post your entire test program?
No problemo!
It is here (posted link to save on comment space):
https://github.com/robotics-masters/mm1-hat-cpy-native/blob/master/experiments/backup-v1.5/tests.py
I am looking at robothatmm1/pins.c, and I see these pin definitions, which are somewhat different that you posted in the first post:
// SERVO Pins
{ MP_ROM_QSTR(MP_QSTR_SERVO1), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_SERVO2), MP_ROM_PTR(&pin_PA17) },
{ MP_ROM_QSTR(MP_QSTR_SERVO3), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_SERVO4), MP_ROM_PTR(&pin_PA19) },
{ MP_ROM_QSTR(MP_QSTR_SERVO5), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_SERVO6), MP_ROM_PTR(&pin_PA10...
OK, never mind, that's the SAMD21 board. But where is the SAMD51 board definition?
You can add some print statements in common-hal/pulseio/PWMOut.c to print out the timers and channels. I started to do this but it would be more direct if you did. To print, do this (adjust args as necessary):
mp_print(&mp_plat_print, "%d %d\n", something, something);
I did add a print statement and tried this on a Metro M4 but unfortunately not all the pins you are using are available on that board.
I am not sure, but I think the assignment logic more goes by the FUNCTION po...
Looks good to me! Thank you!
I think this is ok to close. It's probably best to have separate pages for each board which explain what is present and what is missing.
Is binascii not in within CircuitPython 4.x builds?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'binascii'```
same with hashlib too even though it's listed on latest? https://circuitpython.readthedocs.io/en/latest/docs/library/hashlib.html
oh, hrm
Some libraries are only enabled only WiFi-capable ports (ESP8266, nRF) because they are typically used for network software: binascii, hashlib, uheapq, uselect, ussl.
Are there plans to add these to libraries to 5.x since WiFi /networking is utilized by some boards (AirLift, PyPortal)?
I just fixed the merge conflict and will merge after Travis is ok.
Ya, wish C had kwargs. Does using a struct prevent the compiler from optimizing things?
Will add in my follow up epaper PR. Going to merge this now so I can base the epaper work on it.
This may be a silly question but is there a good way to develop and debug the CircuitPython source? Does anyone have suggestions for a free IDE that could make things easier? Right now, I'm editing code, compiling, and refreshing every change but it's difficult to tell what's going on without breakpoints or the like.
Snekboard is designed to control Lego robots using Power Functions
motors, servos and switches along with whatever other devices you can
devise. Snekboard runs CircuitPython and Snek.
Signed-off-by: Keith Packard keithp@keithp.com
@tannewt you mentioned getting "the mixer" fixes -- if there's an issue or pull, can you link it?
I verified both workarounds,
try:
import audiocore
except ImportError:
import audioio as audiocore
and
try:
from audiocore import RawSample
except:
from audioio import RawSample
with a circutplayground express using 4.0.2 and tip-of-master.
@crowecawcaw, when I was dev'ing primarily on Win10, I used Atmel Studio 7. Breakpoints and I/O registers were a bit of breeze. The [major] downside though was being forced to compile in a VM. It may be possible to overcome that, but I never figured out a way.
I did try to get Segger Embedded Studio working as an IDE on Linux and Win10, but never got anywhere with it.
On Linux, using GDB became just as fast as AS7 in most cases. Especially after I started using a [breakpoints file](http...
Hi @dhalbert ,
It has been merged in last night to the main CircuitPython repo in PR #2014 :
https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/boards/robohatmm1_m4/pins.c
{ MP_ROM_QSTR(MP_QSTR_SERVO1), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_SERVO2), MP_ROM_PTR(&pin_PA19) },
{ MP_ROM_QSTR(MP_QSTR_SERVO3), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_SERVO4), MP_ROM_PTR(&pin_PA21) },
{ MP_ROM_QSTR(MP_QSTR_SERVO5), MP_ROM_PTR(&pin_PA11...
I'm getting an unusual build error. ```Warning, treated as error:
failed to reach any of the inventories with the following issues:
intersphinx inventory 'https://circuitpython.readthedocs.io/projects/busdevice/en/latest/objects.inv' not fetchable due to <class 'requests.exceptions.SSLError'>: HTTPSConnectionPool(host='circuitpython.readthedocs.io', port=443): Max retries exceeded with url: /projects/busdevice/en/latest/objects.inv (Caused by SSLError(SSLError(1, '[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)')))
I'll try again in a bit in case it's a problem on their end, but circuitpython.readthedocs.io loads in my browser
sphinx-build 1.8.5 running with python3 (everything from pip), and I swear it worked last week
@onyx hinge with my PR getting merged yesterday, we're now running on Sphinx 2.1.2. but that looks...Travis-side.
@raven canopy huh so despite trying to use pip(3) to get it, is my sphinx seriously out of date?
smh
shouldn't be too out of date. if you do update to sphinx 2.x (py3 only), you'll need to pull from master though, as there is an update to c2rst that allows it to work with 2.x.
Hello I'm brand new to the circuitpython community. I had the distinct pleasure of Meeting @idle owl at PyOhio and she encouraged me to begin my journey by joining this community. I appreciate all her words of encouragement and I'm excited to be here and start on my GBPhoneHome Project (name credit goes to Dan Lindeman)
👋 welcome @brazen bluff!
@raven canopy it's working now, so yay?
hmmm looking at the support matrix, which is my goal, I see that there are some boards that have "audiocore" but not "audioio", like Adafruit Feather M0 Adalogger. This may be a mistake due to my PR that added audiocore.
@brazen bluff welcome! I was at pyohio but I didn't meet anybody who looks like your avatar there. Don't miss the #help-with-circuitpython channel too
@onyx hinge now that you mention it I didn't see any owls ? 😃
🦉
@raven canopy yeah I did something "smart" for audiocore that confuses the autogenerated support matrix. I think it's not actually the case that "audiocore" is in the Adalogger, just that the script doesn't understand what I put in the .mk file
the support matrix is fresh...and rigid. i wouldn't make decisions based on its result. its easily changed... 😄
here's what I did, which was intended to make it so that boards with audioio automatically got audiocore. It was lazy.
ahh. there are a few others like that already. wiznet, terminalio, etc.
i would've brought it up #in-the-weeds, but i couldn't attend the meeting. just need to have a larger conversation about it. one option is to just write the special cases into support matrix. core code shouldn't exactly bend to the docs.. 😄
Would you like me to file an issue, or do you think you'll remember this?
i'll remember. its got a wrapping bug. but, the initial issue is still open, so i'll add it there too. (i noted it in the PR, as well)
OK, thank you for working on this!
doh! i missed a tannewt reply to the original issue recommending closure. new issue it is. hehe
Closing, then. I'll make a new (or two) issue with some outlying issues, and include the "future page-per-board".
make -n -p BOARD=... | grep ^CIRCUITPY_ will get you the content of relevant makefile variables after all the parsing is done, but sometimes variables still refer to other variables in this listing.
Anyone know if you can edit code on a CircuitPython board using an iPad and USB connection kit?
@onyx hinge yeah, that's the issue at hand. the script reads cirpy_mpconfig.mk to establish the "base", then reads mpconfigport.mk and mpconfigboard.mk to determine inclusion/exclusion. but for those few that don't have a direct on/off correlation, they aren't captured. well, except for FULL or SMALL build.
was that just really fortuitous timing? lol
@near wedge see blog post ^^^ 😄
that is kinda cool
indeed!
Yay! This will come in handy for Defcon! 😄
@graceful heart I just had a chance to finally try out the color picker server demo. It works great! (once I fixed a bug that had nothing to do with your code) 😃
Now that the first iteration of the new module support matrix is done, it needs more work. I'm going to put a few issues into this single one; if anyone would rather have them broken up feel free (or let me know).
- [ ] Text does not wrap in the matrix table:
There are some CSS settings that are in/docs/static/customstyle.cssthat should force wrapping inside the table. They are somehow either getting overwritten, or not included.
- [ ] **Some modul...
rolling through the labels for that issue, i realized Hacktober is like 2 months away. 🎃
@tannewt BusDevice is huge in terms of memory and rather slow. I'm controlling displays on PewPew with I2C, so speed is rather important.
I'm not concerned with me failing to update the library. The scenario I'm concerned with is me updating the library, which then fails to work with all the older versions of CircuitPython, because people didn't update their boards immediately (or can't do it, for instance because they use HUZZAH). That would mean I either would have to effectively support...
@pastel panther :)
I think we might want to re write the demo app to not use 3rd party scripts hosted on a cdn. Works great when your client is connected to internet, but I tried using in conjunction with AP and obviously since my device is connected to the esp AP, it doesn't have internet to download the scripts from a cdn...
So we can either include the downloaded assets in the static folder, or just re write the JS app to not need them. Wouldn't be as cool if you had to type in your rgb values though....
Below are some test results:
[LOOP] Initialising...microcontroller.pin.SERVO5
use new... TCC1[7] 2
[LOOP] Initialising...microcontroller.pin.SERVO6
use existing... TCC1[6] 2 1
[LOOP] Initialising...microcontroller.pin.SERVO7
use existing... TCC1[5] 2 1
[LOOP] Initialising...microcontroller.pin.SERVO8
use existing... TCC1[4] 2 1
[LOOP] Initialising...microcontroller.pin.SERVO1
use new... TCC0[6] 2
[LOOP] Initialising...microcontroller.pin.SERVO2
use existing... TCC0[7] 2 0
...
I guess this sort of shows the issue.
TCC 0 is not being selected in some cases.
I have a working theory on this one. I think there could be an issue with the logic of selecting pins with the same existing TCC timer. Since this is the first part of the function - in other words: It will also check on an existing first - it might rule out some valid pins in later stages.
I am doing some more testing on this now to see if it can be worked out. I see no reason that a valid pin s...
Yes, it's quite possible there's a bug in the "what is free?" logic. It wasn't scanning in the way I thoguht it would, but I haven't had time to desk-check the code with a number of examples.
Two things at play here:
- I think I just have another unfortunate pin selection.
- It is going by lowest TCC timer rather than 'first function'
I have been working off this table for which pins are sharing CC Channels:
Compare Channel: 4
Wave Output: 8
Valid for: SAMD21 TCC0, TCC1 - SAMD51 TCC1
| 0 | 1 | 2 | 3 |
|---|---|---|---|
| 4 | 5 | 6 | 7 |
In fact for TCC0 on SAMD51 it should be:
Compare Channel: 6
Wave Output: 8
| 0 | 1 | 2 | 3 | 4 | 5 |
|--|--|--|--|--|--|...
After spending some time looking through the code base, my plan is to make a module that has a function low_power_sleep() that will put the processor in a low power state until the time elapses. From what I can tell, there are 3 types of timers in play:
- RTC: This is constantly running and is used for time.time(). It runs even if the processor is in low power modes.
- SysTick: Based on the processor clock cycles (very precise) and is used for general timing including time.sleep() and tim...
I wonder if we should have separate issues for tracking this on different ports?
Personally, I would be more interested in being able to wake up on a gpio change than on a timer, so that we can get rid of those power switches from our hardware designs.
The nRF and SAMD RTCs both tick with 30.5us precision, so it could be used for time.sleep() and time.monotonic() pretty successfully, I think.
@umbral dagger ask here please
@slender iron I'm using fill_area to grab pixels from the display. It works as expected on a PyPortal, but on a PyGamer the result is rotated 90 degrees counter clockwise.
the displays are oriented differently
in the init code
pyportal is the weird one
the intention is for the buffer to align with the real orientation of the display
I thought that if an interrupt was firing quickly, it would prevent the processor for staying in the low power state for very long causing the power consumption to remain high. In this instance, the RTC would be triggering interrupts every 30.5us to increment the ticks. By configuring a timer to interrupt less frequently (100ms or so), the processor would be mostly sleeping and its power consumption would remain very low. The power consumption then would not depend much on the type of timer o...
@slender iron Is there a way to determine the rotation?
I'm happy with saving a screenshot rotated, but the width and height don't reflex the rotation, so they'll need to be swapped. Knowing what the hardware is could be used to flag special cases... but that's cumbersome as new boards are released.
ya, width and height are weird like that
feel free to add a rotation property
could even add the ability to set it
@slender iron OK... looking into that where would you suggest it? board? display?
I guess Display
@jepler This is the PR I'm thinking of: https://github.com/adafruit/circuitpython/pull/1365
@umbral dagger yup, display
@tulip sleet @raven canopy is the latest mixer code here: https://github.com/adafruit/circuitpython/pull/1365? (@onyx hinge for context) I restored the branch because it had been deleted
@slender iron I believe that is where I left it. I still have my local branch. I can get it back to current an submit a PR.
@slender iron Would it be possible for binascii to be built with 4.x? I tried adding it to mpboardconfig.h and got 3 of errors relating to mbedtls/ . The pure-python implementation I have works but it's pretty slow
@prime flower what do you mean by possible?
@tidal kiln any idea why usb would fail on one pybadge but not another? https://forums.adafruit.com/viewtopic.php?f=60&t=154635
@slender iron I wanted to import binascii (https://circuitpython.readthedocs.io/en/latest/docs/library/binascii.html) so I can use it with a RSA lib I'm working on. But I found out that it's only enabled on wifi-capable ports (ESP, which doesnt exist in 4.x, and NRF).
Are there plans to re-enable it on samd ports in the future, or would I be better off going with a python implementation?
I don't have plans to add it but that doesn't mean it couldn't be added. What APIs of binascii do you need?
@slender iron weird one. not sure. want me to iterate a bit to offload you?
@tidal kiln sure! I'm not sure what the next steps are with them.
sha256 would also be useful from hashlib, as well. (https://circuitpython.readthedocs.io/en/latest/docs/library/hashlib.html#hashlib.hashlib.sha256)
I'd suggest filing issues for binascii and hashlib.
Sure!
binascii should be moved to the shared-bindings/shared-module split
@crowecawcaw My debug process is documented here: https://learn.adafruit.com/debugging-the-samd21-with-gdb I use it on SAMD51 and nRF too.
Binascii is available in WiFi ports (ESP/NRF), but not SAMD ports.
Specifically, I'm interested in the a2b_base64 (https://circuitpython.readthedocs.io/en/latest/docs/library/binascii.html#binascii.a2b_base64) and b2a_base64(https://circuitpython.readthedocs.io/en/latest/docs/library/binascii.html#binascii.a2b_base64) methods from the binascii API for a RSA implementation I'm working on.
Hashlib is not supported on SAMD ports of CircuitPython.
The SHA256 is useful for a RSA implementation I'm working on. SHA1 is useful for TOTP, and MD5 may come in handy for performing checksums for files on CIRCUITPY.
@graceful heart I finally got around to trying the wsgiserverdemo. It worked great -- so much to learn... Thank you!
The CPython bytes.hex() property does not exist for CircuitPython bytes objects:
>>> b'\xf0\xf1\xf2'.hex()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'bytes' object has no attribute 'hex'
There's a prescaler for the RTC's, so you can divide down the 30.5us ticks to a slower interval.
I ran this program, ^C'd it, and then did ^D to do a soft reload. This doesn't always happen, but it did happen several times, so I tried to provoke. Probably not related to BLE. Notice it's crashing inside the import of adafruit_displayio_ssd1306.mpy.
"""CTS demo
"""
import board
import displayio
import terminalio
import time
import adafruit_displayio_ssd1306
from adafruit_display_text import label
from adafruit_ble.current_time_client import CurrentTimeClient
d...
As a workaround, you can use binascii.hexlify(), I think.
@dhalbert binascii does not exist within samd ports (https://github.com/adafruit/circuitpython/issues/2022). Hexlify also returns a bytes object, .hex returns a string object.
@solar whale 😃 
@slender iron PR soon
@slender iron i did
try: import audiocore except ImportError: import audioio as audiocore
but it still is failing travis... I tested code on my CPX and my test melody.py is playing on stable 4.0.2 and 5.0.0
I just fixed the merge conflict and will merge after Travis is ok.
I verified that the merge commit works on the hardware. Thanks for merging!
@upbeat plover it looks like pylint is complaining about audioio possibly being imported twice:
import audioio
try:
import audiocore
except ImportError:
import audioio as audiocore
This is a tricky one... 🤔
you can replace import audioio as audiocore with just audiocore = audioio
That seems like a useful trick here. I do wonder how mangled the global is after that ImportError. It may work, but imagine it's an interesting web...
not sure what you mean by mangled?
ImportError happens before any code is executed from the module being imported
Right. But audioio is already imported...
looks like new displayio broke stage :(
yeah i havent been able to get ugame to display in 5.0.0
@raven canopy imports are cached, you can re-import a module as many times as you want, and nothing will happen
I wish I weren't so sick, I could look into it
@slender iron any idea what has changed? I basically only call displayio_display_set_region_to_update and display->send
I can't see anything suspicious in those functions
I think I found the problem
Thank you @tannewt and @dhalbert both for the tips!
I have a new lowpower module running with a sleep() function that runs correctly off a timer. The function waits for an interrupt repeatedly until the timer interrupt fires. Current the current draw is sitting at 2.5mA. I've compiled the firmware without the softdevice option which I'm assuming prevents the bluetooth hardware from being initialized and run. Are there other interrupts which could be preventing the processor fro...
@upbeat plover @raven canopy I sure didn't try that compatibility block under pylint. It sounds like the assignment version mentioned by @stuck elbow might be a workaround
Do you have any sort of ideas as to a timeline on this, or where it fits in on the roadmap. This would be super helpful for a project we're currently working on. If we were to write a Python extension in C, would we have access to the Arduino BLE libraries to implement BLE HID from that route? Or would it need to be done from scratch.
If you came to a conclusion about what did work, I'll get it added in a note on that PR
(it's confusing, at $DAY_JOB, PR is a problem report, so sometimes I say PR when I mean issue..)
the other option is to just disable the pylint flags.. 😉
@raven canopy with the support matrix, was it "just coincidence" that it got transposed (so that boards run down the left and modules go across), or was it a deliberate choice?
this is going to be an interesting merge conflict unravelling on my Mixer branch. good thing compilers are smarter than i am, and can point me in the right direction. 😄
fixed it
@onyx hinge deliberate choice.
Since the changes in displayio, displayio_display_set_region_to_update
no longer sends the write_ram_command, so we have to send it explicitly.
I still am thrilled every time I use a debugger on a microcontroller. it's like the future
OK, time to figure out how to pause/resume audio! or at least spend a solid 30 - 45 minutes working towards taht
@onyx hinge it does look much better when the text wraps properly...
oh yeah you are on the right track
and it will be so much better for humans that they can look up the board name, not have to know if it's a samd
by the way, I see there is meowbit in the adafruit shop, any chances for having circuitpython running on it? it's stm32f4 wth an extra flash spi flash
i was just looking at that, cool new board
it's been around for a while
their support sucks hard, though
they have a license-breaking closed-source fork of the mu editor executable, only for windows, for example
(mu is licensed GPL, they don't provide source code)
when i was first looking at a dev board i was gana get a micro:bit, but i heard they were UK made and i seen CPX was USA... now im here
alright! pausing and resuming a RawSample now works on nrf
and a wave file
there was just a bug in my wave file test program 🤕
Good timing: I have been working on this today. The code is really all in Python: the C BLE modules provide the infrastructure. The code is relatively complex because of the complexity of HID. It needs pairing and bonding: I have pairing working, but have not yet implemented bonding (remembering the pairing info so you don't need to re-pair).
No promises on when it will get done, but it's my current task!
just a normal day in software land. build 3 just failed on bringing MixerVoice up-to-date.. 😄
Are you getting further each time though?
I'm going to go do a happy dance for a little while and then re-test everything and find out what I broke while adding pause...
discovered and fixed one bug in here, though: a RawSample would only loop, I think 131070 times...
@tannewt is this done?
haha. clearly not enough. "Loop Uptime: 4 years, 16 days, 13 hours, 6 minutes, 28 seconds"... 😄
I'm using a sample program that makes one repetition of a "440 Hz" sine wave, so that's right around 5 minutes
actually testable
Implemented by #1993.
Implemented by #1993.
That's great! Thanks.
Implemented by #1042.
Seriously fantastic news. Are you developing this on a public branch or repo? Would love to check it out and maybe help if you're looking for outside contributions. Thanks!
travis is having trouble counting how long things take today
was it really fast? really slow? who can say!
@tulip sleet fwiw I'm looking at the new gcc snapshot, at the point of seeing if the travis build will finish. before_script.19 388 0.01s$ (! var_search "${TRAVIS_SDK-}" arm || arm-none-eabi-gcc --version) 389 arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 8-2019-q3-update) 8.3.1 20190703 (release) [gcc-8-branch revision 273027]
on the off chance it succeeds I'll put up a PR; if it fails, I'll add notes to https://github.com/adafruit/circuitpython/issues/1887
blargh ```Old compiler (7-2018-q3-update)
Build trinket_m0_haxpress for pl took 72.58s and succeeded
Build trinket_m0_haxpress for zh_Latn_pinyin took 18.23s and succeeded
https://travis-ci.com/adafruit/circuitpython/jobs/221025799
New compiler (8-2019-q3-update)
Build trinket_m0_haxpress for pl took 199.69s and succeeded
Build trinket_m0_haxpress for zh_Latn_pinyin took 61.75s and succeeded
https://travis-ci.org/jepler/circuitpython/jobs/566215443
that's not gonna fly
@onyx hinge - yeah we did this experiment a few weeks ago, and we were really disappointed
maybe due to -flto
@tulip sleet I don't think things will work without lto, will they?
they'll be too big. i need to do some websearching to see whether there's a fix for this (like turning off some expensive optimizations or something)
I'll document my findings so that a third person doesn't come along and try the same thing
What a disappointment what such a huge performance regression could go out. I wonder what the story is.
It maybe they just built the compiler with optimization off
try an m4 build without -flto and see if gcc8 is closer to gcc7 there.
I can do that while I'm documenting timings, sure
Supposedly clang can build for arm. Has anyone tried that, that you know of?
Hmm the build failed anyway. I didn't drill down yet to see why
Oh, time limits
😭
Great! Thanks for testing.
56f710f Add board support for keithp.com SnekBoard - keith-packard
7736e71 Add snekboard to .travis.yml - keith-packard
326df70 Fix snekboard names - keith-packard
4387ecf Update snekboard PID to official value - keith-packard
9a37c8a boards/snekboard: Add pin aliases for UART and I2C - keith-packard
Sorry I missed that! Thanks for the fix.
Yup! It just hasn't been auto-closed because it hasn't been merged into master.
@onyx hinge I tried clang a while back and the code size was 10s of kilobytes larger
@slender iron 😦 okay
ya, I'd love if it worked
hm, any timings I generate locally are suspect since my baseline is debian stretch's gcc, not the one y'all use
(same for sizes)
I found, and @dhalbert confirmed, that the 8-2019-q3 compiler is significantly slower (more than 3x as long!) to build. The whole build doesn't succeed on travis, because it exceeds the 50 minute timeout for jobs.
Old compiler (7-2018-q3-update):
Build trinket_m0_haxpress for pl took 72.58s and succeeded
Build trinket_m0_haxpress for zh_Latn_pinyin took 18.23s and succeeded
https://travis-ci.com/adafruit/circuitpython/jobs/221025799
New compiler (8-2019-q3-update):
B...
one of these days someone will rewrite circuitpython in rust
I'd love it if someone figured out how to interop with rust
yeah I heard that a wealthy recluse with a lair on a volcanic island was going to provide the funds
would love to use it for new modules
I think it generates normal object files?
¯_(ツ)_/¯
@onyx hinge in my experience funds don't help much, a bored programmer helps much better
I speculated this might be -flto, but other people are also seeing much slower compile times: https://community.arm.com/developer/tools-software/oss-platforms/f/gnu-toolchain-forum/13503/gcc-g-version-8-very-slow-to-compile
@nickzoic @dhalbert can this issue be closed up? It looks like it was covered by #1736.
@stuck elbow your stage audiocore changes havent made it into current CP
with fixes, everything working for feather_m4_minitft_featherwing the ugame
Implemented by #1046. Thanks @jepler
This will be in 5.0.0-alpha.0, and is already available in the master builds here on S3: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin
rust has good ffi
probably not impossible
do you need c-interop or python interop or both?
@slender iron
and c-interop is even easier
hi all! Question for everyone: What do you think is the best way to author a project that has dependencies on Circuit Python libraries (like from the bundle, for example) ? Does a requirements.txt make sense? I don't think a pip install would download the deps in an easy to get to location though?
Is the best option just to write a well documented Readme that points to the latest release of each library the project has a dependency on?
this looks good too https://crates.io/crates/pyo3
@graceful heart yeah, at this time, pointing to the latest release for either the bundle or the library itself is best. for non-Github-oriented folks, this is probably the best link: https://circuitpython.org/libraries
takes a little guesswork out.
So the problem is that the DHCP process is run asynchronously: the python code keeps running while the wiznet device is attempting the get an address. If it can't get an address then the while loop will never exit: you'd need to do something cleverer like giving up after 20 times around the loop and trying something else.
However, you should be able to interrupt the time.sleep(1) in the REPL (with ctrl-C) and the hard fault obviously shouldn't be happening and the flash shouldn't have...
@graceful heart I was working a little bit on a python script that would look at a yaml config file and copy listed circuit python libraries from the bundle onto a device. I stopped working on it for a bit because I realize I was making it over complicated, but I may finish it at some point just in case people want to use it.
https://github.com/tammymakesthings/cpydeploy has my code as I left it when I realized I was making it more complex than it needed to be.
hehe. i have a similar one; auto forking and local git updating for every library repo. GitHub API is a wonderous thing. 😄
I need to keep reminding myself of that principle of “do the simplest thing that could work, and add complexity when you need it and not before” 😂
Premature optimization is a real problem sometimes.
but that's just...no fun. haha. i like cpydeploy; looks good!
Thanks! I need to get back to it and at least clean it up. I also need/want to start contributing to circuit python, and finish a couple of projects I have on my bench. However, I am moving from CA to AZ in a month, and I suspect none of those things is going to happen until after I move.
yeah, moving definitely stalls other stuff.
Yup. I am moving into two new roles at work, presenting a panel at my company‘s customer conference in two weeks, and then moving in early September. A lot going on right now.
I said to a coworker the other day that I’m actually kind of grateful that I have way too much to do to be able to spend time freaking out about how much I have to do. 😂
haha! been there. congrats and good luck on the new roles (if they're desired...)!
Thanks! They are, and they potentially pave the way to some very interesting opportunities a year or so from now.
its "break time" for me. i over-pruned this merge conflict, and my brain is telling me "nope. not doing that right now". 👋
Plus they give me an opportunity to really make a difference for my company and for our customers. (I am a recovering DBA/Dev, and a manager at a software company.)
recovering DBA/Dev
🤣
Your brain sounds like it’s making a wise suggestion.
I was a decent DBA, and I was a decent Dev before that, but I’m discovering that I really have a knack for leadership. The team I’m going to be leaving to take my new role is in a healthier place than it has ever been at any time in the company’s history, according to my boss.
"proof is in the pudding". leadership isn't easy. and to paraphrase something i picked up somewhere (and use a lot): "management is not leadership. anyone can manage. leading takes passion."
Yup. And a fine balance between confidence and humility, I think.
definitely. i've enjoyed most of my leadership roles. some...are just no-win situations. 😄 ok..now i'm off.
Yeah.
@tannewt I think this is ready for another review. I've updated the initial text of the pull request to reflect the state of testing.
Since some parts of audioio were moved to audiocore, we now have
to import them differently.
Hi @deshipu I appear to be having the same problem as @jadudm described in the initial comment. Reviewing the instructions you referenced (https://circuitpython.readthedocs.io/en/latest/docs/troubleshooting.html#file-system-issues) they ask me to "Download the appropriate flash .erase uf2 from the Adafruit_SPIFlash repo." and linked here https://github.com/adafruit/Adafruit_SPIFlash/tree/master/examples/flash_erase_express. Unfortunately there are no uf2's there.
Are there updated instruc...
I'm trying the libraries and examples from the bundle and realized the joystick pins are swapped, whenever I move the joystick UP or DOWN the values I receive are from the JOYSTICK_X, same for the y axis (LEFT or RIGHT) is this normal behavior? any suggestion?.
This is my code:
`import time
import board
import analogio
def read_x(samples=3):
reading = 0
for sample in range(0,3):
reading += x.value
reading/=3
return reading
def read_y(samples=3):
...
Which version of CircuitPython are you using?
Can someone point me at the docs for translators? Or, really, my question is: are translators intended to edit the .po files by hand, or is there some suggested technology to help them out? Or, really, my statement is, I'm excited about https://weblate.org/en/ and I wonder whether it should be investigated for circuitpython
@onyx hinge only https://github.com/adafruit/circuitpython/issues/1098 There are GUI tools that help manage the editing of .po files, but I haven't tried them
it looks interesting, the free tier for libre projects has some limitations but I don't understand what they are
@nickzoic Would it be possible to have a wiznet.connected property within the wiznet module which I would poll against, instead of the while/sleep code?
. If it can't get an address then the while loop will never exit: you'd need to do something cleverer like giving up after 20 times around the loop and trying something else.
Should this be handled within the wiznet module itself? Or in the code.
Can you let us know the exact circuitpython version you were using, eg: the filen...
Can you try with 4.1.0-rc.1? I know the pins were swapped in the early versions, not sure in which version it got fixed.
@deshipu It works incredible well also the example for cursor_control works smoothly any ideas on why is that? is it better to stick with the unstable version? Many thanks for the help!
anyone know of any other libs that need audiocore fix? I just did CPX with @stuck elbow fix.
@upbeat plover maybe the rtttl?
The pins were swapped by error, and it got fixed in a later version. It should get released as stable soon.
did PR for rtttl
@stuck elbow not sure why but CP is using "circuipython-stage" 6d1ae72916 and not master
oh i see why in CP it says its using "circuitpython-stage @ 6d1ae72916"
should it be @ master?
Submodules are tagged to commits. On a local, you can point the submodule to master. But the moment you push it, it will reflect the current commit.
@raven canopy wouldnt that be a good thing? error will be caught faster?
@upbeat plover no, it uses an explicitly released and tagged version
this way we can keep doing development on the master and not break CP
@idle owl Welcome back, and awesome keynote at PyOhio!
@ruby atlas Thank you!
@tidal kiln p0ng
anyone using Visual Studio code to program their CP stuff?
I seem to remember a blog post or something that there was an extension for VSC that enabled the output to be seen.. ie print statements.. but I can't find the extension nor the post.. like the serial console in Mu
@swift arrow this one perhaps? https://blog.adafruit.com/2019/01/02/using-visual-studio-code-to-program-circuitpython-with-an-adafruit-neotrellis-m4-adafruit-neotrellis-circuitpython/
no that is the one that keeps popping up in my searches.. I think it was like an adafruit blog or something
lol which that is also a blog.. but I'm after the one that talks about the name of the experimental serial console like the one in Mu
I wonder if I can't find it because "Mr Lady Ada" talked about it on a show..
argh.. I swear it exists somewhere
The one from Scott Hanselman shows the serial console being used in one of the screenshots. 🤷
doh... nope
@meager fog p1ng
@idle owl do you have a dotstar strip someplace I can test the _pixelbuf refactor on? I think I thoroughly broke it in my latest branch.
@tidal kiln hihi for the seesaw firmware
its almost certainly that bug
so question - if we dont use the callback to query the # of pixels, it still works
@ruby atlas Yep! On it. 😃
not sure. i think the number of pixels is needed. it's parameter to the call that actually does the writing.
me->m_pixelDataSize here:
https://github.com/adafruit/seesaw/blob/master/source/Neopixel.cpp#L219
@idle owl Thanks! That strip will do fine. Now to wire it up to the Metro M4 so I can also connect the Segger.
@tidal kiln ahh i mean, is it that we only store 255 for the length of the buffer, max, or that we can only address
its def a bug, i think it was a miscommunication, we should support 255+ 'pixels' but got turned into '255 bytes'
the samd09 doesnt have a ton of memory but should be able to do maybe 100 pixels
the samd21 has 'infinite' ram 😃 can do 1000
@ruby atlas I usually use the little grabbers on exposed jumper. can be a pain keeping them in place though..
the actual buffer size looks like it is set differently for different targets
it's just that variable for the length
@raven canopy yeah it's a real pain. I need to solder things up more permanently at some point. I've been using alligators.
@tidal kiln ok how about we return 16 bit no matter what, then?
yep. that's the fix.
ok please patch it and try it on raspi/feather if you can
im a lil swamped today with a script writeup
but i can also test
basically just change to uint16_t here:
https://github.com/adafruit/seesaw/blob/master/include/event.h#L479
