#circuitpython-dev

1 messages ยท Page 261 of 1

slender iron
#

they want tagged versions so thinks are hermetic

tulip sleet
#

do they recommend that you tag the action in the .yml?

#

i think that's what you just said

slender iron
#

ya

manic glacierBOT
ionic elk
#

@slender iron Would you like me to store which stm32 pins are 5V tolerant in the pin table?

slender iron
#

@ionic elk I wouldn't bother. I'd suggest starting with just the info you need

#

otherwise you are using up flash space for data you'll never use

ionic elk
#

@slender iron On that note - since STM32 has all the communication devices separately, rather than in sercom units, it'd save some space if I made a new object to store the peripherals and their possible pins separately, and then had macros to whether pins exist in the peripheral object, rather than a bunch of empty slots per pin. I think that'd be more intuitive for how the pins are assigned, and it'd save kbs of space (though I guess we're less worried about that for the STM32s).

#

Do you think that'd be viable?

#

Doesn't have to happen now, just looking at all these UART1_CTS, SPI3_MOSI etc scattered everywhere and thinking it'd be nice to just have them in one condensed table.

slender iron
#

looks at a datasheet

#

ya, I think it's fine to factor that info out as long as it looks the same from the API perspective

dull kestrel
#

I'm having an issue with using evals. Do they work in CircuitPython?

tulip sleet
#

@dull kestrel they should, but we don't use them in general

#

@ionic elk could you suggest a due date for the new PR. this is an estimate not a sweating deadline

ionic elk
#

Analogio?

dull kestrel
#

@tulip sleet I imagine its similar to how they're used in JS. The issue is, in my current setup, I need them I think, but I tried asking over in #help-with-circuitpython and no dice

tulip sleet
#

@dull kestrel I thought you meant the eval() function, which should just work, as it does in "regular" Python

#

@ionic elk the pin table task

ionic elk
#

Probably by tomorrow but I think it'll evolve a lot with analogio and busio

tulip sleet
ionic elk
#

Analogio can function with just a per-pin definition, but busio I think is going to need a separate peripheral sorting table.

tulip sleet
#

yah, that's fine, if you rough it out and do an initial PR we can kibitz on the design, maybe just add analogio and i2c or something like that

pastel panther
#

hey <@&356864093652516868> does anyone have an issue with adding kwargs for shift and lsb_value to UnaryStruct in Adafruit_CircuitPython_Register?

slender iron
#

not me ๐Ÿ™‚

ionic elk
#

STM32 pin assignments are annoying. They skip lots of peripheral numbers, (like having only UART1, 2 and 6), the same exact pin may or may not have multiple copies across pins (SPI1_MOSI/etc all have two pin options, most others don't), and the peripherals can and frequently do exist on the same pins as others of their category (lots of SPI2/SPI3 pins are shared).

tulip sleet
#

it sounds even more irregular than SAMD

ionic elk
#

Bigly

turbid radish
#

๐Ÿ˜‚

main meteor
#

I saw one CPU that was fully flexible, any pin (aside from the power pins) could be assigned to any function.

ionic elk
#

nrfs are like that

tulip sleet
#

yes, they're either dedicated or any pin (but there's the dreaded "use this pin only for low speed I/O or else you'll add noise to the radio reception"

ionic elk
#

So anyway I'm thinking the peripherals go in their own table. Otherwise I'm going to either have a bajillion empty slots per pin, or skip options for pin selection that ought to be available.

main meteor
#

Oh, good point: it would be good to have a compact, but fully generalized method of pin description, but I can't think of one!

tulip sleet
#

@ionic elk why don't you do enough for analogio pins, and PR that, and then implement AnalogIn. Yes, it sounds like it has to be mapped in reverse from what we did

#

there is only ADC, not DAC?

ionic elk
#

Well, probably only for the communication peripherals. The ADC and timers should be ok to go in the regular way

#

So I can easily implement the ADC pins and timer pins and get Analogio out of the way, and then go back and make a separate comm peripheral table that'll be more space efficient.

tulip sleet
#

we had a long discussion before about pin numbers vs addresses, and whether to add a level of indirection for that. Is that a little moot due to using LL?

ionic elk
#

I'm probably going to go ahead and add the indirection. My indecision about that was just some C confusion on where to add the helpers so they apply everywhere I need them.

tulip sleet
#

i think that would be more straightforward in the long run

ionic elk
#

But I think a single macro that just does an address shift for these GPIO banks should do the trick in the pins.c

tulip sleet
#

"by friday", did you mean tomw or next friday

ionic elk
#

Really the issue is that the STM32 hal doesn't acknowledge "pin numbers" or "pin names" at all, so a lot of the existing stuff you and Scott use has to be rewritten.

tulip sleet
#

it acknowledges them in the #defines but not in the code?

ionic elk
#

It has no defines of the "#define PIN_PA4" variety at all.

#

It uses exclusively GPIO ports and masks

tulip sleet
#

can you assign a periph function to more than one pin?

ionic elk
#

So the hal would use "I2C2_GPIO_PORT" and "I2C2_GPIO_PIN" as a pair for all the I2C2 dealings, for instance.

#

Yes, sometimes, sorta

tulip sleet
#

wow

#

and that reflects the hw registers? I should read the datasheet but not before eating

ionic elk
#

If you're referring to the define pairs, yes, the first is a pointer to the GPIO port location, and the second is a 8 bit mask of that port.

#

Anyway, I'll probably have analogio in by monday

tulip sleet
#

i'll add the due dates but you can change them as necessary

idle owl
#

Never read datasheets hungry.

manic glacierBOT
slender iron
#

thanks for the merge @gilded cradle ! Now I can release and then bundle

gilded cradle
#

Of course. Thanks for making the changes.

slender iron
#

np, it makes the examples clearer

gilded cradle
#

Yeah

idle owl
#

@slender iron Would you rather have issues filed on GitHub that turn out not to be issues and you need to close them, or would you rather people mention it here on Discord first and then we tell them to file an issue? Trying to decide how to word an alert in the guide regarding 5.x being currently in alpha.

slender iron
#

good question. I don't mind 1 but 2 is a good way to direct them to a better place to get help

idle owl
#

Yeah, kind of where I was at with it too. I'll direct them here I guess and if Limor wants it changed, change it up then. The alert won't be there forever anyway, it's temporary.

slender iron
#

kk

idle owl
#

I'll put Discord first, and then link the CP issues anyway

lapis charm
#

I've seen #1629, saying porting the esp32 is a big task, challenge accepted.

#

I've start and run into a few compile issues I couldn't figured out

#
machine_pin.c: In function 'mp_pin_make_new':
machine_pin.c:176:30: error: passing argument 2 of 'mp_arg_check_num' makes pointer from integer without a cast [-Werror=int-conversion]
     mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
                              ^
In file included from machine_pin.c:34:0:
../../py/runtime.h:80:6: note: expected 'mp_map_t * {aka struct _mp_map_t *}' but argument is of type 'size_t {aka unsigned int}'
 void mp_arg_check_num(size_t n_args, mp_map_t *kw_args, size_t n_args_min, size_t n_args_max, bool takes_kw);
      ^
machine_pin.c: In function 'machine_pin_call':
machine_pin.c:200:30: error: passing argument 2 of 'mp_arg_check_num' makes pointer from integer without a cast [-Werror=int-conversion]
     mp_arg_check_num(n_args, n_kw, 0, 1, false);
                              ^
In file included from machine_pin.c:34:0:
../../py/runtime.h:80:6: note: expected 'mp_map_t * {aka struct _mp_map_t *}' but argument is of type 'size_t {aka unsigned int}'
 void mp_arg_check_num(size_t n_args, mp_map_t *kw_args, size_t n_args_min, size_t n_args_max, bool takes_kw);
      ^
machine_pin.c: At top level:
machine_pin.c:333:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .make_new = mp_pin_make_new,
                 ^
machine_pin.c:333:17: note: (near initialization for 'machine_pin_type.make_new')
machine_pin.c:414:13: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .call = machine_pin_irq_call,
             ^
machine_pin.c:414:13: note: (near initialization for 'machine_pin_irq_type.call')
cc1: all warnings being treated as errors
../../py/mkrules.mk:55: recipe for target 'build/machine_pin.o' failed
#

I've looked over at the esp8266 port, and this code looks identical around those two functions

exotic pumice
#

Looks like some gcc update nonsense

#

Neither 8266 or 32 are supported anymore

lapis charm
#

yeah now I've seen the message when trying to compile esp8266

#

"CircuitPython 4.0.0 and later do not support esp8266 boards."

timber mango
#

Question: What libraries should I be using to test 5.0.0 alpha2? Using the latest bundle on a pyportal I still see a call to refresh_soon(), which fails the initial call to setup the Pyportal (i.e. "pyportal = PyPortal(default_bg=BLACK)" ) SHould I open an issue on this?

exotic pumice
#

@idle owl re: pointing ppl to discord over issues -- maybe put something in the issue template?

idle owl
#

@exotic pumice We've avoided issue templates because they often result in issues containing only the template and no new information. We're quick to point people to Discord where it makes sense, so we've made it very visible.

exotic pumice
#

Oh ok

#

I thought I remembered you guys having one

crimson ferry
#

re: @timber mango 's question... There's probably a plan already, but maybe one issue (perhaps with a checklist like featherwings had) to handle the bunch of libraries, examples, guides, etc. that need their displayio updated to the refresh() model? (Dave, for now I believe you have to download the .py of the library and remove any calls to wait_for_frame() or refresh_soon() ).

timber mango
#

ok, will do. Thanks

crimson ferry
lapis charm
#

@exotic pumice a question, wouldn't be clearer to remove esp32 and esp8266 directories, if it's not supported anymore ?

exotic pumice
#

Probably, not my call

idle owl
#

Pro tip: when your code is being ignored, and you know it works, maybe check that you didn't somehow add a space to the beginning of the name code.py. ๐Ÿคฆ

#

@lapis charm Having the directories available makes it easier when merging from upstream. We merge from upstream MicroPython when it makes sense, and having the same directory structure keeps it simpler.

lapis charm
#

@idle owl ooh, those upstream merges must be painful anyhow, I can see how this can elevate some of the pain.

idle owl
#

Quite.

lapis charm
#

that's a shame, I wanted to take circutpython for a ride after hearing more about it in test&code pod cast

#

but I only have esp32 / esp8266 / pyboard v1

exotic pumice
#

You could get an ItsyBitsy m4 or something. Pretty cheap

#

Cheaper than an arduino uno and 1000x the power lol

#

esp architecture is pretty whack

lapis charm
#

anyhow, that's for the help. have a good day/night

manic glacierBOT
slender iron
#

@lapis charm we're pretty close to supporting the very basics of the pyboard

#

@idle owl do we need the debug_bus_device and debug_i2c repos? they are empty

idle owl
#

@slender iron Yeah, they are still in the works, but aren't a priority so Limor had me waiting on them. They will eventually be a thing.

slender iron
#

kk

#

I'm running through library infra issues

idle owl
#

Right on. Thanks!

slender iron
#

np, addin einks

idle owl
#

@slender iron Any reason why analogio wouldn't work the same on nRF? The potentiometer example isn't working on Bluefruit. Works on CPX with the same hardware.

slender iron
#

may not be implemented

#

temp and light sensors work?

idle owl
#

It's running, but it's acting like nothing is connected. It's returning the same thing as if it's simply floating.

#

Not sure, will check now

#

Light sensor appears to work.

#

Temp sensor uses thermistor?

#

Hold on.

#

Yes, light and temp sensors work.

slender iron
#

hrm, weird

idle owl
#

Tried on multiple pins.

slender iron
#

may be the pin it's connected to

#

hrm

#

ยฏ_(ใƒ„)_/ยฏ

idle owl
#

A1 and A2. I can try the rest.

#

Ok

#

A0 doesn't exist, so that obviously doesn't work.

onyx hinge
#

I'm not home now but I might be able to try it on a cpb in an hour or so

idle owl
#

@onyx hinge That would be great. I have two here, I'll try it on the other one.

#

I might not be around, but please let me know what you find.

onyx hinge
#

I'll report here

idle owl
#

Same results with both.

tidal kiln
#

@idle owl seems to be working for me? just testing analog in on a CPB?

Adafruit CircuitPython 5.0.0-alpha.2 on 2019-09-04; Adafruit Circuit Playground Bluefruit with nRF52840
>>> import board
>>> from analogio import AnalogIn
>>> pot = AnalogIn(board.A2)
>>> pot.value
96
>>> pot.value
20096
>>> pot.value
29920
>>> pot.value
44544
>>> pot.value
54112
>>> 
idle owl
#

@tidal kiln Yeah... I tried on two separate boards. The potentiometer works on a CPX fine...

tidal kiln
#

weird. do you have an early board rev?

idle owl
#

Got it in the first batch from the store.

tidal kiln
#

same here

idle owl
#

Then unlikely to be a different rev.

#

Ugh.

#

The potentiometer is soldered to alligator clips. There's so little to it, why would it work on a CPX if it wasn't going to work on a CPB, and why the same results on two different boards. Does analog work differently on the nRF and for some reason would render this potentiometer useless? I'm confused.

#

I need to head out for the night.

#

I'll pick it up again tomorrow. Thanks for testing, @tidal kiln

tidal kiln
#

ok. np. gotta be something simple.

#

yah, all seem working for me, tested A1..A6, all good

idle owl
#

@onyx hinge FYI ^^ worked for @tidal kiln. So it might be a me problem. Please test it anyway and report back what you find. Thanks!

onyx hinge
#

I'm seeing 0 or a value close to it when I connect A2 to GND, and 60000 or a value close to it when I connect A2 to 3.3V

#

and seeing intermediate values with a potentiometer

#

so in that configuration, I connected the outer legs of the pot to GND and 3.3V, and the middle leg to A2

#

I ran a manually typed in program like cater did fwiw @idle owl

manic glacierBOT
manic glacierBOT
plucky flint
#

morning

manic glacierBOT
#

Building the current master yields this warning for stm32f412zg_discovery.
Is something missing in the bsp?


Build stm32f412zg_discovery for en_US took 29.02s and succeeded
make: Entering directory '/home/jerryneedell/circuitpython_master/ports/stm32f4'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
GEN build-stm32f412zg_discovery/genhdr/moduledefs.h
QSTR updated
../../supervisor/stub/internal_flash.c:52:16: warning: 'conver...
manic glacierBOT
old smelt
#

Piggybacking on (@crimson ferry and @timber mango)'s thread regarding displayio and 5.0.0-alpha, I am seeing the "wait_for_frame()" error. @crimson ferry , you recommended grabbing the .py library and removing the calls, but isn't displayio a core module? How can I do that? Thanks!

crimson ferry
#

Those calls appear in some bundle libraries like PyPortal, PyBadger, etc (and if people have grabbed examples from the libraries or Learn guides).

old smelt
#

I see.

#

A-HA! Perhaps I should read the stack trace more closely.

#

Right there in adafruit_pyportal.py. I am back up and running. Ugh. I'll be more diligent next time. ๐Ÿ™‚ Thanks!

crimson ferry
#

grep of Library Bundle shows those two calls (wait_for_frame, refresh_soon) used in:

pyportal (drivers and helpers)
miniqr/examples/
turtle (drivers and helpers)
display-text/examples/ (drivers and helpers)
pybadger
pyoa (drivers and helpers)
slideshow
``` issue submitted
old smelt
#

Yes, I commented the wait_for_frame() calls out. Interestingly, it's not choking on the refresh_soon() calls.

crimson ferry
trail pike
#

Hello. ๐Ÿ‘‹

old smelt
#

@crimson ferry - Looks like it is not executing those calls. The only call to wait_for_refresh() I had to comment out was in the play_file() function. There's no refresh_soon() call in there.

manic glacierBOT
solar whale
#

@tulip sleet the reason I posted the stm32 waring issue was that it only appeared for that one BSP -- did that make sense to you?

#

is that build the only one that uses that file?

manic glacierBOT
#

OK, seems fine. I'm not sure why the build isn't throwing an error on the warning. It's worth doing -Werror in the makefiles for stm32f4: we do that for the other ports, because a warning indicates a possible problem, and ignoring them on builds can miss errors. If we need to turn off a bogus warning, we do (for example):

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
// code giving a warning
#pragma GCC diagnostic pop
tulip sleet
#

@solar whale makes sense, and I think it's good to fix - tnx!

plucky flint
#

@trail pike hey hey... fancy seeing you in here. ๐Ÿ™‚ How're things..?

trail pike
#

@plucky flint g'day! Things are good. Reading circuitpython.

plucky flint
#

Nice... are you doing PyWeek?

#

@trail pike BTW it was the ldnpydojo 10th birthday last night.

trail pike
#

Are you? (hoping to! Let's see if the freelance gods line up to let me have time off)

plucky flint
#

We hacked together a bunch of Instagram like filters using pillow and numpy in Jupyter notebooks. ๐Ÿ˜‰

trail pike
#

Sweet ๐Ÿ™‚

plucky flint
#

I was trying to get OpenCV to identify eyes in faces so I could automatically stick on googly eyes. ๐Ÿ™‚

#

We used our current PM as the test subject in the photo. Which was pretty hilarious.

trail pike
#

ldnpydojo is something special. Haven't found a group quite like it.

plucky flint
#

Yeah... we had about an hour of reminiscences before we actually got to coding. Lots of really cool stories, memories and some emotional moments too.

trail pike
#

Drifting on topic a little bit... is there a doc which answers the question (or part of)... "How is circuitpython tested?"

plucky flint
#

I'll be doing PyWeek - I want to use it as an excuse to make a game with my goofy hack on PyperCard. I'm thinking of making a Myst clone (originally created in HyperCard FWIW) called "Missed". ๐Ÿ˜‰

#

@trail pike CircuitPython is a friendly fork of MicroPython. There are docs on micropython.org for devs which contain details of how it's tested.

trail pike
#

Oh... a myst clone would be grand.

plucky flint
#

As for CircuitPython specific stuff I'm less clear (at the moment), but the folks here will be able to point you in the right direction

trail pike
#

Does PyperCard have a zen mode? I really liked the black&white look.

plucky flint
#

...and then I got a bit carried away making something similar for desktop and mobile (it's a simple shim around Kivy)

#

Ideal for beginner programmers.

#

Anyway...

trail pike
#

Coolest hack. I remember you mentioning you were going to make it at EP.

plucky flint
#

Yeah... well I need to get the docs finished for next Friday, I'm trying it out on a class of young coders in an evening class. Let chaos reign. (Actually it'll be really useful to see the bumps in the road, get feedback and check the hunch about such a simple model for UI work is easy to both teach and learn).

trail pike
#

Did you consider removing some capital letters?

plucky flint
#

Capital letters..?

trail pike
#

Ah, there's not that many Capital letters in there, because mostly it's done through json and python classes are avoided?

plucky flint
#

OK... I've lost context. Capital letters where?

trail pike
#

(because, I think python made the mistake of using Capital letters as is done in Dutch for nouns, so many sentences have lots of Capital letters in there if classes are used)

plucky flint
#

Ahh

trail pike
#

But also typing capital letters is harder.

plucky flint
#

But capitalisation makes reading easier. There's some sort of karma going on there... ๐Ÿ˜‰

slender iron
#

@trail pike we keep the micropython unit tests going but the hardware apis are only tested by hand

#

I was just on the Test and Code podcast and we talked about it there a bit: https://testandcode.com/84

trail pike
#

@slender iron interesting. Thanks ๐Ÿ™‚

idle owl
#

@tidal kiln @onyx hinge I'm at a loss here. It worked for both of you. I have two boards exhibiting the same behavior. I eliminated the potentiometer and jumpered A1 to 3.3v. It acts like it's grounded, returning 0.01ish or 500 depending on whether I'm using the helper function or the raw value. If I ground it, no change. If I connect it to VOUT, it returns 2.2V or 44k. I tried it on a different laptop with a different USB cable. I've tried both with code.py and the REPL.

#

You're both also using board from the same batch as far as I know.

#

Ok, I just tested it on A2-A6, and it works.

#

Are you sure it worked on A1 for you?

onyx hinge
#

I think I tried A2, but let me scroll back....

idle owl
#

A7 says it doesn't even have that capability.

#

As does the Audio (previously A0) pin.

onyx hinge
#

you can see from my photo last night that I used A2

#

I think it's what @tidal kiln used too

idle owl
#

@tidal kiln Said he tested A1-A6.

#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

#

It's got to be something with A1.

#

I'll ask Limor.

onyx hinge
#

is there a pdf or png schematic? which pin is for SDA/SCL?

idle owl
#

A4/A5

#

Are SCL/SDA respectively

onyx hinge
#

okay so it's nothing to do with i2c pull ups

idle owl
#

The schematic is in the guide but the guide isn't done yet.

onyx hinge
#

on the schematic I only see the connection to the microcontroller and the pull down resistor

idle owl
#

I was going to check but figured it was going to be too complicated for me to grok

#

I'll trust your take on it

#

Conclusion: it doesn't imply anything is weird

onyx hinge
#

Yeah

idle owl
#

So either there's an issue with these boards I have which is possible, or A1 is weird.

onyx hinge
#

what I did was, open it up in eagle, go to the scmehatic, and in the commandline type "show a1"

#

all the wires and pads on A1 get highlighted

idle owl
#

I've never used the command line in Eagle. I should probably look into that.

#

I usually click "info" and then click the thing I want to see

#

GUI TOWN.

onyx hinge
#

like all commandlines it can make SOME things a ton faster

#

I won't be home until later this evening, but if I haven't updated you with findings about A1 on my device, please ping me about it

idle owl
#

I will

#

Thanks

plucky flint
#

OK folks... I'm stepping AFK for the weekend. Thankyou for your help and advice about circup this week. ๐Ÿ‘‹

idle owl
#

@plucky flint Have a lovely weekend! I'll try to take a look at it soon and give some feedback.

onyx hinge
#

also confirming from the schematic it looks like the "TX" pin is maybe not digital capable -- it's called "D1/TX" as a net name

idle owl
#

@onyx hinge Yeah, I noticed the silk doesn't say A7. Need to verify that with Limor and change the guide because I copied most of it from CPX.

plucky flint
#

@idle owl ๐Ÿ‘

ionic elk
#

Bit of a noobie question here but is using binary constants via gcc frowned upon? Doing a lot of mask work so it sure seems like they'd be nice for visualization.

#

I've used them occasionally in personal projects where I wasn't worried about portability, but it sounds like they could cause damage in larger projects.

orchid basinBOT
idle owl
#

@tidal kiln A1 doesn't work right. The pin assignments are wrong. Dan and Bryan both had the same results I did.

#

@onyx hinge ^^

ionic elk
#

@tulip sleet that werror hotfix has passed CI by the way

onyx hinge
#

@ionic elk You mean writing numbers like 0b10110 ? As far as I understand it, these are not a part of the any C standard. However, in practice, CircuitPython is only buildable with gcc. It looks like there are already a few uses of this extension, see PixelBuf.h

#

@slender iron might have a preference to avoid it though .. comments?

ionic elk
#

@onyx hinge good to know. I'll check out the PixelBuf. Don't have any current urgent use for it but it'd be nice to know the precedent.

tidal kiln
#

@idle owl sry. i'm afk for the most part today. got a sec right now though. let me double check it's working for me...

idle owl
#

@tidal kiln No worries. There's nothing to try. We found the issue. Testing the update right now.

#

A1 and A5 were assigned to the same thing, A1 wasn't useful for anything as it was.

tidal kiln
#

ok. yah. i'm seeing that too. A1 is wonky.

#

tested real quick the other day...must have thought the changes were real.

#

and this makes sense then...

>>> pot = AnalogIn(board.A5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: A1 in use
#

sry for the mis-info. glad it's been found at least.

idle owl
#

Thanks for checking again.

manic glacierBOT
pastel panther
#

@slender iron where can I find docs for using a ssd1305/6 oled with 5.0?

pastel panther
#

I should say "with i2c"

tulip sleet
#

@ionic elk I'll merge #2123 after the latest PR finishes. We are running into the problem that check runs can have their commits disappear out from under them if there's another merge while they're running. Did you see that further back here.

slender iron
#

@onyx hinge @ionic elk I'm fine with binary constants and am ok

#

assuming gcc

ionic elk
#

@tulip sleet that's right we ran into that yesterday.

pastel panther
#

@slender iron thanks; looks like this particular display needs a different setup as it's lighting up a few random pixels but not displaying text that is printd

#

Had a similar thing on arduino so I'm pretty sure it's not CP

slender iron
#

which display is it?

pastel panther
#

I take it back

#

it's the large oled bonnet

#

I think my "hello world" scrolled off the screen when the script ended

slender iron
#

which display module is it?

pastel panther
#

The default text is just a bit big for the display

slender iron
#

kk

#

ssd1305 is the controller ic. usually the display has its own datasheet to describe how it's all hooked up

pastel panther
#

there are a few rebellious pixels on the right side that I'll have to figure out how to address

#

oh right, sorry

#

๐Ÿ‘€

slender iron
#

the pixels are probably do to the width being wrong

pastel panther
#

I have it set to 128x32; do you think it's not working?

slender iron
#

try setting colstart to 4

pastel panther
#

that did it ๐Ÿ™‚

slender iron
#

the ram of the ssd1305 is 132x64

#

I wouldn't mind having a separate driver for the 1305 too

#

it'd make it easier to find

pastel panther
#

ya, that sounds good

ionic elk
#

Has external ram for circuitpython ever been considered? There's a couple of STM32 Discovery boards that include it.

tulip sleet
#

@ionic elk we would certainly consider it for chips that support it. Up to now there haven't been some. It would be for F7 and similar chips.

#

in a lot of cases those chips have minimal on-chip RAM so it's basically required

ionic elk
#

An F103 Bluepill with 2MB of ram ๐Ÿค” ๐Ÿค”

tulip sleet
#

can you execute from the external RAM?

ionic elk
#

That I'm not sure.

#

It just has a FSMC controller

#

I'm not sure it can extend directly off system RAM. Might be why micropython hasn't done it

tulip sleet
#

sounds like it would be OK, but I don't know how fast it is

#

ah, ok, it's serial, so it might be pretty slow to use as regular RAM

#

Some (not all) STM32's have FSMC mapped to an address space (at 0x60000000).

#

good for displays without their own ram

ionic elk
#

^yes that seems to be what it's primarily used for

#

I wonder, though, if there'd be some way to have it link into the core, given that CPy has to store everything in RAM

tulip sleet
#

_Note two serious problems with running from external SRAM:

It's going to be slow. Like 6...8 times slower than running from flash or even internal SRAM according to this. This microcontroller architecture simply isn't optimized for this kind of use.

Some STM32 chips have a silicon bug where FSMC access by two bus masters crashes the chip. This will basically preclude you from using DMA. This concerns STM32F103 revision Y IIRC, probably other chips too._

#

it is an interesting q about how much slower it would be to use as a destination for importing code, since a lot goes on after reading a bytecode

pastel panther
#

@tulip sleet I'm guessing I'm conflating two things, but doesn't samd51 support execution in place from qspi?

tulip sleet
#

yes, it's "XIP". We don't execute code from RAM very much if at all, though MicroPython has ways of including assembly code, so it's possible. But here I'm talking about import an .mpy into the FSMC memory, where it would be read as bytecodes to execute.

pastel panther
#

<-- attempting to take that as a learning opportunity rather than "I has the dumb".

#

I think I understand, mostly

#

thanks

#

@slender iron will you have time later to give me the high level of what would be needed for a displayio ssd1305 driver?

manic glacierBOT
#

Please swap the arg parsing here to mp_arg_parse_all. It will allow it to be a kwarg rather than positional only like this code. Here is an example: https://github.com/adafruit/circuitpython/blob/master/shared-bindings/busio/I2C.c#L66 This dither arg would be like frequency in the example. I'd do it as kwarg-only too so it's always dither=True rather than True on it's own.

Please also document it in the //| section above because it is used for our ReadTheDocs documentation.

slender iron
#

@pastel panther I'm headed out early for a party so the next hour or so is all I have

#

basically it's copy and rename ssd1306

pastel panther
#

@slender iron that's easy enough. I was thinking some more init tweaking needed to be done but I can figure it out

slender iron
#

ya, I usually get the init sequence for a datasheet flow chart or sample code

#

remember that things like colstart are not a property of the IC but rather how the IC is hooked to the display

pastel panther
#

ah, interesting. I did not know that.

#

I shall consult the 'duino driver and datasheet later tonight. thanks!

stuck elbow
#

@pastel panther the only thing you have to do is to reset, switch off, enable charge pump, and switch on

#

All the rest are just fine tuning and tweaks

pastel panther
#

@stuck elbow fair enough, but in my case it's the "fine tuning tweaks" that are the issue ๐Ÿ˜‰

stuck elbow
#

Why?

pastel panther
stuck elbow
#

Is that a reflection?

pastel panther
#

no

stuck elbow
#

I didn't know those displays had grayscale

pastel panther
#

I'm not sure that's what's happening

#

when I saw something similar with the arduino driver, it was smearing "down"

stuck elbow
#

Too high contrast?

pastel panther
#

possibly, I'll have to dig more later. thanks

meager fog
#

@tidal kiln hihi

onyx hinge
#

@idle owl do you need any more info from me about the CPB analog in, or did you solve it?

idle owl
#

@onyx hinge We solved it! The board def was wrong. A1 and A5 were on the same thing.

tidal kiln
#

@meager fog ping

tidal kiln
#

@idle owl yeah! good test / good catch

meager fog
#

@tidal kiln ah i assigned it on basecamp

#

this person fixed the neotrelis but didnt do a PR

tidal kiln
#

ok. seeing it in basecamp. is there a related github issue?

meager fog
#

is not!

tidal kiln
#

where's the fix? not seeing any link?

meager fog
#

one sec

#

thought there was

tidal kiln
#

k. looking....

#

ah. ok. PR that. got it.

crimson ferry
#

In one of the SSD1675 examples, epd_reset (D5) and epd_busy (D6) are used, but not in the other. But aren't those EPD pins really for SRAM and SD on the FeatherWings?

meager fog
#

@ionic elk ihii

#

i just got a discovery '412 ๐Ÿ™‚

#

tell me what to do and ill test! do i upload with st-link?

#

exciting

ionic elk
#

D: discovery doesn't have USB yet

#

But it's OK! you can still REPL

meager fog
#

ok how do connect to te repl

#

yah

#

how do i upload the binary

ionic elk
#

You actually won't need st-link at all

#

it's mbed compatible so you just drag it on in there

meager fog
#

the bin file from s3?

ionic elk
#

Is s3 a release? behind on lingo

meager fog
#

thats where merged code gets uploaded to after CI is odne testing

ionic elk
#

I think that should work. There's a chance that it might have been broken by Dan's HID update, I didn't have the chance to fully test that out. But it should work with the defaults.

meager fog
#

ok please give me known working code then

#

so i dont have multiple variables

ionic elk
#

Let's see

#

Actually sorry I'm an idiot, dan's stuff won't affect it anyway.

meager fog
#

ok so then what ๐Ÿ™‚

ionic elk
#

Sorry, double checking things, it's been a little while since I got to work on it.

#

Ok. For now, compile the board using USB=FALSE. Then, you can use the built-in UART available on the CDC line to the st-link.

#

You should be able to view that with a standard terminal. I'd just ignore the "user USB" until Thach and I get a chance to hack at that again.

meager fog
#

please give me compiled known-workin' binary

#

so im just testing the board

ionic elk
#

Sure.

meager fog
#

๐Ÿ‘

ionic elk
#

Note: there's a buffer bug that deletes every 10th character when copy-pasting into the repl, and can even crash in extreme cases. It won't bother you if you just type. Wasn't a very high priority fix since the whole system gets replaced by USB later anyway.

#

@meager fog just let me know if you have any issues and I'll check it out.

meager fog
#

@ionic elk ok burning!

#

when i drag over the bin it doesnt reboot

#

is that normal?

#

looks like red, orange, green leds are lit

#

how do i get to the repl

#

thru the stlink USB?

ionic elk
#

Yes, there should be a CDC line with the UART interface

#

Not sure what terminal you use - it's tty.usbmodem1411203 for me

meager fog
#

ok yes!

#

yah its COM

ionic elk
#

HOORAY

meager fog
#

are the 'duinoy headers like D12 in board?

ionic elk
#

Yes

#

Should all be the same

meager fog
#

ok great, whats keeping USB from working?

ionic elk
#

We're not sure - I was running into kind of obscure register differences between the F412+ and the ones under it.

meager fog
#

tinyusb demos work fine though?

#

what is 'ones' you are referencing?

ionic elk
#

F405, F411

#

F405 isn't really under, that's in a different classification.

meager fog
#

ok so to be specific, F412 does not work for USB at all even with tinyUSB

ionic elk
#

yes

meager fog
#

F405 and F411 do work with tinyUSB

ionic elk
#

I haven't gotten the F405 BSP in yet but it shouldn't be a problem, and the F411 is done, yes

meager fog
#

for f411, you have the circuitpy build and USB enumerates and you get USB repl?

ionic elk
#

Thach needed to make a new BSP for the F411 before that one worked as well.

#

F411 has full CDC and MSC flash support - it'd have HID too, but the F411 doesn't have enough endpoints for it

meager fog
#

ahh ok

#

fascinaing you cant program the F411 firmware in and have it 'just work'

#

odd but ok

#

is there an issue for the F412 tinyusb failure?

ionic elk
#

Yeah it's a pain! As are... many things with ST

#

I'm not sure we've made one I could throw one up there. But I think Thach was planning on wrapping that up pretty soon.

meager fog
#

please make an issue

#

and you can assign thach

ionic elk
#

Will do.

meager fog
#

?

#

please add a note it doesnt work at this time ๐Ÿ™‚

ionic elk
#

Where would you like the note? Github, comments, documentation?

meager fog
#

@ionic elk now that i htink of it, it should be an issue in circuitpython and link to that tinyusb

#

so you get a notice when thach closes it

#

and then you can re-try

#

ook good news i have a low cost stm32f411 dev board

meager fog
#

theres no bootloader for the stm32f411 i have, can i prog the bin with stlink? what address does the bin go to, 0x0?

#

@ionic elk ^ if ya know lemme know

manic glacierBOT
ionic elk
meager fog
#

@ionic elk all good we stock 'em

#

i use them a bunch ๐Ÿ™‚

#

btw there's adalink if youhaven't seen it yet

#

makes it ez

ionic elk
#

Gotcha - to be clear the board still has an stlink on it, you just gotta use the command line since it doesn't have the mbed boot filesystem. Do you recommend most users to the official ST tool?

meager fog
#

st tool works great - i think its win only?

ionic elk
#

yeah

meager fog
#

yah adalink is python so great for automation

#

ill test the stm32f4 PR

#

good excuse ๐Ÿ™‚

ionic elk
#

I actually JUST found a new bug on it so it might be better to wait until tomorrow.

#

Somethings claiming pins incorrectly. Only happens for some of them though so I missed it at first.

#

Gotta head out for the night but I'll be back at it tomorrow.

meager fog
#

@ionic elk ill just try it for the sake of tryin

pastel panther
#

@gilded cradle do you know if having two Displays works? like one on SPI and one on I2C?

gilded cradle
#

I'm assuming you mean in CP and I'm not sure. I haven't really touched the I2C displays, but theoretically yes since you can do it in arduino.

pastel panther
#

ok, thanks

onyx hinge
#

I gotta learn how to upload a fresh .elf file from within gdb, resetting my session because I have to exit gdb, stop the j-link gdb server, perform the flash, and then put everything back together .. is no good. Anyone have a recipe for commandline / terminal gdb? I'll read back after making breakfast, this is just a drive-by question.

onyx hinge
#

you mean I have to research it for myself ๐Ÿ˜‰

#

maybe it's just "load"? I'll try it next session.

exotic pumice
#

yeah it's just load

onyx hinge
#

nRF I2S.CONFIG.MCLK looks kinda-sorta like it's an integer clock divider .. but .. it isn't.

#

16MHz * (0x80000000 / 0x50000000) isn't 10.666667MHz (it's 10MHz), but programming 0x50000000 gives you 10.66667MHz anyway!

#

smh and taking a break

crimson ferry
#

Would it be a reasonable issue to add to imageload for support of True color BMPs? Or is there a better way than doing everything within a with open("/truecolor.bmp", "rb") as bitmap_file: construct? (I need it in memory and I don't think we have deepcopy)

onyx hinge
#

hm, I have my world clock and bit clock clocking like I would expect for a 44.1kHz, 8-bit stereo signal

#

but the supposed data out is not synchronized to them. It's just a square wave at close to 1MHz

#

also, when I cleared out the PSEL for that pin, the scope didn't change, so .. where's this 1MHz signal coming from? Not I2S I guess.

#

looks like maybe there's a bug where a soft reset can leave pins associated with PWM instances

#

and I guess maybe PWM takes precedence over I2S in whatever the output pin switch matrix does

#

alright, I'm just "DMA'ing" the same single sample over and over again, but when I change it via the debugger it changes on the scope so the next step of playing an actual sample should be pretty quick.

waxen loom
simple pulsar
manic glacierBOT
manic glacierBOT
craggy galleon
#

I have a CircuitPython / REPL question:

I am trying to read back the console through the USB COM port (COM2). This is not an issue. I just use pyserial on Windows and it reads back.

The bit I am struggling with is sending commands to the console. I think my issue is that I am sending encoded data to the console and it doesn't know what to do with them. Does anyone know how I can send text to the REPL / Console for the CircuitPython board over a serial-like connection?

Windows:

import serial

test = serial.Serial("COM2", baudrate=9600)

while True:
    test.write("\n".encode('utf-8'))
    status = test.read()
    print(status)

CircuitPython:

while True:
    data = input("Data: ")
    print(data)
craggy galleon
#

I cracked it! The REPL expects /n/r as the return character!

raven canopy
orchid basinBOT
onyx hinge
#

ugh that's not a sine wave! ๐Ÿ™‰

onyx hinge
#

okay, THAT is a nice pure tone

#

๐Ÿ‘‚

#

there is a little bit of scratchiness on top of it that I wish wasn't there, but I don't know what to expect of this i2s amp. I should test it on a samd part.

manic glacierBOT
onyx hinge
#

well that's the first time I lost progress with git in quite some time. My computer hard-locked very shortly after doing a WIP commit ๐Ÿ˜ฆ

#
error: object file .git/objects/7e/b3549cd8b21c9429dcc1e4a33bfc1b1707023a is empty
error: object file .git/objects/7e/b3549cd8b21c9429dcc1e4a33bfc1b1707023a is empty
fatal: loose object 7eb3549cd8b21c9429dcc1e4a33bfc1b1707023a (stored in .git/objects/7e/b3549cd8b21c9429dcc1e4a33bfc1b1707023a) is corrupt
#

git log, git reflog, etc all fail

gentle bronze
#

sorry for the wait, being a bit busy lately ๐Ÿ™‚

#

forgot to mention, you need to put jumper to JP3 (USB) on the board, it is left open by default.

onyx hinge
#

sigh, why am I stuttering when playing 22050Hz samples. Surely my code's not that inefficient.

main meteor
#

SD card delays?

onyx hinge
#

it's the QSPI (I assume) internal to the particle xenon

#

I would have also assumed it was plenty fast enough at this task

idle owl
#

<@&356864093652516868> Here is the notes doc for tomorrow's CircuitPython Weekly meeting at 2pmET/11amPT. Everyone is welcome! Please add your hug reports and status updates before the meeting, even if you'll be attending - it's super helpful! If you're missing the meeting and you'd like to include your updates, add them to the notes and we'll read them off. Hope to see you there! https://docs.google.com/document/d/12p4adKbmLf-2QIu2vdvnRw98MfD1jh-mLwq-OXcXxRY/edit?usp=sharing

simple pulsar
#

@onyx hinge re: "computer hard-locked" - are your hard disks/ssds healthy?

onyx hinge
#

@simple pulsar well, it seems to be mostly correlated with circuitpython hardfaulting and dmesg implicates USB

simple pulsar
#

Oh, unfortunate, is this on linux?

onyx hinge
#

"Sep 8 12:40:58 soba kernel: [80072.030802] RIP: 0010:usb_clear_halt+0x16/0xc0 [usbcore]"

#

yeah

simple pulsar
#

I'm thinking out loud here but it feels like the driver should be robust for any usb badness going on. Have you got the CIRCUITPY drive mounted?

onyx hinge
#

sometimes, and/or I'm using the serial console

simple pulsar
#

I've nothing useful to add here. I only asked about SSD/etc because I was surprised last year when my first one failed after reaching EOL. Not surprised that it failed just surprised by Windows (on a desktop) doing a wide range of bizarre things with no user notification of impending doom or first signs of doom. I thought in 2018 that might have been basic functionality.

onyx hinge
#

instead of actually characterizing the problem I just complain on chat ๐Ÿ™‚

#

smartctl data all looks OK

#

I do intend to replace the whole system later this year so if it is the HW so be it

#

and I appreciate you trying to make me be systematic about a problem I reported ๐Ÿ™‚

#

hm would an attached j-link affect performance if no breakpoints are being hit? I can't reproduce my choppy audio anymore ๐Ÿ˜•

#

I might have had a hardware watchpoint and certainly some breakpoints set "before"

manic glacierBOT
#

Testing performed: I used a Particle Xenon with a HDA1334 I2S DAC. I played a variety of mono 16-bit samples at 11025 and 22050Hz nominal bit rates. With this setup, all the 11025Hz samples sound good. I tested play, pause, and loop functionality.

During some runs with 22050Hz samples, there were glitches. However, these may have only occurred during runs where I had set breakpoints and watchpoints in gdb.

I also tested with a MAX98357A I2S amplifier. On this device, everything sou...

onyx hinge
#

how likely is it that doing "a lot" of read activity from CP (I2SOut) would "starve" the device so badly it couldn't USB-enumerate?

#

I'm seeing that when my code.py starts playing such a file, linux just can't enumerate it

#

just using a different (e.g., 22kHz mono instead of 44kHz stereo) file "fixes" this

tulip sleet
#

@onyx hinge we've encountered this kind of problem before: https://github.com/adafruit/circuitpython/pull/901 but this was on atmel-samd before tinyusb. nevertheless the usb irq prio may be an issue. I remember adjusting this myself as well, I think in a different situation.

onyx hinge
#
Run till exit from #0  audioio_wavefile_get_buffer (self=0x20008280, 
    single_channel=false, channel=<optimized out>, buffer=0x20008210, 
    buffer_length=buffer_length@entry=0x2003ff74)
    at ../../shared-module/audiocore/WaveFile.c:210
0x0005e4a8 in audiosample_get_buffer (sample_obj=<optimized out>, 
    single_channel=single_channel@entry=false, channel=channel@entry=0 '\000', 
    buffer=buffer@entry=0x20008210, buffer_length=buffer_length@entry=0x2003ff74)
    at ../../shared-module/audiocore/__init__.c:110
110            return audioio_wavefile_get_buffer(file, single_channel, channel, buffer, buffer_length);
Value returned is $8 = GET_BUFFER_MORE_DATA
(gdb) p *buffer_length
$9 = 0
``` hm now I am having a problem with audiosample_get_buffer returning 0 bytes at a time.
#

f_read from the wavefile returns 0 for some reason

#

oh it's another corrupted wav file

#
cp: error writing '/media/jepler/CIRCUITPY/stereo44.wav': No space left on device
onyx hinge
#

I think my problems were bad wave files mostly. What a pile of wasted time

onyx hinge
#

I bet for other audio outputs this was not a "fatal" error. Mine calls over and over again until a desired number of bytes are made available.

manic glacierBOT
#

When given a bad (truncated) wave file, audioio_wavefile_get_buffer can return GET_BUFFER_MORE_DATA but set buffer_length to 0.

Run till exit from #0  audioio_wavefile_get_buffer (self=0x20008280, 
    single_channel=false, channel=<optimized out>, buffer=0x20008210, 
    buffer_length=buffer_length@entry=0x2003ff74)
    at ../../shared-module/audiocore/WaveFile.c:210
0x0005e4a8 in audiosample_get_buffer (sample_obj=<optimized out>, 
    single_channel=single_channel@...
shy kiln
#

I'm considering buying an Arduino Nano 33 BLE (based on nRF52840 with a 9-axis IMU) - I want to experiment with sending IMU data via BLE. I would like to develop using circuitpython, but on circuitpython.org I see that the Nano 33 BLE is not a supported board. Is anyone working on providing support for it?

onyx hinge
#

@shy kiln good question -- I'm not familiar with the module. I don't see any signs that support for this module has been started. I suspect that someone familiar with circuitpython and uf2 bootloaders would be able to create support for the board, but there could always be unanticipated problems.

#

In the "good" case it would be less than 300 lines of code to write

#

based on the amount of code added in CircuitPython for the Particle Xenon

#

hmmm I think all the CircuitPython boards may have QSPI flash modules, reserving the full 1MB for CircuitPython code. checking..

tulip sleet
#

@shy kiln @onyx hinge all our boards do have flash. We have a build for PCA10059 which does not have external flash, so that could be adapted to the new board. Could also buy our board and a 9-DOF breakout

onyx hinge
#

@tulip sleet I was just checking that. What defines the amount of storage reserved for CIRCUITPYTHON in the PCA10059 board?

#

ah is it LD_FILE = boards/nrf52840_1M_256k.ld ?

tulip sleet
#

yes, I was just going to paste that path

onyx hinge
#

ugh somebody needs to make a board revision to move that silkscreen label CSAG. ๐Ÿ™ˆ

tulip sleet
#

I think the CSAG is lower deliberabtely to differentiate from the adjacent labels

#

or am i missing a joke?

onyx hinge
#

I'm just being a tiny bit OCD, I think it would be above the pin (like the other even pin labels) but that interfered with the pads of some resistor so it ended up moved where it was and offset

#

so yeah it's a non-issue

shy kiln
#

@onyx hinge @tulip sleet Thanks for your comments. I can see that using Feather nRF52840 Express plus 9-DOF breakout would be much simpler. On the other hand a smaller size/mass of hardware is advantageous to me, and the nano is already smaller than a feather even without adding the 9-DOF. I'll have a think about this.

tulip sleet
#

@shy kiln it's not too hard to make your own build, and you could submit a PR to us for the board (or that class of boards)

exotic pumice
#

I'm a tiny bit openocd

#

it's pretty bad at samd51 tho

shy kiln
#

@tulip sleet How would I submit a PR?

exotic pumice
tulip sleet
#

that's the guide I was looking for

#

tnx @exotic pumice

exotic pumice
#

yw

manic glacierBOT
shy kiln
#

@exotic pumice Thanks. I was thinking PR meant "product request" ๐Ÿ™‚

exotic pumice
#

lol

manic glacierBOT
manic glacierBOT
onyx hinge
#

'night all! It was a productive weekend.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Git submodules are always tied to a particular commit. To update them, sync CircuitPython and then change into the submodule directory. Once there, fetch origin and checkout the remote branch (origin/develop). Now move back to a CircuitPython folder to do a test build. git status should show "new commits" for the submodule. You may need to git add it for it to be in the next commit but I'm not positive on that. Then, commit it like any normal commit and push to a branch to PR.

manic glacierBOT
#

@ladyada it actually looks like this is general incompatibility with the .hex format. I just tried both methods with the .hex - the mbed disk doesn't respond to it at all (.bin files you drag in there don't ever appear as a file, they're redirected directly to the MCU), and st-flash does not result in successful enumeration or even set up the status LEDs.

I'm sorry I provided the .hex file, I mistakenly assumed ST would support it. It looks like it's required to use .bin only for both met...

manic glacierBOT
#

d87bfaf Add random dithering to ColorConverter - matthewnewberg
3ab6a23 Removed unused return value in displayio_colorc... - matthewnewberg
4604a69 Move dither parameter to ColorConverter constru... - matthewnewberg
b2fb5ac Fix comment on color converter - matthewnewberg
8e55232 Use kwargs for dither in ColorConverter constru... - matthewnewberg

cerulean sparrow
#

@slender iron , thanks for working with me with getting the PR.

slender iron
#

@cerulean sparrow happy to! I appreciate you sticking with me on it

cerulean sparrow
#

@slender iron No problem

plucky flint
#

@slender iron @idle owl @tulip sleet I'm going to have to miss this evening's meeting (I was hoping I'd be able to make it). My son has just informed me he needs taking to Tae Kwon Do. ๐Ÿ˜•

#

My Hug report is for @tulip sleet for his really helpful ideas last week while I was working on circup.

#

(in addition to a general TellyTubby like group hug)

#

๐Ÿ™‚

idle owl
#

@plucky flint Thanks for letting us know. We'll add your hugs to the notes!

plucky flint
#

Thank you! ๐Ÿ‘

pearl notch
#

Hi. Whatโ€™s the algorithm for finding the link to the current dayโ€™s meeting? (Scroll up hasnโ€™t always worked for me.) Iโ€™d settle for a link to todayโ€™s meeting.

plucky flint
#

-> dad taxi

idle owl
#

<@&356864093652516868> Here is the notes doc for today's CircuitPython Weekly. Everyone is welcome! Please add your hug reports and status updates before the meeting, even if you'll be attending - it's super helpful! If you're missing the meeting and you'd like to include your updates, add them to the notes and we'll read them off. https://docs.google.com/document/d/12p4adKbmLf-2QIu2vdvnRw98MfD1jh-mLwq-OXcXxRY/edit?usp=sharing

errant grail
#

In the studio today tracking and overdubbing, so I'll be lurking. Group hug!

onyx hinge
#

"(in addition to a general TellyTubby like group hug)" I may or may not return to this image whenever anybody says "group hug" from now on

#

status: trying to get some sort of lunch together before the meeting starts

idle owl
#

Meeting starting soon; we're finishing up another meeting.

sterile bronze
#

just lurking today

onyx hinge
#

[fx: pots and pans tumble uncontrolled from the counter]

timber mango
#

lurking

manic glacierBOT
meager fog
#

hi folks, text only just say'in hi ๐Ÿ™‚

gilded cradle
#

hi

pastel panther
#

@pearl notch The link used to be a pinned post but it looks like we've stopped doing it. For now you can search for posts that tag <@&356864093652516868>

#

wups

slender iron
#

๐Ÿ˜„

tidal kiln
#

lurking

pastel panther
manic glacierBOT
river quest
meager fog
#

@ionic elk heya im just...not able to get this workin'

river quest
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

hi folks, we wanted to make a super fast stm32 based feather and decided to go with the tried and true STM32F405 which is small enough to fit, and super speedy! hereโ€™s our first pass at a Feaโ€ฆ

#

wiringPi, wiringPi GPIO library โ€“ deprecatedโ€ฆ Lessons for the open-source community
https://blog.adafruit.com/2019/09/02/wiringpi-wiringpi-gpio-library-deprecated-lessons-for-the-open-source-community-drogon/

Adafruit Industries - Makers, hackers, artists, designers and engineers!

Gordon is no longer going to make public releases of wiringPi, hereโ€™s why (read the entire thing) and itโ€™s a good lesson for everyone in the open-source community โ€“ And those who&โ€ฆ

meager fog
#

@ionic elk whats weird is i totally get all the USB appearing when i use thach's tinyusb bin

ionic elk
#

Hmm maybe it's a submodule update issue?

meager fog
#

@ionic elk did you try the binary you posted on your board?

#

(the tinyusb test bin)

ionic elk
#

Yep, it's the same one that's working on my board right now

meager fog
#

and you're positive its the '412 discoboard not the '411?

ionic elk
#

I just downloaded the link I posted off of github and loaded it into the mbed, and I'm getting both the Cpy drive and CDC successfully

meager fog
#

:/

ionic elk
#

:\\

#

what a pain! what OS are you using?

meager fog
#

win10

#

two compys so far

#

no enumeration at all

ionic elk
#

Could you send a photo of your board setup?

#

I mean you're getting it working with tinyusb so that shouldn't be it

meager fog
#

yeah lemme grab my macbook

#

right

ionic elk
#

Oh, could you try it on the mac? Maybe it's somehow related to case sensitive stuff, somehow

meager fog
#

okyeah on mac it works

#

wt?

ionic elk
#

HMMM

#

I... honestly don't know what's up with that. Why would it affect a binary? @slender iron do you have any ideas?

slender iron
#

it enumerates on mac but not win10?

meager fog
#

yeah

#

the tinyusb demo build works fine on win10 - get cdc + msd

#

i could try rebooting my compy

#

i dont think that will affect it but ๐Ÿคท

pastel panther
#

@slender iron links plz

tulip sleet
#

i'll try this on my '412 board on Linux and another windows comp a little later

onyx hinge
pastel panther
#

thanks @stuck elbow ๐Ÿ™„

slender iron
#

@meager fog @ionic elk I'd start by looking at a beagle trace for it

ionic elk
#

I'll check that out after the meeting. otherwise it'll mess up my headphones -___-

slender iron
#

๐Ÿ‘‹ @inland tusk

stuck elbow
#

no mike

#

sorry

meager fog
#

@ionic elk do you have a windows computer to test against?

ionic elk
#

I do I'll need to set it up

slender iron
#

@pearl notch I can't edit the spreadsheet to add myself

meager fog
#

ok thats a good idea - i can give you a trace later if ya need

#

its got promise! at least it works on mac

#

you'll figure it out ๐Ÿ™‚

pearl notch
ionic elk
#

@meager fog can confirm does not work on my win10 machine

#

I'll run a trace once the meeting is over

pearl notch
#

Amazing! The directory appears to be filling out itself. ๐Ÿ™‚

onyx hinge
#

@pearl notch it is impressive to watch

onyx hinge
#

hug reports to the documentation

pastel panther
#

@pearl notch Looks like that was just an image if it was supposed to be a link to a video

pearl notch
pastel panther
#

@old smelt yes, DMX plz

#

also FPGA stuff โค

onyx hinge
#

I would love to talk FPGAs too

slender iron
#

@old smelt have you looked at migen at all? I'm hoping to get those folks building datasheets for shared SoC files that are easy to load

old smelt
#

Yes - a little bit.

slender iron
#

once we have that, we can port circuitpython to it like any other mcu

old smelt
#

Great interview on The Amp Hour podcast with Tim Ansell, Sean Cross and Michael Ossmann.

slender iron
#

totally

#

tinyfpga is on board for it too

old smelt
#

We've been historically Intel-focused, but I am intrigued by the open source activities

meager fog
#

@ionic elk good to hear you had the same non-enum! that means its not just me ๐Ÿ˜„

old smelt
#

...mostly on Lattice.

slender iron
#

๐Ÿ‘

#

ya, and xilinx 7 series is coming too

pearl notch
#

Canoe: awesome!

pastel panther
#

@solar whale whitewater? Touring? All of the above?

ionic elk
#

@meager fog AHA. I was restricting the usb endpoints to only CDC and MSC, since that's required on the F411. When I turned off that setting (enabling HID) I got full enumeration.

#

It seems like windows has some kind of required relationship between the CDC and HID, which isn't required on mac

#

This may be obvious to those more experienced with USB?

prime flower
#

@solar whale thx for looking into the RFM issue, im curious about your future findings

ionic elk
#

I will update the PR to represent the change but it does mean that the F411 will continue to not work on windows... I wonder if there's a way around it?

tulip sleet
#

@ionic elk @meager fog there is a bug in the "turning off USB devices" PR, which I found yesterday and will submit a fix for soon.

#

the interfaces get numbered wrong

ionic elk
#

Is that related to HID numbering?

#

@tulip sleet

tulip sleet
#

it's related to the interface numbers in the descriptors, not the hid report ids

ionic elk
#

As in, are the excluded endpoints still pushing up the numbering, or something? I think I remember something like that

#

Windows doesn't like the endpoints being numbered out of order, or something.

tulip sleet
#

yes, that was the mistake. There's a function that renumbers the interfcaes after they are concatenated, but I was renumbering over the whole possible list, not the selected sublist

ionic elk
#

Welp that's that then.

tulip sleet
#

i'll submit the PR and you can try it on the stm build (or I can)

stuck elbow
#

gotta run

ionic elk
#

@tulip sleet it's not that big a deal since the F412 should have the full descriptor list anyway, since it can fit it

#

I've pushed a commit that removes the restriction.

#

But it will be important for the F411

ionic elk
#

@meager fog in the short term here's a build that should work on windows.

onyx hinge
meager fog
#

@ionic elk tryn !

manic glacierBOT
meager fog
#

@ionic elk yep comes up!

#

got MSD

solar whale
#

Have a great week all -- have to go offline for a bit ๐Ÿ‘‹

meager fog
#

@ionic elk @tulip sleet odd that import os doesnt work, maybe check you aren't missing something?

#

can import board ๐Ÿ™‚

ionic elk
#

I don't think that's supported yet

tulip sleet
#

because no filesystem support

meager fog
#

o ok

#

@ionic elk @tulip sleet lets get you using adafruit VID/PIDs for these boards - dan, plz assign him some

old smelt
#

Thanks all. Have a great week!

onyx hinge
#

Thank you for running the meeting, @idle owl

meager fog
#

that way mu will detect it - and also we can have STM drivers on win7

slender iron
#

๐Ÿ‘‹

ionic elk
#

@meager fog probs the best starting point is just the digitalio example

errant grail
#

Thanks!

meager fog
#

yah i will just like to do os.uname() ๐Ÿ™‚

ionic elk
#

we can add it to the list!

meager fog
#

yes

#

this is great so far

#

excellent work

#

next up will be the pin restructuring and analogin?

ionic elk
#

Could use some help ordering that, BTW. I've got QSPI Flash, F405 support, UART, SPI, and OS

#

Analogin is almost done, that should be in today

meager fog
#

@slender iron @tulip sleet wanna chat about whats next?

#

QSPI flash feels like the next best thing, that way we get consistant storage

ionic elk
#

But the communication devices will need new pin stuff. Possibly a new object, since they're handled very differently than nrf and SAMD

tulip sleet
#

do you want minimal F405 soon?

ionic elk
#

F405 stuff is one of those things that could be really easy or really hard depending on whether something is unexpectedly wrong

meager fog
#

i will need that...but dont know if it makes more sense to get structure in place

#

so adding any boards is simpler

ionic elk
#

like some weird register change, like we had with the f412

#

I think some level of schenanigans risk is inevitable with STM32. Might just be a good idea if we had a place to document stuff like that

tulip sleet
#

you can do external flash as SPI, not QSPI, first, if that makes it easier in some way, but since there are examples already QSPI is probably fine

meager fog
#

well we'd need SPI then ๐Ÿ™‚

#

maybe thats a good next one, SPI usually is not a bonkers peripheral

ionic elk
#

which requires the com peripheral restructuring...

meager fog
#

also the 'f405 doesnt have QSPI

ionic elk
#

Yeah that's why I was kinda pushing for the F412

#

Or one of the other ones

#

F413 has 10 UARTS

#

just sayin

meager fog
#

i def have to make a F405 feather

slender iron
#

I think SPI is a good next step

#

then spi flash

ionic elk
#

Sounds good. Do we want to chat briefly about the comm peripherals object?

meager fog
#

can make a 412 feather after

tulip sleet
#

did you want a unified object? I don't think you really need one. nrf has separate also (unlike samd)

ionic elk
#

Oh, I didn't see that

#

I'll have to go check it out for reference

slender iron
#

ya, I'm not sure what you mean by comm peripherals object

tulip sleet
#

well, SPI and I2C peripherals overlap, but we're allocating them statically right now

ionic elk
#

I just wanted an object for storing what pins are associated with the UART, SPI, I2C, etc peripherals that's separate from the pin objects,

#

since each peripheral has a specific pins for each function, and they're pretty inflexible

#

Including it with the pin array would mean a ton of extra space for basically no benefit

meager fog
#

i'll note that for better/worse the peripheral setup for stm is not as-flexible as sercom, so the table of what you can use is not as bonkers

#

like there's only 2 or 3 spots for each peripheral

slender iron
#

@ionic elk I would just have separate tables for each type

meager fog
#

on smaller chips, only 1 or 2

tulip sleet
#

is there any sharing of periphs? If not, then you can just have a table per periph type

meager fog
#

ok so #1 - work on the peripheral table

#

then #2 add spi

#

?

slender iron
tulip sleet
#

revamp I2C to use periph table

meager fog
#

(i gotta go to my 3:30)

#

ok #1) table per chip, #2) make sure i2c still works #3) add SPI

ionic elk
#

@tulip sleet yes, periph table, test with i2c, add spi, add spi flash, add qspi flash, add 405

#

hows that

slender iron
#

I'd do 405 before qspi

ionic elk
#

ok

meager fog
#

yah good idea!

tulip sleet
#

you can add all these to-dos in basecampe and we can reorder as necc

meager fog
#

you can always use QSPI flash as SPI ๐Ÿ™‚

ionic elk
#

How about documenting all this stuff? I've been hoping to do that at some point

#

Setting up a learn guide for the structure of putting a port together

#

If I wait too long I won't remember :\

meager fog
#

yeah but i dont want ya to have to document things after you do something and then it gets refactored heavily

#

how about after SPI, then document the peripheral table

#

because you had gotten i2c/spi to work

ionic elk
#

This would be more of a guide on how to get the barebones of a port up, then the steps you need to take to flesh it out

#

But I think after SPI would be a good point to do it

meager fog
#

ok

slender iron
#

I don't think it's worth doing a guide unless we revamp it first

#

it's not something we do thaaaaaaat often anyway

tulip sleet
#

taking notes on what was hard or should be revamped is good. You could make a guide outline and just take notes. Don't need to make a draft guide yet

ionic elk
#

Sure, but it might be nice for explaining how ports are structured

#

I'm just hoping to save others some confusion - there's lots in the early port process that's pretty easily explained and could save a lot of time. But whatever structure you feel is appropriate for that I'd be happy with.

#

Could just be on the readthedocs for now, maybe?

tulip sleet
#

i think taking notes about it even in a Google doc is fine, so you don't forget. I wouldn't spend time formatting it all up now

#

we can share the google doc to other porters for now

onyx hinge
#

"gateware" just means the configuration image for the FPGA, "gate" because FPGAs are made of gates?

#

(I was not familiar with the term)

slender iron
#

yup

#

the "bitstream" for the fpga

manic glacierBOT
idle owl
#

@slender iron Ok, circuitpython-build-tools released.

slender iron
#

thanks @idle owl !

meager fog
#

@ionic elk @tulip sleet @slender iron ok back - i am having photo take pix of the '412 discover

manic glacierBOT
ionic elk
#

@meager fog were you still having issues even with the new binary?

meager fog
#

@ionic elk no! it works now

#

huzzah

#

i was in meetin's

#

is this dep on danh's PR

#

or is the PR compelte now

ionic elk
#

super, I was worried there we had a bug beyond what dan described!

meager fog
#

all good - i have lotz o meetings that slice my day up

#

but i did try it now and it enumerate

#

i was going to try to blink some LEDs

ionic elk
#

The PR is done. Having all the USB endpoints sidesteps the bug and should be done anyway

meager fog
#

if you have an example py that will save me a few mins

ionic elk
#

We'll just need dan's fix for the F411, which can't use all the endpoints

meager fog
#

ok i have this adorable F411 board we should support after the discovery

ionic elk
#
import board
import digitalio
import time
 
led = digitalio.DigitalInOut(board.LED1)
led.direction = digitalio.Direction.OUTPUT
 
while True:
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)
#

Oh great what's it called?

meager fog
#

@slender iron lotta flight controllers use the stm32f411

#

when you get shipping, use DHL/FEDEX/UPS not postal, cause it will take 3 weeks

ionic elk
#

k

meager fog
#

@ionic elk did dan give you a VID/PID?

ionic elk
#

not yet,

#

unless I missed it somewhere

manic glacierBOT
meager fog
#
                                   PID 0x8055  # arduino
                                   PID 0x8056  # circuitpython```
#

here ya go

#

you can use the circuitpython for this PR

meager fog
#

@ionic elk i cant seem to save files to flash

#

thats normal?

#

also, cant re-use pins on reset, they aren't deinited?

#
import digitalio
import time

leds = []
for pin in (board.LED1, board.LED2, board.LED3, board.LED4):
    led = digitalio.DigitalInOut(pin)
    led.direction = digitalio.Direction.OUTPUT
    leds.append(led)

while True:
    for led in leds:
        led.value = False
        time.sleep(0.1)
        led.value = True
tulip sleet
#

i was out but just got back

ionic elk
#

I think there might be an issue where it isn't triggering self reset properly

#

can you try hitting the reset button and see if it starts working again?

meager fog
#

yeah

#

i am doing that

#

ok just verifying

#

thats a different PR

#

wanted to verify it wasnt me

#

that example blinks 3 of the LEDs, LED1 seems to not blink but who knows why

#

oh wait i forgot LED1

#

duh one moment

manic glacierBOT
tulip sleet
#

@ionic elk do you want an F412 .bin with restricted USB or an F411 binary as is, for testing?

ionic elk
#

restricted F12 bin

meager fog
#

@ionic elk ok once you update the VID/PID im happy to call the USB for f412 working well enough!

#

pretty lights ๐Ÿ™‚

ionic elk
#

Ok I'll get that in now

#

done

meager fog
#

rad i dragged this file on to test, its a good mini test

ionic elk
#

I'll hang on to it, thanks!

ionic elk
#

I do need to put in a little bitty PR where I standardize LED names

meager fog
#

i think its ok as is, ez to blink ๐Ÿ™‚

#

good test of time/digitalio

#

good work! we're getting there

tulip sleet
#

@ionic elk ok, I think this is right. It has my interface numbering fix, and it's your branch rolled back to before the last commit, which removes the F412 USB device list narrowing

manic glacierBOT
tulip sleet
#

@ionic elk hierophect I took my '412 out of the packaging. Can I save the factory firmware load easily before overwriting it, or is it readily available elsewhere?

ionic elk
#

you mean the factory example? I think it's pretty readily available on the board page but I'm honestly not sure. I've never used it

#

That's the one with the display, right? Let me take a look

tulip sleet
#

@ionic elk Yes, well, I went ahead and overwrote it. ๐Ÿ™‚ I am powering the board with both USB cables, and it enumerats fine on Windows 10 and Linux with USB_DEVICES = "CDC,MSC". I can see the insides of CIRCUITPY and connect via REPL. Yay!

tulip sleet
#

I'll merge my PR after this finishes building so we don't get GitHub actions skew conflicts

ionic elk
#

Great. Could you take a look at my old pin remap one too?

manic glacierBOT
slender iron
#

@ionic elk I think @meager fog meant that pins couldn't be used after a CircuitPython reload. It's super common bug to have early in development. basically all peripherals should be reset after python code is done

meager fog
#

@slender iron @ionic elk indeed, i can open an issue

manic glacierBOT
#

save this as code.py

import digitalio
import time

leds = []
for pin in (board.LED1, board.LED2, board.LED3, board.LED4):
    led = digitalio.DigitalInOut(pin)
    led.direction = digitalio.Direction.OUTPUT
    leds.append(led)

while True:
    for led in leds:
        led.value = False
        time.sleep(0.1)
        led.value = True

on reset it runs, if you go into the repl and hit control-D to restart we get...
![image](https://user-images.githubuserco...

meager fog
#

issue created

slender iron
#

thanks @meager fog

manic glacierBOT
manic glacierBOT
#

Instead of doing the bitpacking yourself please use the : <no bits>; form when defining the struct like we use here: https://github.com/adafruit/samd-peripherals/blob/83a4759d186574d8034435cd2303def85e4ed793/samd/pins.h#L46 That way the compiler will handle all of the packing and unpacking for you and the source will be more readable.

For the ADC1, ADC2, ADC3 I'd define a macro for each and then | them together for the combinations 12 and 23.

onyx hinge
#

@slender iron I'm surprised at volume/clarity differences, i2s being a digital protocol

slender iron
#

@onyx hinge yup, seems like a bug to me on samd51 side

exotic pumice
#

have you checked samd51 errata?

onyx hinge
#

I'm having rather rotten luck today with using "load" in gdb

exotic pumice
#

are you using openocd?

onyx hinge
#

it keeps putting my device (particle xenon) in a state where I have to "make sd; make flash" otherwise it just reboots over and over again

#

no, all segger j-link tooling

exotic pumice
#

ok good

#

try like monitor halt, then load, then reset or something

#

it might be trying to load while it's running

onyx hinge
#

hm

#

I've been using "load; monitor reset"

exotic pumice
#

yeah try a halt first

onyx hinge
#

I don't have a theory why it could end up so confused. I swear this same workflow worked most of the day saturday.

#

particularly how I could have to "make sd"

tulip sleet
#

@onyx hinge it would be worth getting a real j-link, I think

onyx hinge
#

@tulip sleet I do have the "j-link base" now, not the cheapest one

#

non-edu and everything

tulip sleet
#

but you're using openocd?

#

sorry, I read the above wrong

onyx hinge
#

np

tulip sleet
#

but I usually use a feather 52840

onyx hinge
#

Maybe it is this computer, somehow

#

It just hard locked again

tulip sleet
#

the board or the computer?

onyx hinge
#

The whole computer. Recently installed Linux box, but the HW is all 10 years old

tulip sleet
#

is this your startup for gdb server? JLinkGDBServer -device nRF52840_xxAA -if SWD

#

and you're up-to-date on the segger software?

#

I am using a 7010 Dell Optiplex. Both USB2 and USB3 ports work fine with this setup

onyx hinge
#

drwxr-xr-x 8 root root 4096 Aug 31 08:21 JLink_V650a

#
    -if swd -speed 4000 -device nrf52832_XXAA -port 2331
``` well this is wrong
tulip sleet
#

Ubuntu 18.04

#

the default speed and port are 4000 and 2331

onyx hinge
#

debian 10

#

x86_64

tulip sleet
#

it will be interesting to see if the device change does anything. Are you using an offboard USB hub?

onyx hinge
#

Yes, a powered hub

tulip sleet
#

you might try a direct connection, just to make sure

#

but it is not generally a problem, it's usually a particular hub that's flaky

manic glacierBOT
#

This improves the situation where background tasks are starved by

  • bulk I/O (.read())
  • listdir
  • printing

Testing performed: Using nRF I2S audio (not yet in master) I started a 22050Hz, mono, 16-bit sample running in a loop and then ran the reproducers at the REPL:
while True: os.listdir('.')
while True: len(open('somefile.wav').read())

This reduced the amount of buffering in I2S audio required to not hear stuttering from ~200ms to 16m, as reflected in the current state of #...

onyx hinge
#

regardless, it's a good evening of progress!

#

I am sure that I will find a routine that works for me with the j-link and/or maybe it's my PC which I plan to replace in October/November anyway

tulip sleet
#

and it may be the board too, so order one or more Feather 52840's when they're available

onyx hinge
#

doesn't seem likely, but not impossible either I guess

tulip sleet
#

do you have a UF2 bootloader on the board for convenience?

onyx hinge
#

Yeah

#

though j-link "load" in gdb would be even more convenient if it worked ๐Ÿ™‚

#

consistently

tulip sleet
#

did it lock up again after changing the device?

#

I'm not sure the code is any different in the jlink programs

onyx hinge
#

My whole PC hasn't locked up again yet, no.

#

haven't done "load" enough times to know if the problem is there or not, sometimes it works 2-3 times and then stops

#

I've had a whole raft of slightly different problems and I am not sure I've even got a handle on what the pattern is, just that it doesn't work 100% and I'd like it to ๐Ÿ™‚

tulip sleet
#

yah, I really don't see that I do use my aliases for loading, so I always do a mon reset before and after

onyx hinge
#

having the aliases would help me be more consistent that's for sure

#

but still, what can "load" possibly be doing that erases the sd?

#

(softdevice, right?)

tulip sleet
#

right.

#

well, maybe there are some subtle differences between the '832 and '840 about writing flash

manic glacierBOT