#circuitpython-dev
1 messages Β· Page 270 of 1
no, I'm pretty sure it's going for raw frequency resolution too
The setting for max duty cycle resolution is to simply set the prescaler to the lowest possible value.
you mean divide the least?
so that's what the nRF impl is already doing too. It starts at divide/1, and goes to /2, /4, etc, until the counter can be in range (4..32767)
It's going for max frequency resolution. You can only factor in duty cycle res by multiplying the user frequency by the duty cycle resolution.
it maximizes the maximum usuable COUNTER value
If I wanted to use two circuit playground boards to detect when the IR connection between the becomes interrupted, like someone walking between them, and have it ready, how would I go about setting that up?
@tulip sleet do you feel like it's making sense? It'd be easier to brainstorm with a whiteboard π
But for now I think that appnote is the best resource. That table is the best way to think about it
i'll do some computations on paper π
@solid zealot You'd probably be better off asking in #help-with-circuitpython or on the Adafruit forums. This channel is more for development discussion.
Ah ok ty
Don't want your question to get lost in the current lively discussion π
@ionic elk That's what it's for!
Sorry itβs hard to see all the channels on my phone π
@solid zealot No worries! Simply wanted to make sure you get the assistance you're looking for if it's available π
@tulip sleet if you verify the frequency problem, should we make an issue for that?
yes, still thinking about it; i'll take responsibility for that
Been reading along; might I suggest 10 bit is a better compromise. I would want a bit better than 1 degree accuracy from servos!
@ionic elk ^
Can do, but note, that lowers max frequency to 70kHz.
Anyone ever see anything like this: "When I follow the posted instructions for installing circuitpython onto my Hallowing M0 as soon as the UF2 file has been loaded, my Lenovo Flex 5 (Windows 10) loses touchpad capability, and the readout on the LCD display for the Hallowing is garbled."
Same process/board works fine on a different Windows 10 machine. But the same behavior is seen when reconnected to the Flex 5.
@ionic elk I saw that, yes, and to me that sounds perfectly fine. I can imagine that fast pwm people wouldn't agree...
@umbral dagger the trackpad going off is due to the mouse HID device in CircuitPython, so they could change a setting to not disable the trackpad when an external pointing device is plugged in. The "garbling" I don't know, would need to see a picture.
At some point we might need to add a setting that makes this tradeoff more clear.
@timber mango Actually, that could be it - add a new optional setting to the binding that allows you to override the default bit resolution of PWMOut. Lower for faster PWM, higher for better servo resolution.
@tulip sleet what do you think about that?
I think that might make sense. We could discuss this in an "in the weeds" session, or in an issue.
this makes this so much cleaner too. Observe (duty*PULSE_RESOLUTION)/65535
beautiful
I'm actually a big fan of the idea. It'd be ideal for STM32, and would probably work pretty well with Atmel and NRF too. Covers all use cases, only one extra optional input to PWMOut, makes it clear what the actual resolution and max frequencies are, etc.
@ivory yew what was the range for audio, again?
Because this 10 bit business also wrecks frequency granularity. 20kHz and 16500Hz both land on 20kHz, for instance.
20hz - 20kHz
would you hear the difference between 17k and 20k?
absolutely
K I'm dropping back to 8 bit PWM resolution. And given this info I highly recommend we get this feature in ASAP.
This doesn't list all the way up to 20k (because above 8k is basically "overtones" but you'd still hear it): https://pages.mtu.edu/~suits/notefreqs.html
Yeah even on 8 bit that's pushing it. 8 bit intervals are 20507, 19301, 18229
I doubt anyone would output a "note" that high
but lower notes have less distance between them.
Oh, yeah I was looking at the wrong data
if that makes sense
It should adjust for that
at lower frequencies it'll be near exact. Only at high ones will you hit the big gaps
Yes, it's reciprocal
that's probably okay.
this page is super helpful for that: https://pages.mtu.edu/~suits/notefreqs.html
like we'll need to be able to set to 16.35hz and 17.32hz at the lowest end
but 7458.62 and 7902.13 are the highest two notes.
so like 7450 and 7900 are probably passible there
lets see if I can dot hat
but 16.00 and 17.00 probably won't sound right
(note: you likely won't be able to hear <60hz on tiny little speakers anyway)
that's off by enough to sound out of tune to most people
the pessimist in me feels bad for the SAMD21 implementation. its likely going to miss out on all of this.. π
due to build size. not capability.
It won't if it implements dynamic duty cycle resolution adjustment like I've suggested
@ionic elk "Below 500 Hz, the JND is about 3 Hz for sine waves, and 1 Hz for complex tones; above 1000 Hz, the JND for sine waves is about 0.6% (about 10 cents)."
I was overly pessimistic you can actually hit 7457
JND: Just noticeable difference: https://en.wikipedia.org/wiki/Just-noticeable_difference
In the branch of experimental psychology focused on sense, sensation, and perception, which is called psychophysics, a just-noticeable difference or JND is the amount something must be changed in order for a difference to be noticeable, detectable at least half the time (abso...
PWM falls into "complex tones" as a square wave has ostensibly infinite harmonics.
It rounds, doesn't average, so people will have to either mess around or I have to put in a better rounding algorithm
"10 cents", or 0.5% frequency difference, can typically be distinguished in ABX testing. The ratio between those two high 7458.62 and 7902.13 notes is 1.059, but the ratio between the PWM frequencies 7630 and 8003 is just 1.048, so it will not sound like a half step. The difference between the ideal and produced pitch ratios is about 18 cents off.
this also comes into play if they use this for note output alongside other audio equipment
7630 will sound wildly out of tune.
Fortunately that's the one that I can fix, you can hit 7457
you just have to undershoot with what you plug in
ah
it always rounds up
(again pretty rare that someone would ever play a note that high)
like a lot of analog oscillators have a "sweet spot" as well
yeah, I was focusing on the relative error (whether you can play a tune and have it sound IN TUNE) but absolute error is important if you wanted to play in tune with a piano, etc., in the real world
but I want to note that even dropping to 7 bit resolution literally halves this error
like there's plenty of professional grade things out there that only sound in tune from C3-C6.
nRF's PWM audio is not great for absolute pitch either, though (assuming the base oscillator is accurate) I could match popular audio sampling frequencies to within 4 cents
Basically - we don't need the whole range, we should just probably document the range where it's accurate for audio.
Ok, feeling pretty good about this. @ladyada, this is ready for testing. We had a pretty huge discussion in #circuitpython about the tradeoff between PWM duty cycle resolution (required for servos) and speed/frequency resolution (for audio and highspeed driving) so I may pick up on that in a later issue/PR.
(it makes different choices than the "regular" PWM out, it will choose non-round top values like 167(!) for nominal 48kHz audio. not all PWM modules might do this)
people who want really accurate tuning probably won't use PWMs anyway. π
no "true DAC" on nRF so it was the fallback choice
Well, just to be clear: at 4 bit resolution, 7458 goes to 7460, and 7902 goes to 7903. We can easily hit super accurate frequencies. But it comes at the expense of the servo people
@ionic elk Frequencies of timers 1,8,9,10,11 are sysclock times 2, right? So 168 MHz instead of 84. Is that right and are they free and would that help?
saying you care about C6 and not C8 is like letting you have two bits of PWM back
Raising the max frequency could help a little but this is really more of a resolution problem
I'm going to leave this up to @tulip sleet and @slender iron. If I put in a sliding scale for how many bits people want, it makes everybody happy, so hopefully we can just do that. Otherwise I think 8bit resolution probably comes close enough to each to be ok.
The servos won't get sub 1Λ actuation and we won't be able to hit a couple of high notes but I think it's generally pretty decent for overlap
hmmm, so if you want to have a single cycle of a 587.33Hz sine wave (D5) in a 22025Hz wave file, you can choose between having 37 or 38 cycles, and the ideal's nearly 37.5 for an error of 23 cents. π¦
but if you have 10 cycles instead, which is just 375 samples, you can pretty much nail it
this makes me think the "tone out" function should (A) use several cycles and (B) pick DAC over PWM. I think it uses a single cycle, and prefers PWM anyway...
ensuring that you have at least a couple hundred samples and at least one full cycle pushes the max error in cents way down for the example values I'm playing with anyway
"dithered pwm" would help but not a lot of devices seem to have it
Has anybody actually used the nrf or atmel boards with servos, by the way? The way they're set up now, they seem completely optimized for frequency resolution, which should be coming at the expense of people's PWM
at least at certain frequencies that are close to a prescaler value
@onyx hinge I've got a dithered pwm appnote that I could implement but i don't think it's very high priority.
I have some servos but no way to really measure the absolute accuracy of their rotations
also no concept of what is considered "good accuracy" of a servo
also @timber mango only a handful of the advanced timers support above 84MHz, and we don't distinguish between the advanced and standard ones, so I think higher frequencies are off the table.
you basically have a small DMA buffer and fill it with X or X+1, according to the "in between" value you're seeking
at least that's my very quick read of it
and yeah agree that our excitement to talk about this topic shouldn't become a drag on actually implementing something that can be evaluated in a real world, instead of theoretical, sense.
@crimson ferry Howdy! Sorry I haven't gotten back to you sooner.....my city and county are in the middle of a wildfire and things have been hectic since last thur/fri.
I was able to test the v1.5.0 release of NINA firmware, though, for two days last week at the office, and it worked fine. Oh - and that was on a WPA2 Enterprise network.
So yeah...haven't been able to do any other testing, but I plan on some more eventually once life is back to normal...or at least normalish π
hiya can you provide me a bin for the feather f405? artifacts aren't coming thru actions anymore :/
I can't imagine, been reading about the fires, but wow. Thanks for the update, good to have some regression π
Stay safe.
Thanks!
urgh a fan is going bad in my home circuitpy development machine. rrrrrrr-rrrrrrr-rrrrr
I'm in Santa Rosa....and one of the fortunate ones - I've had power, cable tv and internet this whole time....and lots of anxiety and frazzled nerves π heh
@sly falcon hang in there and take care of yourself before seeing to circuitpython π
@onyx hinge ugh.....my desktop at work has a noisy fan on the video card...otherwise the machine is silent....it gets annoying at times, so can totally empathize! π¦
@onyx hinge thanks!
Hi, that's a bummer - here you go.
Hi.
I need some guidance regarding circuitpython and adafruit featherboards. I wanted to get a board with wifi-support. Here is adafruit feather huzzah mentioned (I assume the ESP8266) https://github.com/adafruit/awesome-circuitpython#hardware but checking https://circuitpython.org/downloads and https://github.com/adafruit/circuitpython/releases/tag/4.1.0-rc.1 there are no bin-files for the huzzah with ESP8266 https://www.adafruit.com/product/2821
A curated list of awesome CircuitPython guides, videos, libraries, frameworks, software and resources. - adafruit/awesome-circuitpython
CircuitPython Organization
CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython
Any idea if its possible to get the adafruit huzzah ESP8266 running with circuitpython?
@timber mango CircuitPython support for the ESP8266 was dropped as of version 4.x. The main rationale for this was due to the ESP's lack of USB Drive capability. The current WiFi approach is to use a PyPortal, Airlift board, or an Airlift breakout (all use an ESP32 as a wifi co-processor over SPI).
@raven canopy thanks.
I'm trying to see if I can find any of the old instructions for loading 3.x and earlier on the ESP8266...
acutylly I have adafruit featherboard ESP23 and though I buy an featherboard which has support for micropython, where I was thinking te ESP8266 had it... But no luck on this side....
sorry... support for circuitpython...
@timber mango you can also use micropython on ESP8266 and ESP32. You can't access all the circuitpython libraries without adapting them, but it might still let you achieve your goals.
Your right. Micropython is running. I am not that good in python to adapt libraries, or in other words, I think it will be to time consuming. I wanted to connect Adafruit Flora LSM303 sensor, but could not find libraries. Circuitpython has working sensor-libraries, so I thought buy a proper circuitpython board and use the available libraries to connect.
ok tested with great success! there's some debug output to remove - other than that i tried various frequencies and duty cycles.
did you try enabling displayio?
With the current information, I have to change my tactic. Now I am heading for accelerometer and gyro sensors, which have micropyhton support. Cross fingers π
@timber mango yes they are quite different. It sounds like trying with circuitpython 3 is possibly your best bet, I'm just not sure where to download a build that old ...!
If you have hints or advices, they are very welcom π
https://github.com/adafruit/circuitpython/releases/tag/3.1.1 hmm is feather huzzah the one with esp32? Not sure.
but here are the files from the 3.1.1 release
no, that's 8266
afk, time to make some dinner π€€
Enjoy your dinner. I will hit my bed. Anyway Thanks!
@timber mango FYI - there has never been a CP build for the ESP32 β only for the ESP8266 and as noted it was dropped with 4.0.
(hmmmm is "blinka, except for micropython" a concept just a little too far out there ...? i.e., a layer that lets you use many circuitpython libs on a base of micropython. I bet a motivated person could do it.)
That's impressive.
@ladyada Awesome! Forgot about the debug output I'll get rid of that real quick. DisplayIO has a substantial HAL component to enable Parallel Bus - do you want me to make that next over UART?
@dhalbert let me know if you'd like me to make an issue or want chat more about this variable PWM pulse resolution thing.
The general approach I've taken is that if a resource is explicitly reset then it will clear never_reset. Never_reset really only guards from the broad reset of everything.
In the samd port, never reset is cleared for pins through reset_pin_number: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/microcontroller/Pin.c#L113
re ulab numpy-like library: this looks very interesting and if it fits, it would make a good addition to the builds for the higher-capability microcontrollers we are now supporting. It is not quite dropin due to some API changes we've made. Also there are some bugs to fix
I did notice that. I'm not sure if it's appropriate for reset_ok to actually call reset (it's not implied functionality), so the way it is now is the user or shared bindings or something needs to get in there and manually reset those pins to free them.
@tulip sleet and @slender iron I found this piece of linux c magick that would allow me to grab the containing struct of a UART pointer without actually needing a root pointer array. It's what stm32duino uses:
serial_t *get_serial_obj(UART_HandleTypeDef *huart)
{
struct serial_s *obj_s;
serial_t *obj;
obj_s = (struct serial_s *)((char *)huart - offsetof(struct serial_s, handle));
obj = (serial_t *)((char *)obj_s - offsetof(serial_t, uart));
return (obj);
}
do you think it'd play nice with the GC or not so much?
is this struct serial_s allocated on the heap or statically?
the point of the root pointer list is to note objects that, even though they have no other pointers to them, should be used as starting points to mark used objects during the mark phase of GC.
It's a protected variable in a c++ class
So I guess I'd want to keep the items in the root pointer list, but maybe I wouldn't need to actually fetch them out of it
Will an internal pointer alone keep an object live for gc? I dunno
Unless it's documented I'd guess not a good idea to depend on it
Looks like the definition of BLOCK_FROM_PTR assumes it is passed the first byte of the allocation
@tulip sleet would it need to be included in the build of CPy or is possible to include it as an optional library?
it would need to be part of the build, as it is C code
@ionic elk right, the root pointers list is not mean to fetch from, it's just a list for the GC to use
but is it static or was it malloc'd?
@tulip sleet I guess I'm confused, neither? Why would it be? It's just a component of a C++ class
the wizard function grabs it from anywhere
@ionic elk is the instance of that class allocated at compile time or at run-time? Who calls the constructor?
Is there C++ code in the HAL? I thought it was all C. I'm a little worried about which version of new any C++ code is using: it needs to allocate storage in a way that's compatible with the GC.
@tidal kiln no rush - checkin' if your gizmo guide will be done today
ooo. probably not. sry. i keep tweaking the code...but could be getting into feature creep land at this point.
yeah i think... tweaking is done - time to document π
dont have to write guide today but the project works well as is
okie doke
@tulip sleet sorry for the confusion, let me start over. The linux function I posted comes from stm32duino, it's not a part of the ST HAL. They're using it to link the HAL handle of the UART (which is the only context you have in an ST IRQ) to their own UART object which contains their rx buffer and other essential tools.
I have to do the same thing in my own code, only I iterate through the list of root pointers to all the cpy busio uart objects and see which one has a handle that matches the one in the IRQ.
Their solution, while it contains more magic, has the appeal of not needing to iterate through the root pointers and check each one for a match, and so is probably faster.
but it's probably not that important either way, and the root pointer approach is probably safer, since I think the above could potentially start looking for a struct that doesn't exist.
I was confused when you said root pointers, and thought you were talking about CIRCUITPY_COMMON_ROOT_POINTERS, or something. Do you just mean the table of UART objects you keep?
is the HAL object allocated dynamically?
It's in MICROPY_PORT_ROOT_POINTERS
what's the name of what is in MICROPY_PORT_ROOT_POINTERS?
i don't see anything stm32f4-specific in the source tree that adds stuff to MICROPY_PORT_ROOT_POINTERS
I have an array of busio_uart_obj_t type pointers in the MICROPY_PORT_ROOT_POINTERS alongside CIRCUITPY_COMMON_ROOT_POINTERS called cpy_uart_obj_all. Whenever a uart object is created, it is added to this list.
I mean there's nothing in master yet, this all is UART specific
I would have used a static array, but tannewt was concerned that I'd get bad references since the GC could eliminate members of it at any time.
But are these busio_uart_obj_t objects the objects you return when someone calls busio.UART() ?
let's audio chat, cause it will be faster
I don't really understand that question. Sorry @tulip sleet I don't mean to waste your time with this. I thought it was an interesting linux function, that's all
amelia earhart
Github user @rdagger reports the following problems:
I've been having problems with I2S on the Feather nRF52840 Express running CircuitPython 5.0.0-alpha.4-260-g2b02750f1 (2019-10-26.)
I'm using an Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A (PRODUCT ID: 3006).
I've been using the example programs and here are some issues:
- The sine waves only work well at certain frequencies. Some frequencies causes the Feather to reboot in safe mode. Other frequencies have very...
hiya no UART is more useful.
@tannewt is parallelbus required for displayio or is it possible to have only spibus support?
@meager fog Hiyo, as I'm debugging I've found a funny problem with that debugging gps library you sent me. When I soft reboot the device, whether through writing to the sketch or manually, it just returns all 1s or all 2s. But from my debugging text, it isn't actually attempting to perform a read at all.
But it's only on the STM32. So I'm trying to figure out what I'm missing
@ladyada Do you think you could give this latest binary a run? I'm trying to get a better handle on what's wrong with it, which is proving tricky without better python experience. It's structurally very similar to stm32duino, but it just doesn't seem to be delivering on the basics these libraries need from it.
bin if git CI is still down
firmware.bin.zip
Hi! I've been looking at issue 2076 in core ("Transparency setting for shape fill color cannot be dynamically changed after initialization") and it looks like the issue is really in the adafruit_display_shapes library. What is the proper procedure for this? Should I open an issue against the library and reference that in issue 2076? I've about got a PR ready for the library
@timber mango That would be perfect!
thanks! Will do
This issue looks to be in the library. See https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes/issues/7
for details.
@tannewt I didn't expect anything to actually happen here but it turns out it might be fixed: https://twitter.com/zooba/status/1188954487924260864
@ionic elk before you write that PWM issue, I want to talk to you again; I talked to Limor this evening about this. We can do some kind of whiteboardy thing if necessary
out of curiosity, is this normal? I'm not having any issues with my board and my code runs as expected so I'm guessing it has no effects. I'm using a CPX
@remote zenith probably you just unplugged or reset the board without ejecting it, and Windows isn't sure it was unmounted cleanly. If you scan and repair, it will probably say there are no errors. To avoid this, you can "Eject" the drive before you unplug or reset it.
ahhhhh, I see, thank you!
windows especially can take up to 90 seconds to write everything to the drive; this is being fixed, we think (it's a decades-old problem)
oh wow, that's quite a while
this is especially true for very small drives (FAT12)
it's from code that was written for floppies
okay that brings up an important question
that's not serious in the slightest - if I grab an I2C port expander, can I bitbang PATA?
PATA uses a 40 pin connector I think, of which half are ground
never mind, about 29 data pins unless I messed up my counting
you could try it π if there a minimum speeds on some things, it might be an issue, but maybe that's not true
First I'd need to go find a PC with PATA!
Actually-
I just need to get a USB CompactFlash adapter
i have had USB external drives that supported PATA
I mean enclosures for PATA drives
oh wow
i think
I mean, fair enough, for some time that would have been cheaper than SATA
yes they are
This is off-topic for this channel but just for kicks and giggles...connect the I2C port expander to the link port on my TI-84+ and bit-bang I2C to bit-bang PATA...all with Z80 assembly. This is definitely a good idea and absolutely nothing could go wrong with this.
https://www.microcenter.com/product/285941 is something like what I have
but they have several like that, not hard to find
you should know that @ tannewt here is using circuitpython to control GameBoys via the cartridge port
these are all over the place: amazon, etc. not rare
I never knew these existed, thank you!
just search for USB IDE adapter
These are way cheaper than I would've thought
well, they were a high volume item when IDE was common, and when the transition to SATA was happening, and there are still IDE disks people want to read
So now I only need to bitbang USB host π
good luck with that π
(just joking but the TI-84+ actually does do that already)
I most likely could write a driver for usb8x, which does USB host on the TI-84+
(link: https://en.wikipedia.org/wiki/Usb8x)
This is very off-topic from this channel now
i'm on my way to π€ but it was fun
sleep well and I'll see you around!
I followed one of those USB-IDE adapters with an IDE-PCMCIA adapter to read an ancient 6MB memory card once.
hahahaha wow nice!
@tulip sleet happy to talk whenever you want
@ionic elk now is fine
The counter clock frequency (CK_CNT) is equal to fCK_PSC / (PSC[15:0] + 1).
@ionic elk hihi back, if you wanted to look at the gps library again
@meager fog hiya, I've been in a PWM algorithm discussion with @tulip sleet and @slender iron, but I'll take any help I can get on the UART end
ok whats the UART Q
btw the stm32's went into the shop
so expect a lot of users/bugs/feature requests π
I'm trying to determine what is going wrong, which is best seen from the python end
Specifically, when soft rebooted, it starts reporting that it's seeing 1 character available, but my debugging doesn't report that it even hits the read API
and generally, it seems much too slow
Just knowing what exactly is happening with that 1 character report would be tremendously helpful.
ok give me a bin
up on github!
@ionic elk for later: Python version of nRF PWMOut prescaler and max-count calculation, and output
@tulip sleet I think I have figured out how my algorithm differs. I'm still trying to reconcile it with my equation based approach mentally, which is closer to existing walkthroughs of the STM32, but it looks like I was approaching the incrementation backwards from you and Scott.
What I've whipped together for the moment is this:
for (int i=0; i<65535;i++) {
period = source_freq/(i*frequency);
if (period <= 32767 && period>=4) {
prescaler = i;
break;
}
}
if (prescaler == 0) {
mp_raise_ValueError(translate("Invalid frequency supplied"));
}
^ a python version of the nRF prescaler and count finder, run on variou PWM frequencies
yes, that looks like the nrf thing. the 4..32767 is nRF specific: can you use 0 to 65535?
your code is just trying all the divisors, as expected. i will not get very big π
well, 0 isn't really very useful because that's 0 pulses per interval. 2 is the point at which you'd presumably be able to actually have a duty cycle.
right π
But I can go up to 65535 actually, I mixed up the prescaler and the period limits now that I double check the datasheet. Divisor should only count to 15 bit
so you are able to do finer divisions instead of just power of two
I'd really like to bring together how I was thinking about the math + how micropython does it in my head, but it might take a day or two
sleep on it etc
since the input frequency is an integer (can't get below 1 Hz), then i won't get above72, I guess
sure
@ionic elk btw, did you order some STM32F405 feathers?
I've got 2 right now, I don't have the store ones if they're different
@tulip sleet should I get more?
@ionic elk no, they should be fine. I got two store ones; I never had protos. I'm not sure if there's any significant difference. Limor would have told you
PyPortal Titano display tweaks
- Switch to 8-bit mode
- Native rotation
Tested on PyPortal Titano running CircuitPython 4
ok lets wait for actions then we can merge!
@ladyada passed actions, could I merge?
I spoke to @tannewt about this issue this morning. It turns out that PWMOut common-hal is used by displayio from C, so we don't really want it to throw Python exceptions. Hence the error code returns instead.
Scott would actually like to see most or all of the common-hal code be callable from C as necessary, so we should actually consider moving in the other direction.
However, it may be true that the PWMOut error codes should be generalized across ports, which I think is another th...
@ionic elk @tulip sleet I updated Dan's python example for the stm constraints: https://gist.github.com/tannewt/b17bb946789625ca8d4d805a0ca1e61d
sample output at the bottom
includes target frequency vs actual too
Closing as won't fix for now; this hasn't been a really big support issue.
I'm working on specifying the flash layout on nRF boards in one central place instead of spread around, and I'm seeing that the size of the internal filesystem may not be specified exactly correctly. WIll follow up again when I know for sure one way or the other.
See https://github.com/adafruit/circuitpython/issues/2206#issuecomment-539725561 for a more thorough explanation of why this is very hard. Closing for now.
No recent reports of the origianl problem. Closing for now.
uzlib is not turned on for any CircuitPython ports. It might be nice to have if it's not too big. It should be moved to shared-bindings and shared-module.
Closing for now due to no further information. Please re-open if you can reproduce with 4.1.0. Note that framebuf has been replaced by displayio in 5.0.0
@shazz could you re-test with the latest version of https://github.com/adafruit/Adafruit_CircuitPython_SD ? Thanks.
Hi @anecdata, could you retest on 5.0.0-alpha.4? Thanks!
Hi @anecdata, could you retest on 5.0.0-alpha.4? Thanks!
Ideally, we would do this by 5.0.0 GA.
Did someone report this to Apple? I thought that was in the works.
@siddacious still true with latest CircuiPython Build?
Hi @anecdata, could you retest on 5.0.0-alpha.4? Thanks!
@ntavish @deshipu Have you discussed this? I'm just making a pass over older PR's.
That makes sense. My only concern with this approach is the errors that are port or architecture specific. The benefit of port specific error codes is that you can tell the user that their system is failing because they didn't match the frequency to the existing channel they've set up, or because all channels have been reserved, etc, giving them a pathway to quickly resolve the bug. Making those errors more generic puts the user a little further from solving their problem. But perhaps that's ...
@slender iron did you put in my updated algorithm to test, or is that just the expected value set?
I didn't see any updated algorithm. I just based it on Dan's py file
Ah, I see, it's just the math
and swapped the divisor to 16 bit
Testing now, we'll see what it outputs
@slender iron I made a pass through all the unlabeled or 5.x issues and PR's (as you can see). The only thing that probably should really be in an alpha.5 is the two I2C's for CPB, as we discussed. Lots of other bugs but no showstoppers.
everything (both issues and PR's) has a milestone now, and I added a bunch of labels as well
@dhalbert I opened up the other pyruler I bought at the same time as the other and it works fine; probably a hardware issue? I'm fine with closing, sorry for dragging my feet on this
@tulip sleet how about this? ```python
import time
import adafruit_ble
from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServiceAdvertisement
from adafruit_ble.services.nordic import UARTService
ble = BLERadio()
advertisement = ProvideServiceAdvertisement(UARTService)
while True:
while ble.connected:
for connection in ble.connections:
if UARTService not in connection:
continue
print("echo")
uart = connection[UARTService]
uart.write(b"echo")
# Returns b'' if nothing was read.
one_byte = uart.read(4)
if one_byte:
print(one_byte)
print()
time.sleep(1)
print("disconnected, scanning")
for entry in ble.start_scan(advertisement, timeout=1):
connection = adapter.connect(entry)
adapter.stop_scan()
print("connected")
it won't scan if no connection has a uart
while True:
has_uart = True
while ble.connected and has_uart:
has_uart = False
for connection in ble.connections:
if UARTService not in connection:
continue
has_uart = True
print("echo")
(untested, just playing with the API)
removing the service recognition makes the advertisement printing a little less nice but that's ok
Ok, new PWM algorithm is in and tested.
@slender iron I think that looks really nice. "Radio" is a great term: really describes the actual hardware well.
π I'm on the right track then
@slender iron
while ble.connected and any(UARTService in connection for connection in ble.connections):
is that too obscure π
fancy π
I think that works
looks cleaner to me
If that's going to be common usage I'd suggest wrapping it in a helper method. Like ble.connections.find_service(UARTService)
connections is just a sequence (prob tuple)
the radio class could do it though
should it be first or all? find_service(UART_SERVICE) with_service(UART_SERVICE). Latter might imply all such services
I won't worry now. we can add it later
unless plural
yeah
one we figure out the building blocks we can optimize common cases with helpers like that.
totes
5.0.0-alpha.4 on 2019-09-15 with CP Lib Bundle 20191029
doesn't appear to improve or change the behavior of either example.
5.0.0-alpha.4 on 2019-09-15 with CP Lib Bundle 20191029
doesn't appear to improve or change the behavior of either example.
(Note that the code as shown above has the 3-color EPD enabled, just swap the True / False in lines 17 & 18.)
Ugh! Last minute CP issues on Halloween
Missing audioio on a CPX BLE Alpha?
Not trying to do audio but the CPX code requires it?
I just taped the Monster M4SK to the window π
Traceback (most recent call last):
File "code.py", line 2, in <module>
File "adafruit_circuitplayground/express.py", line 53, in <module>
ImportError: no module named 'audioio'
you can remove that part from the CPX library.
audioio has been replaced by audiocore and other more specific modules
just get the source, the CPB should be able to load the .py
Link?
do you need BLE for this Halloween project?
Appears to have the same quirky behavior on 5.0.0-alpha.4 on 2019-09-15 with CP Lib Bundle 20191029.
hmm. it should still map fine with audioio though...
wrong ref, i think...
oh wait. nvm. nrf doesn't use AUDIOIO_COMPAT. argh. sorry.
This will include the changes to the infrastructure checks, with regards to checks for the migration from TravisCI to GitHub Actions.
Just another translation string
We need to disable the speaker on the CircuitPlayground Bluefruit just like we do on the Express because it currently makes noise when the AUDIO pin is touched.
A little quick analysis: It looks like the related code in the samd port for the express version is:
#ifdef SPEAKER_ENABLE_PIN
speaker_enable_in_use = false;
gpio_set_pin_function(SPEAKER_ENABLE_PIN->number, GPIO_PIN_FUNCTION_OFF);
gpio_set_pin_direction(SPEAKER_ENABLE_PIN->number, GPIO_DIRECTION_OUT);
gpio_set_pin_level(SPEAKER_ENABLE_PIN->number, false);
#endif
(reset_all_pins)
and a few other bits all gated by SPEAKER_ENABLE_PIN. Similar code will...
@dhalbert i believe pt filed a bug report
tnx!
The DotStars on various different boards come in a couple of different varieties. The two vary significantly in brightness at equal color levels. Adjust the status colors so they work for both and are not too bright, not too dim, across both kinds, but just right. Goldilocks will review.
I have both kinds: dimmer on Trinket and M4 Itsy, brighter on Itsy '840.
@ladyada this is ready for one last re-test with the updated algorithm
@ionic elk hiya sorry i could not test uart yeterday, i was croutoned to deth
How are you observing the noise, on VBUS and VCC or is this also making RFI? Specifically, I'm assuming this is actually the joy of class D amps and is coming from the PAM8301?
Croutons for Halloween? I would think that's more of a Thanksgiving thing.
@meager fog you died of salad?
yeah basically π
that sounds horrible
its when you cant do anyting because you have a small interrupt action required every few minutes
I am saleaeing the heck out of UART today but I will appreciate any insight you can bring!
so you end up context switching and then you're like "all i did is eat little croutons"
yeah I remember that from when I was doing more managementy stuff
it's the worst. I had to put up an open/closed sign at my desk
which everyone promptly ignored
@ionic elk ok firs tup why are you salaeing uart
I'm examining what happens at startup on an atmel control vs the feather f405 with an extra line for IRQs. I'm seeing differences in how TX and RX data is spaced, and it seems related to where the IRQs unexpectedly halt. I think there might not be adequate IRQ protection around TX writes, and that's disrupting buffer variables.
ok so when you transmit data, if an IRQ comes in during that time for something else, you have an issue?
at this time you dont have DMA for TX, you have to submit each character to the TX HAL, then wait for it to return?
or do you have an IRQ when the TX buffer is empty?
The problem only seems to occur at startup which was why I didn't encounter it before. It seems like if I get an RX during the first TX write of the library, it disables IRQs and can't restart them.
ok checking a GPS against UART, its def able to get larger qty of bytes at a time now
so that is solved yay
Yeah I added a LOT more protections. It shouldn't brick itself all the time anymore either
the input buffer is 64 bytes
But evidently I still missed something
Just copied that from NRF
But I can make it bigger, I wouldn't guess that's a very big deal
yeah... i think bump it to 256 bytes
k
chonks not dinks
yumm chonk
ok i will try the GPS parsing demo next
did you have anything that wasnt working
that i can replicate for ya
If you soft reboot, it borks the heck out
interrupts are halted, but it constantly returns a value for the size of the buffer
But I don't see it actually entering the function that sets that value
So I don't know what's going on in the python there, any insight would be helpful
Yup, just hear it out of the speaker when I touch the audio pad. It's not the end of the world but it is unexpected.
@ionic elk whats the exact code you're running
you can give me a zip or the code.py
so we are looking at the same thing
softrebooting with just RX works ok - https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/CircuitPython_Essentials/CircuitPython_UART.py
oh yeah thats weird
works every other time
or at least, sporadically
do you need something to constantly send data so you can repro consistantly?
when it wedges UART, it never seems to start with an empty buffer
code.py output:
2
2```
Hmm I thought it borked every time, unless I swap it out with another program
Does the python lib just keep reporting that value if the read halts?
Because my debugger doesn't show it even ever getting to the read function
it never 'halts'
runs forever, reporting only 2 bytes read
it never reads more data, so the GPS parsing code does not run
im running the binary you posted in the UART PR
with a GPS module wired up to send data to TX
on the feather stm32
I was interested in anything PAM8301 related because I somehow let the magic smoke out of mine with some rather innocent use, I added some notes to an existing thread: Adafruit Forums: Circuit Playground Express gets VERY hot.
@ionic elk i think we should verify we have the same output
perhaps you are debugging something different?
@meager fog sorry I got distracted assisting somebody in the help channel
I also don't see it ever stop reporting the buffer size
but I have a GPIO trigger for when it enters the c-level read function and it actually never even hits tat
so I was wondering if the python might be getting stuck somehow
ok lets remove the GPS library
what is your os.uname?
Adafruit CircuitPython 5.0.0-alpha.4-285-ga8070a418-dirty
Adafruit CircuitPython 5.0.0-alpha.4-286-gc78d79938-dirty on 2019-11-01
ok tahts a different build
how about you try the firmware bin you posted
so you can see what i see
you can stash your commits
then you can run this standalone example
import busio
import digitalio
import time
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT
uart = busio.UART(board.TX, board.RX, baudrate=9600)
uart.write(b'$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n')
uart.write(b'$PMTK220,1000*1F\r\n')
while True:
print(uart.in_waiting)
time.sleep(0.01)
if uart.in_waiting < 32:
continue
data = uart.read(32) # read up to 32 bytes
if data is not None:
led.value = True
print(''.join([chr(b) for b in data]), end="")
led.value = False
Ok
Dang, that built just crashes on me super hard
hi back from commuting
At least on mac something is horribly wrong
ok you cant even get USB to run?
It works ok when plugged in but whenever you restart it crashes
crashes USB that is, not just a circuitpython crash
OH wait durr wrong bin dang it sorry
bbiab i have a review for 30 min
No worries I think I can take it from here, thanks for the superior testing sketch
much simpler
@ionic elk hihi ok so did you load the test sketch
@tulip sleet @ivory yew back at you on the BLE library PR
@slender iron gotcha
yes I got it up and running. While this build doesn't have my interrupt signifier, so it's not easy to tell when they halt, it's still showing what could be problematic TX/RX overlap at startup.
I'll dig into it and check in again later.
Fixes #2259.
Reduces status RGB LED brightness on boards with DotStars. There are various versions of DotStars that vary significantly in brightness. Also parameterizes the RGB status color definitions. It's a bit of overkill, but it doesn't add code. I did it because I originally didn't realize there were run-time brightness changes being done in rgb_led_status.c, and was preparing to do compile-time brightness changes based on the kind of status LED.
@tannewt I'm confused about why there are now merge conflicts.
@ionic elk ok if you make a new build with the irq signifier
please post here and i will test it
@ionic elk next up i can check out the PWM as well
@dhalbert Jeff fixed a typo in one of the comments I changed. Merged now.
@slender iron will try to poke at it tonight
π
fixed uart
@ladyada New bin, should have fixed all crashes and buffer errors.
firmware.bin.zip
@ionic elk lol
@meager fog new bin up for UART, should work with GPS lib
@ionic elk you fixed one thing
but then i put it to the ULTIMATE TEST and it did not pass
ltimate test is while you have TX going to the feather, have RX on GPS also connected to TX
ah.
lemme make sure data is coming out
lol ill scope first
No, I need to get in there and implement full IRQ writes. I was going to raise an issue for that and wrap it up after displayio but if that's a core feature I'll get it in this weekend
oh wait it does
i think
it is not happy...
but it is getting data
lol
some data is corrupted
Writes block reads right now, that's how I was getting the HAL to cooperate
probably due to the buffer size tho
hmm want to try bumping buffer size up
well i dunno
i mean it isnt writing data in this example
so why would that make any difference
give me a build with a larger RX buffer
ok we can give it a shot
wait you specify the receiver buffer size, it's exposed in the API
where?
busio.UART(tx, rx, *, baudrate=9600, bits=8, parity=None, stop=1, timeout=1000, receiver_buffer_size=64)
oh neat, and you respect that?
yeah all variables are supported
as good as it can
i think document that writes are blocking
and thats fine
it isnt that unusual to have uart writes block - maybe one day we will have DMA or IRQ-based
It won't be too much work to put in the non-blocking ones, it's just I only found that issue today, but I can definitely try a prototype pretty quickly.
But if it's working well enough I can just start a long term issue and push it behind displayio etc
yup
good friday afternoon everyone!
yay verified this works a lot better, this is ready to merge/release to folks. open an issue to add dma/non-blocking writes and we can get feedback ask well
tested functionality on STM32F405
@slender iron ok please review the UART PR at your convenience
functionally its good but needs a stylistic review
I am looking at the CPB / nRF "speaker noise when touching AUDIO pad" . Making this change will cause problems for e.g., simpleio.tone, because it does NOT set the SPEAKER_ENABLE pin. So without changing the code, your CPB is silenced.
kk, should be able to do a pass today
PWM needs a little more testing, what is next after that?
i was thinking displayio but...other stuff could be good too
should I go ahead and PR this and file issues against (presumably) simpleio and circuitplayground modules?
looks at stm issues
@onyx hinge we tell people to manually enable speaker - check the CPX guides
Currently, STM32 writes both block and disable IRQs to protect against HAL-related failures. The entire system should be replaced with a non-blocking IT or DMA alternative, so faster full duplex data transfer can occur with fewer errors.
@slender iron @ionic elk tawk amongst yerselves. i have weekly meeting. bbiab
@meager fog ok my first test code was one that Kattni sent me for testing simpleio.tone and my change silenced it.
but if the guides would already cover that, then no worries
needs to learn to read guides and use the code in them for testing by default
@meager fog PWM should be ready for whatever you want to put it through, it matches NRF and atmel more closely now.
this should be easy to knock out and critical for some libraries and examples that use board.I2C
Ah yeah I can get that out quickly
@ionic elk please assign to yourself when you are actively working on an issue. leaving it unassigned means someone else can help us out and do it
https://github.com/adafruit/circuitpython/issues/2194 should be fixed for delay
Ok, I'll get on those next. I'll be working on stuff this weekend, so feel free to add anything else you'd like to the cleanup list and I'll get on it.
gotta go to a thing, be back tomorrow.
This allows the board to disable the onboard speaker until explicitly enabled in user code.
Testing performed on a CPB:
- Touching the AUDIO pin with a fingertip no longer generates noise/buzz
- Generating a waveform with
simpleio.toneproduces no sound by default - When the board.SPEAKER_ENABLE is configured as a digital output and
set True,simpleio.tonedoes produce sound
Note that while guides should include information about SPEAKER_ENABLE, it's possible t...
@ionic elk (talkin for limor, she is in a meeting) limor will be around this weekend to test anything ya need as well as give you more issues to work on if ya get through'em
Checked that https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground already manages this pin as would be expected.
@ladyada ParallelBus can be stubbed out and raise a NotImplementedException from make_new.
ok that makes sense! @hierophect do that - i believe nrf52 does the same so you can get hints here :)
if (period <= (1 << 16) && period>=2) {
32767 is a magic number. Instead, use an expression here to make the intent clearer. Is it meant to be 15 bits? (1 << 15) Isn't the prescaler 16 bits?
Thanks for getting this going! A number of style comments but looks good overall.
Please add intermediate variables for mcu_tim_pin_list[i], mcu_tim_pin_list[i].tim_index-1 and reserved_tim[mcu_tim_pin_list[i].tim_index-1]. These are used in multiple spots here and naming them with variables will make it clearer.
Here do:
if (((isrflags & USART_SR_RXNE) != RESET) && ((cr1its & USART_CR1_RXNEIE) != RESET)) {
our_own_receive(context);
} else {
HAL_UART_IRQHandler(&context->handle);
}
Here is how to read the data from the peripheral: https://github.com/adafruit/stm32f4/blob/89a356f0b44883d55c45a5d22940777a44a2b881/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c#L2976-L2999
This is kind of crazy because it starts and stops reception every read.
What about intercepting the RX related interrupts (https://github.com/adafruit/stm32f4/blob/89a356f0b44883d55c45a5d22940777a44a2b881/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c#L2011) and handling them yourself? More below in call_hal_irq.
Good job getting this going using the HAL. I think it'd be simpler to not use the HAL for the RX interrupt but don't want to block if others disagree. The main thing will be to make sure the interrupt bits are cleared after you handle it. (The peripheral interrupt bits get merged into the interrupt line to the CPU.)
@hierophect All of those examples seem port agnostic. Do you know any port specific ones?
@ladyada Did you try the slow double tap to get into safe mode? CircuitPython should wait 700ms on start up to see if a reset occurs and then enter safe mode if it does. Its the same trick as the bootloader, just a wait after the bootloader's wait.
i tried but was not successful - i probably didnt have the timing right
Hi @tannewt I considered doing the RX interception, but opted to base it off stm32duino instead, to avoid exposing all the error management and parity/wordlength/buffer code. I could probably make it more elegant/speedy with a register approach, but perhaps that could be pushed further down the line with an issue?
I'm not sure exactly what you mean by stop and start - most of the time HAL_UART_Receive_IT(handle, &context->rx_char, 1) will transition into the next read the same way it do...
Hey @tannewt, my current approach is inspired by stm32duino, which is completely HAL based. I opted to follow the way they did things as I felt it'd make stuff more readable to contributors who are familiar with that system. It also avoids exposing all the parity and wordlength management in UART_Receive_IT in the uart.c file. But I can revisit a custom register approach if you feel strongly that it's more maintainable/appropriate.
Prescaler is actually 15. I'll use expressions for this kind of thing from now on, thanks for the input.
@ladyada Tried this on a Crickit. A servo works fine, so it's working, but if the Crickit isn't powered, then I get what I presume is the #2253 I2C hang. So I'll work on fixing that either with a timeout or better "unpowered I2C" detection.
tested CPB + crickit. was able to read accel from wire1 and talk to crickit on wire2 at the same time!
Hi, on stm32 based feathers, the A0 input is the ADCs channel 0? Or it doesn't really matter the adc channel it goes to?
Currently it happens (I observed this in SAMD boards) that, if lots of data is written to the uart the write call returns none.
The reason in seems to be in pystream.c (https://github.com/adafruit/circuitpython/blob/master/py/stream.c#L237)
I can handle this problem by waiting "a little" and retry, which seems to work.
Only I can not say how short "a little" can shall be.,,,,,
I think UART.out_waiting() would be helpful.
@tulip sleet ping me if you have time to chat BLE some time today. I'm on a plane tomorrow and would love to wrap up the PRs today.
@slender iron Sure! We're going out momentarily but will be back in a couple of hours or less. Will ping you not too long after that (have a phone call to make too).
No worries. I'm around all day. Just wanted to make sure we checked in
nis reported on Discord that neopixel_write isn't available on the STM32F405 feather. This either means it's not implemented at all or the module isn't turned on.
here's a working implementation from Arduino library
https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.cpp#L1902
out_waiting is a good idea for fast chips and slower baud rates it is part of pyserial so we can mimic it
<@&356864093652516868> Here is the notes document for Mondayβs CircuitPython Weekly meeting. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the meeting - itβs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and Iβll read them off during the meeting. Hope to see you there! https://docs.google.com/document/d/1dUDIH1vMwaufMwKyfNdI6StwcEDinveuXFtQSlLnVCk/edit
5.0.0-alpha.5 in process... stay tuned
stays tuned
πΊ π»
Automated website update for release 5.0.0-alpha.5 by Blinka.
New boards:
- itsybitsy_nrf52840_express
- arduino_nano_33_ble
- serpente
- stringcar_m0_express
- sparkfun_qwiic_micro_no_flash
- circuitplayground_express_displayio
- sparkfun_qwiic_micro_with_flash
- pyboard_v11
- feather_stm32f405_express
- spresense
thanks @tulip sleet !
@AdinAck We recently heard about this interesting library: https://micropython-ulab.readthedocs.io/en/latest/, which might be able to fit on certain CircuitPython builds.
Thatβs awesome Iβll check it out!
On Sun, Nov 3, 2019 at 6:55 PM Dan Halbert notifications@github.com wrote:
@AdinAck https://github.com/AdinAck We recently heard about this
interesting library: https://micropython-ulab.readthedocs.io/en/latest/,
which might be able to fit on certain CircuitPython builds.β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circuitpython/issues/2157?email_source...
@slender iron The alpha.5 release is finished and will be in the blog in a few minutes. I will hold off merging the BLE PR's until sometime tomorrow after there is some smoke testing of alpha.5 (just in case we need an alpha.6).
@tulip sleet sounds perfect! thanks!
Congrats everyone on the new Alpha π
@slender iron sorry didn't mean to hit review request on PWM, still working on it.
Congratulations on alpha5. Will be home tomorrow- looking forward to testing it and the new bleio....
@ionic elk I'm about to head to the airport so Dan can finish the review
Let me know how you feel about my reductions. I felt it was a little clearer with reserved_tim still in there but with better indexes
has to be self->channel = 4 * (self->tim->channel_index - 1) I think. I thought it was weird that it wasn't a bit shift here, which is why I linked the macros. But on double checking it looks like it's consistent across devices so this should be ok.
No, wait it is 16 bit. I must have gotten confused with something online, my bad. Glad I double checked.
@ionic elk are you ready for re-review or should I wait?
@tulip sleet still working on style improvements. I should have everything together by early afternoon, or we could just touch base tomorrow since I'll likely have some cleanup PRs in the works then too.
sounds fine; please ping if you have any discussion points, etc.
Adds three images - small, large, and original sizes for the SparkFun Qwiic Micro. Also adds a markdown file with its information.
@tulip sleet just wrapped up PWM, you can take a look now if you like or we can focus on it later
i have to do some pre-meeting stuff, so may not finish review until later today
totally fine. You could also weigh in on the UART HAL vs register point Scott brought up in the UART PR when you have a minute.
Can we close this out since the pull request was accepted?
Almost... I'm applying a fix and then we can...
Also added links to some existing itsy bitsy boards
@tulip sleet @meager fog going to run into a little bit of a problem with this:
../../shared-module/displayio/Display.c:116:13: error: too few arguments to function 'never_reset_pin_number'
never_reset_pin_number(backlight_pin->number);
Should I make microcontroller.c an official part of common-hal? Normally I count on any function not using the prefix as being port level.
yay thanks folks - @edspark we needed to make two entries because there are two builds that were defined. please check https://circuitpython.org/downloads
It also wanted very specific names for the boards.
Today should be the last time that "my job" makes me miss the weekly discord meeting. π
@onyx hinge π
<@&356864093652516868> Meeting in a little over an hour. Please add your Hug Reports and Status Updates to the notes doc even if you'll be attending - it's super helpful! https://docs.google.com/document/d/1dUDIH1vMwaufMwKyfNdI6StwcEDinveuXFtQSlLnVCk/edit#
Sorry for partial message send, that was unintentional.
It is at 11am Pacific?
@fierce girder Yep!
Just got to Seattle. No longer in CET π
Nice!
This PR adds support for DisplayIO to the STM32 port, using a stub for ParallelBus for now. Tested with an SSD1306 on the Feather_STM32F405_Express
Additionally, this PR suggests two new definitions to be added to the common hal in shared-bindings, common_hal_reset_pin, and common_hal_never_reset_pin. These avoid exposing the internal structure of the pin object, which varies between ports. They do not replace the port level versions and should not affect other parts of circuitpython other...
I'll be lurking today.
That goes for me as well. I'll be lurking until 11:30, then offline.
Iβll be unavailable for this weeks meeting
ok @trim elm
<@&356864093652516868> Meeting starts in a few minutes
since we have 30 boosts the sound quality should even be better (384 Kbps)
lurking
** lurking ** (until in the weeds)
just listening/lurking today
I am having mic troubles of my own.. Going to drop and rejoin.
Hey Drew, say Hi to Helen for us
Sorry! :0
Just lurking
Yay! 30 boosts, we now have: +100 emojis for a total of 250, 384 Kbps audio, vanity URL, 100 mb uploads for all members.
CircuitPython 5.0.0 Alpha 5 released!
Lead story is more STM support!
https://blog.adafruit.com/2019/11/03/circuitpython-5-0-0-alpha-5-released/
Take Flight with Feather - Hackaday and Digi-Key:
https://hackaday.io/contest/168107-take-flight-with-feather
All 35 posts from Open hardware month in one spot (MicroPython and more included):
https://blog.adafruit.com/2019/10/31/all-35-posts-from-open-hardware-month-in-one-spot-ohm2019-oshwa-ohsummit-opensource-opensourcehardware-opensourceorg-adafruit/
"maintainable code is more important than clever code":
Python creator Guido van Rossum is retiring from DropBox, this is a great quote
https://blog.dropbox.com/topics/company/thank-you--guido
Snekboard - A Python Microcontroller for Lego:
https://www.crowdsupply.com/keith-packard/snekboard
Crowd funding and crowd sourcing trackers with PyPortals:
https://blog.adafruit.com/2019/10/31/tree-count-donation-display-with-pyportal-teamtrees-pyportal-dashblock-teamtreesofficl-dashblockhq-adafruit/
New boards! Now up to 86 boards!
https://circuitpython.org/downloads
SparkFun Qwiic Micro
ItsyBitsy NRF52840 Express
CircuitPython Organization
DRAFT, issues/PRs all welcome, ships out on Tues 11am ET:
https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2019-11-05-draft.md
Python for Microcontrollers
https://www.adafruitdaily.com/
ok this is dependant on PWM so we need to get that merged in first :)
if you give me a bin ill try this with a TFT featherwing
ok this is dependant on PWM so we need to get that merged in first :)
if you give me a bin ill try this with a TFT featherwing
oh right boo git CI. Here's a bin for the build
firmware.bin.zip
@meager fog got a bin for u
sed is a unix program for making changes to text files, like search & replace
@tulip sleet is there something else I have to link to get the board defaults to register? I'm having trouble getting it to recognize them as part of the module, seeing AttributeError: 'module' object has no attribute 'I2C'
SedFu!
sed = Stream EDitor
yeeees
@ionic elk you mean board.I2C doesn't work? Did you add the last three lines to pins.c that you see in other board files?
why use sed when you can use butterflies?
@tulip sleet that was it thanks for the heads up
I thought it was just mpboardconfig.h
Can a bird have 3 wings?
typed this in the wrong window:
hug report to @gilded cradle @timber mango @meager fog for feedback on https://github.com/adafruit/Adafruit_Blinka/pull/168
Add PWMOut for PocketBeagle which has the AM3358 SoC to resolve issue #159
Unfortunately, the generic linux PWMOut implementation will not work as the BeagleBoard.org kernel has a patch which chang...
An Old Timer I worked with years ago gave me this book as he transitioned into retirement. It's been a while since I pulled this from my bookshelf. π
π€£
Here's a reasonable sed command to append "100" to the names of all the resistors so that you can shuffle the numbers around:
sed -i \.uncut -E "s/((name=|part=)\"R)([0-9]+\")/\1100\3/" FILENAME(S) HERE
This PR adds default I2C, SPI and UART modules to boards that have obvious defaults for these peripherals, such as the feather_stm32f405_express. Resolves #2192
A lot of sed-fu is actually regex-fu but useful in any case.
@idle owl for in the weeds, I'd like to ask about ithe generic linux PWMOut implementation:
https://github.com/adafruit/Adafruit_Blinka/blob/master/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py
@timber mango proposed abstract self._pin_path.format(self._pwmpin) as function - this way one could override it for boards where the /sys/class/pwm channel path is different like PocketBeagle/BeagleBone.
for example, generic needs:
pin_path = os.path.join(channel_path, self._pin_path.format(self._pwmpin))
but beagle needs:
pin_path = os.path.join(channel_path, self._pin_path.format(self._channel,self._pwmpin))
Making that a method that I could override seems like a good solution.
Does this sound like a good approach?
Details in this PR as to why the path is different on beagle:
https://github.com/adafruit/Adafruit_Blinka/pull/168#issue-332797708
Add CircuitPython hardware API and libraries to MicroPython & CPython devices - adafruit/Adafruit_Blinka
Add PWMOut for PocketBeagle which has the AM3358 SoC to resolve issue #159
Unfortunately, the generic linux PWMOut implementation will not work as the BeagleBoard.org kernel has a patch which chang...
and a much more unreasonably long "one liner" to change the names of the auto-broken-out nets for the caps and resistors to something more reasonable like R23_A and R23_B
gsed -i\.uncut -zE 's/(<signal name=")N\$[0-9]+(">\n<contactref element="([RC][0-9]+)" pad="1"\/>)/\1\3_A\2/g;s/(<signal name=")N\$[0-9]+(">\n<contactref element="([RC][0-9]+)" pad="2"\/>)/\1\3_B\2/g;s/(<net name=")N\$[0-9]+(" class="0">\n<segment>\n<pinref part="([RC][0-9]+)" gate="G\$1" pin="1"\/>)/\1\3_A\2/g;s/(<net name=")N\$[0-9]+(" class="0">\n<segment>\n<pinref part="([RC][0-9]+)" gate="G\$1" pin="2"\/>)/\1\3_B\2/g'
He will be a truely TAN newt...
lol
Hopefully not a burnt newt.
@fierce girder I'll add that to the notes
That's a handy one: generally when I get to that level of detail, I reach for XSLT or Python, but I cheerfully admit that's using a big hammer for a small problem: the sed approach seems more appropriate.
Looks awesome
BGA. yummy.
BGA
When you want please send me basic info and links and I'll add the board to Awesome Feather
And Awesome CircuitPython
Alorium? The Arduino-on-an-FPGA people?
how many I/Os ? I see those tiny castellations, I think?
interesting castellation usage
Feather footprint plus 32 more I/Os on the castellations, apparently. Nice.
amazing, indeed!
@old smelt Awesome!
@pastel panther - Thanks! I'm very excited about it!
** IN THE WEEDS **
is this a bug? or just the way it is?
Adafruit CircuitPython 4.1.0 on 2019-08-02; Adafruit Trinket M0 with samd21e18
>>> import os
>>> os.stat("/font5x8.bin")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: small int overflow
>>>
@tidal kiln that seems like a bug to me
note it's a M0
@tidal kiln in some places, the "zero time" was supposed to be 2000 instead of the standard unix 1970...
maybe that's not applied everywhere or it broke or something
[I had put an item in In The Weeds, but work just lept up and bit me and I have to go. It can surely wait.]
Have to drop and head to a 2:00pm meeting. Have a great week, all!
for in the weeds, I'd like to ask about ithe generic linux PWMOut implementation:
https://github.com/adafruit/Adafruit_Blinka/blob/master/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py
@timber mango proposed abstract self._pin_path.format(self._pwmpin) as function - this way one could override it for boards where the /sys/class/pwm channel path is different like PocketBeagle/BeagleBone.
for example, generic needs:
pin_path = os.path.join(channel_path, self._pin_path.format(self._pwmpin))
but beagle needs:
pin_path = os.path.join(channel_path, self._pin_path.format(self._channel,self._pwmpin))
Making that a method that I could override seems like a good solution.
Does this sound like a good approach?
Details in this PR as to why the path is different on beagle:
https://github.com/adafruit/Adafruit_Blinka/pull/168#issue-332797708
Add CircuitPython hardware API and libraries to MicroPython & CPython devices - adafruit/Adafruit_Blinka
Add PWMOut for PocketBeagle which has the AM3358 SoC to resolve issue #159
Unfortunately, the generic linux PWMOut implementation will not work as the BeagleBoard.org kernel has a patch which chang...
os.stat_result(st_mode=33188, st_ino=7876932, st_dev=234881026,
st_nlink=1, st_uid=501, st_gid=501, st_size=264, st_atime=1297230295,
st_mtime=1297230027, st_ctime=1297230027)
>>> os.stat('boot_out.txt')
(32768, 0, 0, 0, 0, 0, 126, 1480810702, 1480810702, 1480810702)
>>> hex(1480810702,)
access, modify and create iirc
Ran into this here:
https://github.com/adafruit/Adafruit_CircuitPython_framebuf/issues/25
Can recreate by trying this on any file:
Adafruit CircuitPython 4.1.0 on 2019-08-02; Adafruit Trinket M0 with samd21e18
>>> import os
>>> os.stat("/foo.py")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: small int overflow
>>>
@main meteor - there are 34 castellated I/O, not 32. I misspoke.
@tulip sleet all my PRs are ready for review now, if you'd like to take a look
Thank you for considering this!
@ionic elk I had yet another meeting and now have to cook but I'll get back to this tonight
np! whenever you're free no rush. There's always other stuff for me to work on
oled does work, but TFT ILI341 did not, i do see the right pins toggling so a little mysterious. will require more research!
@ladyada isn't the TFT a 8 line parallel bus architecture? That's stubbed right now as per @tannewt 's instructions
no
i verified the hardware connectivity with
https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_RGB_Display/master/examples/rgb_display_ili9341test.py
so its def something odd happening in displayio but not sure what
@ladyada is this the tft featherwing? The 2.4" one?
yes, the 2.4" is ILI9341, the 3.5" ix HX8357D
Got it. I can take a closer look as soon as the A2 Saleae frees up again (should I request one of those?)
@meager fog do you know how fast a controller would need to be to run the SPI eyeballs? Or who might know that?
which exact code are you refering to
https://www.adafruit.com/product/4343 "CircuitPython isn't quite fast enough to do the 3D animation techniques we use to draw the eyeballs" just curious how fast it'd need to be, and whether I could maybe hit that with a 168MHz F405
Peep dis! Have you always wanted to have another pair of eyes on the back of your head? Or outfit your costume with big beautiful orbs? The MONSTER M4SK is like the Hallowing but twice as ...
Just curious. Doing eyeball stuff on my own, wondering if that's something that could come up later on for the faster CPy mcus
no you will not
perhaps a 500mhz cpu could do it in python
or with C math helpers
right now it maxes out the SAMD51 and we overclock it to 180mhz
Woof ok got it.
OK, I think this resolves all the outstanding review requests. Since @ladyada already tested in on hardware, good to go, and I'll merge! Thanks for your patience!
OK, I think this resolves all the outstanding review requests. Since @ladyada already tested in on hardware, good to go, and I'll merge! Thanks for your patience!
Thanks for getting this going! A number of style comments but looks good overall.
yep we will find more/any bugs during user testing for sure :)
one teeny thing: missing newline
MIssing newline at end of this file.
Move this down below the initialization to line 89 or so, because if you throw an exception, dac_on will incorrectly remain set.
OK, great! Merging this to start rewriting other examples and testing with the new API.
Warning: use the correct version of Adafruit_CircuitPython_BLE with builds following this merge.
This overflow is due to #1143, which restored using the 1970 epoch to os.stat(), so that the timestamps returned would match standard Unix timestamps. Previously it was using a year 2000 epoch.
We could use year 2000 epoch timestamps for non-longint builds, or we could just return 0, say. @notro do you have an opinion or suggestion?
Note that on non-longint builds, time.time() and other epoch-1970 related functions are turned off (see #846, which switched back to 1970 epoch for othe...
Hmmm just flashed new firmware to my board but can't get the CircuitPython drive to show up
Boot drive shows up fine and I can connect to the REPL
any ideas?
I thought I might have the wrong flash chip
old firmware works. Hrmp. I'm pretty sure I used the same flash config.
got it working
considering I just had to make a new flash device definition I'm curious how it ever worked lol
Hey hey... I was ill (head cold) yesterday so missed the weekly meeting. As a result I want to highlight what would've been my hug report -- it's for @gilded cradle for reporting a bug in CircUp and giving me a kick at the right moment when I'd made the wrong decision. Details here: https://github.com/adafruit/circup/issues/20
@slender iron did you see the new Positional-only parameters in 3.8? they seem right up displayio's alley (https://docs.python.org/3/whatsnew/3.8.html#positional-only-parameters)
Great! Please prepare a PR for https://github.com/adafruit/circuitpython-org as well. See the README there for details.
There was an issue with a change in behaviour for blocking with serial output on the new Circuit Playground Bluefruit. I thought this was Circuit Python at first but on probing it turned out to be Arduino-land: https://forums.adafruit.com/viewtopic.php?f=58&t=158213 - where should that issue be filed? Is this a known phenomena?
@simple pulsar thanks! I replied in that thread
np, would that potentially affect CircuitPython too?
it could... but it depends on a lot of choices made in the code. Easiest just to test and see.
I do have some bluefruits now so I may have a go later...
thank you if you do end up testing it
oops I gave away all my CPXes to interested coworkers
@onyx hinge i order small batches regularly
@tulip sleet if you have a minute today could you take a look at the common hal changes I proposed in the DisplayIO PR? It's not ready for merge yet, since Ladyada is reporting some TFT issues, but I'm hoping to get input on the API layer edits I made
π
@ionic elk I just did a little reviewing but would prefer to wait for Scott's opinion on some of that. Could you merge that PR from upstream, because it will remove the PWMOut changes I see, I think.
hiya is there something for me to re-review?
@ladyada no sorry I just noticed you weren't being tracked as a reviewer. Were you still digging into the TFT issue? If you'd like me to pick up on that instead, could you let me know what issues you were seeing in a little more detail so I can hone in on it?
i have not done any digging into the TFT issue, you can spend 3-4 hours trying to debug it. if you have not figured it out by then, post here
@ladyada do you have preferred names for each of these? Folder type names like feather_stm32f405_express/.
no preference as long as they are unique enough to avoid future confusion. you can get inspiration from the other folders :)
@tulip sleet what exactly is mphalport.c? Seems like leftover micropython API?
is there anything that actually uses it?
the timing delay functions are defined in it, and they are definitely used. In MicroPython, there's some more functionality, like some clock stuff and misc functions.
@tulip sleet gotcha. It seems like it overlaps strongly with microcontroller __init__.c. Do you have a preference for where things are implemented? The atmel version seems a little mixed up on that point - us delay is implemented in mphalport.c and called by microcontroller, but the interrupt enable/disable functions are the other way around.
it probably doesn't matter that much. I think the idea was that basic functions relevant to the microcontroller were in mphalport.c. They might be callable from Python or they might not. Stuff that is clearly callable from Python would be in in common-hal/microcontroller, but internal-only stuff would be in mphalport.c. But MicroPython doesn't even have common-hal, so it mixes these things up.
could/should that be cleaned up so that all of these internal functions are in common-hal/microcontroller? It'd get rid of one more file in the port root clutter zone
you could see if there's code that we haven't written that calls things in mphalport.c, e.g. in py/...
Sure I'll look around
that would be a reason to keep mphalport.{c,h} and not get rid of it
mp_hal_delay_us is used in drivers/ extmod/, shared-bindings/ and shared-module/. Mostly for i2c stuff. I'm not sure if those kinds of locations could be edited to use common-hal versions instead
Anyway not too important, it just seems like this mp themed stuff in the port root level could stand to be tidied up a bit or worked into the common-hal system somehow
we have been trying to move stuff out of extmod into shared-*. However, we want to track fixes from upstream, so just deleting stuff from extmod/ makes it hard to track what changed. So when we merge from upstream, which doesn't happen very often, we can examine the merge and manually update our copied versions in shared-module (or whatever)
@idle owl did we decide what to do with the cpx library wrt using it on cpb, specifically, the audio stuff? I think that would prevent it from being used directly.
No we never decided. I want a separate library for CPB. Yes it can't be used directly at the moment.
ok, I am just making up a hack demo and needed the Photocell code, so I just took it, and then i wondered what would eventually happen. tnx, that prevents further mind wandering
Yw.
Adds the CIRCUITPY_ENABLE_MPY_NATIVE for mpconfigboard.mk that allows boards to enable the micropython.native decorator.
I am 100% open to suggestions on this PR. I wanted to open a PR that more or less does the minimal amount of work to enable this. As such, I had to disable a few warnings to get this to build. The upstream code for this has deviated a bit, so if it's preferable to backport that code instead I'm up for it.
Related to #1248. I would enable it and test and mark as ...
I think this is laudable, because it's a port-agnostic way of getting speedups (at the expense of RAM). At the same time, there is further work that could be done to speed up CircuitPython in general, by probably about a factor of 2: see #2142.
I do worry about fixes to MicroPython related to this that haven't been merged. It's been a long time since we merged from upstream, so I think it would be worth looking at that. You could do a trial merge into a junk branch and see what's affected,...
Yeah, I'm happy to take the time and do this as "correctly" as possible and see if the latest code can be pulled in. I just didn't know if we've done any sort of piecemeal merging from upstream before.
#2142 is great because it improves the speed of all ports without any need to opt-in (unlike this). This is a great parallel effort, though.
(psst, im into this too, there's a lot of times we could have some optimized code for drivers!)
After some initial exploration it looks like the changes to emitnative.c and friends are pretty extensive. I could try to merge these in, but it seems like it might be likely to also effect the bytecode stuff as well (several of the changes involved touch the bytecode stuff).
Not sure how we feel about it right now. We have three options:
- Merge this as-is for now, leave it as "experimental". Update this code along with the rest of the micropython code during the next merge from u...
I'm happy to have us try this, since it's all optional anyway. Yes, there may be bugs, but that's true of anything. We have no short-term plans for a merge from upstream: certainly not for 5.0.0
Have you tracked down why you need to do this? Is this older code that could use a change in parameter types, or something like that?
Just one question: it looks great!
@tulip sleet close to getting a partial merge of just the native bits to compile. Gonna see if it runs.
So I might have been wrong. π
I really don't love their strategy here for this stuff.
They have h files that they use as "templates" in the c files and use a bunch of defines to turn on and off sections.
so the h files don't really behave like you expect.
I mean this isn't a totally unusual pattern but other projects I've encountered make it obvious. Like thing.template.c
compiled! Fingers crossed
well all seems okay, except I didn't actually enable the decorator.
oooooof nevermind.
I think I'm pretty close but there's some changes in compile.c that are pretty tricky
Fwiw I spent about an hour trying option (3) and got reasonably far, but there's some significant changes in compile.c that I'm not confident enough to try to graft on to our fork. Maybe down the road.
the bugs I've found do not inspire confidence in this code. π¦
Fixed in 3439c3619, this one turned out to be pretty easy to fix once I looked at what the code was trying to do.
In case anyone is curious about my work to update all of the native emitters there's a branch here. Perhaps after supercon I'll have some time to get that into a mergeable state.
@ivory yew the code you're not confident in is the native code emitter stuff? π
yeah
mpy seems to build with much less strict warnings so a lot of easily spotted bugs get through.
Scott set a policy early on of making all warnings errors so we would catch the maximum amount of stuff. I don't know eactly why Mpy didn't do that. MPy has tried to support varied toolchains so that may be one small reason, but in general it seems like a bad idea to not care about warnings.
we spend little to no time in this core code
@idle owl - working through your Git/GitHub guide. This is excellent. Thank you!
@old smelt You're welcome! Thank you for letting me know π
You're welcome. Step 1 of adding our new board to CP
Will do. Thanks!
@tulip sleet @meager fog is there anything urgent you'd like done at the moment? I'm currently working on Β΅s delay and get core temp and then had meowbit/pyb_nano/blackpill support after that. Anything I should push up to the forefront?
@ionic elk #2268 says it has merge conflicts now
you need us delay for neopixel_write, I think. I would say do neopixel before adding the other boards
@tulip sleet I'm trying to figure out why either of those merge conflicts came up
i think you can bring in the arduino version with its tricky timing stuff mostly whoelsale, but see how things work in the atmel port to see how we don't freeze anything out. The nrf port is completely different: it uses SPI (which is eexpensive in terms of RAM) because no-interrupt tight timing code doesn't work with bluetooth running in the background
should I break temperature reading away from the us write?
temp reading can be in microcontroller
I'm not sure what you mean with the arduino stuff. Are you referring to neopixel write or us delay?
Right now us delay and temp reading are a joint issue. I'm wondering if I should just submit my code for the us delay (very simple blocking loop) and then return to it for the temp readings after the neopixel module
neopixel write. The atmel m4 code uses a NOP delay loop
what does temp reading have to do with delay? I'm confused
both are implemented in the microcontroller module
so I put them together
The issue is just "fill out microcontroller module" with all the stuff it's missing
well, do the prerequisites for neopixel_write and then do that itself, because more customers will want that write away. So break up the to-do's if necessary
Cool, that's why I was asking. I'll submit a short PR for the us delay loop and then move on to neopixel
also, can you take a look at those merge conflicts? I'm trying to understand why they're conflicts at all
i think the merge conflicts may be from the PR I just merged?
try merging from upstream again
When it's just outright updating stuff, why is it a merge conflict?
It's just adding text, there's no difference
are you using separate branches for each PR?
yes
is that... not how you're supposed to do it
I'm sorry my git flow fu is not optimal
no, that's right. if you change the same file in two diff PR's and merge one, then it can be confused because it's not sure which takes precedence
right my confusion is that the older files do not appear to be changed
<<<<<<< stm32-dac-deinit
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000)
=======
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000)
#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
#define DEFAULT_I2C_BUS_SDA (&pin_PB07)
>>>>>>> master
like, what?
shouldn't that just be a cut and dry fast forward?
Anyway that's just me being puzzled obviously it's an easy fix but yea
i agree and don't understand why it's confused
This PR adds a microsecond delay function required by the neopixel implementation. Currently a simple blocking loop. Other missing microcontroller module features, such as get temperature and get voltage, will follow in a later PR.
the DAC auto shutoff? merging upstream reverted the defaults PR
I need to read up on Pro Git again
ok, do git reset --hard HEAD~1 and git push -f, and tell me the branch name and I'll look at it
yeah, 2268 is DAC shutoff
it's fine I fixed it
it didn't revert that much
Should be ready to merge if you approve
Sure, i will wait for the previous PR merge (#2266) to finish so I won't break the builds
A user did
eth = wiznet.WIZNET5K(board.SPI, board.D10, dhcp=True)
but actually meant to do:
eth = wiznet.WIZNET5K(board.SPI(), board.D10, dhcp=True)
The board.SPI as an arg caused a fatal crash, which makes me think WIZNET5K is not validating its args completely.
is this ready for review?
I am going to review a bunch of these; merging them one at a time to avoid build problems.
This delay could vary based on the optimization level, etc. The examples I see online use DWT->CYCCNT ,e.g https://github.com/keatis/dwt_delay/blob/master/dwt_delay.c
For the Express boards, does the UF2 bootloader itself require the 2MB SPI flash to be present?
@old smelt no, it has no idea whether itβs there or not
Ok.
That helps. Thanks @tulip sleet
We're bringing up the new board, and it's not enumerating as a USB device. UF2 bootloader loading process seems to be working without errors, but it doesn't enumerate. Just wanted to rule this out as a possible factor. Board doesn't have flash module on it yet.
@tulip sleet @slender iron Just a FYI and thank you! Started playing with new bleio and BLE examples -- so far so good!! the new central/periph demo and the color proximity demo are very nice! Using two CPBs at this time.
9d4c95d Revert "Add default defines" - hierophect
b9063dd Merge remote-tracking branch 'upstream/master' - hierophect
632b326 Add auto-shutoff of DAC when channels de-inited - hierophect
38e38b9 remove redundant comment - hierophect
dfe73a0 Fix error that would carry past python exception - hierophect
I just got a bluefruit and my "trusty" Windows 8.1 desktop is spending a long time looking for drivers, i.e. device setup window saying Installing Adafruit Circuit Playground Blue (not a typo, perhaps there's a length limit here?) has been sitting there for several minutes. Is that to be expected?
Windows 10 worked in seconds with bluefruit and COM11 appeared for the board.
@simple pulsar is it looking in Windows Update? The latest drivers package has it: https://github.com/adafruit/Adafruit_Windows_Drivers/releases/tag/2.4.0.0
@solar whale great! I have some fixes for use cases that aren't covered in the demos. It's a lot easier to define your own genuine BLE services now instead of using the UART Service and its packet protocol, and we're trying to move in that direction.
This was probably submitted prematurely. Closing until more of these issues have been addressed.
@ionic elk I was waiting for the build to complete, but it was really slow yesterday. Thanks for merging
@tulip sleet I'm not sure what it's up to. Good point, I'll install latest driver and see what it does. I actually have a Kitronik ARCADE doing the "same thing" but perhaps that's something to do with blockage from the former.
Adafruit CircuitPython 5.0.0-alpha.5 on 2019-11-04; Adafruit Circuit Playground Bluefruit with nRF52840 !
@tulip sleet we're just waiting on Scott for UART and DisplayIO right?
def DisplayIO, not sure about UART, but if you were having a back and forth with him, it could wait. But I thought you were talking to Limor about UART interrupt handlers.
No UART's just waiting on what Scott's issue which I think he wanted input on, which was whether it'd be more readable to have the whole thing be register based instead of using the HAL. Limor tested the current system and it worked for her tests, it just probably needs non-blocking writes at some point for completeness.
My preference on the Scott issue was to keep it HAL based since that's what stm32duino uses and it'd be more consistent with the other work I've done in the port overall. But switching to register-level wouldn't be tough, I know how the guts work. It's really a style question.
i'd leave it as HAL for now if it works, and move on to other stuff.
Ok. Do you want to chime in on the PR? I think Scott was looking for that kind of input
I think he was concerned about the read approach - it's based off Arduino and is much closer to NRF than the atmel version.
i think he was concerned initially that getting the HAL version to work was very difficult, and that it might be easier with the register version, since you could manage your own interrupt routine that way. But you've worked around that, is my impression.
yeah it was kind of a pain in the butt I'd definitely start from the registers next time I do an interrupt system
Since Arduino did it this way and it seems to be working pretty well now, I'd rather keep it consistent for the moment. That's just me, you and Scott are the style/approach leaders here.
But I'd like to get UART merged asap, which is why I'm asking. Want to know if I should devote some time to switching over to registers and debugging that and stuff
if it's satisfactory from limor's point view, let's just leave it for now. I'll finish reviewing for style.
Also, while I've got your attention, how close do we want delay_us to actually be? I'm looking at my SAMD51 control with a saleae and it's not exactly super precise. I'm looking at a 5us request (SPI bitbang delay) coming out to 21us between pin changes, and even a 1000us delay is 1769us in practice. For the really short ones I'd expect the actual pin write code is an additive but that 1ms delay seems weirdly off to me?
the basic routine should be pretty accurate: if it's not, then it's a bug. it could be tested by using low level bit flipping to output something, or just remember the Systick or CYCCNT register before and afterthe delay call and see if the values make sense
the 1000us delay might have had a deferred interrupt handler run in between
btw, does the STM32F4 have an instruction/data cache for program execution, and is it turned on? we didnt' realize it wasn't turned on during SAMD51 development. When we did turn it on, we doubled CPy's speed
Hmmm I will look into that
I could also probably take some time here to do that bootloader thing
Although the Wiznet Ethernet Featherwing, is shipped with a unique
Adafruit MAC address, there is no way to use it or enter it with
Circuit Python. As a result, the Wiznet chip makes up a random MAC
address every time it is initialized, and gets a different DHCP
assigned IP address, hopping up and down the user's network address
space.
The initialization of the wiznet.WIZNET5K() class should provide for
a parameter of the desired MAC address, to be loaded into the Wiznet
chip befor...
@tulip sleet I tried disabling interrupts for the 1000us count, and it just added 10us of execution time. It's 1778us total, almost twice what's expected
I'm going to switch over to my implementation now and see what that gives me.
how are you testing this, from bitbangio.SPI?