#circuitpython-dev
1 messages Β· Page 287 of 1
(not sure why groups can't be enlarged after creation, must be some reason it can't be allowed)
That's a place to start.
a normal python list can be enlarged, so here's something you could do: gather up all your items in a list, get the len() of the list, and then create the group that big.
it would change your code a bit of course
I don't know if that's a sensible idea or a workaround, it's too early in the day to know such things
hmm
in my code in jeplayer I just always counted the number of things and made the group that big. but it was a small number like 3 or 8 ...
yeah I think I'll pick an arbitrary number that is hopefully large enough and go from there.
This is 4 objects total, but the second one is its own group
er
fourth
if nothing is built "conditionally" then I would expect it to run the same everytime
one of the groups moves around the display based on accel data
changing position by updating the x and y properties?
yes
that should not count against a group's max
but ... why is there a (arbitrary) limit to the number of elements in a group ?
which btw, thank you @cursive condor for your maze demo. While that was way more complicated than what I'm doing, I was at least able to suss out how to make a group mobile.
if you set a text label with too many characters I think you can get this. maybe a sensor goes from "3.14" to "-10.00" and exceeds a limit? Capture the stack trace next time and maybe that will give a clue.
a Label has a group inside, either the size of max_glyphs or len(text)
I'm not sure what you mean by capturing the stack trace. is that the traceback? or something more complicated
@cursive condor I am guessing there is a reason that the storage can't be enlarged after creation, I just don't know why that is. Tannewt would be able to tell you why he made it that way, but he doesn't seem to be around
TY @idle owl. if you have a monster m4sk you can check Chateau in my github, there is adding and removing of groups
yeah the traceback. sorry, other language lingo creeping in
@cursive condor If I hit a point where I need that, I will definitely take a look, thanks.
@onyx hinge no worries, simply making sure I understand. π
I have to go to this thing, but let me know what you discover!
Ok. Thanks, @onyx hinge! Have a good one!
My inclination is to "fix" this just by returning 0, which will be 1969-12-31 midnight. The time functions I mentioned in #846 throw exceptions when the time is out of range, but that seems like a bad idea for os.stat(). We can document the 1969 behavior. If no objections, I'll do this for 5.0.0.
Currently we don't use SPIM3 on nrf builds even though it's the only SPIM that provides 32MHz. The peripheral has hardware bugs which must be worked around.
Fixing this will fix #1222.
Also https://github.com/adafruit/Adafruit_nRF52_Arduino/issues/364
Is there a way to have a single if statement that checks two things separately? So not "or" because that means if either is true. I am referring to I have foo and bar, and I want to do something to foo if foo is true, and something to bar if bar is true, but not to both if either is true.
I think I might need two separate sets of if statements.
if foo:
foo = 2
if bar:
bar = 3
??
you need to change this name #define W25Q80DL if its a different chip
are you checking for None or something?
Yeah, basically
no
It's checking temperature against a temperature range
and humidity against a humidity range
and changing text color based on whether it's outside the range
do you want to limit it to the range or just check that it's in the range
check that it's in. Currently I have this for the min: python if temperature < min_temp or humidity < min_humidity: data[3].color = (0, 0, 255) data[3].text = "Temp: {:.1f} C".format(temperature) data[5].color = (0, 0, 255) data[5].text = "Humi: {:.1f} %".format(humidity) data.show()
problem is, it means if either is true, both things happen
both?
is the color different out of range?
there is only one thing happening
@tulip sleet yes
@stuck elbow that code is wrong, I know.
I need to change two separate lines of text based on two separate pieces of data
can't tell if I can do that in a single if statement
if temperature < min_temp:
data[3].color = (0, 0, 255)
data[3].text = "Temp: {:.1f} C".format(temperature)
data.show()
if humidity < min_humidity:
data[5].color = (0, 0, 255)
data[5].text = "Humi: {:.1f} %".format(humidity)
data.show()
this?
Yes, that is what I think I need, but wanted to make sure
if temperature < min_temp:
data[3].color = ...
if humidity < min_numidity:
data[5].color = ...
data[3].text = ...
data[5].text = ...
That I wasn't missing some magical Python syntax
ok
yah not sure I can have .text outside the if, but I'll find out
don't see why not
anyway, was simply checking that I wasn't unaware of some kind of syntax to do weird things with a single if statement.
I am apparently not missing anything.
yah it works with the text outside the if
so that slims it a lot
@idle owl w.r.t. group full and text labels:
https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/issues/11
for group in general, i think it's because the memory allocation happens in the core C stuff, so size must be stated explicitly. or to put it another way, a group's size can not be dynamic.
I'm not concerned with group size being dynamic, I assumed there was a reason for that, and that makes sense. I simply wanted to understand how to pick a group size because it seemed entirely arbitrary when working with text. Because text size changes. But I think that was fixed with max_glyphs. I don't know. Either way, tried to figure it out.
@stuck elbow @tulip sleet ```python
while True:
temperature = clue.temperature
humidity = clue.humidity
data[3].text = "Temp: {:.1f} C".format(temperature)
data[5].text = "Humi: {:.1f} %".format(humidity)
if temperature < min_temp:
data[3].color = (0, 0, 255)
data.show()
elif humidity < min_humidity:
data[5].color = (0, 0, 255)
data.show()
elif temperature > max_temp:
data[3].color = (255, 0, 0)
data.show()
elif humidity > max_humidity:
data[5].color = (255, 0, 0)
data.show()
else:
data[3].color = (255, 255, 255)
data[5].color = (255, 255, 255)
data.show()
you could put the data.show() at the end after the last else, since it's the same in all the clauses of the if
can move data.show() out
oh hmm ok
what are we supposed to say, jynx π
jynx
Indeed. Suggest that the limitation is noted somewhere in the time module documentation. Python 3.6.3 for Windows overflows sometime after year 2514 (35-bit integer?), but their documentation lacks specificity.
could also have the (255,255,255) set be before the conditional and remove the else
@idle owl that will only ever make one of the things red
I thought you wante the humidity and temperature independent
I do.
you need to group the temp checks together; they shouldn't all be elifs
and have two if/else (think same as what @stuck elbow is saying)
then don't do elif between them
it works though...
try with both low or both high
@idle owl Got it, will do.
oh i see. it gets weird.
while True:
temperature = clue.temperature
humidity = clue.humidity
data[3].text = "Temp: {:.1f} C".format(temperature)
data[5].text = "Humi: {:.1f} %".format(humidity)
data[3].color = (255, 255, 255)
data[5].color = (255, 255, 255)
if temperature < min_temp:
data[3].color = (0, 0, 255)
elif temperature > max_temp:
data[3].color = (255, 0, 0)
if humidity < min_humidity:
data[5].color = (0, 0, 255)
elif humidity > max_humidity:
data[5].color = (255, 0, 0)
data.show()
ok. i won't copy/paste same thing this time.
Ok, so I also need to add a buzzer. Which if I move the stop_tone outside of the else it pulses, it doesn't play the tone evenly on a temp/humidity event.
what's the event? being above/below limits?
yes, I was trying to type less.
could set a flag and then trigger on that later?
now that everything is moved around, it doesn't play the tone evenly anymore. not sure what change caused that, but even putting an else below each group with the stop_tone in it doesn't resolve it.
Also this doesn't work
when it's below the threshold, it flashes white then holds blue and repeats.
Presumably because it's running through the loop which sets it to white
ah, yah. it would do that. sounds like there's more inside the forever loop?
while True:
temperature = clue.temperature
humidity = clue.humidity
data[3].text = "Temp: {:.1f} C".format(temperature)
data[5].text = "Humi: {:.1f} %".format(humidity)
data[3].color = (255, 255, 255)
data[5].color = (255, 255, 255)
if temperature < min_temp:
data[3].color = (0, 0, 255)
if buzzer:
clue.start_tone(1800)
elif temperature > max_temp:
data[3].color = (255, 0, 0)
if buzzer:
clue.start_tone(1800)
else:
clue.stop_tone()
if humidity < min_humidity:
data[5].color = (0, 0, 255)
if buzzer:
clue.start_tone(1800)
elif humidity > max_humidity:
data[5].color = (255, 0, 0)
if buzzer:
clue.start_tone(1800)
else:
clue.stop_tone()
data.show()```
is what I have currently
(i have to drop out for now)
@tulip sleet Thanks for your help.
so you want the tone to play constantly until temp/humid gets back within the limits?
yes. This works: ```python
while True:
temperature = clue.temperature
humidity = clue.humidity
data[3].text = "Temp: {:.1f} C".format(temperature)
data[5].text = "Humi: {:.1f} %".format(humidity)
if temperature < min_temp:
data[3].color = (0, 0, 255)
if buzzer:
clue.start_tone(1800)
elif temperature > max_temp:
data[3].color = (255, 0, 0)
if buzzer:
clue.start_tone(1800)
else:
data[3].color = (255, 255, 255)
clue.stop_tone()
if humidity < min_humidity:
data[5].color = (0, 0, 255)
if buzzer:
clue.start_tone(1800)
elif humidity > max_humidity:
data[5].color = (255, 0, 0)
if buzzer:
clue.start_tone(1800)
else:
data[5].color = (255, 255, 255)
clue.stop_tone()
data.show()
sort of
or at least it did work once. doesn't now.
still "flickers" the sound.
you better start the sound just once and set a var to True until you stop the sound it in the else: clause
if one param is within limits, it will stop the alaram
yeah ok
while True:
alarm = False
temperature = clue.temperature
humidity = clue.humidity
data[3].text = "Temp: {:.1f} C".format(temperature)
data[5].text = "Humi: {:.1f} %".format(humidity)
if temperature > max_temp:
data[3].color = (255, 0, 0)
alarm = True
elif temperature < min_temp:
data[3].color = (0, 0, 255)
alarm = True
else:
data[3].color = (255, 255, 255)
if humidity > max_humidity:
data[5].color = (255, 0, 0)
alarm = True
elif humidity < min_humidity:
data[5].color = (0, 0, 255)
alarm = True
else:
data[5].color = (255, 255, 255)
data.show()
if alarm:
clue.start_tone(1800)
else:
clue.stop_tone()
is buzzer a global control for turning the alarm feature on/off?
Yeah. set at the top.
@tidal kiln alright, that works.
tested with setting both off at the same time, and each one individually
results are what I wanted.
looks like start_tone does a check for playing, so above seems safe-ish?
yeah.
ok to spam calls to start_tone
This PR adds support for the Espruino Pico board (Adafruit). This board normally runs a javascript interpreter and is updated via a bootloader over a web interface - because Circuitpython depends more on the internal filesystem, this bootloader is not supported and you MUST use the built in F4 ROM bootloader included on all ST chips. This process is documented in the boards/espruino_pico/README.md file.
anybody know what a sphinx doc for special methods like "+" aka __add__ look like in a C file in the core?
do I just document the method called __add__
@onyx hinge i know we have special things like setitem
i think'd be the same
@simple pulsar p0ke - plz tag me when yr around
@meager fog aha that helps! shared-bindings/_pixelbuf/PixelBuf.c://| .. method:: __setitem__(index, value)
@meager fog I emailed you some instructions and files, I'll be available in a few hours.
@indigo wedge np i just know its hard to do over email - ping me when yr around
ill try what you sent as well π
@tannewt need PID for this when you have a sec.
Espruino Pico VID 0x239A PID 0x008D # bootloader
PID 0x808D # arduino
PID 0x808E # circuitpython
Thanks! When you're done, submit a PR for your boards to https://github.com/adafruit/circuitpython-org. The README there has details.
No longer used for atmel-samd; remove.
Iβve added side neopixel strip to lanyard of my cloudBadge : https://twitter.com/iayanpahwa/status/1225466296352956417?s=21
Hereβs the video β> https://youtu.be/g_Ey5NY_z4Q
Internet of things with CircuitPython using the PyBadge and ESP32 Airlift Feather-Wing.
Support my work: https://github.com/sponsors/iayanpahwa
Link to the blog - http://codensolder.com/blog/cloudbadge
Link to the code - https://github.com/iayanpahwa/CloudBadge
Used the stemma connector to attach strip
This PR adds support for the Espruino Wifi board (Adafruit Link). This board normally runs a javascript interpreter and is updated via a bootloader over a web interface - because Circuitpython depends more on the internal filesystem, this bootloader is not supported and you MUST use the built in F4 ROM bootloader included on all ST chips. This process is documented in the boards/espruino_pico/README.md file.
The ESP3...
@ladyada need some PIDs over here too :)
those names are OK - we might be able to use it with the ESPAT library https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol
Espruino WiFi VID 0x239A PID 0x008F # bootloader
PID 0x808F # arduino
PID 0x8090 # circuitpython
I am stuck with this error while building the docs: <rst_epilog>:1: WARNING: more than one target found for cross-reference 'array': array.array.array, ulab.array
@onyx hinge try replacing the array reference with ulab.array
so that it isn't ambiguous
I don't have any references like ~array or `array` in my source, unless my editor's search is tricking me
//|
//| :param order: Whether to flatten by rows ('C') or columns ('F')
//|
//| Returns a new `ulab.array` object which is always 1 dimensional.
``` my references already look like that
@cursive condor @onyx hinge @idle owl @tidal kiln Group size is fixed for now because it was the simple thing to do at the time. I was already doing a bunch of complex display transforms. If someone wants to change it to make it dynamic please do.
@slender iron noted
I was trying to understand how to choose the number. I believe it was explained well enough.
setting size up front is better for memory use too because dynamic algorithms tend to over allocate memory
Becuase I kept getting group full and the number that worked was entirely arbitrary, so
π it should be big enough to store anything you plan on adding later
based on what you append?
yup
so each append is 1
correct
if I append 4 times, group size 4 should not fill up
yes
Ok. Thank you.
np
but if you append again, then you'd hit the limit
@slender iron it seems like there are good arguments for keeping it not dynamic
aha ! There was a reference to array elsewhere; it had to be qualified to array.array!
(you have to find it, sphinx won't tell you)
@onyx hinge welcome to Sphinx.
@onyx hinge nice! I just realized I hadn't helped you find it. it makes sense that you'd find other previous references to array
np, I wasn't stuck for that long
@tidal kiln maybe, maybe not. it depends on how much extra would have been allocated
anyway, learning experience π
Whenever is good for you
@tidal kiln looks like it doubles every time it runs out of space: https://github.com/adafruit/circuitpython/blob/master/py/objlist.c#L244
im here now
want to video, audio or text?
We could hop in amelia?
What type of writes are you referring to? SPI? I2C?
k, lemme kick the cat off my lap and head upstairs
everything takes longer than you estimate, even when you account for having a cat on your lap
i guess the big Q is do we want to do STM32FH7
or keep cleaning up the STM issue list
I'd like to π
then we get portenta and 32blit
I think we'll find similar uses to the imx rt
It shouldn't be too tough to add the F/H7, since Micropython has some good references as to what changes, but there's a number of modules I keep seeing people asking about
also possibly the https://www.adafruit.com/product/4478
to do that we'll need a camera module
k
I also want to revisit the internal flash at some point, because it's still pretty slow, and a lot of boards use it.
I think pulseio and rotaryio are good to do first
i second pulseio and rotaryio
It doesn't seem like QSPI is very high priority though
Ok, cool. I can get those done pretty quick I think.
Do you still want me to do any audio stuff?
It's on my basecamp todo
oh right yes I can do that today
So, shortlist: PulseIO/RotaryIO + docs, Setup for F7H7, then maybe flash?
Is there a particular board you'd like to see first with the FH7?
I can probably clean up remaining structural issues (package selection, etc) alongside the F7H7, since they'll require some structural thinking anyway
I'd probably start with the stm32h743
tinyusb has the f767nucleo and h743nucleo
so those would be best to start with
yep!
One modification I'd suggest though is that if the F7 nucleos don't have external flash, I really think that needs to be pushed up.
internal flash I mean. I don't think it should be too crazy, it just needs cleaning up. It never got a lot of focus after the feather got added.
slow but working is ok
if you have specific clean ups in mind then we can talk about those. general clean up doesn't always have an end
I'd like to add caching and track down whatever flash erase error happens sporadically on startup
Could also add the CCRAM cache for the F405s
what kind of caching?
a FS cache in CCRAM is a bad use of the ram
because the FS is only read at the start of the python vm
Having a better intermediary buffer so that fewer writes go to flash immediately
I remember that I had some specific optimizations that I was going to do but then the feather came out and we all switched gears
I don't think write speed is that important though
and a buffer will only help large writes
Ok, I won't push it too hard if you don't think it's priority. I've just been using the Espruinos today so I've had the sluggishness on my mind. But I'm excited about the F/H7s too so I'm happy to just get started on those.
I'd rather improve VM speed than flash write speed
do writes take more than, say, 4 seconds?
When you save a file it takes about 5 seconds or so yeah
hrm
The f767nucleo and h743nucleo don't have external flash. So I could do this concurrently
lets do pulseio and rotaryio and then f7/h7
if f7/h7 are slow too then we can look at refining the internal fs support
the tricky bit with a cache is that you have a window where a crash, reset or unplug can lose data
True. I'd have to get back up to speed on how NRF and Micropython do it
Could also take a look at STM32Duino
Cool, thanks @meager fog @slender iron for the discussion. Anything else we want to cover?
Picking up nucleos now
we already do it external_flash so it may be worth factoring out from there
it is a 4k cache though
Ok, I'll check it out - happy to do that after the F7 as you suggested.
π
its a bit complicated because the cache is allocated in the vm heap when available and outside of it if not
the stm32f/h7 could be a better option for large and fast circuitpython programs
assuming the internal flash is faster than the imx rt's external flash
hmmm gotcha
hey, to convert a bin file to uf2 do i just run it through the Microsoft uf2conv.py ? https://github.com/microsoft/uf2/blob/master/utils/uf2conv.py
yes, you can find it in the circuitpython repo too (maybe as a submodule)
thank you. i am trying to convert a bin but it's not outputing a uf2 it just says No drive to deploy.
Images automagically compressed by Calibre's image-actions β¨
Compression reduced images by 78.8%, saving 601.10 KB
| Filename | Before | After | Improvement |
|---|---|---|---|
assets/images/boards/large/ndgarage_ndbit6.jpg |
344.96 KB | 72.12 KB | -79.1% |
assets/images/boards/original/ndgarage_ndbit6.jpg |
344.96 KB | 72.12 KB | -79.1% |
assets/images/boards/small/ndgarage_ndbit6.jpg |
7... |
Hi Thomas,
It looks like you've hit a bug in the pin reset code. For SAMD it is here: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/microcontroller/Pin.c#L81
Are you hitting the RuntimeError after your code works once? Is it a "pin in use" error? All pins should be reset before all VM runs using the function in the link above. Since the SWD pins are a special case, it is likely that it needs to be fixed.
@TheKitty You'll need to deal with the merge conflicts but otherwise this is ready to merge when you're ready.
Why not set to 407 below? This could be confusing if one searches for MCU_SUB_VARIANT and ignores a comment like this that is nearby.
-
Ok, makes sense to use this for sub-byte packing. Note that
structcan skip bytes objects withpack_intowhere you give it a bytearray. -
Yup, that is on the right track. We then put the arg parsing in shared-bindings and the implementation in shared-modules. shared-bindings can also have inline docs. We name everything verbosely too so it includes the module name (
_evein this case). The example implementation function would becommon_hal__eve_vertex2f. The arg parsing methods...
The MCU subvariant is used to associate with the package, the peripherals, and the startup file name - changing it to the f407 would mean having duplicate files and an extra check for those instances without actually being used for any changes.
@tannewt I've got no idea what this translate error is, any thoughts? I've rerun the test and it's the same error.
@sommersoft my control build (no changes) is not working, unfortunately:
Warning, treated as error:
RSVG converter command 'rsvg-convert' cannot be run. Check the rsvg_converter_bin setting
Google says this might be related to a missing dependency for sphinxcontrib-svg2pdfconverter. But why would that be any different than the remote build?
@idle owl I was just trying the CLUE library and the display_sensor demo requires adafruit_display_text. (its not in the list in the readme) Nice demo!! -- moving on to the others
ooh -- the spirit level is great!
hmm -- actually, I wonder if the motion of the "bubble" should be swapped 180 degrees -- in a real level the bubble "rises" up
@marble hornet FWIW, here's how it's done in the makefile:
https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/Makefile#L338
As per title. Resolves #2587
Nevermind, just had to install librsvg. Didn't realize I had to do that with brew rather than pip.
@solar whale Thanks!
great demos !! also display_shapes is needed for some as well...
Those were just added, forgot about the README
@solar whale Fixed the spirit level, it now rises.
Great! Thanks!
I'll push it. Holding off on releasing because I have been tweaking things.
What should be the format of an SD card for the weather station? I'm getting SD card not found I placed my icons on one and installed it but get the same sd card not found
and it doesn't show in File Explorer
ladyada beat me to it !! works great!
Thanks for testing!
Glad to -- Thanks for the demo!
@idle owl do you also want to add display_shapes to the readme... sorry
No, it's for a demo only, not the driver itself. I'm putting together a guide page that will have all the libs for all the demos and library included.
That's why I added the note about demos maybe needing more libraries.
Didn't make sense to add under driver-specific dependencies since it's not a driver dependency. At least to me.
ah -- ok -- thanks -- that makes sense
@idle owl That spirit_level demo is a great example of how much can be done with a few lines of code in CircuitPython. Very impressive!
Thank you! I'm actually really proud of that... I figured it out on my own.
Cleaned up board definitions per this conversation.
Cleaned up board definitions per this conversation.
Cleaned up board definitions per this conversation.
Cleaned up board definitions per this conversation.
Cleaned up board definitions per this conversation.
Cleaned up board definitions per this conversation.
Cleaned up board definitions per this conversation.
Cleaned up board definitions per this conversation.
@solar whale Do you happen to know if the lines on a spirit level have a name? Google seems to imply no.
Don't know about name. They are division markings for precision. A 'Precision' level has more. A good machinist ( a lot better than me) with a precision level can check level and tram of a roll on par with a laser setup.
@idle owl not that I know. Iβve also seen this type referred to as a βbulls-eyeβ level.
Willing to give up possible tearing effect for faster bitmap draws
I think this is ready for review, including the "our style" docs even if they are mostly extremely short blurbs rather than full reference documentation.
There are some hard faults that I have encountered (wrong argument types not caught, I think) but we can pursue those by PR'ing upstream. The one I know offhand I verified exists in micropython, so it's not introduced by us.
I also have some ideas that might make the differences (vs micropython-ulab) we have to carry smaller, but I di...
@indigo wedge hihi
im at a breakpoint if you wanna have me look at this feather
maybe mine lives π
sorry, wasn't able to find free time this evening and now it's midnight π¦
but if you connect the jlink and exec the commands i sent you'll know if it's alive or not
np ok
ill do that now for fun
note im on windows
so i cant run linux execs (easily)
oh
that's gonna be a problem, i do everything on linux so don't know what works and doesn't on windows
but for jlink you should have same commands on both
yah ill try those now
@indigo wedge ok i just need to load the feather firmware.elf using jlink?
yeah, that's the uf2 bootloader, if that works then you can upload CPY using uf2
woops jlkink too old
yeah it needs to update the fw in the jlink to add imxrt1011 support
yay
if it worked you should see the uf2 disk
looks like a disk
oh
but nothing there
the native ROM one?
the firmware.elf you attached
i mean qspi flash chip, sorry my bad
aww
so basically same thing u got i guess?
quite annoying since it's a copy of my design with fairly minimal changes
right, that's the ROM one
i removed a few caps but don't think that would affect it
doubt it...
like i had some stability issues first but it was just long cables
i'll sit down during the weekend and do a side by side comparison to see if i missed something
sorry about the delay π¦
np - hardware is like that
but it was supposed to work on first try! π
@tulip sleet is the i2c weirdness on both nrf and atmel?
yes, was detected on clue, but i'm testing on itsy m0
interesting
random choice: I thought my itsy was an m4, and i may have fried my metro m4
so it's an issue in shared-bindings
i think
ya, that's all that changed in that commit
i have another pending ping from someone, so i'll let you know when I'm back with any more info
aha maybe:
in writeto_then_readfrom:
writeto(self, args[ARG_address].u_int, args[ARG_out_buffer].u_obj, args[ARG_out_start].u_int,
args[ARG_out_end].u_int, false);
readfrom(self, args[ARG_address].u_int, args[ARG_in_buffer].u_obj, args[ARG_in_start].u_int,
args[ARG_in_end].u_int);
but writeto and readfrom both call normalize_buffer_bounds, which take the address of the start,end, and length args
so the first may be confusing the second
the transaction length stays the same though right?
π
Why change this? It doesn't look like the Pico uses it but something else may.
How much of the flash does the Espruino bootloader take up?
Overall looks good! One request to change the new override swd define so the compiler can help us a bit.
Please do:
#define BOARD_OVERWRITE_SWD (1)
and then #if when used. That way the compiler can verify it is available. (Also, add a default into mpconfigport.h)
I think I was thrown off by only one entry in Finder under locations. If I hit computer I can see two. I don't think the serial numbers are actually the same. I was just confused by how mac was handling it. I swear is used to show two in finder. Oh well.
I also built locally, and everythingΒΉ seems to be turning out correctly. Thanks @hierophect!
ΒΉ There appears to be some deeper brokenness going on. Things like frequencyio are showing up as available on the STM32F4s. They shouldn't be, since its not included in a MINIMAL_BUILD and I don't see it explicitly turned on anywhere. That is mostly outside of this though, so I'll find a better way to document the issue.
How is this used? Can we remove it or replace it with something that takes in a ulab.array instead? I'd love to be a strict subset so we can use this interchangeably with a numpy array in CPython.
//| :synopsis: Manipulate numeric data similar to numpy
Thank you so much for adding these docs! Very helpful. One typo and a question about the extra bits on array. Otherwise it looks great!
I'd be tempted to remove this in favor of optimizing bytes(a) where a is a ulab.array instead. It looks like this and rawsize are the only two extra things preventing array from being a strict subset of numpy's array.
lol. what are the odds of simultaneous review?
π
I meant to add: I'll hold off on merging. I'm not a huge fan of sending known-incorrect documentation out. Without a better grasp on what is causing the noted problem, I'm not sure how a long a fix would take.
Thoughts on holding this until I (or whomever) gets a handle on the secondary problem?
I just mixed up my linker files like a chucklehead, thanks for catching it
renamed them so they're more clear too
@tannewt the bootloader always takes at least 16KB (one sector) because it can't overwrite itself. It might take even more in the Espruino case, it was kind of hard to tell from their code. It also isn't super well documented how to upload your own binaries with it, since it's designed for use with their online IDE. I don't think it'd be any easier for new users to use it rather than the DFU option, as compared to a UF2 bootloader.
I found two library issues I would like to work on. One is from @idle owl and the other is from @gilded cradle . I commented on both and am working from my geekguy-wy Github account now for all Adafruit stuff.
I responded with some more thoughts on the issue, but you'll have to figure out the remaining on more specifically how you want it to work, which is part of the fun. Enjoy. π
@gilded cradle I just read them. Yes, this is what attracted me to this issue in the first place. π I already have some ideas of the things I would like to do with this and it does look FUN!
Are there any power consumption values for BLE? Iβm interested in values newer nRF52 boards.
Sorry, that was a typo (forgot to change L to V when I copy-pasted). Should be fixed now.
@steep oasis check out https://devzone.nordicsemi.com/nordic/power/
with circuitpython you won't get these values though because we don't sleep at all
@timber mango Thank you for looking into issues! Let us know if you need any assistance.
@idle owl I will. I have been looking for ones that I have the hardware to test with, which is not very many.
No, it's not really bytes(a) because it acts like an array of the same data type and it refers to the same storage. However, maybe we could make memoryview() work on them which would mean we could remove asbytearray. For some reason, memoryview doesn't take ulab arrays.
There are other differences that make this not a particularly strict subset of numpy.
- fft, ifft are in a different location
- spectrum isn't in numpy
- fft, ifft deal with complex values differently (numpy has a...
I don't think that rawsize is useful as anything but a debug tool and wouldn't mind turning it off.
I noticed that ulab float arrays are actually using doubles. This is probably not what we want, but I'm not sure where the knob is to turn. I know this because the rawsize method says elements are 8 bytes big...
@slender iron Thanks. Thatβs what I was afraid of. Any plans to move to low power? Especially with BLE?
@steep oasis Iβd like to do basic low power sooner rather than later. I want to preserve ram though rather than completely shutting down. Iβm not sure how big the power savings will be.
@slender iron Iβm more on the electronics side of things. But let me know if you decide to work on it. Iβll help as much as I can. I see more and more work being done on the nRF52. Iβm surprised nobody has tackled low power.
Hey sorry for the bad quality and (probably) stupid question, but my Feather M0 express running circuitpython 4 is not responding to code. I think I may have deleted something from the CIRCUITPY, or actual microcontroller but I donβt know what. I tried resetting and reinstalling circuitpython but it did not do anything. Any help?
@short phoenix do you get read-only errors if you try to save anything to the CIRCUITPY drive? it sounds like it may have gotten corrupted, which happens for a couple reasons.
Yeah i do
k. copy anything you want to save from the Feather to your PC, then run these commands:
im doing some translations for zh_latn_pinyin, for "Already advertising." i can get close with somethat that translates to "Ads have been served." would this work?
import storage
storage.erase_filesystem()
run that in the REPL. it will wipe and reset the filesystem. then you should be able to put all of your relevant files back onto the board. make sure that you eject the board from your OS, before removing the USB cable. also, be wary of editing code files directly on the board; some editors do not complete writes before the board resets.
hmm maybe something like "broadcasting" would work better
yeah. "Ads" doesn't quite equate to the context of BLE Advertising. well, i assume it doesn't; i don't speak Chinese. π
yeah i went with "currently broadcasting" seems to work
@raven canopy so it will reset my device file system, and i will have to redownload circuitpython, install libraries, and then it should work?
@upbeat plover my feeble linguistics agree.
you won't have to redownload circuitpython
yeah, it won't touch the firmware.
but you will have to copy your libraries and code back to the device
yw!
and now, time for my late-night, RosiePi, small accomplishment post. the push notification subscription program had its first few successful flights:
(.venv) ~/Dev/physa_sub/physaci_subscriber:$> subscribe_to_registrar
Initiating physaCI registrar subscription...
Generating new node signature key...
Sending subscription request...
Successfully subscribed.
WooT!
the node-not-expired collision detection even worked with 4 month old, pre-planned code. can't have duplicates in the queue! π
"Cannot have scan responses for extended, connectable advertisements." another hard one
hmm does "Cannot compile MP3" work for "Failed to parse MP3 file"? idk "parse" in chinese
just added missing translations
Hi,
after a pressing reset and the code starts to work (so: "after my code works once") I am not getting the error ever again until I power on the device once again.
Your answer leads me to another question / request:
In my project the ItsyBitsy is a controller for peripherals and does "powermanagement" for an Arm-Board (NanoPi Air).
The ItsyBitsy can (among other things) turn the power on and off for the Arm-Board.
This (and the behaviour of CP) creates with a problem for updating the...
oh I was mistaken -- arrays use doubles on the unix port, but floats on real devices, so that's no concern
The Adafruit_CircuitPython_Bundle February 07, 2020 auto-release is still transmogrifying from last night?
Fixes #2334 and #2508.
- Increase precision of
time.monotonic_ns()to microseconds on all ports. I need some rough timing values that were more granular than milliseconds. - Round
time.sleep()to the nearest millisecond. Tested #2508 sample program and now get 100 Hz as intended.
time.monotonic_ns() and time.sleep() should still not be used for precise timing, but this makes them more useful than they were before.
Note that time.monotonic() still increases only on millisec...
@crimson ferry the CI failed to upload the release. My quick-look-on-phone points to an upstream tool that is suffering from a recent GitHub API authentication scheme deprecation.
@idle owl I'll work this as soon as I can, unless someone else wants to. Problem is here, I think: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/master/.github/workflows/release.yml#L39
That action is still using the old token scheme that we just fixed with adabot.
Hmm ok. @raven canopy I'll leave it to you as I haven't touched the actions stuff yet and don't need to break the bundle.
Or break it more anyway.
Tested a bin from limor on my pygamer, it makes loading OnDiskBitmaps from SD in landscape mode fast.
Is there a known issue with the Github CI currently? I just had it fail in a way I haven't seen before. During "Install Deps" I ended up with these errors:
E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/s/systemd/libudev-dev_237-3ubuntu10.33_amd64.deb 404 Not Found [IP: 52.177.174.250 80]
Fetched 230 kB in 0s (4477 kB/s)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
##[error]Process completed with exit code 100.
@lone axle those errors are usually transient and are due to some problem in the github actions cloud
@tulip sleet I see, thank you. will it re-attempt itself automatically later? Or should I just make another push after a while to get it to try again?
if you go to the actions page and click on the action that broke, on that page there is a dropdown on the right at the top of the list that lets you re-run the checks.
you don't need to push to make it happen
you have to click on one of the runs on the left first: example:
Ah cool. I'll wait a bit and have it retry. Thank you
you can try right away, it's usually quite transient
or wait until all the current jobs are done if you want
Same error on the retry
I'm not sure if it's expected to be visible from outside of the Github / Azure cloud but I'm also getting 404 response from the URL for the .deb file referenced in the error when I try from my local PC. I'll give it another try here in a bit.
ok, that may be a problem with their archives.
Nice! if you are looking for testers, I can try it on a standard PyPortal later.
@lone axle cool thanks!
as for the problem installing that package .. there was recently a security update to the package (feb 4): http://changelogs.ubuntu.com/changelogs/pool/main/s/systemd/systemd_237-3ubuntu10.38/changelog
this causes the old version of the package to be removed from the package servers. However, the package metadata on the ubuntu image hasn't been updated to know about the new package yet.
IMO the ideal case would be that github makes sure the metadata is up to date, but if my understanding is right it can be fixed/worked around by putting an "apt-get update" step before the first "apt-get install".
(some package management systems in linux download metadata every time, but debian's apt-get does not)
import board, digitalio
class WithTest:
def __init__(self):
pass
def __enter__(self):
pass
def __exit__(self, *exc):
pass
d13 = digitalio.DigitalInOut(board.D13)
d13.switch_to_output()
# CYCLICALLY INCREASING INTERVALS
wt = WithTest()
while True:
with wt as wtx:
d13.value = not d13.value
#OK: CONSTANT INTERVALS
while True:
with WithTest() as wt:
d13.value = not d13.value
Putting a scope on D13...
I see. Is that something we have control of in the Github CI system? I'm not very familiar with how much of that is in the users control vs. up to Github to make the changes
yes .github/actions/*.yml files within individual projects are where this apt-get line would be added
I don't see any apt-get install commands in build.yml or release.yml but it looks like maybe it's executing a separate script that would be issuing the install commands:
- name: Install deps
run: |
source actions-ci/install.sh
what repo are you/we looking at?
seems that it is referring to this file https://github.com/adafruit/actions-ci-circuitpython-libs/blob/master/install.sh
Ah, so I could add a section like this before it:
- name: apt-get update
run: |
apt-get update
would that need to go in build.yml, release.yml, or both?
I think that if you added it to that install.sh then it would be automatically picked up by ALL repos that use actions-ci-circuitpython-libs
@lone axle remind me your github so I can mention you? I'll PR this change I mean...
Oh, that does sound like a better option.
weird there are LOTS of audio glitches on pyportal pynt that I wasn't hearing on pygamer π¦
I am FoamyGuy on github
okay
I've still got it on my list of stuff to give some more time to testing but I was getting pretty different results between PyGamer and NeoTrellis M4 when playing back audio
On the NeoTrellis I though it was related to Mixer voice 0 vs voice 1, but started to make a self contained example and testing on the PyGamer and wound up with different results. I'm going do some more testing and try to get my findings documented this weekend.
is neotrellis also an M4 based board?
these audio glitches are ones I think means the board isn't quite keeping up with mp3 decoding
maybe the screen having about 2x as many pixels is enough, it feels pretty "marginal" on pygamer
@onyx hinge 0ortibg π
In my case they were wave files instead of mp3.
wave files on flash storage should be solid, but I've been wrong before.
on sd, I don't expect they work very well
Are there similar issues on other ports, or just stm32f4?
Flash storage in my case
Hi Scott,
I tried to create some simple code, so that you can reproduce the problem.
But not so easy!!!!!
I took a new (never used) itsybitsy and loaded my code into it.
(In order to strip it down to a minimal repro code.)
But it turns out when no pins are connected to any peripherals the bug does not occur.
Then I reread the code piece you referenced...
Line 81 says: // Configure SWD. SWDIO will be automatically switched on PA31 when a signal is input on SWCLK !
I have connected th...
This is a strange one: I've been iterating on some code on the Feather STM32F405 and today I'm reliably getting a crash into the hard fault handler when I do the following:
- power on/reset
- wait for
code.pyto start running - write to CIRCUITPY -> triggers automatic restart
- wait for
code.pyto start running again - write to CIRCUITPY
->Crash
Some context: I'm working on a project using the LPS33 and the Feather STM32F405 to make a sip & puff input device. I learned late yeste...
Thank you! Unfortunately it looks like it needs to be merged with the latest changes before we can merge this PR.
The pin reset is deliberate so that the state of the hardware is the same every time the code runs. Why do you want to control the power pin from CircuitPython but not have it reset and start the same as the first run?
Ok, it makes to do since the ISRs and bootloader take that much up. I was thinking Espruino owners probably know how to use their Web IDE so it'd be easiest for them. If you still want to do DFU instead, then feel free to merge.
Ok, that would be my vote. I think python does actually have a way to pass in an object and get its size back. I can't remember what though.
I'm not an Espruino pro so I could be wrong, but if any come along and think there's a way to get around this, then it'd be easily revisited.
The existing name is confusing if it doesn't return a bytearray. I suggested bytes because it is immutable and we could refer to the same memory. That could be weird though if it is changed through the original array. memoryview is a better idea and I bet it works with np.array and cpython's memoryview.
I leave it up to you whether to move things around so there is a module that is a strict subset of numpy. (meaning ulab code can be run with numpy ok, not necessarily the reverse)
@hierophect you added two new error messages. When you add anything in translate() then you also need to run make translate at the top level. It'll then put the new strings in the translation files so that translators have access to it there.
@hierophect and/or @makermelissa - add these to circuitpy.org next please :)
I'd recommend putting the proper 407 files in now even though we're not using the differences yet. Doing it now will make this file clearer until then and make it easier when someone wants to add support for the camera or ethernet. (camera may not be that far out if we want to support the openmv devices)
@tulip sleet I'm through almost everything. need anything else?
that's great! thanks
Thank you for the split! It's definitely getting closer! Would it be possible to merge all of auto-generated functions into init.c as well? I realize that would make updating a bit more work but it'd be more consistent here. Thanks!
In order for these functions to appear in the docs they'll need comments here similar to these. Although it is more work, I think it is worth it for the clarity.
I usually put everything from here down in the shared-bindings header because these are the functions that shared-bindings relies on and must always be provided for the module. This file should hold the struct like it does and any internal to shared-modules function declarations.
@slender iron good luck at pycascades this weekend!
Thanks @tidal kiln ! Headed out now
anyone else seeing the library download buttons broken on the webpage?
hmmm. looks like the release assets aren't there for latest.
@hierophect you added two new error messages. When you add anything in
translate()then you also need to runmake translateat the top level. It'll then put the new strings in the translation files so that translators have access to it there.
Huh. Did it just never come up before because I was using words that had already been translated, or something?
@tidal kiln Yeah known issue.
okie doke
@idle owl do you know if theres a good basic hello world example for receiving text from BLE Connect App?
@tidal kiln No idea. I haven't had much to do with that end of things.
ok. no worries.
There is a target in the top-level Makefile, make check-translate, which will tell you whether you need to make translate.
The issue with the bundle affects all releases on all libraries. If you release a lib, the actions job will fail to release and upload assets. This is currently being looked into.
@tulip sleet ping
@dhalbert, looking at samples for different ports, I'm not seeing similar issues.
I'm pretty confident that its only related to the use of CIRCUITPY_MINIMAL_BUILD. The minimal build logic was added after docs/shared_bindings_matrix.py was written, so it just doesn't handle it.
Because the ARM-Linux should run continuously as long a possible. And changes to the code of the itsybitsy should not shut the down the Linux system.
I can very well understand your argument, that "the hardware" should be the same every time the code runs. And this is very positive for most, if not all of the users.
But: you introduced exceptions already by offering "microcontroller.on_next_reset(run_mode)"
I think such an obscure and really not "dangerous" / rarely used (and not many by...
Running some example code for my featherwing OLED and Feather M0 Express from https://learn.adafruit.com/adafruit-oled-featherwing/circuitpython-and-python-setup, and keep getting the error "AttributeError: 'module' object has no attribute 'I2CDisplay'" in the serial display. Any help?
@short phoenix what version of CP are you using?
yep. i think it's 5.x only.
Yeah it is 
@tidal kiln are you looking for a BLE Connect text sample app?
https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/master/examples/ble_uart_echo_test.py. But we're always looking for a packet on the receive side, and there are no "text" packets.
so you'd have to read raw stuff and then parse it into a color packet if it looked like one.
ok. thought that might be the case.
https://github.com/adafruit/Adafruit_CircuitPython_BLE/pull/14 someone else wanted kind of the same thing
so just read everything raw, and can borrow code from color packet
look for !C at start, etc?
yes, you can use Packet.from_bytes() to read a packet and generate the proper object. You need to register the packet class by importing it first
oh. i was just going to uart.read and then just work with that.
yeah, you would do that, and then once you recognize the color packet, you can call from_bytes() on the accumulated bytes (if you want)
passing in the correct number of bytes
are you sending from the official app, or from something else?
official app
it's a little bit too bad we don't have a text packet type, but we'd have to add support in the app (as opposed to just the raw UART)
has anyone ever suggested a "text" something for the control pad?
that PR above kind of implies it
I originally thought there was such a thing, and had to be deconfused by limor
apparently the typical use case was sending text back to the phone, not sending text to the device
from what i can tell, the packets are nothing but special text strings
that's right, and the original idea of the app seems to be to -send- stuff like accelerometer and color packets, not receive them
that shows whatever text is sent back from the device (not the app)
that's what I was confused about
it's just raw text
oops
does this look correct in terms of doing the raw read?
while True:
ble.start_advertising(advertisement)
while not ble.connected:
pass
ble.stop_advertising()
while ble.connected:
if uart.in_waiting:
msg = uart.read(uart.in_waiting)
print(msg)
looks good to me, but it's possible (not sure) a packet might get split
i have to go out, sorry
ok. no worries. thanks for the help. mainly wanted to make sure i wasn't overlooking something obvious.
okay one more thing @tidal kiln, my text is not displaying when using the example code in CP 5 latest. I think I am missing a library maybe?
you should get an error if you are missing a library
I am not getting any errors, it just shows the outline as mentioned but there is no text
are you trying the example code here?
https://learn.adafruit.com/adafruit-oled-featherwing/python-usage#example-code-8-14
yes
hang on a sec and let me give it a try...just happen to have a Feather M0 and OLED wing sitting here...
there is one line of pixels of text in the top left corner
but i tried shifting x and y values to get it to center but it would only shift the border
I am pretty sure the text is just sitting in the top left by default and hasn't been moved to center
looks like that example needs to be updated
not sure when, but x and y can't be passed in anymore
need to set them after
try this:
text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00)
text_area.x = 28
text_area.y = 15
hello, i am using itsybitsy m4 express microcontroller and I am trying to connect it to esp8266 wifi chip. I noticed it says that the ESP 8266 is not supported by circuitpython and that in order to use it, it has to be used as a wireless co-processor. Can someone explain how this works please :)?
Thank you cater
and would it still be able to receive data from the itsy bitsy m4, and send the data over wifi?
@short phoenix np. there's also some fancier anchor options that were recently added. worth checking out:
https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/blob/master/examples/display_text_anchored_position.py
@golden sail it works via special firmware that runs on the ESP8266. you then talk to the ESP8266 using protocols defined by that firmware. i think this guide covers most of it:
https://learn.adafruit.com/adding-a-wifi-co-processor-to-circuitpython-esp8266-esp32/
Can an Airlift act as a wifi coprocessor?
do you mean this?
https://www.adafruit.com/product/4201
if so, yes. that's basically an ESP32 with the special firmware preloaded.
i think it was found that the ESP32/SPI combo worked better than the ESP8266/AT combo, which is why everything has been using that, like PyPortal, etc.
from that guide:
If you can choose - use ESP32 with SPI Commands - it's the best experience by far.
do you have any hardware already?
using itsybitsy m4 express, Adafruit Ultimate GPS Breakout, and mpu6050
gps and mpu650 will send data to itsybitsy m4 express
and now im looking for a way to send that data to a smartphone over wifi.
i have an esp8266
I believe there is no library for the esp8266 atm, only esp32.
good point. in terms of CP support. only the ESP32 one:
https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI
i think given what you currently have, the airlift should work.
GPS on UART, MPU on I2C, ESP32 Airlift on SPI
sercom party!
@tulip sleet fyi - i got something working. thanks again for your help. pointed me in the right direction.
I am planning to make a game on the Featherwing OLED and Feather M0 Express (basically the chrome dinosaur game) and use the A B and C buttons on the OLED to control it. It will obviously be fast moving and I will need to control it using buttons. What libraries will I need?
@tidal kiln i think the MCP2221 fix ya came up with worked out?
you could merge in a 'final' fix with values
yep. i hope so. seems to be working.
what's your thoughts on value? seems like most were able to get by with under 0.5. but could just crank it up 1?
The Tomu team have a port of CircuitPython https://github.com/xobs/circuitpython/tree/fomu/ports/litex for the Fomu (new to the Adafruit shop) so while I try to hunt down a Tomu port, you could add the port to the official CircuitPython repository. If I find a Tomu port, I will edit this post.
@short phoenix this page will get you started on which libraries you need in order to draw to the screen: https://learn.adafruit.com/adafruit-oled-featherwing/circuitpython-and-python-setup
It looks like the 3 buttons connect to 3 digital pins, you don't strictly need a library to use them. But you could use the Debouncer library to make it a bit easier if you wanted.
<@&356864093652516868> Due to a recent deprecation of a GitHub API authentication procedure, many services that relied upon it are not working. Release mechanisms for both the Adafruit and Community CircuitPython bundles, and each library are broken. Any releases will not have the proper release assets. For now, please point anyone looking to download the CircuitPython Library Bundle to the last successful release here: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/tag/20200206
@gilded cradle DId you create the image that shows the 16-bit format of the segments for the alpanumeric display?
@timber mango, yes
@idle owl ouch. any meaningful way we can help?
@onyx hinge Not at the moment. Sommersoft is looking into it. I'll let you know if there's anything you can do.
@gilded cradle Wonderful! Could you please add the decimal values for each bit under each segment letter? Like for segment A would have "1" on a slanted line under the box, up to segment N which would have "16384" It will make it easier for people to add the bits to make a bitmask.
I'm not quite sure what you mean, but now that I look at it, I noticed that it shouldn't start with 0x as that implies hex, when it's actually binary.
yay! my LED demo went from 15fps -> 30fps with pixelbuf, and now it went to 60fps with ulab
it's "just" 96 pixels but it's still pretty cool to go 60fps with circuitpython
that is amazing
Yes, the way it is shown in the image is actually binary, so should be prefaced by 0b instead of 0x. I mean to add the decimal values of each bit under the box for each segment. 1 for segment A, 2 for segment B, 4 for segment C ... up to 8192 for segment M , and 16384 for segment N.
Then, people just add up the values for the bits of the segments they want to light up and that is the bitmask for that character or animation frame.
I think putting all those numbers will make it look a bit more cluttered than I would like it
It's more meant to be a reference for which segment is controlled by which bit than a binary to decimal converter.
It is not really a binary to decimal converter though. It is a bitmask constructor. Without this information, I think a lot of people might not understand what a bitmask is, especially those who are completely new to this.
How about this: A wheel diagram with 15 segments. The display segment letter (A, B, .. M, N) on the outside edge and the bit values below that. Think of an umbrella.
The Wheel of Fortune wheel is a much better example of what I am going for.
@onyx hinge Impressive!! π π
π
Sorry for asking so many questions (I'm new to this as you may be able to tell)... but I am trying to use this guide https://learn.adafruit.com/circuitpython-oled-knob-sketcher/drawing-pixels in the latest circuitpython 5 build with an OLED Featherwing and Feather M0 Express. This guide may be made for Arduino or outdated, so my question is what would be an updated version of how to draw even just one pixel in circuitpython?
I tried to design an FIR band pass filter using scipy and all I got was this weird moray mouth
lol
hey that looks like a band pass filter
too bad a 97 pole filter is probably infeasible to run even with ulab supporting it
@short phoenix responding to your questions over in #help-with-circuitpython , which is a better channel for general questions. this channel is more for developer questions about the circuitpython firmware
Gotcha, thanks for everything π
sure. no prob. i'm outta here. have fun with your project!
can anyone help I feel like I've lost my mind lol
was going to try downloading the latest circuitpython library for 5.0.0
I go here: https://circuitpython.org/libraries
click latest releases
@steady coral there is an issue caused by github auth change. One sec
ah thanks!
If you scroll up a bit there is note from Kattni explaining a bit more
ah ok I missed that thanks for the heads-up
Is there a support for the CANbus protocol on CircuitPython?
no
@onyx hinge What program are you using to design/plot your DSP filters?
@lunar crown those were from scipy.signal.firls.
And the plot is also by matplotlib iirc, based on a scipy sample
Parameters poorly chosen by me
@idle owl maybe pin that message about GitHub problems?
@onyx hinge Yes, balancing the parameters is almost an art. Thanks.
the background is, we are in the process of adding "ulab" to accelerate numeric calculations in circuitpython.
ladyada asked me to look into doing low pass / high pass signal filtering with it so I'm literally just learning since yesterday.
@onyx hinge i've got the release issue cause pinned down. i'll put up another message, and pin both.
@raven canopy thanks for burning the midnight / weekend oil on this!
its the only oil i have available, generally. π
also, i used this when i was trying to figure out filters: https://fiiir.com/
@onyx hinge For real time filtering, probably better to make some C-Extensions to CP and expose selected functions from the ARM filter library. I am trying to learn how to do a C-extension on the Teensy4 / M7F.
ulab is in C but does not use CMSIS functions, it uses portable C.
I understand the tradeoffs. More general solution vs. higher performance.
cmsis arm_fir_m32 looks quite optimized compared to ulab.convolve, but will have bigger code size
<@&356864093652516868> Update on release asset uploads: we've narrowed down the cause of release asset uploads being broken. The GitHub API Authentication was actually a red herring; thanks to @ruby atlas and @idle owl for guiding me away from that. The actual cause turned out to be a change to the 3rd-party release asset upload action we're using. Issue has been filed to that repository, and the maintainer is engaged on a fix PR. I'll be putting the PR in shortly, so hopefully this will be fixed rather soon. Thanks for your patience! https://github.com/csexton/release-asset-action/issues/6
@onyx hinge Where is ulab being developed. I didn't see it in the master branch.
@lunar crown its currently in this pull request: https://github.com/adafruit/circuitpython/pull/2583. ulab is external. i think jepler is working on adafruit's fork, and may be sending things upstream when possible. https://github.com/adafruit/circuitpython-ulab
@raven canopy Thanks
@onyx hinge any "Bilinear interpolation" in ulab? I would love to double the number of pixel when displaying thermal camera image...
What is the status on I2S on Feather STM32405 Express? (I need to choose a small board such as that or Feather M4 Express.)
@raven canopy Thank you for you work on this!
@raven canopy yay good π΅οΈ work
it was a team effort!
@half sedge I didn't see any interpolation function like that.
@half sedge the upstream was receptive to the first function we wanted to add (convolve), so maybe look at how you would do bilinear interpolation in numpy and maybe we can suggest it or even pull request it
@onyx hinge Maybe this is too much math for me. π I was thinking that the Raspberry Pi simple example was using numpy for that... but it use PIL: https://github.com/adafruit/Adafruit_CircuitPython_MLX90640/blob/master/examples/mlx90640_camtest.py
I am pretty sure I saw somewhere an example of MLX90640 that was inventing pixel values to double the resolution. Maybe that was AMG8833 but that is Arduino code: https://learn.adafruit.com/thermal-camera-with-display?view=all
@meager fog pong. ok can for a bit.
@half sedge yah, i think it was AMG88xx. the guide above used Arduino:
https://github.com/adafruit/Adafruit_AMG88xx/tree/master/examples/thermal_cam_interpolate
theres a CP example that uses numpy on rpi:
https://github.com/adafruit/Adafruit_CircuitPython_AMG88xx/blob/master/examples/amg88xx_rpi_thermal_cam.py
which probably also could have used PIL
@meager fog sry. gotta scoot. can chat l8r.
How do you guys edit code? Iβve been using VSCode directly on the CPy device, but occasionally it hangs and I donβt like that.
Mu when working with code directly on a device, PyCharm for code stored on the PC
@tidal kiln all good - sent mail
Thanks @tidal kiln , it seems there is more than one way to kill a cat, now I need to find a Circuit Python way...
happy saturday folks - here's the DRAFT of the upcoming βPython for microcontrollersβ newsletter that ships out tuesday at 11am ET via adafruitdaily.com - please send any links, news, events and more via an issue/PR, or @ us or really any thing π we'll get it added!
<@&356864093652516868> I am deleting or marking as pre-releases the bad library bundle releases, so that https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest will point to the last good release. I'll try to keep it that way manually until we fix the bundle building problem.
Greetings everyone.
In a library, if I want to have some constants available to the outside world, is there a preferred way of doing that?
@tulip sleet Did Github cause this problem?
It was third party library. See pinned messages in this channel for details
Ah, OK, I had missed that part.
I have been absorbed in working on animations for the HT16K33 and alphanumeric display.
@gilded cradle I have something to show you.
PyCubed is an open source and radiation tested hardware + software platform for small satellites called CubeSats running on CircuitPython!
See pycubed.org for more info. See quickstart.pycubed.org for lots of circuitpython examples
@meager fog sweet! it's very minor, but it works well.
Snakes on a satellite!
@lime trellis do you have an example library you're using it in?
@meager fog not yet- but I'll be having students use register for the BMX160 IMU library they're building. I confirmed it works, tho
I can send you the quickie code I used to check it on the ADS124S08 and SX1280 if that'd be helpful? I use it exactly like I use i2c_bits in my https://github.com/maholli/CircuitPython_BQ25883 library
@lime trellis thing i want to try to get working is dual/use SPI or I2C
we have a lot of dual use sensors -
maybe BMX is too?
(you should totally sell a breakout btw, it's a fun little IMU so far)
its the chip inside the BNO055 right?
so like https://github.com/adafruit/Adafruit_CircuitPython_DPS310/blob/master/adafruit_dps310.py#L49
maybe instead of adafruit_register.i2c_struct we'd have adafruit_register.i2cspi_struct
holy cow!! if the BNO055 just a BMX160 with an M0 in it? I need to look into this further. Might give the students a great starting point for the library if they have the same calls.
@meager fog agreed on the adafruit_register.i2cspi_struct. I didn't port over any struct stuff since I wasn't using it.
Would it still be helpful for me to send over a library with spi_bits implemented?
I'm just not sure if there are SPI devices that don't use the register-access scheme I described in the PR? I couldn't think of any offhand
it isnt the classic 8-bit-for-RW?
As far as I know. I also implemented reading more than 1 register at once in the spi_bits, but that's not necessary if you wanted to keep it simple.
For SPI:
oh yuk
tahts different lol
every company re-invents!
still, does BMI have the same register map for i2c and spi?
Yes- only one register map that I know of
@lime trellis well we have various spi modes in busio
for arduino
see....
if you're up for implementing and adding yours as a third option (for cirucitpy) it would be a mega mitzvah
but the idea is that it would allow us to use i2c or spi in a tidy manner
@meager fog oh that seems super doable! It won't be able to be that tidy I don't think, but I'll whip it together when I get a chance and you can be the judge
id be in your eternal debt π
cause i was going to implement it - but got so much on my plate π
did you try out the ulab PR btw?
happy to help :)
and no I haven't touched-base with the Andrew lately on ulab implementation. Enough on my plate that I'm trying to not get involved π
we did a PR for circuitpy
you could try it out hehe
no involvement needed just...distractions!
omg they will quite literally shout for joy! π
slacking them now. Darn now I'm going to have to come up with something else to grade them on this quarter! π€£
oh they can add plenty o things to ulab
Hi folks, is anyone working on making CP work as a keyboard in "BIOS mode"? I think that means HID with no other profiles & no other USB descriptors... but I'm not sure. I know that a user's having trouble getting our custom keyboard interface boards to work through a KVM and suspect that this would solve it... hoping not to start from scratch https://www.facebook.com/groups/ATMakers/permalink/815702142174560/
This is marked as closed - was it done? If the fix was the same that I used in the XBox stuff which requires a custom build, is there any example of making this work?
The fix requires a new descriptor and its own endpoint, at least. I'm not sure what else. Perhaps it could be added as a compile option for the descriptor generating Python script, and then later as a boot.py. We can reopen this as long term.
I understand this not being in the core CP, but I do think it should remain open until there's some way to do it. I don't mind having to do a custom build (like we do for the XBox Adaptive Controller), but we have found lots of folks who really want to use devices through KVMs, and the composite devices don't work through them.
Here's our current pressing issue: https://www.facebook.com/groups/ATMakers/permalink/815702142174560/
Um... I don't think so? I think the reason this is needed is that the KVM listens in on the keyboard commands and relays them. That lets it watch for trigger keystrokes ('scroll-scroll-enter') to jump between devices. We don't kneed the triggers, but the stupid KVM doesn't know what to do with composite devices. It might be that we just need a non-composite device w/no other profiles. Or only a single device (no serial/mass storage?)
I just know it is a known issue that "complicated...
msgid "Extended advertisements with scan response not supported."
is like line 785, I think it has latest
think it has latest at line 682
not sure why but when i looked at https://github.com/adafruit/circuitpython/pull/2600/conflicts its like at line 785, but when i look in the file its line 682
did a lil hardware test - just checks the button and LEDs
import time
import board
from digitalio import DigitalInOut, Direction, Pull
led1 = DigitalInOut(board.LED1)
led1.direction = Direction.OUTPUT
led2 = DigitalInOut(board.LED2)
led2.direction = Direction.OUTPUT
switch = DigitalInOut(board.BTN)
switch.direction = Direction.INPUT
switch.pull = Pull.DOWN
while True:
if switch.value:
led1.value = False
led2.value = True
else:
led1.valu...
loaded it up and did initial button/LED check with
import time
import board
from digitalio import DigitalInOut, Direction, Pull
led1 = DigitalInOut(board.LED1)
led1.direction = Direction.OUTPUT
led2 = DigitalInOut(board.LED2)
led2.direction = Direction.OUTPUT
switch = DigitalInOut(board.BTN)
switch.direction = Direction.INPUT
switch.pull = Pull.DOWN
while True:
if switch.value:
led1.value = False
led2.value = True
else:
led1.value = T...
tested wifi with settings
resetpin = DigitalInOut(board.ESP_CHPD)
rtspin = DigitalInOut(board.ESP_GPIO13)
uart = busio.UART(board.ESP_RX, board.ESP_TX, timeout=0.1)
esp_boot = DigitalInOut(board.ESP_GPIO0)
the built in module's wifi version is too old to use our ESPAT library and updating the esp8266 firmware isn't easy so i didnt get farther than this:
ESP AT commands
Resetting ESP module
Scanning for AP's
---> AT
<--- b'AT\r\r\n\r\nOK\r\n'
---> ATE0
<--- b'A...
Addresses #2509.
storage remount now checks if USB MSC is mounted.
Would appreciate more testing before merging.
With the HT16K33 alphanumeric display animation I am working on it may be possible to make simple games. I have not tested this out though because I am not a game maker. Is any game maker interested in trying this out?
I suggest using this with an M4 or faster micro.
I noticed that ulab float arrays are actually using
doubles. This is probably not what we want, but I'm not sure where the knob is to turn. I know this because the rawsize method says elements are 8 bytes big...
It depends on your platform and the implementation, whether you have floats or a doubles: https://github.com/v923z/micropython-ulab/blob/936bb3bae55dfdc81d1c8d9580905ae0ac760a44/code/ndarray.h#L22 , also in https://github.com/micropython/micropython/issues/4380#issuecomment-452...
When making changes to something I want to contribute back to master, should I be working on the original or a cloned fork of the original?
@timber mango use a fork then create a branch <https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
OK, that is what I thought and what I am doing. How can I keep in sync with the Adafruit master?
Reading the learn guide now.
it's all in the guide -- fetch/merge from the remote repo
My test program prints the peak audio frequency detected:
f = ulab.fft(u)[0] # Take real part
f[0] = 0 # Remove DC component
f = abs(f) # We care about the magnitude
It is probably nit-picking, but the real part of the FFT is not what you want. This is why I implemented spectrum. You need the absolute value of the complex transform, and not the absolute value of the real part. The maximum position of the real part might depend on the phase of the signal.
But has ulab got to be a strict subset of numpy? I see a couple of reasons for a slight departure from numpy, and this is why I didn't call the library unumpy or something like that.
numpyhas at least 11 data types, perhaps more. It is extremely expensive to implement all those for binary operations, because the costs scale in a quadratic fashion with the number of types. It seems to me that the library is already too big in certain cases: https://github.com/v923z/micropytho...
@v923z A philosophical difference between micropython and circuitpython is, how much like standard python and well known python packages should the product strive to be. Circuitpython has made a lot of decisions to be more like python. Our default is to try to make our reimplementations of standard Python features be subsets of the "standards". We think that this is helpful, because it removes friction when going between circuitpython and desktop python. Another adafruit software product ...
I want to have a class C with a class variable N, but I want N to be immutable. If I have x=C(), I could also have x.N to access the variable. Could the instance modify class variable N. I do NOT want to allow x.N = 2.
I don't know how you make a member of a class not assignable. You could give all instances of a class an immutable member with an @property, but then you can't get that value given only the class.
I just want certain members of the class to be immutable. Just a few variables.
"all members of a class" -> "all instances of a class"
# Give all instances of C the immutable property N with value 3
@property
def N(self): return 3
but then C.N is a property object, not the number 3
the only way I can find involves a python feature not in circuitpython (metaclasses)
@property
def N(self): return 3
class C(metaclass=CMeta):
@property
def N(self): return C.N
print(C.N)
x = C()
print(x.N)
### Either of these lines will cause an AttributeError
#x.N = 9
#C.N = 9
but it works in desktop python3
I could use a dict, but that seems awfully clunky for this purpose. I do not want to make a user do C.dict["N"] to get the correct value.
i would go the @property route, as well.
Hmmph.
I wouldn't worry about, "what if somebody goes assigning C.N or x.N in contravention of the docs". In general this is going to make things breaky-breaky
(my snippet based on answers at https://stackoverflow.com/questions/5189699/how-to-make-a-class-property which maybe has an idea that would work in cpy)
That looks awfully MESSY to me and over complicated for what I want to do. I just want a CONST N = 2 such that N can not be modified.
don't worry, 2 can't be modified no matter what you do π
you can use from micropython import const; N = const(2)...
didn't realize you were wanting a const-like thing.
even though immutable variables kind of go against CPython's ethos. π
@raven canopy That does not make N immutable though.
@raven canopy I know. I am trying to combine an FP feature with a non FP language.
i mean const() is available. use it. we're in the gray area a lot around here, since we have the constraints that PCs don't. hehe
and yeah, 'immutable' was not the word i wanted. 'static' is more what i wanted...
Hi @idle owl , I know you are working on a blog post for mlx90640 camera. I have improved the mlx90640 demo for the PyGamer: https://github.com/dglaude/CircuitPython_MLX90640_PyGamer_Plus It is not yet at the level of the "DANIU HY-18", but I believe it is possible to make a very similar UI and match the feature. That one use STM32, likely not using CircuitPython and has a 320*240 screen. Maybe on the PyGamer we will not have interpolation, but we have SD card support that could be great for saving some picture.
My brain is breaking, so I need a nap. I will be back later.
hmm. you're right though. i guess i've misunderstood const() this whole time. my bad!
I think what X = const(123) does is, allow replacement of X in an expression with 123; and also in some circumstances it CAN signal an exception when X is assigned (but not in general). It works for module level variables, and I think the protection against assignment is only when evaluating the module's code, not something that imports it.
Define pins for buttons A, B, C and D for the Open Hardware Summit wrist badge:
https://hackaday.io/project/168483-open-hardware-summit-2020-badge
SW1 = A
SW2 = B
SW3 = C
SW4 = D
I tried to use the BLE libraries to have one central CPB connect to two CPB's that act as peripherals. Is it possible? I just want to be able to send messages to both of the peripherals from the one central CPB. Thanks in advance.
@pdp7 please let us know when its ready for review!
@tulip sleet fyi, here's what i ultimately came up with:
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/TFT_Gizmo_Candy_Hearts/candy_heart_ble.py#L88
@tidal kiln that seems pretty simple. It's slightly possible that raw_bytes will be an incomplete packet, but probably not in practice.
it looks like Packet.from_bytes() at least has some checks? or do you think more is needed in the user code to handle a potential incomplete packet?
@tidal kiln are you trying to transfer images over BLE?
nope. just some basic stuff, from the BLE connect app.
if it's not a disaster if there's a lost packet, no issue
Ok.
yah. it's not.
@half sedge the main thing was being able to receive generic text from the UART interface in addition to the other "special" packets that get sent by the Controller interface (like the Color Picker)
in the example above, i only cared about the ColorPacket
but the if instance(): could be expanded for others
Maybe some "Text Message" should be added to here: https://github.com/adafruit/Adafruit_CircuitPython_BluefruitConnect
I don't know if it exist in the Arduino version and in the App however.
It seems possible to register new Packet Type to enhance the "over UART" protocol.
you could, but there is no special "text" packet in the BLE Connect App side - the app that runs on the phone
there's only a simple UART that that sends "raw" text
so the above example is one way to handle that
Is this possibly related to memory management? I added a call to print gc_free_mem() inside the loop and see a steadily decreasing amount of free memory - 32 bytes less each iteration. When it reached almost no free memory it was all freed (due to garbage collecting, which would use time?). Adding a call to gc.collect() inside the loop resolved this; but I don't have a scope to see if this actually affected the signal timing.
good morning
@idle owl @raven canopy et al Each time the library bundle generates a bad release, I am editing it by putting a warning at the top and marking it as a pre-release. Making it a pre-release means that https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest skips those and points to the last good release. I was deleting the releases but this is a bit better because it preserves the release notes.
maybe we should fork and fix https://github.com/csexton/release-asset-action at least temporarily?
Is (total memory of micro) - gc.mem_free() an accurate measure of how much memory a script needs after it loads?
@timber mango gc.mem_free() is reporting how much heap storage is left for creating objects after doing imports. The total RAM memory is not too interesting: there are static RAM areas and the stack in there, so if you consider those you are just considering overhead. On the M0 boards, the stack is about as small as it can be (4-5kB). On M4 boards we allocate about 24kB for stack. You can adjust the stack size on restart: https://circuitpython.readthedocs.io/en/latest/shared-bindings/supervisor/__init__.html#supervisor.set_next_stack_limit.
I am just curious how much RAM a script requires after all imports and instantiations are done.
you can call gc.mem_free() (or gc.mem_alloc)()) just after all the imports, and then call it various places. But your program is probably creating objects while it's running. When it runs out of heap, it will garbage collect. There is something called gc.mem_info() which gives more details but we have turned it off to save space.
Ah, OK.
if you are worried about space the best thing to do is to figure out how not to allocate new objects that live a long time (e.g. complicated lists and tuples). Allocate buffers once and then reuse them. If you have a significantly-sized static data structure, considering encoding it in a bytes() or reading it from a file rather than coding it as a nested set of tuples or lists or whatever.
I am not worried about space. It was just a curiosity that popped into my head when I was sleeping. Odd things like that happen when I sleep.
when we do we a build for a particular board, there is some stuff printed that is interesting. Here's part of the output from a Trinket M0 build:
2512 bytes free in flash firmware space out of 188160 bytes (183.75kB).
23836 bytes free in ram for stack and heap out of 32768 bytes (32.0kB).
Space is too vast to worry about.
so about 4kB of RAM is used for stuff other than heap and stack. The stack is about 4k, so the rest is heap
Interesting. So, that shows the maximums available for scripts and stuff?
yes; if you just started a REPL and didn't import anything, gc.mem_free() would tell you total available heap. But if you do any I/O, there's a 4kB buffer that's allocated pretty immediately. The command history in the REPL also uses up some up. (You'll see it shrink as you type more commands.)
Adafruit CircuitPython 5.0.0-beta.5-4-ga63f49cb8 on 2020-02-06; Adafruit Metro M4 Express with samd51j19
>>>
>>> import gc
>>> gc.mem_free()
159264
>>> gc.mem_free()
159168
>>> gc.mem_free()
159104
>>> gc.mem_free()
159040
>>> gc.mem_free()
158976
>>> gc.mem_free()
158912
>>> gc.mem_free()
158848
Yes, I did see that. I have a script that is printing gc.mem_free() at the start of each loop. I can see when gc is done.
On another note, I am experiencing a long delay from when I save a script to flash to when it actually starts running. I get ```main.py output:
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
OSError: [Errno 5] Input/output error
Press any key to enter the REPL. Use CTRL-D to reload.``` right after I save a script.
@timber mango what editor and what OS are you using?
that's often because the file is not 'flushed' by the editor
@tulip sleet we might wanna elucidate that error message
it comes up for me on win10 a lot
Editor is Geany and I run Raspbian Buster on a Raspberry Pi 4.
i think it might be because the FAT metadata is in a bad state.
Geany probably doesn't flush to disk immediately on write. See https://learn.adafruit.com/welcome-to-circuitpython/creating-and-editing-code#1-use-an-editor-that-writes-out-the-file-completely-when-you-save-it-7-13
@meager fog we could add "... make sure your file is completely written", but it's a pretty general error that could happen in other cases (like filesystem corruption)
ah, I see I even tested geany and it doesn't flush to disk
it's in the not-recommended list
you could lobby the geany maintainers to fix that, or if they have plugins you could write a simple plugin that does a sync.
Hmmmmmm. I have not found any other editor I really like.
if you type sync in a terminal window after writing the file that will speed up the flush
but it's best if the editor does it
Github question: I went to push changes to fix an issue and Github wants me to login every time I try to push. This is on my second account. This does not happen on my main account.
@tulip sleet Ah, OK.
If Git prompts you for a username and password every time you try to interact with GitHub, you're probably using the HTTPS clone URL for your repository.
OK, reading, thanks.
@tulip sleet we could point to a fork, but there is an easier way by providing the step with an extra variable (the breaking change). With the maintainer's quick response on the issue, I thought the PR would move quickly (I F5'd it all weekend π)
@tulip sleet OK, thanks. I will have to mess with this later.
Requesting to add my CircuitBrains Deluxe and Basic boards.
@neubauek looks great - needs another small PR please change the 'names' here to
circuitbrains_basic_m0
and
circuitbrains_deluxe_m4/
to match the buckets https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin
I'm grumpy today. grumpy at my own nrf pwm audio out code, which is not well structured and resistant to adding ramp up/down code.
this looks good, right? Well, there's a hum during the ramp time and still clicks at the start and end π¦ π¦
@onyx hinge theres no way to avoid it realy with PWM because by definition you'll get an initial square wave when the first pwm starts
square waves are like juggernauts π
should I just move on? users are grumpy on the forums, and they should be -- it's a BIG pop with the PAM8302A amplifier which is on crickit (I'm using a breakout tho)
I would love for it to be better than it is
whats the link to the forums?
Thanks! @ladyada do you mean the board_id field?
I think there are a lot of things I don't understand about how PWM audio works out in practice. Theory says, you can't hear a 62.5kHz carrier frequency. Practice says, I hear something just fine.
@ladyada thanks for testing the Wifi, I didn't include that in my usual run of tests since I don't know much about it. Shame it didn't work all the way but hopefully it's a good starting point if someone really wants to get it up and running.
I noted that for the arduino code pinMode() function (even up to 1.5.7) unfortunately resets the DRVSTR bit, because it writes the full PINCFGn register where n is the pin number, zeroing this bit.
I wrote a special code that does set the DRVSTR at the same time we set the pinMode as output (so that as soon as we are set as OUTPUT we we have the DRVSTR drive on) :
`// like pinMode(pin, OUTPUT), but to set drive strength (max is 2mA if false, 8mA if true)
bool setHighStrengOutputPinMo...
This looks good to me! @bmeisels one question: Did you test this by powering the board by battery and having USB plugged in, and then disconnecting and attempting the remount()? Assuming you did that, I'm happy to approve.
yep - the pins are right, our library is looking for SSL support that was not added so it doesnt continue. someone could adapt the library to skip that check, if they like :)
@onyx hinge yes! square waves have harmonics
@fab672000 Are you noticing an issue with CircuitPython, or did you want to comment on the SAMD51 Arduino board support package? (https://github.com/adafruit/ArduinoCore-samd/)
Do you want me to do this to all the other ones I've been using?
#define BOARD_NO_VBUS_SENSE
#define BOARD_VTOR_DEFER
#define BOARD_USE_INTERNAL_SPI
etc. Or alternatively, I could move them all to mpconfigboard.mk like MCU_SUB_VARIANT so everything is in the same place. I haven't been putting in defaults because I've been basing basically everything off the peripherals pins.h file, which doesn't use a default:
#ifdef NRF52840
#include "nrf52840/pins.h"
#endif
they leak below 20khz and we cant effectively filter them, you really want the PWM freq to be 2MHz (100x highest freq)
You just need move this so it's in alphabetical order. That should fix the checks failure.
Try git fetch from upstream (adafruit/circuitpython), then git merge, then do a make translate and push agian.
OK, I will add a 'changes requested' review to hold off on this until the .py script is fixed.
Let's hold off until this is fixed:
@sommersoft sys:
I'm pretty confident that its only related to the use of CIRCUITPY_MINIMAL_BUILD. The minimal build logic was added after docs/shared_bindings_matrix.py was written, so it just doesn't handle it.
Also, do you mean that you want me to #undef BOARD_OVERWRITE_SWD so I can redefine it? I've never seen that syntax in Circuitpython before.
Just wanted to comment on the arduino code side because it was not clear to me before I looked at your source code if your change would also affect my arduino code (thought the code was factorized), looking at your code though, it seems cleaner that the current samd arduino code as I think you use the bits structure as opposed to bit masks operations BTW.
Please do open an issue or PR on https://github.com/adafruit/ArduinoCore-samd/ if you think there's something to be done, since we don't share code with that repo.
@jepler do you feel this is ready for a first merge? I think it just needs a make translate and push to build successfully.
@dhalbert do you think it'd be worth it for me to address #2458 as a part of this? Just do it all in one go?
@hierophect I think so, if you can get it to work, since then the doc will be correct from the start.
Our practice has been to omit the space after the ,. It's allowed but spaces are significant in ways that aren't expected, e.g.
FOO = 12
ifeq ($(FOO), 12 )
$(error true)
else
$(error false)
endif
prints false because of the space after the 12
ifeq ($(FOO),12)
# is same as
ifeq ($(FOO), 12)
# is not same as
ifeq ($(FOO),12 )
One trivial style thing, but I realize now there are still some things under discussion.
Hmmm. This seems fine for now, but in the future it might be reasonable to group both of these under a generic "F40xxx" signifier like ST does, since they're so similar - the two MCUs actually share a datasheet, and the F407 is essentially just a footnote to include a couple extra peripherals on the F405.
Though I guess then they'd be easy to mix up with the F401, which I guess ST just kind of ignored with that naming scheme?
not sure if I won or lost the CLUE lottery but I got a black one when I was hoping for a green one. If anyone wanted black and got green, I'd be happy to trade
@slender iron quick PR report: core temp should be ready now, F407 is ready for your re-review, and I have a question on your espruino wifi request.
@ionic elk thanks for the update. I'm a bit behind on everything since I was at pycascades all weekend. Will get to everything by the end of today. I have meetings this morning
@slender iron np take your time! just mentioning it since you said it was good to ping you
yup, thanks!
Thanks! done.
Also suggested a fix for it that does not alter accidentally other user config bits (basically using the bit datat structure in the union)
@dhalbert can you comment on the 192KB and 256KB builds you suggested here? What's the best way of selecting what items fit into each one? Would I need to actually test per build to figure that out, or is some of that work done already?
<@&356864093652516868> Here's the notes doc for the Weekly meeting in under an hour. Please add your status updates and hug reports even if you're attending. Thanks! https://docs.google.com/document/d/1CTN9esAIa35AYV7EVIBUsa9nZsf_vzcJTJIvZqtiPgc/edit
@v923z A philosophical difference between micropython and circuitpython is, how much like standard python and well known python packages should the product strive to be. Circuitpython has made a lot of decisions to be more like python. Our default is to try to make our reimplementations of standard Python features be subsets of the "standards". We think that this is helpful, because it removes friction when going between circuitpython and desktop python. Another adafruit software product is...