Yes, there should be a space included in this prefix. The validation script I gave @dherrada yesterday should verify it.
#circuitpython-dev
1 messages Β· Page 303 of 1
@lucid solar Interesting! I'd love to see your draft of it. I don't know cmake so it'd be tougher for me to do.
I'm also making sure you can build it directly without having to use their ./install.sh scripts etc.
My feeling is that it shouldn't be included. A helper python function can always do it and it wouldn't take up the flash space. (Lower power is out of space on two boards now which has me wary of adding else to the core objects.)
Cool cool! Thanks for the PR.
Note that this uses the capitalised module name
Cryptoto be compatible with the pycrypto module at https://www.dlitz.net/software/pycrypto/api/current/Crypto.Cipher.AES-module.htmlI've added documentation, but I'm not sure if I documented it correctly.
Let's not match pycrypto at the package level. Lets only have the aes module API match. That way we can turn on and off crypto algorithms at the module level. So, the cross-platform import would be:
import sys
if ...
@dhalbert All requested changes have been implemented. Thank you for the guidance.
Comments
-
With how
supervisor_flash_init()is structured in external_flash.c, it was necessary to add an extra define ofEXTERNAL_FLASH_NO_JEDECin my mpconfigboard.h file to establish the proper flash device. This is because members of theflash_devicestruct are not yet accessible at that point, but the JEDEC response is used in establishing it. -
Three new members were added to `external_...
Thanks for the PR! The doc style looks right to me. Just a couple API comments.
We don't want to mimic pycrypto. I got the wrong python module. (PyCrypto was last released in 2013.) It looks like cryptography is the recommended package: https://docs.python-guide.org/scenarios/crypto/
Instead, I think we want our own APIs that only feature encrypt_into and decrypt_into that both take two arguments, the source and destination buffers. They can be the same or different. Omitting the methods that return new memory means folks are less likely to generate a bunch of g...
@xobs Would you mind PRing the '833 board defs? I have a dev kit I can try it on here.
@tulip sleet do you have cycles today to do further lower_power tests for me? I'm curious if master has a problem for and and if you can repro on a debugger
@slender iron i've lost track of things - what's the desire for pixel_order? should it be a string, a tuple, or support both?
looks
I imagine it should use the pixelbuf variables and not care what the value is
where are those defined?
@slender iron I can try master, within an hour or so.
@tulip sleet ok, that would be awesome. poking at it now. chatting with helen soon I think
@onyx hinge No rush. When you get a chance, can you reply to this? I am assuming you may know. https://forums.adafruit.com/viewtopic.php?f=60&t=164898
circuitpython could support user code at the C level, if external modules could be added without having to modify the core. This could be achieved by implementing make fragments as is done in micropython.
The broader context of this issue can be found in https://github.com/adafruit/circuitpython/pull/2811
@idle owl when I'm creating an alias for a readthedocs subproject of circuitpython, should the alias use dashes or underscores? I seem to be finding both
@v923z We should discuss this on a separate issue.
OK. It is here: https://github.com/adafruit/circuitpython/issues/2825
Generally, we don't support users integrating their own C code into CircuitPython.
I understand this, but here seems to be a legitimate reason for changing that.
@slender iron nevermind, moved question / discussion to PR.
https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel_SPI/pull/15
@tulip sleet Look at the RTD link in the README of the lib. And make it exactly what it is in the README.
got it; there is also a link in the release notes, so maybe one is wrong
@idle owl thanks, done!
@onyx hinge thank you!
@slender iron I am not seeing the same Metro M0 trouble on the tip of master that I am seeing on lower_power.
also I still hate sphinx:
/home/halbert/repos/Adafruit_CircuitPython_BLE_BerryMed_Pulse_Oximeter/adafruit_ble_berrymed_pulse_oximeter/__init__.py:docstring of adafruit_ble_berrymed_pulse_oximeter.PulseOximeterValues.finger_present:1: WARNING: duplicate object description of adafruit_ble_berrymed_pulse_oximeter.PulseOximeterValues.finger_present, other instance in api, use :noindex: for one of them
sphinx is generating useless "alias for field number <n>" for namedtuples that conflict with the real docstring ... actually this appears to be an artifact of CPython, which generates useless docstrings, and sphinx doesn't override them properly
(That's why I didn't respond to you so promptly)
@tulip sleet I don't think I've ever reproed the partial enum you see. can you send me a uf2?
one thing I've seen is the DFLL not coming up
did you see the extraneous reset in the trace?
I thought the xobs comment might be helpful: https://github.com/adafruit/circuitpython/pull/2685#issuecomment-620386943
This is built from a completely updated clone of your repo, for Metro M0, so it should be the same as yours
I think my tinyusb asserts are on but I don't hit any
when I see a usb failure it looks like this:
did you look at the trace i put in the issue?
what's the hardware you have that's running Arch?
what motherboard, and is it an Intel CPU?
no, a ryzen
@tulip sleet What did you end up doing for the namedtuple Sphinx issue? The last time I ran into it was another one of your libs, and we tweaked it until it passed, but the "alias for" lines are still in the docs.
@idle owl not solved yet; it seems to have reappeared maybe with 3.0.3 of sphinx, or maybe it was always there
total pain
We found one workaround but it was complicated and extraneous and I'm not even sure sommersoft ever got it to work.
@slender iron do you have an vanilla intel box or laptop you could try?
my thinkpad might be an intel
could boot off an ubuntu dvd; that might replicate it
i haven't tried yet
@tulip sleet I think this is the one we updated but left the alias lines in the docs - it wasn't worth the fight: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Heart_Rate/blob/master/adafruit_ble_heart_rate.py
@idle owl yes, I was doing the same as that one; I'm going to try that one again and see if it fails anew
Ok.
@slender iron I can certainly try it in the debugger but I wasn't sure what to look for
once it stops you can see if it's in the sleep_until function
that's mostly what I'd expect
or it could be some other timing loop that is wrong
What I was thinking of doing was triggering a pin on each call to TinyUSB task and see whether it's late
compared with the same thing in master
do we actually need to call it regularly or just after any interrupt?
i thought we had to call it every msec; that's what Thach told me
in the lastest master, do you do that still?
I think we should ask him about it when he gets up
in the lower power we only call it when awake
the frustrating part is that it works for me
right, it's clearly some timing thing that's different on your USB hardware or the drvier
what does your thinkpad run?
i mean, is it linux or some old windows?
if you can bring up the thinkpad and bring it up to date with whatever, just try it, but mainly let's wait for Thach and ask him if we WFI and don't call tud_task is that fatal?
it's possible he's scheduling something that needs to be done not on an interrupt but sometime after an interrupt
is there a timer interrupt every msec
i.e. does the WFI return every 1/1024 of a sec?
only if ticks are enabled
which you could turn on to try
but we also disabled wfi and had the issue
definitely; how?
it still might not be calling the background task every tick
for some reason
it should over-call it if wfi isn't called
so maybe I should instrument that call to the tud task and look at it on the Saleaea
ya, and see if you can see where it is with a debugger
does the neopixel ramp up and down?
or maybe you turned off some interrupts? did you redo the priorities
yes, the board seems fine; I just can'talk via USB
I think I replaced systick with rtc but nothing else
anyway, how do I enable the ticks? I'll try that just in case
there is a function to do it in supervisor/port.c
I'll try that; I'll turn it on at the beginning of main or something
@idle owl it's actually still broken in heart-rate: it doesn't throw errors but the documentation is missing:
That's odd, it was included previously - I remember the documentation existing with the aliases below it.
Maybe when built locally or something. I have no idea.
Be back in a bit. Recording.
@tulip sleet looks like my nuc may have tickled it
@idle owl mine has py:attribute, heart-rate has just :attribute::, which I think might be a bug: the leading : is wrong. If I remove that, I start to get
/home/halbert/repos/Adafruit_CircuitPython_BLE_Heart_Rate/adafruit_ble_heart_rate.py:docstring of adafruit_ble_heart_rate.HeartRateMeasurementValues.heart_rate:1: WARNING: duplicate object description of adafruit_ble_heart_rate.HeartRateMeasurementValues.heart_rate, other instance in api, use :noindex: for one of them
@slender iron excellent (I guess!). I'm just trying to get the pulse ox library into the bundle because the guide went live
I wonder if I'm calling it too fast
@idle owl I'm going to do this for now, just to get it to sort of work. I'll file a bug on sphinx eventually.
Hi @tannewt I've got it kinda passing the script you wrote (it's been working great so far). However, I do have two questions, first, it didn't pass unless there was no leading whitespace, how does this affect the python examples in the code.
Secondly, the script fails on __init__.c which doesn't have any associated stub files. What should I do about that? It always gets checked last, so I can still go through all of the other files, but I just wanted to check if there's anything I s...
When I add a space before class, it says invalid syntax
@tulip sleet catching up on the scroll-back; i took most of the day away from the PC.
the namedtuple alias thing is certainly annoying. like Kattni said, we dug into it, and the 3.x "fix" was the error getting thrown. there is an issue about the alias fields though: https://github.com/sphinx-doc/sphinx/issues/7353
i did try building with the workaround mentioned in the issue, but my notes (DMs w/Kattni) said it failed; i just don't remember why.
@raven canopy thanks, I found that workaround, but it's from 2015. There may be some other way. I might submit a new issue because of the index warnings, which are more trouble (since we treat them as errors). I made it into a bulleted list for now instead of using attribute. Apparently CPython may generate those useless docstrings. I would like any supplied docstring to override those for namedtuples.
huh. it does appear that CPython creates the aliases...
>>> bar = namedtuple("bar_tuple", ("foo", "bar", "baz"))
>>> help(bar)
Help on class bar_tuple in module __main__:
class bar_tuple(builtins.tuple)
| bar_tuple(foo, bar, baz)
|
| bar_tuple(foo, bar, baz)
|
| Method resolution order:
| bar_tuple
| builtins.tuple
| builtins.object
... methods removed ...
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| foo
| Alias for field number 0
|
| bar
| Alias for field number 1
|
| baz
| Alias for field number 2
@tulip sleet I think the host controller is changing behavior because we're responding faster
and tinyusb is assuming we can handle the tx complete interrupt before the next setup packet arrives
do you want to bring this up with Thach?
We could have him debug this with lower_power
ya I'll ask him about it
is it also dependent on the chip periph? Why don't we see this on SAMD51 or nrf, for instance?
I think xobs is seeing the same on '833
aha, ok
the SAMD51 may be fast enough to handle the tx complete before the next setup packet
i can try on an 840 also
I think we're responding faster to the string descriptor fetches which is making the host assume we're fast
'840 seems OK, so the SAMD21 is really the test
are you trying with a debugger?
there may be tinyusb asserts that fail with asm("bkpt")
no, I can do that
For displayio has there been any discussion on the Labels for being able to choose different gravity/justification? I'd like to be able to do top left positioning.
do i need to compile DEBUG to enable the asserts?
that I don't know
@tulip sleet there is an older CPython issue about this as well. not much movement on it though. seems the most effective workaround (applies to Sphinx and CPython help) is to subclass namedtuple, and supply the desired docstring. but then...might as well just write it as a class. :D
https://bugs.python.org/issue16669
not trying to interrupt debug; can be dealt with later
hehe. ISRs everywhere!
@slender iron I see no bkpt asserts either way on '840, but that doesn't mean xobs isn't seeing them. But I'm glad it's reproducible for you. I think Thach can help us.
taking a break now
One approach considered by the Covid Watch distance estimation team is separate consideration of RSSI based on the channel the advertisement came in on. The Covid Watch anonymous exposure notification app needs to make good exposure estimations. CircuitPython is used with small boards for experiments and testing.
The change would be in _bleio.
Perhaps _bleio.ScanEntry could have a new property called channel. It might be obtained from this (as suggested by another):
This is a work in progress, see issue #2815
Any comments or changes needed, please let me know.
what is the difference between py/runtime.h and py/runtime0.h ?
@marble hornet that's a good question; I haven't figured out why both exist
maybe it's like coke vs coke0 π
a quick diff was not very helpful. but runtime0 is included with 4 files in py/.
if you grep for either's inclusion in various files, there are a lot of examples, and I don't detect an obvious rhyme or reason. I looked at the micropython issues and PR's and also didn't come up with an explanation
the redundancy bothers me
i'm attempting to write a module based on the extending circuitpython guide. in the shared bindings the bindings include an __exit__ method but i don't see the __enter__ method defined . the comments say it is made via a "Provided by context manager helper." but i don't see where it is used
//| .. method:: deinit()
//|
//| Deinitializes the Meaning and releases any hardware resources for reuse.
//|
STATIC mp_obj_t tinydisplay_tinytft_deinit(mp_obj_t self_in) {
shared_module_tinydisplay_tinytft_deinit(self_in);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(tinydisplay_tinytft_deinit_obj, tinydisplay_tinytft_deinit);
//| .. method:: __enter__()
//|
//| No-op used by Context Managers.
//|
// Provided by context manager helper.
//| .. method:: __exit__()
//|
//| Automatically deinitializes the hardware when exiting a context. See
//| :ref:`lifetime-and-contextmanagers` for more info.
//|
STATIC mp_obj_t tinydisplay_tinytft_obj___exit__(size_t n_args, const mp_obj_t *args) {
shared_module_tinydisplay_tinytft_deinit(args[0]);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(tinydisplay_tinytft___exit___obj, 4, 4, tinydisplay_tinytft_obj___exit__);
it doesn't subclass anything
or there's a default __enter__() which doesn't do anything
{ MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }
trying to find where the default __enter__ is.
ah
do you have a PR #?
trying. only commit surfing now...
this is the original commit for runtime0: https://github.com/micropython/micropython/commit/d99b05282d14ceb0163cbcd059aa37bdb415af43#diff-7f2d7c73676c7b412b695ef33348571a
this is the original commit for runtime0: https://github.com/micropython/micropython/commit/d99b05282d14ceb0163cbcd059aa37bdb415af43#diff-7f2d7c73676c7b412b695ef33348571a
this is the original commit for runtime0: https://github.com/micropython/micropython/commit/d99b05282d14ceb0163cbcd059aa37bdb415af43#diff-7f2d7c73676c7b412b695ef33348571a
this is the original commit for runtime0: https://github.com/micropython/micropython/commit/d99b05282d14ceb0163cbcd059aa37bdb415af43#diff-7f2d7c73676c7b412b695ef33348571a
okay, i think i finished the c but would now like to hook it in
if i remember properly the guide is out of date for that
the first steps of this link seem to be wrong https://learn.adafruit.com/extending-circuitpython/inside-the-virtual-machine#ports-slash-atmel-samd-3-29
it's from 2018, so it may be outdated
a bit, since most of that is built in the .mk now. but, still mostly doable: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/Makefile#L287
okay:
here is what i tried SRC_SHARED_MODULE += tinydisplay/__init__.c tinydisplay/TinyTFT.c
and i am getting this error
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
make: *** No rule to make target `shared-module/tinydisplay/__init__.c', needed by `build-pyportal/genhdr/qstr.i.last'. Stop.```
rule?
I would say mostly ignore that guide, and just look at an existing module, and model what it does
makefile rule
what existing module is similar to this?
oh, noted. should it be worth taking the guide down? or a warning at the top? and it will be a procedural display library, like the python rgb_display but in c
so i'm not totally sure. i'm just trying to get methods and properties working on an object
which native module is this most simlar to? maybe the new RGBMatrix? (I don't mean in the details, but the purpose).
i'll add a red warning to that guide
looking to see which it would be most similar to...
i'm drawing a blank, displayio is kind of close in that it lets a user control the screen
do you have port-specific code, or can it all be in shared-module?
it should all be in shared module
does it need to live across VM instantiations? E.g., are you showing the REPL or something like that?
no, it won't need to
_pixelbuf is straightforward (even if it is an _ module). See where that is added, turned on and off, etc.
it is only shared-module, no common-hal
emulate that. Search for where it's mentioned in the makefiles, etc.
i refactored all that a while ago. I didn't really know about that guide. I've put a warning on it.
ok, π€, good luck!
sleep well. thank you (i think it is working! )
This adds support for Simmel, an nRF52833-based bluetooth tracking
board designed to aid in pandemic tracing.
PR generated at https://github.com/adafruit/circuitpython/pull/2828
Note that it requires a bootloader that's smaller (such as https://github.com/simmel-project/bootloader) in order to give more storage on the small internal flash.
@gentle bronze you around?
@slender iron yup
We found a weird issue on samd21 in my lower power branch. Let me go up to my computer
ok
kk, so I think the issue is that we're calling tusb_task more frequently than before
enumeration is failing here: https://github.com/hathach/tinyusb/blob/master/src/device/usbd_control.c#L169
its weird because trcpt and setup received bits are set
I can only repro it with an intel system too
my macbook and ryzen pcs are ok
but my intel nuc has issues
(my changes are here: https://github.com/tannewt/circuitpython/tree/lower_power )
this seems similar: https://github.com/hathach/tinyusb/issues/296
it is different, the nuc120v is more difficult to work with, I couldn't get it running on my board at all. majbthrd could get it running on his dev board (different one) though.
right, different nuc π
dan sees it have after set configuration
mine stops after get string descriptor
hold on, I am checking out your tree to test with.
k, I'll try with a tinyusb example
if you could reproduce it with tinyusb example repo, try to enable LOG=2 LOGGER=rtt https://github.com/hathach/tinyusb/tree/master/examples#debug-log
and use jlink rtt viewer for the log, that hopefully would not intefere with the timing.
building for metro m0
@slender iron I didn't follow low power issue, could you sum up the major modification it does π
we switch timekeeping from systick to the RTC
in samd21 that meant we run gclk2 faster than before
we also always call tusb_task instead of at a 1 ms-ish interval
sleeps should actually sleep by calling wfi
π π
let me know if you can reproduce it. I was happy I could earlier
I am able to reproduce it, it stall every request after the first device descriptor, very consistent
great! that's the first step
It must be late for you, please take the rest, I will do a bit of bisect to catch up with the low power changes first
then try to narrow down the issue π
great, though it is still late. I will get you updated if I could figure out something.
π thanks!
no problems π
I'm building a robotics board that has a SAMD51, display, optical encoders, motor drivers and a few other sensors. Would I please be able to get a VID/PID.
The robot is called a BBS_StudioBot
Thanks!
@slender iron btw, do you know from which commit the issue occurs
no I don't unfortunately
no problems, I do a binary search π
it's probably worth looking at which commits are in the samd directory
since many of them will be for others
I can help too
it is OK, I could narrow it down for several trials:)
I get a bit further if I do: ```
// Handle SETUP packet
if (USB->DEVICE.DeviceEndpoint[0].EPINTFLAG.bit.RXSTP)
{
// This copies the data elsewhere so we can reuse the buffer.
dcd_event_setup_received(0, _setup_packet, true);
USB->DEVICE.DeviceEndpoint[0].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_RXSTP | USB_DEVICE_EPINTFLAG_TRCPT0;
return;
}
yup, that seems to fix it for me
based on one trial π
ok tv time. thanks @gentle bronze !
great finding, I will double check it with manual, and update tinyusb if needed
I tried but it doesn't fix the issue, samd doesn't reponse correctly, I will do more check
basically, samd response with device descriptors contents for all the GET_DESCRIPTOR request (string/configuration etc ...)
Morning @here - today is MicroPython's 7th birthday. I can't think of a nicer way to celebrate than to publicly thank Damien for all his friendliness, extraordinary effort (lots of that) and technical excellence. e.g. I just tweeted this: https://twitter.com/ntoll/status/1255412859435126785 Thanks, and apologies for the loud "PING" in this channel.
Today is @MicroPython's 7th birthday. π
Please join me in thanking Damien et al, who run this amazing project. My work with MicroPython has been some of the most friendly, fun & rewarding of my career.
How about you? Share your MicroPython positive story to celebrate!π¬πβ€οΈ
Is there an API reference for that library? I used to have a simpler api with an encrypt() and decrypt() call, but I threw that away to create API compatibility with PyCrypto.
What should the API look like when it comes to instantiation, key and IV management, and actual usage?
@ionic elk stm32 and timer/counters question. I'm working on rgbmatrix/protomatter for stm32f405 feather. Is statically allocating TIM6, the "other" timer with no associated PWM pins, reasonable? Any hints for debugging my register setup of the timers? I feel like I am more in the "cargo cult" stage of trying to get this to work, than the "understanding it" phase, and it's been frustrating me for a bit of time now. I can share my WIP code with you if it's helpful.
between not being familiar with stm timers and not quite grasping how protomatter needs to use them it's been vexing me and I'm not making progress.
@xobs plz add to the build queue so we can CI :)
Boards missing in .github/workflows/build.yml:
simmel
##[error]Process completed with exit code 1.
@xobs k - when you push the addition, CI will re-run - if it passes we can review :)
BBS_StudioBot VID 0x239A PID 0x00A1 # bootloader
PID 0x80A1 # arduino
PID 0x80A2 # circuitpython
@onyx hinge You'll be competing with RotaryIO, which will also need an unallocated timer and I had using TIM6, though I haven't progressed very far on it. It seems we're outstripping these "unallocated" timers - what we might need is some kind of intermediary that has a list of low-priority timers it can check and dynamically allocate.
STM32 basic timers like TIM6 and TIM5 are further complicated by not being fully represented by the stm32 HAL (presumably because they're not really intended for "timer" use but more for DAC stuff?). You have to manually go in and implement on the register level via the reference manual. And if you ever switch to a general purpose everything changes and you have to rewrite.
I have a whole raft of pins, I could later change to use a timer that is related to one of those pins I guess
I actually do have my interrupt executing now, yay.
It'd be good to add a generic way to grab a free timer. Many chips don't have basic ones
@gentle bronze any insights on my usb issues?
@slender iron yeah, it is a race condition with setup packets, I have a solution, only need to check with manual a bit more
ya, seemed like a setup packet was catching up to OUT completion
yeah, it is right after the out, causing missing setup, though the event still registerred and dcd duplicate the old setup packet as new. Should be a quick fix, just a bit more reading
$68 = {ptr = 0x2001f3a0, length = 3168}
``` Is the stm stack smaller than the "usual" stack? I am hitting `reset_into_safe_mode (reason=HEAP_OVERWRITTEN)` a lot. The stack at the time this occurs looks "sane, but full".
ports/nrf/mpconfigport.h:#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000
ports/atmel-samd/mpconfigport.h:#define CIRCUITPY_DEFAULT_STACK_SIZE (24*1024)
ports/stm/mpconfigport.h:#define CIRCUITPY_DEFAULT_STACK_SIZE ((uint32_t) &_ld_default_stack_size)
``` I can sort of tell that the stm approach is trying to do something allowing the default stack size to be in the linker file .. but it's a wildly smaller stack than nrf and samd...
what board are you on?
ports/stm/boards/STM32F405_default.ld:_minimum_stack_size = 2K;
the stm feather (f405)
stack when I hit the soft reset
I thought the stack was dynamically sized
the .ld stuff is just to make sure we have a minimum size
(gdb) p next_stack_size
$72 = 2048
static uint32_t next_stack_size = CIRCUITPY_DEFAULT_STACK_SIZE;
right now it's also being used as the default "next stack size"
that's pretty small π
I can chuck an issue in github, add a workaround in my boot.py, and probably get on with things. Mind if I do?
you can just increase it π
even samd21 is 4096
samd51 is 24*1024
it'd be cool to move it to CCMRAM which is 64k
I think I need to avoid getting side-tracked, I'm at 1 week with nothing to show for my rgbmatrix port to stm π¦
@onyx hinge I raise you, two days spent just drawing plots of a rather simple passive filter.
BTW, I put a question about displayio in the forums earlier: https://forums.adafruit.com/viewtopic.php?f=60&t=164925
86 if (current_safe_mode > BROWNOUT && reason > BROWNOUT) {
(gdb) where
#0 reset_into_safe_mode (reason=HARD_CRASH) at ../../supervisor/shared/safe_mode.c:86
#1 0x0802f2a8 in HardFault_Handler () at supervisor/port.c:244
#2 <signal handler called>
#3 0x0803088e in allocate_stack () at ../../supervisor/shared/stack.c:61
#4 0x0bff133a in ?? ()
``` well that didn't go so well
Due to hitting the stack overflow error, I noticed that the stack size is much smaller (2kB) than nRF, samd51 (24kB).
My particular code is work in progress RGBMatrix, so the stack-overflowing code is not something that you can easily reproduce.
I tried increasing it to 0x6000 (24kB) by boot.py:
supervisor.set_next_stack_limit(0x6000)
but this leads to crashing errors! 0x2000 works, and I don't get the errors anymore. However
- default stack size shoul...
OK, moving on/back
Yup! It is here: https://cryptography.io/en/latest/
It's not super clear to me how you arbitrarily assemble pieces from the hazmat layer.
I'm concerned this may be the result of something being carried over from Atmel-SAMD in the very early stages of the port. I'll check it out.
@slender iron esp32s2 port is going to be quite hard, there's a lot of linking config we need to sort out. I believe I know why it was crashing the linker now, we were not including some .ld files that it needs...so I think it was confused how big some sections were and that caused some crash.
@tannewt I'm interested in this idea of port-level implementations. A lot of the STM32s have optional Crypto processors as a sort of mini-upgrade to the chip - the F415 is one such upgrade to the F405, with AES support.
-L/Users/mark/src/esp-idf/examples/get-started/blink/build/esp-idf/esp32s2
-Tesp32s2_out.ld
-uapp_main
-L/Users/mark/src/esp-idf/examples/get-started/blink/build/esp-idf/esp32s2/ld
-Tesp32s2.project.ld
-L/Users/mark/src/esp-idf/components/esp32s2/ld
-Tesp32s2.peripherals.ld
Testing performed: on stm32f405 feather, all pins change in plausible ways on a logic probe. Didn't actually drive a display yet.
@ionic elk I removed the ld-defined minimum stack size in the atmel and nrf ports when I parameterized .ld files. There may be an inconsistency in the stm port.
Just got this after a mere 15 seconds on a CLUE after a copying code.py triggered application reload. This is on 5.2.0.
I recently added a dfu-flash option to STM32 in #2819. Other ports that support it include NRF with a dfu-flash and the cxd56 which has custom flashing with their ".spk" file.
This seems like something where there's going to be some natural port-level implementation differences. STM32 has the built in dfu bootloader that is always accessible and thus makes the most sense as the default flash command, compared to atmel and NRF which have an easier time fitting in a UF2 bootloader since i...
I can see the appeal of this when used in a product. Is it feasible this could be added as a build flag?
Thing is with the STM32 dfu bootloader is you need to bring high the boot0, but that's not so fun on the boards with stlink built in.
I think we should add a default target 'flash', which makes the most sense, but if there are more options, we can use 'flash-openocd', or 'flash-stlink' etc.
Personally, I'd like to copy the way Zephyr does it...it seems to work very well.
i can test once you need a verifier!
perhaps it would make more sense if it was handled in boot.py somehow?
I like montage for creating sprite sheets for displayio. https://imagemagick.org/Usage/montage/ really handy
The question is which one is the default. If I recall correctly, Zephyr has one west flash and a list, defaulting to the top of the list unless you pass another option as a parameter --jlink, correct? I'm not sure how I would do that with a makefile.
@slender iron by the way, I wrote a bunch of implementations for rotated rectangles and images when I was working on ExpressionEngine. Is that something you might be interested in having in DisplayIO someday?
That sounds right about how Zephyr works, I think we could have a parameter, and also let it read from an ENV variable. I'd like to set CIRCUITPYTHON_DEFAULT_DEBUGGER=openocd for example.
Hi @tannewt I've got it kinda passing the script you wrote (it's been working great so far). However, I do have two questions, first, it didn't pass unless there was no leading whitespace, how does this affect the python examples in the code.
By removing the whitespace you are making it so the script doesn't include it in the .pyi file. (You can see the results in the circuitpython-stubs directory.) So, you aren't fixing it, you are removing it from the process.
Secondly, the ...
@tannewt Ok, that makes a lot of sense. How exactly am I supposed to format the whitespace? I'm referring to any __init__.c, I'll get you the exact error message in 1 sec
@tannewt Ok, that makes a lot of sense. How exactly am I supposed to format the whitespace? I'm referring to any init.c, I'll get you the exact error message in 1 sec
Every line for the stubs should start with //| and then be indented from there like a valid .pyi file.
@tannewt
dherrada@dherrada-MacBookPro:~/adafruit/stubs/circuitpython$ python3 tools/extract_pyi.py shared-bindings/busio circuitpython-stubs/
circuitpython-stubs/busio.pyi
Traceback (most recent call last):
File "/home/dherrada/.local/lib/python3.6/site-packages/astroid/builder.py", line 168, in _data_build
node = _parse_string(data)
File "/home/dherrada/.local/lib/python3.6/site-packages/astroid/builder.py", line 446, in _parse_string
node = _parse(data + "\n", type_...
@tannewt Ok, I thought that was what I was doing before, but I'll give it another go.
@tannewt
dherrada@dherrada-MacBookPro:~/adafruit/stubs/circuitpython$ python3 tools/extract_pyi.py shared-bindings/busio circuitpython-stubs/ circuitpython-stubs/busio.pyi Traceback (most recent call last): File "/home/dherrada/.local/lib/python3.6/site-packages/astroid/builder.py", line 168, in _data_build node = _parse_string(data) File "/home/dherrada/.local/lib/python3.6/site-packages/astroid/builder.py", line 446, in _parse_string node = _par...
@tannewt Ok, I'll do that
@slender iron after lots of testing and logging, I think we finally fixed it. PR to tinyusb is on the way https://github.com/hathach/tinyusb/pull/388
nice! I was thinking it might be due to delaying the interrupt handling
it is hardware race condition, samd doesn't have an way to NAK setup, it will just always acked. We need to ready the buffer at anytime.
I didn't think the usb spec allowed NAKing a setup
I actually make the race worse when doing the last clean up, by moving the setup prepare after the status complete. But it must be before queueing the last status (both IN and OUT status)
right, if the assert didn't catch it first
ah, I mean a way to not acked and discard setup. normally other mcus has special sram/pointer to store setup
anyway, the samd controller is very fast in this regard π
right, that makes more sense
@slender iron you ok with me grabbing a Toasty? https://www.tindie.com/products/webtronics/toasty-480mhz-stm32-usb-development-board/
@ionic elk sure
@slender iron do you want to review the pr https://github.com/hathach/tinyusb/pull/388
@gentle bronze ya, looking now. is it always a ZLP?
the status is always ZLP and has opposite direction to the setup[0]'s bit7
Yup! will do. Thanks again!
good night
@tulip sleet USB should be working in lower_power now. I think I have two boards I need to find space for
excellent! I'm still working on PacketBuffer and its vagaries with connection handles. It has been painful.
the connection handle is not easily found. I saw how you cached it and thought I could get it from the service, but that doesn't work for local services
what do you need it for?
and there is no "read" evt, so we couldn't get it if the client is just reading
I needed the connection handle to get the mtu for packet length
there is a way to inject yourself in a read
yes, I know about that (authorize stuff), but I hoped to avoid that
ble_midi_simplein, for example
midi should only be using notify and write
it does do a read at the beginning but it's not critical I believe
the characteristic assigned to packetbuffer is notify/read (remember my "pathological" remark?)
it just has to do with the buffer setups in the MIDI service
right, the read is just for a single read at the start
not for the actual midi packets
so the packet size for that read is always below MTU?
even if MTU is 20?
i thought it was using the same characteristic bidirectionally, either for sending midi notes (et al) or receiving them
def __init__(self):
super().__init__(
properties=Characteristic.WRITE_NO_RESPONSE
| Characteristic.READ
| Characteristic.NOTIFY,
for _MidiCharacteristic
right. the read is only for the initial read
so "a packet that has no payload" is going to be <= 20 bytes?
it is empty
packets usually have a header byte but this packet is empty
I'm not sure any implementations actually check it's contents
the current MIDI code does this in __init()__:
self._in_buffer = bytearray(self._raw.packet_size)
self._out_buffer = None
but we don't know packet_size without knowing the MTU, so I rewrote it to delay creating this buffer. I see that you adjusted the size by re-checking .packet_size, so maybe you were assuming it might be too small and then grew it as necessary. There were other services (e.g. heart rate, iBBQ), where I just called packet_size once in __init()__, and I now defer creating the buffer until connected
I will have some draft PR's for those
anyway, I got waylaid because I thought the service had the connection handle, which it doesn't unless the service is remote, because there's no way to find out the connection handle for a local service with a connection. You have to spy on it like you did in PacketBuffer. I wondered why I didn't run into this in CharacteristicBuffer, but it's because I never implemented writing.
service->connection is null for local services even if connected
CharacteristicBuffer doesn't try to be exclusive to a single connection
ah right, doesn't characteristicbuffer just notify on every connection?
CIRCUITPY_COUNTIO here and a few other spots
Thanks for this! A couple comments. You'll also want to ensure that the submodules here are the same as in master. A number of us are on Discord if you need live help: https://adafru.it/discord
I don't think this should be called LinearEncoder because it's simply counting the number of edges since startup. I'd just call it Counter. It might be worth adding a reset() too.
Why do you need to check this? Shouldn't we increment every edge?
it only implements read, not write or notify, so it never ran into this problem
all it does is get notified
it doesn't send out notifications
kk. that must be how the general set value for notify works
but PacketBuffer does
right
sd_ble_gatts_hvx() needs a real connection handle, but sd_ble_gatts_value_set() doesn't care about the connection handle unless it's writing a CCCD
@slender iron you ok with me grabbing a Toasty? https://www.tindie.com/products/webtronics/toasty-480mhz-stm32-usb-development-board/
@ionic elk I just ordered two Toastys. π π I can hardly wait to get them!
it looks like a pretty neat board
It'll be cool to try running some really crazy displayio stuff and see how it goes.
Though... that means I'll have to get displayio enabled for the H7
@tulip sleet this is what I'm thinking of: https://github.com/adafruit/circuitpython/blob/master/ports/nrf/common-hal/_bleio/Characteristic.c#L156-L179
i forgot about that. so packet buffer could do the same thing, instead of caching the conn_handle
@tannewt Can you take a look at __init__.c and SPI.c from the last commit to make sure that they're correct. If they are, then I'm going to revert a few commits and re-do everything, which is quicker than editing it since the rst actually had more or less the correct whitespace to work with the pyi to begin with.
did you consider doing that, instead of grabbing the conn_handle on certain events in PacketBuffer?
I didn't want to do that because it feels like the wrong model because midi is one to one in my mind.
i'll leave it alone for now. I don't know if BLE MIDI is meant to support fanout to write-only devices, but from the spec, it sounds like not (like the single read packet)
kk, time for a run
I'll contact the maker/vendor (8086.net) but I have a strange behaviour with the Commander board. Mu does not find the serial interface. However, if I use device manager to find the serial port, then use Putty to access COM26, I have the REPL.
Any idea?
That sound like a Mu problem. But it works on this computer with every other board I have (all Adafruit).
Mu looks at hte USB PID/VID to see if it's a board it can talk to
So when new board appear...
for Adafruit boards, it just checks the VID (Vendor ID).
What is the VID/PID for the Commander board?
I might need to boot in Linux for that... dunno how to do it in Windows.
the check for only the Adafruit VID (as opposed to particular PID's) is relatively new
you can look at the properties in Device Manager
what version of Mu are you using?
that already has the adafruit VID-only check
I upgraded the bootloader and CP.
but the Adafruit VID is 0x239a
here the VID is 0x3171, and Mu doesn't know it
you can hack mu to add it
The VID/PID is in the bootloader?
no, when CIRCUITPY is running (actually both, but Mu doesn't care about the one for the bootloader)
There are only a handfull of Commander (there was 5 in stock and it is brand new). I already aquired great stuff from 8086.net, so I felt like I should support and spend on this "unique" device.
I have a working solution with Putty.
I'll share this conversation with the maker, he might want to ask Adafruit for a VID/PID or check with Mu?
he paid for 0x3171 already
@thorny jay you can add the board to mu/modes/base.py
i'm a little confused about the list there; there's also adafruit.py, which has the wildcard entry
Automated website update for release 5.3.0 by Blinka.
@tulip sleet @slender iron is there something that needs to be done for board sorting due to me releasing 5.3.0? I am still fuzzy on that.
the download counts are all zero to start, and we have to update them by hand. with zero counts, they show up in reverse alphabetical order, I think
I haven't started owrking on that yet. You could add fake download counts to sort them alphabetically or something. "Adafruit" comes conveniently at the beginning of the alphabet
maybe it should be fixed so that they show up in alphaetical order if the counts are zero
for now
@slender iron can I get an openMV-H7 PID?
@tulip sleet Yes, you made it... it works now. I will try to make a PR for Mu. Thank you so much.
@ionic elk limor maintains the file of the PIDs. She pushes to an internal repo periodically, but it's probably best to ask her
I periodically refresh that to add a bunch of empty slots
Ok, sure. I don't know the workflow there, I just know it's usually Scott who posts the VID/PID collection for people.
@meager fog could I get an openMV-H7 PID?
maybe send her an email or open an issue so she can queue the work. She could pass it to me too but she's pushing to that repo all the time
open a circitpython issue
and assign her
typical PID request PR, if you want a template @ionic elk https://github.com/adafruit/circuitpython/issues/2829
I;m afk for an hour or so
@tidal kiln This issue: https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/issues/11 doesn't make sense on this library anymore, as the solution appears to be changing the Group full message, which isn't generated by the library. Dan created another issue referencing it on CircuitPython - am I ok to close this one?
Or should I leave it until the issue is resolved?
@tannewt Here's the .pyi file generated: https://pastebin.com/F1ntViVb
@slender iron Where are we at with pixelbuf? Asking as I'm going through lib issues and some are related or potentially resolved by pixelbuf, and I'm not sure of the status.
@slender iron "build-mac" failed 5.3.0 but that doesn't inhibit all boards from building (we know why and it's fixed in master, but 5.3.0 is affected). Is it still okay to complete the 5.3.0 release in this state? https://github.com/adafruit/circuitpython/runs/630740349?check_suite_focus=true
@idle owl @tidal kiln should be reviewing NeoPixel_SPI which has an open PR to update to newer pypixelbuf
@onyx hinge ya, fine with me
Ok thanks
This PR adds basic pin and clock definitions for the OpenMV-H7 board. The OpenMV-H7 is a development board for embedded machine vision using the STM32H743 processor. More information about the project can be found on on the website, OpenMV.io.
This PR is naturally a little anemic for the scope of the OpenMV project, since it doesn't support the board's primary feature, the OV7725 Camera. OpenMV as supported with Micropython is an expansive project that actually uses ...
@idle owl yah, i'd say leave it open until the other issue is resolved. if that one results in changes that will work for also fixing the issue in Display_Text then can close it
@tidal kiln Ok.
looks like the issues have been cross referenced?
@tannewt Alright, I'm feeling pretty good about this one. Let me know if it's all good and I can do the same for everything else.
pyi: https://pastebin.com/ruQHPnaF
@tidal kiln They have.
Though... that means I'll have to get displayio enabled for the H7
@ionic elk This is a good thing, right? π I am looking forward to doing some crazy stuff with this too, especially for robotics. π
cool. is there a pressing need to close it?
My last nitpicky thing would be to have empty lines after the ... function bodies. (Empty lines are just //|.)
Also, GitHub Gists will highlight the file: https://gist.github.com/tannewt/583e619db573bd64e7970890338c4e9f
@tannewt Ok. I'll do that and then start on all the other ones.
@tidal kiln No, I'm cleaning library house basically. It's welcome to stay open, but if it could be closed, I wanted to close it. Trying to clear out some of the longstanding issues, but there are many that cannot be closed still. So it is what it is.
any objections to me turning off bitbangio in the specialty cpx builds? we need to turn pixelbuf on to make the upcoming frozen neopixel useful
No. Do it.
π also means my lower power stuff will fit
Also good.
@slender iron looks good to go:
https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel_SPI/pull/15#issuecomment-621428914
@idle owl ^^ fyi
ok, awesome!
@tidal kiln cheers.
I am also getting a few display featherwings. I want to see if I can add multi-display support to the HT16K33 library for the alphanumeric and 7-segment displays. I could not quite fit the matrix displays into my Digi-Key order though because priorities.
@timber mango it shouldn't be tough to get displayio into the H7. The only reason it isn't already in is because DisplayIO by default requires PWM, which requires timers, which have some significant differences on the H7 series. But I think I can just turn it off with a flag, it's been a little while since I worked with it.
I agree it'd be a nice feature to have since powerful LCD capability is probably one of the top use cases for a chip that overpowered alongside camera work and DSP.
I agree it'd be a nice feature to have since powerful LCD capability is probably one of the top use cases for a chip that overpowered alongside camera work and DSP.
@ionic elk Overpowered is good! π I am very excited about the Toasty board! I see a lot of possibilities for this board in my projects. It is breadboard friendly too! π
I wish I had been able to fit a couple of nice TFT displays into my order.
nice! we do want to have some x-platform image capture soon - samd51 and imx rt also have camera capture peripherals :)
@kwagyeman take a look!
I'm a little confused about crypto. I can see things are happening, perhaps with the cryptography library. Is all of cryptography being added, or just parts. Will it be broken into pieces?
Cool stuff.
We are about to bring an interface library online for the OpenMV Cam H7. I spent an extensive amount of time fixing PYB peripherals. So, you might only want to change the core logic.
@bright aspen definitely pieces so that we can enable/disable based on the board
xobs has a PR for AES currently
@thorny jay I added a PR a month ago to add commander support to Mu but not heard anything yet.
Oups. I did not check. So I made a duplicate...
@copper crescent Any plan in enhancing your documentation. I have tested most part using Adafruit documentation. I could write some stuff, like a bigger demo.
My commander run the lattest CP and lattest bootloader. So far, so good.
@thorny jay yes, I'm planning a week off the dayjob to try and catch up with things like that. :)
One comment about pin names.
Why not name these after the color?
You can include two mappings so both names work as well.
We are about to bring an interface library online for the OpenMV Cam H7. I spent an extensive amount of time fixing PYB peripherals. So, you might only want to change the core logic.
What do you mean by interface library? I'd love to know more details.
Looks like the CI needs to be changed so that it downloads the newer soft device.
@dhalbert This is waiting on a reply from you.
@deshipu any object to me closing this until it is fixed up?
@fgallaire Want to try adding these as frozen soon? I fixed turning off USB_HID and USB_MIDI so they free up more space in my #2685 PR which will hopefully be merged soon.
Consistency, a lot of other boards go by number, as does the Micropython implementation of this one. I'll add the colors as an added option.
@slender iron what is the official name of the driver software for the i.MX series? Does it have a manual somewhere?
not that I know of. I usually just look through the source and data sheet
I'm finishing up the process of releasing a high performance RPC library for the OpenMV Cam. This lets you use all the interfaces on the board to move large data structures (images or whatnot) at high data rates. For example, the library lets you call a function on the camera, pass a unlimited length (e.g. 2^32-1) byte struct to the camera, and then get an unlimited length byte struct result.
For example, I have SPI transferring RAW QQVGA RGB565 images between one OpenMV Cam and another at...
okay: I am still trying add a new module in c. there continues to be build errors (see below) b/c the module does not have a rule to make it. from what i can see there are three places new module (w/out port specific code) need to be tied in:
py/circuitpy_defns.mkin theSRC_SHARED_MODULE_ALLlist andSRC_PATTERNSpy/circuitpy_mpconfig.hfor defining theextern _mp_obj_module_tpy/circuitpy_mpconfig.mkfor defining the contstant used to turn the module on or off
am i correct in my assessment that these are all the place? where else does it?
if so i am still getting build errors.
@tulip sleet gave me some good pointers to help find this information, these are all the places that pixelbuf is defined that i could find through a search tool but i;m not sure where else to add them.
the error is: the display is named tinydisplay and has been tied into the above three mentioned locations```
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
make: *** No rule to make target shared-module/tinydisplay/__init__.c', needed by build-pyportal/genhdr/qstr.i.last'. Stop.
@marble hornet can you push your code to a branch on your fork? would be easier to spot any disparities for folks that are up-to-speed on it. (i haven't in a while, but willing to take a look)
@raven canopy sure! sorry for delay, there was an unexpected dinner. https://github.com/TG-Techie/circuitpython/tree/add_tinytft
@marble hornet you should create that above-named file (relative to the top source directory), as an empty file if necessary.
thank you! i'm getting a difference error now! (schrodinger's "yay")
where can i find the docs for mp_arg_check_num ? i'm curious what the laster argument is, and why it is often true EX:mp_arg_check_num(n_args, kw_args, 0, 0, true);
if there are docs for the inner working ?
no docs that i've ever seen. just the source code...
for which, there is a lot. π
IT"S WORKING !
π
and of much code that is sure
i have a question about how MP_QSTR work?
it seems like sometimes they are only used in one place and not defined as variables
is there source code manipulation to turn QSTRs into c char arrays in the background?
Ah, the hexfile was in my local repo, but because *.hex is in .gitignore git silently ignored it. Let's try this again.
@tannewt OK, I think this is finally ready for review again. I decided not to rename .packet_size, but it would have create churn in the libraries, and I decided the alternate names were not really clearer. The doc is clearer.
This has been tested with BLE MIDI both out and in, with ble_uart_echo_test.py, and with some other libraries that use PacketBuffer.
@hierophect some parts in the nRF52 family, for example, also contain crypto accelerators for certain primitives. For example, AES128.
@tannewt that new library looks like it would be complicated to implement. They decouple modes from algorithms from encryptors from backends. The best example appears to be from https://cryptography.io/en/latest/hazmat/primitives/symmetric-encryption/#cryptography.hazmat.primitives.ciphers.Cipher:
>>> import os
>>> from cryptography...
I am trying to write a getter for a new class (TinyTFT working title). the attribute i want to return is an instance of displayio's displayio_display_obj_t when given as an input it works fine, however the compiler says that is in an incompatible pointer type with an mp_obj_t.
does it need to be wrapped in something?
../../shared-module/tinydisplay/TinyTFT.c:11:16: error: incompatible types when returning type 'displayio_display_obj_t {aka struct <anonymous>}' but 'mp_obj_t {aka void *}' was expected
return self->display;
~~~~^~~~~~~~~
../../shared-module/tinydisplay/TinyTFT.c:12:1: error: control reaches end of non-void function [-Werror=return-type]
}```
the branch is https://github.com/TG-Techie/circuitpython/tree/add_tinytft and the module name is tinydisplay
when it is passed in you heave to get the display itself by getting .u_obj from the argument
args[display_arg_index].u_obj) what is the wrapper that contains the .u_obj?
I chime in a bit, since I added a Arduino library supported for ARM CryptoCell CC310 on nrf52840. Unlike AES on all nrf52 which is shard with SoftDevice, CC310 subsystem is separated and available to use, it is more powerful and could do lost of crypto with arm/nordic a.lib . I have used it for computing the ECC DH
https://github.com/adafruit/Adafruit_nRFCrypto
https://infocenter.nordicsemi.com/topic/ps_nrf52840/cryptocell.html?cp=4_0_0_5_5

So what's the distinction between rgbmatrix and protomatter again? Are we transitioning to just one, or using both for different things?
Also @ladyada should I pick one of these up so I can test it when reworking this basic vs general-purpose timer issue?
So what's the distinction between rgbmatrix and protomatter again? Are we transitioning to just one, or using both for different things?
Protomatter is the name of the original Arduino library, which forms the core implementation in Cpy. That name is not going to change. It was called protomatter in CPy, too, but was renamed to rgbmatrix for clarity.
@tulip sleet i was just curious if it was pre-processed or some combination of c features (but i could;t find any from googleing).
FYI -- I built 5.3.0 after the release yesterday -- the build went fine, but they do not have the 5.3.0 tag -- is that expected?
Adafruit CircuitPython 5.3.0-54-g2d7cf4b79 on 2020-04-29; Adafruit PyPortal with samd51j20
I pulled from master -- It looks like the released version is the latest commit to the. 5.3.x branch. and I should have just checked out the 5.3.0 tag.... Someday I'll get this straight π
@marble hornet QSTR stuff is specific to micropython, I think (it's not a general tool). The ideas may have been copied from elesewhere.
π€·
@tannewt led alternatives added
Translations update from Weblate for CircuitPython/circuitpython-master.
In https://github.com/adafruit/circuitpython/pull/2799/commits/b0383f4aff0259b9d3fdcf23aa736fc973b1eff6, I removed PO-Revision-Date from circuitpython.pot template and from all the .po files, and it seems to have worked. I'm not sure if it's going to be restored by some .po tools, but it should help fix some unnecessary merge diffs. I don't see any reason for that field since the file is under source control and its history can be tracked.
I will look into whether this can be controlled in weblate.
if necessary, the make targets for translation could use sed to remove those lines.
I think if it's not in the .pot, it may not show up in the .po files
public reminder: verify that you're using good USB cables. been fighting a sneaky USB bug on RosiePi for over a week when attempting to upload firmware. cable works on multiple computers; assumed it wasn't the issue. came to the end of my research abilities, threw a hail-mary on a different cable...issue solved.
I exile haunted cables to the ghost-box
Life is too short for bad cables ...
it has markings of warding to keep the spirits contained
i mean, the RPi is the only one that has issue with it. it still has capability. this is an old motorola cable, which are quality in my experience. (granted, all of that belief is what got me here in the first place. π)
sounds like they wouldn't want to change their software to omit that data
weblate's using its own internal methods to update these files, not our usual tool. They are not keen to change it, even though others have suggested omitting this metadata: https://github.com/WeblateOrg/weblate/issues/55#issuecomment-603208399
@onyx hinge could we just remove it from the commited files? does weblate get upset if it's missing, or does it just restore it?
it'll put it back every time, I think
that's ok, if we just remove it before the commit
i think that would save useless diffs
it's weblate that creates the PR, and I think if a human adds commits on top outside of the weblate service they get stomped on
I just did this once : sed -i '/^"PO-Revision-Date:"/d'
oh, i didn't realize it created its own commits
right, the idea is to use this web service to make it easier for community to contribute localizations
@onyx hinge do you want to merge 5.3.0 for the website or should I update the download count for it?
@slender iron oh I thought I had merged it βΉοΈ but I most certainly didn't do anything about download counts, because I couldn't figure anything smarter than hand-editing a huge json file and just "nope"'d out of it
if you can do it, that would be awesome and I'll owe you for it
ya, nope is fair
dan has the ball rolling for it so I don't mind doing it manually
will do it into your PR
you rock, thanks!
np
oh no wonder I'm hungry, it's lunchtime in the central US
I'm hungry as it's evening meal time in CET. But my lovely wife is making fish & mash π π₯
Can someone explain safemode for me? what causes it to go into it?
reasons include: fatal error (e.g. hard fault), power brownout
typedef enum {
NO_SAFE_MODE = 0,
BROWNOUT,
HARD_CRASH,
USER_SAFE_MODE,
HEAP_OVERWRITTEN,
MANUAL_SAFE_MODE,
MICROPY_NLR_JUMP_FAIL,
MICROPY_FATAL_ERROR,
GC_ALLOC_OUTSIDE_VM,
PROGRAMMATIC_SAFE_MODE,
NORDIC_SOFT_DEVICE_ASSERT,
FLASH_WRITE_FAIL,
MEM_MANAGE,
} safe_mode_t;
I've always been curious what you can actually do from safe mode. What was the original purpose of it? Can you get it to reveal information about the crash?
Or is it just the above enum?
@tulip sleet thanks, will look into it after food
@hierophect yah a 32x32 is plenty large!
the goal is to give you drive access if your user code gets you into deep trouble
examples: bad user code, a bug in CircuitPython, power sag (we see this on the Trellis M4, for instance: user code turns on all 32 neopixels full blast, which draws too much current from a USB port)
there has been discussion of a setting to NOT go into safe mode when there's a power sag, for (example:) proper operation of solar-powered devices
I retitled the PR for clarity.
@ladyada whoops, wiring details:
width=64, height=32, bit_depth=1,
rgb_pins=[board.D13, board.D12, board.D11, board.A4, board.A5, board.D6],
addr_pins=[board.A0, board.A1, board.A2, board.A3],
clock_pin=board.D5, latch_pin=board.D9, output_enable_pin=board.D10, doublebuffer=False)
@onyx hinge website PR has download counts now
@tulip sleet do we have bootloader updater for nrf?
not yet, thach is working on it
Do not recycle VID/PID, they must be unique for each device!
@dhalbert This is ready for another look and test. Thanks!
A couple questions about packet_size. Thanks for taking this on.
// If we're not connected, it's OK, because we can still read and write the local value.
Should you check that characteristic is not NULL here too?
How are you accounting for whether the characteristic is in the client or server role?
//| Maximum size of an incoming packet.
I exile haunted cables to the ghost-box
@ionic elk If I prove a cable (any cable) is bad, I cut the connectors off and scrap them. I check the wires for continuity, and If the wire is good, I keep it for future use. Otherwise I scrap that too. I can not have bad or even flaky cables around.
@tannewt that new library looks like it would be complicated to implement.
Agree. Go ahead and do an API you think is best. (Remember that it shouldn't return new bytestrings because that forces an allocation.)
I can see the appeal of this when used in a product. Is it feasible this could be added as a build flag?
Note that CircuitPython is not intended for use in a product and we provide no warranty. It's up to a product creator to understand CircuitPython enough supply a warranty to their customers.
If they ship with a custom build of CircuitPython they should call it CircuitPython-compatible and not vanilla CircuitPython. CircuitPython has more meaning than just the code base.
@tannewt wait this needed a valid PID
I'd happily accept changes to make it easier to integrate custom C code into a CircuitPython build. It shouldn't be done through another module like ulab.
It isn't a priority for me though because it is a very niche use case.
Also, any builds with custom C that is not in this repo of CircuitPython make the build CircuitPython-compatible and not vanilla CircuitPython.
Looks good! Thank you!
@tannewt I don't mean a literal commercial product necessarily, and I don't mean to imply anything by that statement regarding warranty or legality. I think the point here is that removing the automatic terminal display just adds a bit of polish when a project is demonstrated to non-technical users. Even just from an aesthetic standpoint I think this request is valid - if an artist was using DisplayIO for something and doesn't want a bunch of technical output on reboot, is that so unreasonable?
Please make another PR:
OpenMV-H7 R1 VID 0x239A PID 0x00A3 # bootloader
PID 0x80A3 # arduino
PID 0x80A4 # circuitpython
We should probably use draft for PRs that shouldn't be merged.
I'm adding a debug_console (VCP on stm32) at the moment, that will be enabled via a build flag, we could add one for the display_console at the same time?
Was the first revision released publicly? We don't want to break anyone who already has the board.
We should probably use draft for PRs that shouldn't be merged.
Yes, this was my bad. I'll use a draft PR next time I need a PID before merging.
[adafruit/circuitpython] New comment on pull request #2834: Update teknikio bluebird pin assignments
Was the first revision released publicly? We don't want to break anyone who already has the board.
No, the first version was not released publicly. We only had 20 pieces built which were used for internal and alpha testing
Quick fix PR for an incorrect PID number for the STM32 OpenMV board.
[adafruit/circuitpython] New comment on pull request #2834: Update teknikio bluebird pin assignments
No problem. Thanks for the quick review @ladyada
This is a work in progress!
Todo:
Make more generic
Enable debug_console when entering REPL
@slender iron I'm getting tired, so I've commited and did a draft PR of what I've got so far. I'll come back to it either later tonight or tomorrow.
Also, any builds with custom C that is not in this repo of CircuitPython make the build CircuitPython-compatible and not vanilla CircuitPython.
I don't want to weigh in too heavily on this issue, because it is not impossible to insert a custom module, even now. But is the distinction really so important for you? I mean, as soon as you make circuitpython open source, it is not in your hands anymore what others do with it. The question is only how hard you make the modifications.
I c...
@slender iron could i have yet another video chat with you re packet_size?
yup, got a bit of time now
hi can you refer me to where this PID was assigned?
@ladyada I made a PR for it in the internal repo.
oo ok i will look i was confused!
added PID to list, ok now!
@lucid solar For safe mode, here's an old discussion mainly on reboots but one that touched on safe mode: https://forums.adafruit.com/viewtopic.php?f=60&t=151877
Ok, @dhalbert. This commit should be a winner.
@v923z I don't think Scott is rejecting the idea, so much as establishing what the labeling guidelines will be if it is implemented and what's considered priority for the sponsored-by-Adafruit team. I'd also be very excited to see C modules supported and I saw it in three Circuitpython 2020s, so I don't think anyone would object to a PR being submitted to align with Micropython's implementation. It's just not high on the list for sponsored folks.
I see "Circuitpython" as a label as importa...
It'll keep for In the Weeds on Monday, but I made good progress with weblate today, and I wonder what should definitely be done before inviting people to use it. "Soft launch" would mean actually asking people on Discord to use it, with the understanding that it might not work out in the end. "Launch" meaning stuff like newslettering and blogging it and being relatively committed to running the service as long as it's bringing in quality translations. Here's my internal list, with the (DONE) tasks being stuff I accomplished today: ``` * enable github auth (DONE)
- enable pull request creation (DONE, but re-disabled temporarily)
- enable google Cloud Translation (MT) (DONE)
- some sort of backups (DONE; digitalocean weekly "system level" backups)
- make sure we can accept the PRs it generates - (danh's metadata problem)
---- soft launch here? - Move the github authentication API keys to adafruit organization
- Move the github PR creation to adafruit organization (adabot?)
- enable weblate.circuitpython.org via DNS
---- launch here? - Move the Google Clould Translation (MT) to adafruit organization
cost: $20 / 1 million characters translated (probably not a lot of $$) - Move the digitalocean droplet to adafruit organization
hey folks. I'll need a quick review on this: https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/pull/83
it adds pypixelbuf as a pypi dep for neopixel
Also, any builds with custom C that is not in this repo of CircuitPython make the build CircuitPython-compatible and not vanilla CircuitPython.
I don't want to weigh in too heavily on this issue, because it is not impossible to insert a custom module, even now. But is the distinction really so important for you? I mean, as soon as you make
circuitpythonopen source, it is not in your hands anymore what others do with it. The question is only how hard you make the modifications.
...
Yes, the CircuitPython trademark and brand is incredibly important to me. Losing control of what it means to be CircuitPython means that guides, drivers and experiences will not match user's expectations. By being open source, we give others the right to use the code, not the trademark. I outlined more about it here: https://github.com/adafruit/circuitpython#branding
Fair enough. I wasn't trying to fan the flames, and I can definitely understand and respect this standpoint. Thanks ...
Fair enough. I wasn't trying to fan the flames, and I can definitely understand and respect this standpoint. Thanks for clarifying!
No problem! I'm just passionate about it because I think the use of "MicroPython" in other forks has hurt micropython/MicroPython. We renamed ourselves to CircuitPython so we wouldn't further confuse what MicroPython is.
Looks like my earlier requested changes were resolved. No new testing or review performed.
@slender iron (I can review that PR but not merge it apparently)
(the neopixel one, that is)
Ok! Lower power is merged and NeoPixel on PixelBuf is released!
let's see what bugs we find π
:rubs hands together gleefully:
now I can do the testing I should have done before the PR was merged π π
and then fix the bugs you find π
hi, as you make many products with USB, please purchase a VID!
https://store.makerdiary.com/
The set of commands that are handled in terminalio.Terminal() are insufficient for some editor software with an attached display.
In particular, the following commands are desired:
- Line;ColumnH - move cursor to line, column
- XX;YYm - set highlighting mode
- M - scroll up one line
- Line1;Line2r - scrolling the region between entry Line 1 and Line 2
- 25h and 25l - cursor highlighting on or off
This additional set of commands will enable a text editor like [robert-hh/Micropython-...
Beginning with b3b6a64ed7fb10ffb61bc1b71ba4083bca3ada30, USB no longer enumerates when using Simmel, based on the nRF52833. Reverting that commit fixes USB.
After doing a mass_erase of the internal flash and loading the SD and bootloader, I load firmware.uf2 via USB. The device resets itself, attempts enumeration, and a short time later triggers an assert:
(gdb) c
Continuing.
nrf52.cpu: external reset detected
nrf52.cpu: external reset detected
Program received signal S...
Just to double check, did you do a git submodule update after pulling the latest? I'd guess so, but I just want to make sure you got the very recent TinyUSB fix that allowed us to proceed with that PR.
I tested this on an nRF52840 on Ubuntu 20.04.
Tagging @hathach, who may want to know more.
Yes, the tinyusb module is at a74a823b0a140667a4e4e80fa2678870faba2bd0 committed 30/04 at midnight, although the only updates I see to nrf module in tinyusb in the past month have to do with renaming the irq handler to dcd_init_handler.
On what kind of host is this, and do you see the same thing on a different OS?
That's a very good question. This is on a Windows machine.
It's difficult to move the board between machines, because the power cables are a little fragile. However, I also see errors when I plug it into a Raspberry Pi:
[539218.392350] usb 1-1.4: new full-speed USB device number 5 using dwc_otg
[539218.526172] usb 1-1.4: New USB device found, idVendor=1209, idProduct=c051, bcdDevice= 1.00
[539218.526187] usb 1-1.4: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[5392...
Does anyone know if there is a way to determine if you're inside the REPL, a script or waiting for "press any key to enter repl"?
I tried this with a Circuit Playground Bluefruit (nRF52840) on a Dell Intel laptop and a desktop, both running Windows 10, and they seem to be enumerating fine. Both MSC and CDC are working.
I then also tried on an RPi, and the logs don't show the errors you have above.
I'm not sure why it would be peculiar to the '833.
Me neither. Maybe it has something to do with v7.0.1 of the SR? I'm still unclear how that factors into it.
I believe this was fixed by adafruit/samd-peripherals#29. Please feel free to re-open if it reproduces on current CircuitPython. (The fix was probably first in CircuitPython 5.0.0, btw)
I just tried on a NRF52833-DK EVK board, and I see the same thing. If you have one of these, I can give you instructions on how to reproduce the issue.
This is using the Simmel bootloader (https://github.com/simmel-project/bootloader) which shrinks the bootloader partition to 16 kB and removes bluetooth/serial from the bootloader.
Do you have an nRF52840 board you can try with the same CircuitPython commit? It would have 6.1.1, unless you went to some effort to upgrade the build. I guess you could try rolling the '833 SD back to 6.1.1, since it appeared to work. I agree that I don't see why that should make a difference.
I successfully tried with a Feather nRF52840 on Windows too, because the CPB has only a 32MHz crystal. The Feather has both 32kHz and 32MHz, which is more typical.
@tannewt said he had one, which is why he said I should create a PR for Simmel.
I won't have access to an NRF52840 (specifically a PCA10059) for a few days.
@lucid solar it looks like accessing __name__ from inside of code.py or another file will return the name of the file. But in the REPL accessing __name__ will raise a NameError
@lone axle Thanks, but not quite what I was needing, I want to know this inside of C.
Ah, I imagine that functionality is backed by C code somewhere, perhaps you could get access to the same info at that layer. I'm not sure how to do that though.
Thanks anyway
@lucid solar when at "press any key", the GC heap is deinitialized so MP_STATE_MEM(gc_pool_start) is 0
ok, that's probably good enough for what I want. Thanks @onyx hinge
I have to figure out if I need that...
but you could add code in main.c:run_repl() to set a global and check it
@indigo wedge @slender iron I'm trying to help out with the pin claiming issues in the i.MX port but I'm kind of confused by the GPIO bank system. What's the relationship between the actual GPIO banks (GPIO1, GPIO2, etc) and the pad names? GPIO, GPIO_EMC, GPIO_AD, GPIO_SD... I can't find anything in the datasheet or reference manual that explains what the labels actually mean
good question, i don't think there is much relation there, i think they reuse HW blocks from their CPUs and it's some legacy stuff
Hmmm gross. I dunno why they use that labelling when it seems like they have perfectly good GPIO blocks right inside
yea it just adds to the confusion
their defines are also a bit off IOMUXC_GPIO_AD_01_GPIOMUX_IO15 vs IOMUXC_GPIO_SD_13_GPIO2_IO13
Oh, that's no good. There currently aren't any instructions, so the link should be appearing at all.
Fixes #468. Download instructions weren't showing if non-existent, but still showed if empty. This fixes that.
@ionic elk did you find the mapping between pin and gpio?
@slender iron Did this ever get addressed? https://github.com/adafruit/Adafruit_CircuitPython_MIDI/issues/7
@idle owl I thought so but I don't think I've actually tried it
Ok I'll dig a little deeper then. Thanks.
This PR allows the SPI line to be defined as SCK and either MOSI or MISO, removing the requirement for both. It also adds SPI index reservation to the module, meaning that additional SPIs cannot be defined which "poach" the original peripheral, changing its settings and potentially sending erroneous signals over previously configured pins.
Tested on the EVK 1010 and I think it's fine? I don't have a good unidirectional SPI device other than my SSD1306 screen, and I can't get that to work...
@slender iron wasn't really a specific issue, more a documentation confusion. Sounds like the answer is "they're using legacy names that don't make sense" which is what it is
I think the pin naming might be power domain
Hmm, I'll look into that
Β―_(γ)_/Β―
I was asking because I'm looking at implementing pin claiming so I just have to pick some way of sorting GPIO banks
But the internal ones are probably fine
does the gpio handle muxing?
I'll do that. Real quick can I ask for your help on a git rebase thing? I screwed up the base of my last PR
totally
I made my branch off another branch I was working on instead of master (which I could have SWORN I specifically checked out to not do but hey) and now I need to get these commits onto master
but all the rebase tutorials only talk about moving a base forward in history, not backward, so I'm afraid of messing up
git rebase -i will give you a list of what commits to move over
My confusion is what constitutes moving over? I'm in my branch, do I need to make a new one?
Basically I'm trying to remove two commits from the start of my branch
that are from another branch
yup, you can edit the list of what to do with -i
so you can just delete the first two commits
it lists back to the common commit between your current branch and your target I think
I'm just getting a rebase noop?
what command are you running?
git rebase -i HEAD~4
try that
then assuming it opens in vi/nano...just delete the lines that are the commits you want to delete...then save...
@slender iron I've got a very weird issue, when in the REPL, it's reading lots and lots of \b (0x08) and I have no idea why
from the uart?
yeah
what is 0x08 in ascii?
\b (backspace)
is the stlink sending it?
@lucid solar that did the trick! Thanks, I'm using that forever now
@ionic elk when I learnt it about 2 weeks ago...mind blown!
@ionic elk do you understand why it worked?
Yeah it makes sense to just manually move back by X commits
I knew about rebase interactive...just didn't know about deleting commits
can't you just use drop? That's what I just did
@slender iron I'll get out my logic analyzer...
@ionic elk yeah, I forgot about that...
to move back four commits you can just check out the older commit and make a new branch
true but my concern with making new branches is they can't fix already-submitted PRs
they can be used in a new pr though
and if you are fixing something commited you'll want to start with the latest version of master
Right, I'd have to close the PR and open a new one. I've done that with git stuff that's gone really wrong but rebasing out a couple commits was all that was needed for this one
to change an existing PR you can change the branch completely and force push it
beware that it makes existing comments hard to find though because they are associated with commits
@slender iron weird...the analyzer says it's 0xC9
does seem like the repl should handle backspace
But I shouldn't really be sending it
are you doing tab completion? maybe the internal autocomplete is trying to use it
This PR adds DisplayIO support to the F7 and H7 STM32 families. Should enable some fairly impressive screen use given the large RAM sizes and speeds of these chipsets.
Includes some minor changes to remove DisplayIO's strict dependency on Pulsio. Before, DisplayIO required PulseIO to be implemented as empty stubs but with the CIRCUITPY_PULSIO macro still turned on, which was confusing from a documentation perspective and not especially necessary since it could smoothly default to DigitalI...
I'm not doing anything...I don't type anything...
Hmm...I was reading the TX not RX I think...that explains one part of it...
@slender iron I think github has some intermediary comment saving. I force push quite a lot, as does @lucid solar, and it preserves previous PR comments despite the history changing. The Zephyr folks actually require all PRs to be a single commit.
I see the comments in the overview but not in the file diff
@ionic elk I always clean my commits....but they don't require a single commit...just clean ones. My last PR had 4 commits for 4 parts of the thing
my preference is to rebase until making a PR and then merge from then on
makes sense
One major fix and test needed.
#if (CIRCUITPY_PULSEIO)
Please test on a non-STM board as well with a display that PWMs the backlight. The #ifs here have a typo.
@slender iron Something really weird was happening...so I've upgraded stlink on that board and it's working again...not tested the \b thing yet though.
It's not sending the \b over the UART itself.
I don't think it should be a build flag because then building would be required to change.
I think adding something to boot.py is ok.
However, I don't think it's really necessary. One can show an empty group on the display both in boot.py and code.py very early to minimize when the terminal appears. I don't like the idea of a hard disable because it's helpful to have it appear on crashes.
@k0d I think the debug console is fine at build time because I assume folks are already building...
Commands are handled here: https://github.com/adafruit/circuitpython/blob/master/shared-module/terminalio/Terminal.c#L48
I'm pessimistic that we'll have space in the small builds for the extra commands. An alternative would be to implement a second VT100 terminal class in Python that can be loaded as needed.
I only added what was required for the REPL in terminalio.Terminal.
Whoops, good point and good catch. I'll make a note to include an out-of-port control when testing shared module.
Thanks tannewt, I can definitely understand wanting to keep things small. Iβll find a way to build a separate wrapper for to handle these extra commands.
@tulip sleet Would you like me to ticket that namedtuple thing? 3rd/4th posts in https://forums.adafruit.com/viewtopic.php?f=60&t=164835 for anyone else interesting in os.uname()
@slender iron the \b is because the HAL_UART_Receive is exiting with HAL_BUSY...it must be some default value or something weird...
@slender iron are you streaming in ~2 hours
@lucid solar yup streaming at the normal time
@slender iron will you do esp32 stuff? it could be good for me to switch my brain off from uart for a bit π I've made a lot of progress, the only thing to fix is why it's reporting it's busy when it shouldn't be.
Yup! Went through your changes yesterday and will talk through them today
Then going to do pin info
ok, cool. The biggest thing I learnt is that some linker files were missing, which I think caused the linker to crash. Just to sumerize π
ooooooh! the other way to get it to not crash was to remove gc-sections
I should try adding it back
Yes...gc-sections stopped it crashing, because it didn't reach as far as it couldn't find the right linker files...
Can't explain it right...but gc-sections is good to have enabled
kk
@ionic elk do you know why, after I receive one character with HAL_UART_Receive(&huart, &data, 1, 500) the next time it's called I get HAL_BUSY returned?
@slender iron IT WORKS! I can enter the REPL, exit it, reload the script...it all works!!
@simple pulsar I use os.uname().machine quite a bit to adapt to whatever hardware the code is running on. Have you figured out a way to auto-ID SPI devices? I was using input pins but that was very limiting, so now using a manually-edited file to itemize SPI displays, etc.
@gilded cradle Is this something simple and would you be interested in adding it? I recall you working with Pillow. https://github.com/adafruit/Adafruit_CircuitPython_MLX90640/issues/3
@idle owl i think that's a one liner
@tannewt @hierophect
This works now...the only thing is that it's not generic, meaning that we should decide where we set the config and how to enable/disable it.
Could you have a look through the commit, ignore where it says "TODO"...but I'd like your general comments on the solution.
@tidal kiln Do you want to pick it up?
sure. got the stuff right here. i can check and PR real quick.
@tidal kiln Perfect thank you!
Sorry @idle owl, just saw this. Thanks @tidal kiln.
no worries
@gilded cradle No worries! Carter's got it
π
@idle owl do you know why the examples are named the way they are? noticing the one named pygamer has nothing to do with pygame - looks like it uses displayio
@tidal kiln No idea. Feel free to rename as needed. Do a quick search for guides, though they throw an error when code links are broken.
@slender iron Are you deep diving today?? π
@timber mango just started!
@idle owl meh. punting. i have question. responded in issue thread.
@tidal kiln Ok.
@idle owl and figured out the filename - it's "pygamer" as in the PyGamer, not the Python pygame module π€¦ββοΈ
Fair enough π
@idle owl actually, back on, found something existing to just PR:
https://github.com/adafruit/Adafruit_CircuitPython_MLX90640/pull/17
@idle owl done. i'd say release and close issue.
@crimson ferry No, nothing clever I'm afraid, I was just after a basic way to distinguish between CLUE and CPB+Gizmo. I'm currently just checking machine and if I don't find Circuit Playground assuming it's a CLUE.
@crimson ferry In my particular case it's reasonable to assume the Gizmo is present if it's a CPB.
@simple pulsar Does CLUE show up for the CLUE board?
@timber mango Yep, ```>>> import os
os.uname()
(sysname='nrf52', nodename='nrf52', release='5.2.0', version='5.2.0 on 2020-04-09', machine='Adafruit CLUE nRF52840 Express with nRF52840')
As far as I've seen, those .machine strings are descriptive enough to uniquely identify each variant
(suspect that's by design)
@gilded cradle I ordered the displays I need to start working on multi-display support for the HT16K33 based displays. Three each of the 14-Segment and 7-Segment displays. π
This is going to be a very interesting project, which will probably touch several sections of the library.
I will also be able to add animation support for the 7-Segment displays. π
animation on 7-segment?
animation on 7-segment?
@marble hornet Yes! If you happen to have any of the HT16K33 14-Segment alphanumeric displays Adafruit sells, you could run the animation script I wrote. It allows one to do simple to medium difficult animations on those displays.
what kind of animation? like fading ? unfortunately i don't have any 7-segment displays
Hello people
I'm new to hardware programming and I have some questions about Circuitpython/Micropython
I recently got some boards to start fiddling and learning, including an Esp32
I have been having fun with it using an ultrasonic sensor, I'm using micropython
but I am a bit confused with something. As far as I know circuitpython is a version of micropython for Adafruit boards
if my esp32 is not from Adafruit, can I use circuitpython?
@queen mason CircuitPython does not support the ESP32 because it does not have native USB. There is work in progress to support the ESP32-s2
@solar whale oh ok, thanks!
@slender iron I rewrote .packet_size and related code, and discovered that ... at least first write (and maybe more of the early writes) when doing ble_midi_simpletest.py is/are not actually happening. PacketBuffer.write() used to just return quietly if the conn_handle was INVALID. Now I have it return an error value and shared-bindings raises and error, and it got raised. So the write is happening before intercepting the events that contain the conn_handle.
I'm thinking that maybe PacketBuffer should have a routine that lets you pass in the current connection for it to remember. That would make this easier.
hrm, interesting
it might just be a race: the client hasn't gotten around to setting the CCCD yet or writing that empty packet
could have midi.start(connection) as something required before you start writing. Anyway, can wait until monday if you'd like; I just saw you were still on
I have an 833 DK, but I don't see why it could run on 840 but 833. @xobs could you try to flash our stock bootloader on your 833 (best to be DK) with SD 6.1.1 to see if that would works. Since we don't enable SD, it wouldn't be an issue for testing USB with it.
Also it is helpful if you could provide bus capture along with tinyusb log as well by changing CFG_TUSB_DEBUG to 2 and retarget using tu_printf. It is a bit manual now.
@dhalbert do we have any printf debug log via RTT SW...
Shape uses a bitmap to represent blocked regions. This is fine
for some shapes, but others may be more compactly represented.
This lets users make large, possibly overlapping areas of their screen be colored without running out of memory due to bitmap arrays in adafruit_display_shapes.Rect.

Used like:
palette = displayio.Palette(1)
palette[0] = 0x001100
bitmap_gri...
And a CPB running 5.2.0 just did this after 5-10 minutes of running from power-up.
@crimson ferry I don't know what it's doing but I just ran some code that uses displayio and a gizmo and it runs ok without the gizmo. The only difference is a ~5 second pause somewhere in the initialisation. After that all the code seems to run without any ill effect to my surprise! I'd imagine some of the shapes are doing pointless drawing, just about to see if I can detect the absence.
@crimson ferry I may be wrong about pause, that may just be my application. Possible and probably the gizmo library is just firing off signals "hoping" the gizmo is there.
This adds the Nordic NRF52833-DK, aka PCA10100.
I created a PR to circuitpython to add the PCA10100 (aka NRF52833-DK). It uses v6.1.0 You can build it with:
make BOARD=pca10100 V=1 SOFTDEV_VERSION=6.1.0
It also exhibits the same issue.
Any luck @C47D? I'm very interested in this too.
I have been playing a bit with a 2.9" eink screen that uses the IL0373 driver (specifically the GDEW029T5) and it seems to work pretty ok with only minor changes to the examples (swap_rams=True and black_bits_inverted=True), but there is a black border all the way around the active pixels, and it's pretty thick on the 2.9" screen.
When I look closer on the smaller 2.13" tri-color (as on the e-ink featherwing) I also see a black border, but it a bit thinner and kind of hidden behind the edges of the screen, so not as noticeable.
After a bit of digging, I have found the VBD bits in the CDI command and changing the last byte in the start sequence from x37 to xf7 makes the border white (the light background color the display)
@boutonce hi, as far as I know there's support for I2S out on this board. Check the latest circuitpython.
@simple pulsar Yeah, if I'm reading the docs right, that range of st7789 displays don't even have a MISO connection, so they're write-only
@C47D - thank you. I did see a reference to it in CircuitPython, but is it supported in Arduino IDE? (I need interrupts and circuitpython doesn't support them currently to my understanding)
I haven't used CP in a while, I think is better if you open a new issue because this one is too old.
Hi friends! I'm trying to get this pull request green and the hallowing_m0_express build is failing on GitHub.
253888 bytes used, -192 bytes free in flash firmware space out of 253696 bytes (247.75kB).
is what github says. When I build it locally to try and repro I see
251748 bytes used, 1948 bytes free in flash firmware space out of 253696 bytes (247.75kB).
I don't think I added 1948 bytes of flash demand in this pull request & I'm not entirely sure how to get to the bottom of this. Any ideas?
I'd like to investigate the possibility of using device trees, I've copied in some code from the Zephyr project to test with. So far it's working to read in the flash-size of nucleo_f746zg into mpconfigboard.h.
This is very much not complete, I'd just like some feedback.
@hierophect @tannewt @ladyada @dhalbert @jepler
@crimson ferry There might be some hacks to work out if the TFT Gizmo is attached: https://forums.adafruit.com/viewtopic.php?f=19&t=165042
@crimson ferry BTW, i think you need to power cycle to get rid of the library screen code once its active that will be holding loads of the pins in use even if there's no attached Gizmo. It lasts even when code.py has been interrupted, presumably to keep the screen alive for showing the serial console.
@simple pulsar That's a useful find. I'll look into whether the backlight could be used on standalone displays. Yes, from what I understand, even imports can't be un-imported. I usually do conditional import and setup based on hardware config, but some cases are tough if you have to initialize to detect... at least the runtime code can be skipped, and device objects can possibly be manually de-inited.
Looks like there's a resistor-transistor arrangement on the standalone IPS display Backlight pin that may give a useful level for a presence test. I'll wire one up and see.
The error in the building isn't down to your code, it's something to do with the Korean font. I don't know much about that, but I just wanting to let you know it wasn't your code.
@low sentinel Without any extra flags, you get an English build of CircuitPython. The CI builds all languages. The first failing language was korean (language code ko): "Build hallowing_m0_express for ko took 14.96s and failed"
the CI's build of english had 1948 bytes left just like you saw locally
Gotcha. So I guess I'm curious how I bloated the Korean build that much π
Thanks for letting me know. I'll work something else out.
On Sat, May 2, 2020, 13:04 Mark Olsson notifications@github.com wrote:
The error in the building isn't down to your code, it's something to do
with the Korean font. I don't know much about that, but I just wanting to
let you know it wasn't your code.β
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circuitpython/pull/284...
Other languages just take up more space in flash
You are in safe mode: something unanticipated happened.
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Who did this? You need lots of socially-distant hugs. Thank you! (I wrote a bug and this lovely thing rescued me gracefully)
Few minor comments otherwise looks good!
A bit inconsistent using STATIC here and next line uses static, but minor detail.
These comments I'd leave since they show what should be done here later.
π tinyuf2 just got hf2 support thanks to @kbeckmann !
I can't reproduce this on demand but I just noticed I got a MemoryError after making minimal changes to a progam and copying code.py over an old version to re-deploy it to an Adafruit CLUE running 5.2.0. I only had the TFT LCD screen active and it mentioned 12000 bytes. The code actually has a forced GC in the main loop which has been there for some time. I added a debug print of the mem_free() to see if I'd accidentally got close to running out of memory and I'm nowhere near it, ov...
Another example of why this would be useful is here: https://forums.adafruit.com/viewtopic.php?f=60&t=165077.
User wants to use the standard I2C bus for an external sensor that needs 100kHz instead of the standard 400kHz, but board.I2C() provides no way to set the frequency, and the CLUE library has already instantiated board.I2C().
Would this help those who are running the i2c bus over long cable lengths too?
supervisor_flash_init() erroneously attempts to send CMD_READ_STATUS2 for devices with only a single status byte.
For my case with the MX25L51245G flash memory chip wired for QSPI and QSPI enabled in mpconfigboard.h, the boot up process hangs in supervisor_flash_init() at the point where the CMD_READ_STATUS2 command is issued because the command is not supported by the device and the subsequent check in the enclosing while loop is always true.
I corrected this for my case by simply not ...
Hmm if you do spi.write and then a spi.readinto is it normal to see what you wrote in the response buffer?
like i'm seeing bytearray(b'*Hello World'), and * is what I'm sending to spi.write and Hello World is what the device is sending back.
hrm if I toggle the CS pin between writing and reading it works as expected
You are in safe mode: something unanticipated happened. CircuitPython core code crashed hard. Whoops! Crash into the HardFault_Handler.Who did this? You need lots of socially-distant hugs. Thank you! (I wrote a bug and this lovely thing rescued me gracefully)
@low sentinel That is exactly why we have it. π
What do you want to use device trees for? I generally find them hard to understand.
You could split Rectangle out into a shapes module or similar and only include it on larger boards. M0 boards are basically out of space for new features.
Hey @slender iron thanks for the note on Github! :-)
I'm doing just that today, and while I'm at it I'm trying to put together a non-TileGrid binding for vector shapes.
I got full vector polygons working last night π¬. I was using displayio_vector as the module name; shapes felt squatty and it clashed in my mind with displayio.Shape. Any module naming input you have before the PR (whenever I get it ready) would be welcome!
@low sentinel no problem! it's something I'd love to see included. We generally add io to the end of our modules so they aren't too generic.
we can brainstorm naming ideas π
shapesio, vectorio, display_shapes, ...
Lots of ways to skin it. I don't know if I have all the seds figured out to rename in place but I'll try π
It lets me think of factorio every time I say it.
K, I like it. I'll make it vectorio. Thanks!
Me too (factorio)
>>> import vectorio
>>> help(vectorio)
object <module 'vectorio'> is of type module
__name__ -- vectorio
Polygon -- <class 'Polygon'>
Rectangle -- <class 'Rectangle'>
VectorShape -- <class 'VectorShape'>
looking reasonable. Time to exercise that Safe Mode...
This is the output I get from RTT:
00> Adafruit CircuitPython 5.3.0-128-ge3c6d0f-dirty on 2020-05-04; PCA10100 nRF52833 Dongle with nRF52833
00> USBD init
00>
00> CDC init
00> MSC init
00> MIDI init
00> code.py output:
00> USBD Bus Reset
00> Hello World!
00> USBD Bus Reset
00> USBD Setup Received 80 06 00 01 00 00 40 00
00>
00> Get Descriptor Device
00>
00> Queue EP 80 with 18 bytes
00> USBD Xfer Complete on EP 80 with 18 bytes
00> Queue EP 00 with zlp Status...
If you could upload the datacenter packet log as well, that would be helpful to @hathach. Thanks!
I have an nRF52833 DK board arriving in a day or two, and will try to reproduce the problem.
ah so weird, I'm seeing that behavior with SPIDevice as well
with spi as io:
io.write(bytearray([42]))
with spi as io:
spi_result = bytearray(13)
io.readinto(spi_result)
print(spi_result)
# Prints bytearray(b'*Hello World!')
# the '*' is the 42 sent above, which shouldn't be in the read buffer?
Is that .. normal?
@ivory yew what device is it?
I'm running the circuitpython code on a Metro M4
it's talking to a barebones SAMD21 board running custom firmware.
The firmware on that device just waits for a SPI command that equal 42 and responds with "Hello World"
void spi_respond() {
struct io_descriptor *io;
spi_s_sync_get_io_descriptor(&SPI_0, &io);
int32_t recv_count;
do {
recv_count = io_read(io, spi_in_buf, 1);
} while (recv_count == 0);
if(spi_in_buf[0] == 42) {
io_write(io, example_SPI_0, 13);
}
}
i think it may have to do with how the SPI peripheral works; looking...
so you are transmitting the last byte you read on the SAMD21 side
in the SAMD51 datasheet
but it applies to the SAMD21 as well?
yes, their peripherals are very similar
the exact same paragraph is 27.6.2.4 in the SAMD21 datasheet
i think you may not be ending the transaction or something. Did you take that code from an existing example? Maybe look at the Arduino SPI libraries for both sides
the Atmel example for SPI slave literally just had reading, not writing.
gonna do some more research
thanks, it helps just to know this isn't "normal" behavior.
it's common to do a write_readinto, where you send a command and then start getting back data at the same time
I was looking at the ESP32SPI library for the CircuitPython side.
they send the command, then use a function to way for the "start response" byte then use readinto
which I think makes more sense here, as the device might not be ready to respond immediately.
same problem: https://forum.arduino.cc/index.php?topic=578373.0 (on a '328!)
SPI slave echoes MOSI and ignores Slave output
response in the thread is not so clear
AVR Freaks
I want the slave to immediately send a zero on the transaction immediately following the master sending 0x02.
i think you're late on the write
AVR Freaks
I'm using my Atmega32 SPI as a slave.. these are my spi init, transmit and receive codes.
that last one is the clearest
@tulip sleet have you seen any complaints about BOOT drive issues on RPis/Linux? i've been fighting this for two weeks now, and the closest i can get is USB/FS errors; just not sure at what level since it just immediately locks up and logging isn't captured. new (to me) Grand Central is on a 1.x bootloader and doesn't have issues. Metro M4 was on 3.9, now 3.6, and immediately locks up. I'm walking back bootloader versions in hopes to find a diff...
interesting
"When transmitting several characters in one SPI transaction, the data has to be written into DATA register with at least three SCK clock cycles left in the current character transmission. If this criteria is not met, the previously received character will be transmitted."
With SPI, as with so many other things in life, it's much harder being a slave than a master. from the last link
i have not had to write an SPI slave driver yet, but I thought that ASF4 might provide an abstraction for you
i've written code at that level, but only on the master side
sigh
@raven canopy @tidal kiln and I have both seen this, but we've been seeing it for months, well before the newer bootloaders. I used to get random Linux hangs, but then I installed kdump and it's really crashes. I even opened an issue: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1871143
Device is an Adafruit microcontroller board running https://github.com/adafruit/circuitpython, using the TinyUSB USB stack: https://github.com/hathach/tinyusb.
Device presents a composite USB device that includes MSC, CDC, HID, and MIDI
Device was commanded to forcibly reform...
I thought it was past the bootloader, in the TinyUSB in CircuitPython, but I think @tidal kiln said he saw it on Arduino too. It's quite frustrating to press reset on a board and have the host crash. It seems to be timing-related.
i've done a lot of websearching on this and haven't come up with similar reports
except maybe from years ago
i think it's some kind of storage-management issue in the driver, based on the backtraces from the crashes
that second dmesg is similar from what i've seen. i haven't seen any of it on my laptop (Ubuntu 18.04), so i was leaning toward it being related to the RPi's dwc_otg USB driver. nice (relative) to see it happening on ehci as well. i've been to narrow in my launchpad searches, since i haven't come across that report. i've been digging down the udev route... π
Seeing it plenty on the RPi with both 19.10 & 20.04.
i have a very vanilla Dell Optiplex about 8 years old. I think it's happening more often, but I don't know whether to attribute it to more recent Linux kernels or more recent TinyUSB commits
I was running 18.04, now running 20.04. I upgraded to 20.04 early in the hopes it might have been fixed in the newer kernel series
@tidal kiln has an older HP machine
@tulip sleet thanks for your help, I think I understand this now, and I can make it work as-is. π
I haven't seen it on my laptop either. But if it's ehci, it would be the same driver, though maybe that doesn't mean much if it's hw-specific in the driver
@ivory yew great! you probably understand it better than me already
yeah, it could definitely be hub/driver specific...
