#circuitpython-dev

1 messages Β· Page 317 of 1

lapis hemlock
blissful pollen
#

Living near an airport nothing gets your attention like a couple F-18s taking off. I can sleep through a 747 but the fighters are another matter

ivory yew
#

so I can hear someone's smoke alarm going off for 30 minutes, but as long as no smoke goes into the hallways it doesn't trigger the building-wide system.

lapis hemlock
#

If so, I can do this for the rest, so that you would no longer have to write the docs.

modern wing
#

I'm right on a main road, 2 blocks away from a train line, in the flight path of two airports. If I did audio recordings, I'd have to literally build a booth.

ivory yew
#

except for that time some jerk tried to cook a steak at 10pm and caused the whole building to evacuate.

lapis hemlock
ivory yew
#

So I'm outside in the cold in my pajamas holding a giant, angry cat until the Fire Department shows up and clears the alarm.

idle owl
#

Oi!

onyx hinge
#

@lapis hemlock it looks about right but the automatic processing of the documentation often finds problems a human doesn't see. I would copy the processing steps from circuitpython into ulab before proceeding, so that things can be checked.

idle owl
#

@ivory yew Give the cat to steak jerk to hold for the duration, I suppose.

onyx hinge
#

like, maybe there has to be a blank line after the last :param? not sure

idle owl
#

@blissful pollen Gah, yeah, that's fair.

lapis hemlock
#

I have checked it with extract_pyi.py, and compared against the existing docs.

onyx hinge
#

nice, cool!

lapis hemlock
#

Do you think we could make it for the 6.0 release?

#

I can work on this tomorrow night.

modern wing
#

@blissful pollen I'm in northern NJ, and when certain dignitaries come to town, they scramble fighter jets for escort. Rattles my walls.

onyx hinge
#

It seems possible -- we are talking about a beta release next.

ivory yew
#

@idle owl haha. I don't think she forgave me for that for like 3 or 4 days. She blamed me for the loud noises, too.

lapis hemlock
#

What is the timeframe?

onyx hinge
#

beta release this week, but this can be done independently imo

idle owl
#

@ivory yew Figures. Sounds like something my cat would do.

blissful pollen
#

@modern wing that would be less fun happening that often! To their credit they do try to take off away from the city unless the wind won't allow it

onyx hinge
#

the word "dignitary". it may have meant something different to people born before 2020.

ivory yew
#

She didn't sulk much but when she did she made sure I knew it.

lapis hemlock
#

As I said, I could pull this off tomorrow night, and we might have to polish the python code a bit, but I think that shouldn't be more than one or two lines.

onyx hinge
#

@lapis hemlock OK I will try to make time this week to do the tooling but I seem always to be overbooked

#

do you want to have these .pyi in ulab documentation, or is the goal only for circuitpython?

lapis hemlock
#

Oh. I don't know this feeling...πŸ˜‰

#

I think these could be useful in general.

#

They are a bit terse, so I would probably have a section with these in my docs, and then would expand on specifics in later chapters.

#

Something like a quick reference.

onyx hinge
#

you have docs on readthedocs, right? we should be able to do the same things in ulab and circuitpython. might have to ping tannewt on it, he did it for us.

lapis hemlock
onyx hinge
#

πŸ‘ please ping me again about this if you don't see movement on my end.

lapis hemlock
#

At the moment, I have everything in rst.

#

OK.

onyx hinge
#

I see you have added (some) types, def trapz(y: ulab.array, x=None, dx=1.0) -> float:, this is good

#

ttyl

lapis hemlock
#

There is a new function, arange, which is undocumented at the moment, but not for long. Actually, this is why I wanted to pop this idea now, because then you wouldn't have to deal with this anymore.

onyx hinge
#

you are awesome, thank you

lapis hemlock
#

It was my pleasure.

#

But I might head for the bed now.

#

πŸ‘‹

craggy moth
#

Can someone tell me if the Arduino Due is supported by Circuit Python?

tulip sleet
#

no, sorry, it doesn't have enough ram or flash

#

i take that back, it's adequate, but it's a different architecture and we moved on to more modern architectures

craggy moth
#

no, sorry, it doesn't have enough ram or flash
@tulip sleet

How? It has more RAM and Flash than the SAMD21

#

It's a Cortex M3. Does it miss anything vs the SAMD21's Cortex M0+?

tulip sleet
#

back in a min

#

@craggy moth sorry, was in a mtg. The Due uses an older chip, and we don't make or sell a Due clone. We opted to use SAMD51 (M4) instead, and our Grand Central board is Due-shaped, but with a more modern processor with more RAM.

#

It would be possible to port CircuitPython to the Due AT91 M3 architecture, but it would be a noticeable amount of work.

craggy moth
#

Aah I see. So the current entry level CircuitPython board would be the Trinket M0?

#

Or the identical looking Seeeduino Xiao?

slender iron
#

Those both do work but a more powerful chip is a better experience for not much more money

#

something with more RAM

tulip sleet
#

@craggy moth a good board to start with would be a Metro M4 Express if you want an Arduino-shaped board. The Feather and ItsyBitsy M4 are smaller; Grand Central M4 is bigger.

manic glacierBOT
#

Is there an issue ticket that describes this work? I saw this was mentioned in a long YouTube video: https://www.youtube.com/watch?v=iQQLMhxAR34&t=39m30s but I've not yet gone through all of that, is there an editted highlights for that?

There isn't an issue. This is the best place.

There isn't an edited version because I don't know how to edit video (nor have the time.) Maybe once it's in I'll try to do a 1 minute video about it.

One specific issue I'm interersted in is whether ...

manic glacierBOT
tulip sleet
manic glacierBOT
#

BHB needs better accuracy from the ADC readings. To avoid changing the ADC configuration for all boards or adding complexity to AnalogIn, I implemented a custom user module to allow the BHB to talk to the ADC in the way that it needs to.

We'd love it for you to improve all of the boards. :-)

I would be happy to implement those for the SAMD21/51 boards in a later pull request (once I'm settled in after my move), are there any objections to merging this for now?

Nope. This isn'...

manic glacierBOT
#

Thanks! This helps me solve a customer issue with BHB.

I definitely didn't want to do this for all boards just yet because it
would require either accepting conversions that are 64x longer for every
SAMD21 board or making changes to the API, which definitely warrants
further discussion.

When I'm on the other side of my move and done with the module I'm working
on I'll start the conversation for what a more flexible AnalogIn interface
would look like that lets folks configure multisampling, ...

manic glacierBOT
manic glacierBOT
slender iron
#

do we have an issue for gcc 10 support?

#

arch has it by default

lone axle
#

Some πŸ’ cherries for the pie in the sky custom circuit python building server: Allow the user to select a specific display size and driver and basic information needed to initialize the display. Include the required driver and point board.DISPLAY to work with the selected driver and size etc. So they can use that build as though it's a "built-in" display even though it's not.

manic glacierBOT
low sentinel
#

@lone axle ☝️ this was an oversight from when I made absolute transforms work (my test display lives transposed). Thanks for the bug report! Feel free to @ me on these, I'm very likely to miss them otherwise.

lone axle
#

Okay will do. Thank you. I will try out this build tomorrow.

manic glacierBOT
manic glacierBOT
tulip sleet
#

@slender iron There is a "preview" arm gcc download. MicroPython ran into some gcc 10 issues of overzealous optimization. I'll open an issue with pointers.

manic glacierBOT
#

The arm gcc10 toolchain is available in preview form here: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads (currently second item in downloads list). This preview was released in late June, 2020, and is not recommended for production use.

MicroPython has had to make some changes to fix compile errors: gcc 10 optimises memset to call itself
.

Compilation speed bench...

#

clang/llvm is progressing, and might be considered as a replacement for gcc. Clan/llvm has helpful semantic analysis tools available via the tool chain that are not available via gcc. Better code formatting is also available: see #1012.

Historical background:
https://medium.com/@alitech_2017/gcc-vs-clang-llvm-an-in-depth-comparison-of-c-c-compilers-899ede2be378

ARM's paid toolchain is now based on clang/llvm.

May 2020 article mostly about static analysis:
https://interrupt.memfault...

manic glacierBOT
#

@foamyguy has written (https://github.com/adafruit/Adafruit_CircuitPython_ProgressBar/pull/8):

When the progress is moving down the library previously would fill the "empty" portion of the progress bar from left to right so it looked like it was moving "the wrong way" I modified the behavior to fill emptiness from right to left so the progress bar appears to visually "empty" itself in reverse as it gets drawn.

This prompts me to imagine that there's a missing piece: A decorator and/or...

uncut nexus
#

Hi All - general question: Does a PR need an associated issue?

ionic elk
#

Total college freshman coding question here, but when I want to convert a 16 bit "ratio" value, like a PWM duty setting, into a 32 bit number, is there an accepted best way to do that? val*(2^16), val*(2^16+1), (val<<16) + val are all going to be a little bit off

#

actually I guess (val<<16) + val is about as good as it gets

tidal kiln
#

@uncut nexus Not required, but generally nice. Typically if you are working on a PR, then you were probably motivated by something. That something could be used to create an issue. And it can be nice to have a discussion there (in the issue thread) before even starting to code things up.

honest dust
#

@ionic elk What do you mean by "convert into a 32-bit number"?

ionic elk
#

We often have fractional values represented by a range of 0 to 65535 (16 bit max), as opposed to using something like a float. An example is the duty cycle of a PWM pin. However, sometimes you see the fraction represented as a range from 0 to 4294967295 (32 bit max). If you just multiply by 2^16 it ends up too low because the numbers are odd, which could cause problems if you need to identify 0xffffffff as a special value. But I think (val<<16) + val does the trick across the board

honest dust
#

But how is this fraction encoded in the 16 bits?

ionic elk
#

1 is represented by the max, 65535. So your fraction is your value over 65535

#

so you have 65535 bits of resolution for a fractional value

honest dust
#

Ah OK.

ionic elk
#

0x7FFF/0xFFFF ~= 1/2, etc

honest dust
#

I see what you mean. If you just shift it by 16 bits, the fraction changes. Just like 0x7F/0xFF is somewhat different than 0x7FFF/0xFFFF.

#

Duh, this makes sense: 0xffffffff / 0xffff = 0x10001. So you need to multiply 0x7fff by 0x10001, which is 0x7fff7ffff. So the math works out too. πŸ˜„

ionic elk
#

Right 0x10001 is just the same as my bitwise operation

honest dust
#

Yeah exactly.

manic glacierBOT
#

This PR makes the following changes to tools/extract_pyi.py:

  • Automatically insert import statements (e.g. import microcontroller) to .pyi files.
    • Import statements are necessary to use .pyi with mypy/pyright/etc.
    • Use isort to prevent redundant imports.
  • Insert from __future__ import annotations into each .pyi to solve the problem of forward references
  • Use the standard ast module instead of astroid
#

Doing some testing, I have seen that using -O2 instead of -Os for boards that have sufficient flash memory can be quite helpful.
Some examples:
On A PyPortal, using the script from https://pastebin.com/BAUS82X9:
With -Os
neopixel flicker,6-0-0,3.80859 neopixel rainbow,6-0-0,3.41797 GPIO on/off benchmark,6-0-0,3.56396 integer sum,6-0-0,4.53271 integer multi,6-0-0,6.50293 float sum,6-0-0,2.94238 float multi,6-0-0,2.94873 float divide multi,6-0-0,3.01025

With -O2
`neopixel flick...

idle owl
#

@gilded cradle I would feel free to merge Brent's PR. I don't think anyone but Brent has the hardware to test it πŸ˜„

gilded cradle
#

Sounds good

manic glacierBOT
#

@dhalbert https://github.com/dhalbert Unfortunately, moving the call of
RUN_BACKGROUND_TASKS to the loops in mpz_pow_inpl()
or mpz_mul_inpl() is not as effective. Since in there it is not called as
often, it takes a very long time (over 2 minutes) for
CIRCUITPY to show up after a reset, if it mounts at all. Since in a normal
(i.e. not exponentiation) multiplication
it would only call RUN_BACKGROUND_TASKS once; I think leaving it in
mpn_mul() will take care of the
USB stall without a notic...

manic glacierBOT
ionic elk
#

@slender iron is it possible to use log2() within Circuitpython? Or is <math.h> off limits? It would be useful for calculating maximum duty cycles per frequency for ESP32-S2, but I'm getting a linker error trying to use it

slender iron
#

it should be possible. what are you trying to do?

ionic elk
#

Really nothing crazy, size_t max_duty = log2(LEDC_APB_CLK_HZ/frequency);

slender iron
#

and max_duty is the number of bits?

#

I'm surprised you need log2

ionic elk
#

I mean I could make a big table but this seemed cleaner

slender iron
#

why do you need log2?

ionic elk
#

Am I being dumb? is there another easy way of doing that equation?

slender iron
#

I don't understand what you are trying to do

ionic elk
#

I could make a recursive log function myself I guess, I don't know how sophisticated log2 is behind the scenes

slender iron
#

or why you are doing what you are doing

ionic elk
#

There's an inverse correlation between frequency speed and the resolution of the duty cycle (both are parameters that get passed into the pwm config). The equation for calculating the maximum duty cycle resolution for a given frequency is the above: duty_cycle_bits = log2(system_bus_clock/desired_frequency)

slender iron
#

where is that equation from? why do you care about how many bits it is? isn't it enough to know the number of "ticks" of resolution which is the input frequency / the pwm frequency?

#

then you just need to figure out the fraction of those ticks to be high

ionic elk
#

but I think my problem is actually that we're missing the -lm flag in the makefile

#

hmm no we have it, maybe it's in the wrong order?

slender iron
#

ah, I see

#

the idf takes in the number of bits

ionic elk
#

I might still be being dumb though can I just get the bits by looking at the size of the division output

#

Pretty sure that's the same deal here let me see

#

ech there's nothing built in for doing that. Should be as simple as just counting the number of zeros before I hit a one from the MSB though

#

@slender iron yeah we aren't including $(LIBS)

low sentinel
#

size_t max_duty = log(LEDC_APB_CLK_HZ/frequency) / log(2); is that expression if you're missing log2 right?

ionic elk
#

I'm actually missing log

low sentinel
#

woops

ionic elk
#

I use log2 but it appears to be complaining about inlining log

#

but that would def work if that was the issue πŸ™‚

low sentinel
#

MP_NEED_LOG2 :slow_parrot:

thorny jay
#

log(M/N)=log(M)-log(N)

#

log2(x) would be finding the most significant bit of that value?

#

I am rusty on the math... but it feel like there might be some optimisation possible.

ionic elk
#

Right, I could just program something to do that instead, but right now I'm more curious as to why <math.h> isn't working. Seems like that should be fixed

slender iron
#

sorry, got distracted by a package delivery

#

it'd be worth figuring out how to add log2 though you can just shift and count in a loop to find the last binary 1

ionic elk
#
$(BUILD)/firmware.elf: $(OBJ)
    $(STEPECHO) "LINK $@"
    $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group
    $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE)

ST for reference

#
$(BUILD)/firmware.elf: $(OBJ) | $(ESP_IDF_COMPONENTS_EXPANDED) $(ESP_AUTOGEN_LD)
    $(STEPECHO) "LINK $@"
    $(Q)$(CC) -o $@ $(LDFLAGS) $^ $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) build-$(BOARD)/esp-idf/esp-idf/newlib/libnewlib.a -u newlib_include_pthread_impl
    # $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld
#

@slender iron and yeah I figured that math.h not working was a problem in and of itself. Circumventing it is no big deal but this seems like it should be working

#

In the above esp32 build setup, where should $(LIBS) go? I'm not great at these statements, reading up as we speak

#

st has the ,--start-group $(LIBS) -Wl bit which esp32-s2 is missing

slender iron
#

I think you want it on the $(CC) line like the ST version

manic glacierBOT
lone sandalBOT
manic glacierBOT
slender iron
#

looks like GCC 10 reduces code size

tulip sleet
#

did you fix the gcc10 memset issue?

slender iron
#

no, I need to look at that

#

had a bunch of externs to add

#

arch already uses 10.1 so I'm working into it rather than figuring out how to downgrade

tulip sleet
#

i missed what you said yesterday: are you doing dev on linux now due to laptop heating?

ionic elk
#

@slender iron I tried $(Q)$(CC) -o $@ $(LDFLAGS) $^ $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) build-$(BOARD)/esp-idf/esp-idf/newlib/libnewlib.a -u newlib_include_pthread_impl -Wl,--start-group $(LIBS) -Wl,--end-group but still not getting <math.h>... using the counting method for now.

slender iron
#

what error do you get?

ionic elk
#

same as before, undefined reference to 'log'

slender iron
#

kk

manic glacierBOT
thorny jay
#

Hi @stuck elbow I wanted to play with a Waveshare 1.44inch-lcd-hat (it's a pHAT for Raspberry Pi with a 128x128 LCD ST7735R with a joystick and 3 button). I was super happy to have displayio working with blinka. Then I started to write code for the joytstick and button... but then I found out that gamepad was something in C and so not present in blinka. You wouldn't have a quick fix for me by any chance? Just to be able to write CircuitPython Game on a Raspberry Pi.

slender iron
#

anyone have experience with -fmerge-all-constants?

#

looks like we get a few hundred bytes back

#

(though it may mess pointers up)

stuck elbow
thorny jay
#

Maybe @gilded cradle, is there a list of things (library) that do work on CircuitPython but not yet on Blinka because it is in C and not a Python Library?

gilded cradle
#

Sorry, I thoughtyou meant displayio specific

thorny jay
gilded cradle
#

No, a lot of modules haven't been ported over yet.

stuck elbow
#

right, but you don't have to use the gamepad library for the buttons for the ugame games to work

thorny jay
#

Sorry that was not the right link...

#

Yes, it is only GPIO button, so I can scan them another way.

#

I think I just started to understand that all the "module" that are not pure Python library and contain some C code in CircuitPython core will by default not work with Blinka.

gilded cradle
#

Yeah, there's lots of people adding stuff to CircuitPython and not as many adding to Blinka, so there's lots of modules that haven't been ported.

thorny jay
#

Maybe there should be a Python reference implementation first, that is slow on MCU but would work find on SBC. And then only a C version.

#

But maybe the reason it is done in C is because those are stuff that would not work in Python, like too slow, or need interupt or need to run in parallel with user code.

#

Durring the meeting on monday, someone was talking about the alternate timeline where we would not have Blinka and only have a Unix version of CircuitPython... would then all of the module be there by default?

slender iron
#

only the ones that don't use hardware

thorny jay
#

Like uLab?

slender iron
#

yes

#

though ulab shares API with numpy so you should just use numpy in cpython

thorny jay
#

Yeah. So I was into the mood of programming on the Pi with Blinka and then when thing start to work, move to a Feather. But there are too many traps. It's like that idea of running the same code on Clue and CPB+Gizmo and Pi+Blinka+MiniPiTFT. They all have 240x240 and two button. But on the Pi side, I might have some issue because piece I would like to use do not exist.

slender iron
#

we aren't really targeting the pi -> feather case because cpython will have extra apis

thorny jay
#

And if I do Feather => Pi, then I need to avoid the missing modules.

slender iron
#

or implement them

thorny jay
#

So Blinka is great to have instantaneous driver working both in CPython and CircuitPython. Everything I2C or SPI or UART that is writen in Python library will work fine.

#

I can drive the screen, I have displayio. This is good enough right now. And most of all, I learned a few stuff (I guess I should have known before, but it was not so clear as it is now).

manic glacierBOT
low sentinel
#

@slender iron I ran another compatibility issue with async last night:

async def f():
 await ''

This does not raise on circuitpython's async, but it raises TypeError on CPython at runtime.

slender iron
#

because it's awaiting an invalid type?

low sentinel
#

Yeah, it's like TypeError: object str can't be used in 'await' expression

slender iron
#

ah. I wonder where we'd need to add that check

low sentinel
#

Yeah, that'd be interesting. It's probably mp_builtins_await or somesuch. The bool taint that I have applied to generators might be able to be exploited there, but I imagine I'll either need to bleed a struct from objgenerator.c into a header or poke another method into the methodmap on the generator type.
I haven't looked into it yet; thought I'd see if you had insight or opinions before I do.

slender iron
#

I think it's worth a brief look

#

but not the end of the world

low sentinel
#

I agree. I'll look into it πŸ‘

slender iron
#

thanks!

manic glacierBOT
manic glacierBOT
low sentinel
#

uPy allows normal generators to be awaitables

:sigh:

manic glacierBOT
cerulean valley
#

cool

manic glacierBOT
#

I thought I'd help out and knock this one out which was a fail. Here's some notes for the next person:

docs/shared_bindings_matrix.py is used to run the Jinja2 template syntax within shared-bindings/support_matrix.rst.

Within shared-bindings/support_matrix.rst the Jinja for loop is used to basically pass a CSV formatted list into the csv-table RestructuredText directive.

{% for key, value in support_matrix|dictsort -%}
"{{ key }}", "{{ '`' ~ value|join("`, `") ~ '`'...
manic glacierBOT
low sentinel
#

bast_pro_mini_m0 is getting pretty ridiculous

188420 bytes used, -4 bytes free in flash firmware space out of 188416 bytes

stuck elbow
#

@low sentinel you could use a shorter error message

#

this will explode anyways as soon as that message is translated to German

#

how about "coroutine is not iterator" -- shaves some bytes

thorny jay
#

Tonight I wat thinking about the message translation and that space issue on M0 board. In the idea I had was (1) disable other language on M0 (2) Translate into a fake language that only say "Error 123" with a dictionary that say what 123 is (3) Have the translation from error number to text be done with a file on the drive so that it is external to the firmware.

#

Not sure any of this make sense or is acceptable.

#

In fact I was in the "module-support-matrix" yesterday because I wanted to use gamepad on the "8086 Commander" (that has 4 button) and it was not there. Then I said to myself, "I am going to use uGame10 as an external joystick." I wanted to do a JOY of Arcada ( https://learn.adafruit.com/joy-of-arcada-usb-game-pad-for-adafruit-pygamer-pybadge ) kind of thing, but in CircuitPython, on uGame10 (no need for using the screen) just button to USB-HID... but then I found out usb-hid is not part of uGame10 either.

Adafruit Learning System

A USB game pad with personality. Pew pew pew!

#

I understand that uGame10 primary goal is to be able to write little game, so the module set to choose must be limited to the minimum. But those "missing module" are frustrating. So I plan to learn how to recompile CircuitPython with other set of module. But any solution where we can save memory (like on the error message) would be great. There could be a "LowMem" version for M0 were one accept to lose clear error message...

tulip sleet
#

Tonight I wat thinking about the message translation and that space issue on M0 board. In the idea I had was (1) disable other language on M0 (2) Translate into a fake language that only say "Error 123" with a dictionary that say what 123 is (3) Have the translation from error number to text be done with a file on the drive so that it is external to the firmware.
@thorny jay

#

We are reluctant to do 1) because we'd like to treat all languages equally. 2) same. 3) This has been in my mind too.

thorny jay
#

Maybe one usefull information we could get from Weblate or compilation is how "long" each translation is. To see where effort in shortening are possible.

tulip sleet
#

in fact it could be done at run-time, e.g. "translations.dat" or whatever could be substituted, and one could use a single .uf2 for all language builds

#

size checking would need to be per board, since it doesn't matter for some boards (plenty of space).

#

and some boards don't use large swaths of the error messages (e.g. _bleio is not present on many boards)

thorny jay
#

Because of where I work, multiliguisme is very important (not in CircuitPython). And all of our languages are equal... but some are more equal than other.

#

Full disclosure... I work in IT for the European Parliament. (maybe this message will be edited soon).

tulip sleet
#

do you feel that's it's a big plus to have all these translations? Do you use one of them yourself, or would you recommend their use in school ,etc?

#

i assume it's also a regulation for much software

#

i would think yes, though everyone still needs to learn the english keywords, library method names, etc.

thorny jay
#

Personally, I only use the EN version, because I learned computing en Engish with the ZX81 manual that was all in English.

#

In Belgium, as we are a bi/tri-lingual country... English might be used more for IT stuff. But I guess in France, they can be very frenchy with everything in French.

#

Not sure about regulation... I feel that if only the error message are in English, but everything else (documentation, learn guide, ...) is translated, it can be difficult in school.

manic glacierBOT
tulip sleet
thorny jay
#

I am a kind of electronic voting expert (on NGO side since 20 years). And one of the bug we had was when the (DOS) computer had floppy disk error, and was saying (A)bord (R)etry. This was not understood by the operator because not in an official language. Also that was not in the documentation. Analysis from the expert seems to indicate the user aboarded, did not mention the incident and we ended with some floppies with missing vote. It was detected "by chance" due to another error. So sure, sometime having things in the proper language can help. πŸ˜‰

tulip sleet
#

that is our feeling too: the translations make life easier, they are not part of what one is learning, but instead are unexpected. ... That is a great example!

stuck elbow
#

it's a bit weird, I was talking to people from France and from China, both pretty "closed" countries language-wise, and I thought they would be happy about the fact there are translations β€” they both told me that they don't care, because they teach programming in English, because that's the only way that is actually useful in the long-term

lone axle
#

I think the custom build server that I have in mind would help in the situation like is mentioned with the uGame10 above. Where a device has different modules built-in than the ones you are hoping to use for a particular project.

#

I am thinking of it a bit like the Bootstrap Customizer page if you've ever used that. It lets you select only the things you want to be included with your specific download.

tulip sleet
#

i think it's a bit of a chicken-and-egg problem: without any translations, English makes more sense, and so the people in the course who have the English skills see it as OK. But it may shut out others with less English skill.

thorny jay
#

it's a bit weird, I was talking to people from France and from China, both pretty "closed" countries language-wise, and I thought they would be happy about the fact there are translations β€” they both told me that they don't care, because they teach programming in English, because that's the only way that is actually useful in the long-term
@stuck elbow Professionally, yes, very hard without English skills... but for STEM, kids, ... very difficult if not in the right language. My failure to get my own kids to learn a bit about computer is also because I failed to find non english "curriculum". I am not a good person to tell you about language usage, when I started to use it, the internet was in English, IRC was in English, ... everything was in English. I was surprise when French content started to be available. πŸ˜‰

stuck elbow
#

I thought the French pretty much had their own Internet

thorny jay
#

It can really be a blocker. Now English is a class you have to take at university for Computer Science (in French Belgium, and Flemish Belgium may do a lot in English). And some class you cannot succeed without reading English reference books.

#

I thought the French pretty much had their own Internet
@stuck elbow Are you refering to Minitel. πŸ˜‰

#

I can also see how the news gets propagate and translated and then propagate into other "circle". With the use of Google News and some of my device in French and other in English... some web site are "news translation content". Some bi-lingual journalist, read the news in English, translate what is more relevant and propagate in their own language. That works for every languages. Something might be widly known in one langage and unknown until one initial person does translate to another world. Then it spread, some do go back to the source and propagate further.

#

The owner does translate Adafruit documentation and product page.

#

He was very much into MicroPython... and might start to be more and more interested in CircuitPython.

stuck elbow
#

it's very similar with Polish

thorny jay
#

He is likely an official resealler of Raspberry Pi stuff and Adafruit stuff.

stuck elbow
#

but I noticed this is more about tutorials and documentation, and less about error messages

thorny jay
#

Yes, his work is on the documentation, and original content too.

stuck elbow
#

they don't read the error messages no matter what language they are in, they just say "it doesn't work, help"

thorny jay
#

Or you "google" the error message.

stuck elbow
#

yes

thorny jay
#

This is where translated error message are a problem.

stuck elbow
#

then it actually helps if it's English

#

precisely

thorny jay
#

So a unique error number might be a fun way to reconcile things.

#

Also, I am very much interested into the Spanish translation going on.

thorny jay
#

First they will establish a corpus of learn guide to translate... and then they will be maybe report on the use of Circuit Python in other languages, for kids.

stuck elbow
#

you know, back in the days of DOS, we had a version of DOS translated to Polish

#

including all the commands

thorny jay
#

There were French version of LOGO and BASIC.

stuck elbow
#

it was an exceedingly bad idea

#

the language you use to talk to the computer is artificial anyways

#

even English speakers have to learn it

thorny jay
#

Also, in the [hardware] hacker community, I see a lot of German only content. You can see that in the CCC conference. Some very technical topics are in German only (they have an interpretation team). And I am sure you can survive and have computer fun in Germany without speaking English...

stuck elbow
#

I think the German-only stuff is mostly politics

#

on the CCC at least

thorny jay
#

Possible. You mean. Patent, Electronic Voting, Licence, Hacking society, ...

stuck elbow
#

but yes, there are lots of electric engineers active in Germany who don't speak English

thorny jay
#

So there was that French person that jumped into the meeting. I don't have the nick-name and if I should contact him.

stuck elbow
#

it's recorded

thorny jay
#

I'll have a look.

stuck elbow
#

a lot of people understand English, and often can even write understandable English, but are afraid to speak

#

I had that, because all my English I learned by reading, and I was really shocked to learn how some of the words are actually pronounced

#

like "actually"

thorny jay
#

Same here.

stuck elbow
#

I blame the Great Vowel Shift, of course

ionic elk
#

I mean us native speakers can't pronounce english either. I even said pronunciation as "pronounciation" until like, two years ago.

manic glacierBOT
#

Hi, @tannewt

Are you using these in a specific editor?

I’m new to CircuitPython, and I want to use these stubs on VSCode. But I am still looking for a proper way to do that.

Want to help us auto-deploy to PyPI as well?

Of course, I want to contribute to that when I have time.

By the way, I’m not sure that distributing these through PyPI is the right way or not. For example, typeshed is just a repository, not a PyPI package. I’ll need further research.

manic glacierBOT
low sentinel
#

@low sentinel you could use a shorter error message
@stuck elbow I've got it #if MICROPY_PY_ASYNC_AWAIT'd off though - and I really like that message as it's a copypasta from CPython's error message :sad:

@tulip sleet thanks, that looks like something I'll be interested in pretty soon.

lapis hemlock
manic glacierBOT
onyx hinge
#

@lapis hemlock hello

lapis hemlock
#

Yup!

#

Perhaps it is faster on the voice channel.

onyx hinge
#

okay, give me a moment to wrap up something else and I'll hop in

lapis hemlock
#

kk

manic glacierBOT
#

Changing the readinto code like this works, but may not be acceptable (it puts a potentially large variable size array on the stack):

 bool common_hal_busio_spi_read(busio_spi_obj_t *self,
-        uint8_t *data, size_t len, uint8_t write_value) {
+        uint8_t *data_in, size_t len, uint8_t write_value) {
     if (self->miso == NULL) {
         mp_raise_ValueError(translate("No MISO Pin"));
     }
-    HAL_StatusTypeDef result = HAL_SPI_Receive (&self->handle, data, (uint16_t)l...
onyx hinge
#

@lapis hemlock I'm ready πŸ™‚ thanks for your patience

lapis hemlock
#

No problem.

onyx hinge
#

@slender iron if you had a second to join me and @lapis hemlock in Amelia for a bit of renaming discussion

slender iron
#

bast_pro_mini_m0 is getting pretty ridiculous
@low sentinel I've been poking at this build too. I think I disabled COUNTIO

onyx hinge
#

@slender iron For 6.0, ulab is going to move the spectrum function into fft, an incompatible change.

#

some of the markup is not quite right but so be it; we can fix it once we can see it rendered

lapis hemlock
#

@onyx hinge Thanks!

#

Oh, I almost forgot: would it make sense to insert a link to the numpy documentation for each function?

onyx hinge
#

that would be fine. I didn't do it out of laziness.

lapis hemlock
#

I will do that, then.

#

You haven't yet pushed your changes, have you?

onyx hinge
#

almost

#

struggling with git

slender iron
#

@onyx hinge sorry, I've been distracted getting my linux box going πŸ™„

lapis hemlock
#

Take your time.

slender iron
#

made the mistake of updating the bios yesterday

#

got it going now though

onyx hinge
#

@slender iron uh oh, that can lead to really bad news. Hope it was worth the pain

#

@lapis hemlock pushed now ```To github.com:v923z/micropython-ulab.git
4759264..23e1ef3 documentation -> documentation

slender iron
#

meh, I like to be up to date. no fun that it wipes efi entries

lapis hemlock
#

@onyx hinge thanks, I will take it over now.

slender iron
#

luckily I have a shell script in the root of the FS that adds them back πŸ™‚

#

and I figured out that my magewell is happy in a particular usb port

ionic elk
#

@slender iron have you ever considered the STM32WB line, by the way?

#

I have a friend who's working with it

slender iron
#

looks

#

no, that space is covered by esp32 and nrf52840

ionic elk
#

Right, seemed like a direct competitor. I dunno if it's cost effective though

#

The STM32WLβ€―MCU is a LORA on chip though, that seems kinda neat

onyx hinge
lapis hemlock
#

@onyx hinge Some of the modules, e.g., poly, do not list their functions.

onyx hinge
#

OK, I do not know why that is

manic glacierBOT
#

This version

  • moves source files to reflect module structure
  • adds inline documentation suitable for extract_pyi

There are some remaining markup errors in the specific revision of extmod/ulab but they do not prevent the doc building process from completing.

For a time, a copy of the generated documentation reflecting the initial state of this PR is at http://media.unpythonic.net/circuitpython-docs-with-ulab/shared-bindings/ulab/index.html

Once the docs have been merged into ul...

onyx hinge
#

@lapis hemlock those are the only definitions in the .pyi file, not sure why

lapis hemlock
#

@onyx hinge I also noticed that the very first function of the other modules is missing. I will look into this.

onyx hinge
#

oh wait I misunderstood what you meant. not sure why e.g., ulab.approx gets a second level of table of content while ulab.vector does not.

#

why does approx have "newton" but not "bisect" in the table at the top

lapis hemlock
#

Right.

#

Or, rather, wrong.

#

πŸ™ƒ

#

bisect is the very first function in approx. I just don't see at the moment, what the heck is wrong here.

onyx hinge
#

I don't either. I pursued one theory based on syntax highlighting in my editor (that the "*" parameter was creating a rst markup error) but that does not seem to be it.

#

there are excess blank lines in the rst file but that should not matter

lapis hemlock
#

I think it will be the tabs/spaces issue: here is the diff against the circuitpython source: ```< """
< :param ulab.array a:
< :param ulab.array v:
<
< Returns the discrete, linear convolution of two one-dimensional sequences.
< The result is always an array of float. Only the full mode is supported,
< and the mode named parameter of numpy is not accepted. Note that all other
< modes can be had by slicing a full result.
< Convolution filters can implement high pass, low pass, band pass, etc.,
< filtering operations. Convolution filters are typically constructed ahead
< of time. This can be done using desktop python with scipy, or on web pages
< such as https://fiiir.com/
< Convolution is most time-efficient when both inputs are of float type."""
< ...

"""
:param ulab.array a:
:param ulab.array v:

Returns the discrete, linear convolution of two one-dimensional sequences.
The result is always an array of float.  Only the ``full`` mode is supported,
and the ``mode`` named parameter of numpy is not accepted. Note that all other
modes can be had by slicing a ``full`` result.

Convolution filters can implement high pass, low pass, band pass, etc.,
filtering operations.  Convolution filters are typically constructed ahead
of time.  This can be done using desktop python with scipy, or on web pages
such as https://fiiir.com/

Convolution is most time-efficient when both inputs are of float type."""
...
#

I think that's not it. bisect is tabulated, as is the rest of the functions.

onyx hinge
#

@lapis hemlock at least some build errors from circuitpython with that branch by the way ...

../../extmod/ulab/code/create.c:106:16: error: no previous prototype for β€˜create_linspace_arange’ [-Werror=missing-prototypes]
 ndarray_obj_t *create_linspace_arange(mp_float_t start, mp_float_t step, size_t len, uint8_t typecode) {
                ^~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors```
#

I can look at resolving them "soon" but for now I need to step away

idle owl
#

@slender iron Have you created the notes doc for the meeting next week? Wondering if I missed it, or if it's not out yet.

slender iron
#

nope, I forgot

#

will do it now

#

sorry!

manic glacierBOT
idle owl
#

@slender iron No worries, I had a hug report I didn't want to forget. Realised I only had last week's link.

slender iron
#

kk

#

Here is the notes document for Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1K-himsiOHsJozTNUktOK8SEmiBcRhlDkBW363jlQ2DQ/edit?usp=sharing

manic glacierBOT
#

The errors I've been getting on a Fedora 32 are:

/usr/bin/ld: build/py/parse.o:(.rodata.nibble_to_hex_lower+0x0): multiple definition of `nibble_to_hex_lower'; build/py/gc_long_lived.o:(.rodata.nibble_to_hex_lower+0x0): first defined here
/usr/bin/ld: build/py/parse.o:(.rodata.nibble_to_hex_upper+0x0): multiple definition of `nibble_to_hex_upper'; build/py/gc_long_lived.o:(.rodata.nibble_to_hex_upper+0x0): first defined here
/usr/bin/ld: build/py/persistentcode.o:(.rodata.nibble_to_...
ionic elk
#

@slender iron ESP32-S2 PWMOut is ready for your review.

slender iron
#

I'm aware

#

it's in a tab todo

manic glacierBOT
ionic elk
#

Ok, sorry, you mentioned you liked pings outside the github ones so I figured I'd mention it.

slender iron
#

if it's been 24+ hours then feel free to ping me

#

most days I have a dozen or so things to look at

slender iron
#

@teal fern what OS are you on? looks like it can't find arm gcc

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

While working on some performance issues, it was found that using the -O2 option instead of -Os on boards with sufficient flash memory can greatly help performance.
Connie & I did some testing on the boards we have available. The tests we ran were:

  1. The long-running bigint calculation script from issue #2949
  2. The script from https://pastebin.com/BAUS82X9
  3. The ulab simple benchmark script from https://learn.adafruit.com/ulab-crunch-numbers-fast-with-circuitpython/a-simple-
    ben...
simple pulsar
#

Hello. Is there any reason for pylint check (Arduino Library CI / pylint (pull_request)) to get queued for a long time on guides? I have one that has been stalled for hours: https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/1185

manic glacierBOT
tulip sleet
#

@simple pulsar we have been seeing a lot of flakiness on GitHub Action jobs today. I'll restart that PR.

manic glacierBOT
simple pulsar
#

@tulip sleet Thanks. I think it was travis the last time I did this.

manic glacierBOT
#

I tried compiling with -O2 for all SAMD51 and SAMD54 boards, but there were
three boards
(loc_ber_m4_base_board, pewpew_m4, and one other I don't remember) that did
not have sufficient
flash. Also, I am hesitant to make changes for a board I have not
tested.So, making it a global change
was not something I thought would be a good idea.

On Wed, Jul 22, 2020 at 6:12 PM Dan Halbert notifications@github.com
wrote:

Note that in py/py.mk, gc.o and vm.o will be compiled -O3 if SUPEROPT_GC
or...

#

@dhalbert - Because gcc only pays attention to the last -O option, the -O3
for gc.o and vm.o will still be in effect.
From the (very long) compile line:
...
-DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=256
-DCFG_TUD_MSC_BUFSIZE=1024 -O2 -flto -flto-partition=none
...
-O3 -c -MD -o build-pyportal/py/vm.o ../../py/vm.c

On Wed, Jul 22, 2020 at 6:12 PM Dan Halbert notifications@github.com
wrote:

Note that in py/py.mk, gc.o and vm.o will be compiled -O3 if SUPEROPT_GC
or SUPEROP...

#

@deshipu - gcc only uses the last -O option on the command line. So, the
-Os higher up will be overridden
by the -O2 farther along.

On Wed, Jul 22, 2020 at 6:03 PM Radomir Dopieralski <
notifications@github.com> wrote:

@deshipu commented on this pull request.

In ports/atmel-samd/Makefile
https://github.com/adafruit/circuitpython/pull/3190#discussion_r459131744
:

@@ -106,6 +106,11 @@ CFLAGS += -Os -DNDEBUG
CFLAGS += -DCFG_TUSB_MCU=OPT...

manic glacierBOT
#

I tried compiling with -O2 for all SAMD51 and SAMD54 boards, but there were three boards (loc_ber_m4_base_board, pewpew_m4, and one other I don't remember) that did not have sufficient flash.

These boards all have INTERNAL_FLASH_FILESYSTEM = 1 in mpconfigboard.mk, so that could be the trigger for not adding -O2 to a SAMD51 board. Nearly all the other boards either

I have tried in the past to minimize the number of board-specific settings in mpconfigboard.mk if they can be deriv...

#

@dhalbert - Because gcc only pays attention to the last -O option, the -O3 for gc.o and vm.o will still be in effect. From the (very long) compile line: ... -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=256 -DCFG_TUD_MSC_BUFSIZE=1024 -O2 -flto -flto-partition=none ... -O3 -c -MD -o build-pyportal/py/vm.o ../../py/vm.c

Thanks, I was not sure the new setting would be the last one, since it depends on the order of applying CFLAGS +=.

The -O2 could also be set by parameterizi...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@dhalbert See comment below. I think we will need to implement this on a board-by-board basis.

That is what I am trying avoid. I would like the defaults for a particular chip or chip family to be the most common case, and then the boards that don't work can be overriden in mpconfigboard.mk. I would like most mpconfigboard.mk files not to have to change. For instance, the current PR does not change a large number of SAMD51 boards that could benefit from -O2.

I did a big refactorin...

manic glacierBOT
#

Can you send me a complete example? Is it possible this affects only airlift? Here's the example I cooked up based on your description. However, I didn't get any crashes (tested with 5.3.1, 6.0.0-alpha.1, and latest on metro m4 non-airlift):

import board
import displayio
import digitalio
import framebufferio
import rgbmatrix

displayio.release_displays()

for a in [board.A0, board.A1, board.A2, board.A3]:
    d = digitalio.DigitalInOut(a)
    with d:
        d.switch_to_...
manic glacierBOT
#

@dhalbert - I see your point. I was just unsure about making changes for boards I have not tested. I did try using -O3 on a couple of boards and saw problems (like not booting properly). This made me cautious about increasing the optimization level globally. So, I will change the defaults in the Makefiles and then let them be overridden if needed by the boards mpconfigboard.mk.

simple pulsar
tulip sleet
#

@simple pulsar I think you're right

manic glacierBOT
#

Try this and wait like 30 seconds:

import board
import displayio
import framebufferio
import rgbmatrix
import terminalio

displayio.release_displays()
matrix = rgbmatrix.RGBMatrix(
    width=64, height=32, bit_depth=4,
    rgb_pins=[board.D2, board.D3, board.D4, board.D5, board.D6, board.D7],
    addr_pins=[board.A0, board.A1, board.A2, board.A3],
    clock_pin=board.A4, latch_pin=board.D10, output_enable_pin=board.D9)
display = framebufferio.FramebufferDisplay(matrix, auto_...
lapis hemlock
#

@lapis hemlock at least some build errors from circuitpython with that branch by the way ...

../../extmod/ulab/code/create.c:106:16: error: no previous prototype for β€˜create_linspace_arange’ [-Werror=missing-prototypes]
 ndarray_obj_t *create_linspace_arange(mp_float_t start, mp_float_t step, size_t len, uint8_t typecode) {
                ^~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors```

@onyx hinge That's really odd. With micropython, I don't see this error. The funtion in question is a local helper in create.c.

onyx hinge
#

If it is a local helper then it should be STATIC. I think the compiler is saying "This thing has extern linkage, but there's no declaration in an included header for it. This is probably wrong."

lapis hemlock
#

We could declare it STATIC, though, it's not going to fix anything.

#

OK, I will make it static.

onyx hinge
#

either it should be STATIC or it should have a declaration in a header that is included

lapis hemlock
#

Was that the only error, or did the compiler/linker bail out at the first one?

onyx hinge
#

it stops at the first one

lapis hemlock
#

I think that was probably the only addendum, so it should be OK now.

#

Sorry for the mix-up.

slender iron
#

crazy idea: we could defrag pointers that only exist in python objects if we cannot allocate after a collect

onyx hinge
#

πŸ’ͺ it's amazing how productive sitting down and working for a couple of hours uninterrupted is πŸ’ͺ

slender iron
#

πŸ’―

slender iron
#

anyone have anything they want to do before a 6.x beta?

onyx hinge
#

@slender iron yeah we still want to get this incompatible ulab change in

slender iron
#

I see some 6.x deprecation warnings I'll remove now

#

kk, when do you think that'll happen? I can just do an alpha release today

onyx hinge
#

It just started building, I'm going to create the PR in the next 56 minutes

#

well 5 minutes but I'll leave the typo

slender iron
#

I want to get more people testing what we have

#

kk

onyx hinge
#

+1

slender iron
#

I think the pystack might be too small

tulip sleet
#

issue #2082?

onyx hinge
#

I think importing circuitplayground lib was the "worst case" that made us bump the C stack size

slender iron
#

@tulip sleet yup

manic glacierBOT
onyx hinge
#

lunchtime here .. @slender iron I'll keep an eye in case you have a chance to look at that PR. I can chop it up so we don't immediately take the pyi files from ulab if the regression in the doc appearance is important. Therte are some markup problems that have not been corrected yet, including some head-scratchers as well as some shallow stuff

#

afk

slender iron
#

ya, will look. ideally I'll release today so I want to get things in for it

lapis hemlock
#

If you can hold on for an hour or so, then I can merge the norm function and its documentation into ulab/master.

manic glacierBOT
#

What do you think about async only being enabled on non-m0?

I could imagine async being used for simple multi-task timing projects even on a Trinket M0, say. I think a simple task library would fit.

Sure, but that doesn't mean we need it enabled. There are lots of things that could be useful on an M0.

Is the problem with the bast pro mini that it has more pins than other small boards like trinket and gemma?

Yes, I think so.

While looking at #3190, I realized that bo...

slender iron
#

@mental nexus ping me if you need help with git for #73

lone axle
slender iron
#

ya, it's been flaky the last few days

#

is that on a cp pr or a library?

lone axle
#

Library

#

Its on the display_text library. I pushed the change you pointed out to fix black color background. I just happened to leave the tab open though and noticed the dot never changed from yellow

slender iron
#

I've seen it flaky on CP to the point where the builds blocked by the test passing run but the test itself only shows as yellow

ionic elk
#

@onyx hinge want me to review your SDIO PR or are you still working on it?

manic glacierBOT
#

I could imagine async being used for simple multi-task timing projects even on a Trinket M0, say. I think a simple task library would fit.

Sure, but that doesn't mean we need it enabled. There are lots of things that could be useful on an M0.

I was just thinking that if it was really easy to use, it could be used in simple blinky and NeoPixel programs, etc.

While looking at #3190, I realized that both py/gc.o and py/vm.o are compiled -O3 by default. We have turned...

#

Once the docs have been merged into ulab's master branch we can update this PR and merge it. We should do this sooner rather than later, because it will create an incompatible API change as well.

I think I am done with the reshuffling of the files/stubs. I would still like to merge the norm function for 6.0, but I am waiting for someone with that: https://github.com/v923z/micropython-ulab/pull/145.

onyx hinge
#

@ionic elk that would be grand

ionic elk
#

u bet

onyx hinge
#

For the pin checking I followed the "new" spi way and was happy how little code it ended up being.

manic glacierBOT
onyx hinge
#

H.m I don't think I actually tested the 1 data pin case

lapis hemlock
#

@onyx hinge I have just seen that you had to fix the code in ulab.c. Many thanks, and sorry for the slip-ups!

onyx hinge
#

@lapis hemlock no problem

#

I just wish we had a better workflow for you to see and corect these problems first

lapis hemlock
#

Well, I could have compiled it locally. But perhaps, we could add circuitpython to the github workflow.

onyx hinge
#

I'm not quite sure how to "invert" the flow so that the CI of ulab can build with circuitpython...

#

since circuitpython has ulab inside to begin with, ..

lapis hemlock
#

Oh, that's a good point.

manic glacierBOT
lapis hemlock
#

We might run into an infinite recursion.

manic glacierBOT
slender iron
#

@tulip sleet did you want to leave .packet_size on PacketBuffer for 6.x?

onyx hinge
#

If you pull request the update of ulab you will of course get the errors in our own actions runs @v923z

lapis hemlock
#

I think the easiest way is to compile locally. That should throw errors, if something is wrong. I should have done that, but I was really in a hurry.

ionic elk
#

@onyx hinge what's the data tuple in pins.c?

onyx hinge
#

@ionic elk sdio has 4 "data" pins. I put them in a tuple.

ionic elk
#

Is that to avoid making a peripheral file? Or is it something we should be doing for other peripherals?

tulip sleet
#

@slender iron Originally I thought I might leave it in and remove it in 7.0.0 after the libraries have been updated. But I can update the libraries to try both the old and new property. I'd have to add compatibility code right now if you drop it in a beta. There are four libraries to do that for right now.

#

ble_adafruit, ble_ibbq, ble_midi and ble_heart_rate

onyx hinge
#

SDIO uses Clock, Command, and either 1 or 4 data pins. It's not a "choice of", it's "all these pins, together"

#

there are additions to the "periphs" for stm32f405, +const mcu_periph_obj_t mcu_sdio_clock_list[1] = { etc

ionic elk
#

Right, that makes sense. I'm trying to understand why you need a tuple for it in pins.c, as opposed to the other peripherals which don't need that data structure.

#

Since that probably impacts how the pins are dealt with in the context of the module, right?

onyx hinge
#

so that you can write sdioio.SDCard(clock=board.SDIO_CLOCK, command=board.SDIO_COMMAND, data=board.SDIO_DATA)

#

alternatively you'd write, I guess, data0=board.SDIO_DATA0, data1=board.SDIO_DATA1, ... ? I didn't like an alternative like that

ionic elk
#

Ah, so it's an equivalent to SPI_FLASH_MOSI_PIN style defaults, but without an out-of-port shared-module or supervisor component?

onyx hinge
#

it's like board.MISO except that it's 1-or-4-pins-in-a-tuple

ionic elk
#

Ok, so the difference is the 1-or-4 part?

onyx hinge
#
+    { MP_ROM_QSTR(MP_QSTR_SDIO_CLOCK), MP_ROM_PTR(&pin_PC12) },
+    { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PD02) },
+    { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) },
#

yes there might be a board where the tuple has just 1 pin in it, though both boards with a board.SDIO_DATA tuple have 4 right now

#

it should be static to pins.c though

ionic elk
#

ok, I think I get it now, thanks for walking me through it

#

Do you feel it is fundamentally incompatible with a board.h #define SDIO_CLOCK style approach because of the requirements of the data structure?

#

I think it would be good to keep the method of adding board level pin use defaults consistent if possible. If not, it might be good to add a note in board.h that the SDIO defaults must be created in pins.c

onyx hinge
#

@ionic elk I'm not sure how that would work, can you show me? It would probably work for clock and command.

teal fern
#

@slender iron I was doing it on a linux subsystem since "make" does not work on windows

manic glacierBOT
mental nexus
#

@mental nexus ping me if you need help with git for #73

#

@slender iron I can use help with this repo. Somehow the diff is comparing against an old version of master, even though it says it is comparing against the current adafruit/master repo.

onyx hinge
#

frustrated with github actions today

slender iron
#

@mental nexus I think the issue is with your branch

mental nexus
#

Hmm. Do I need to merge the master back into it and then make my updates?

slender iron
#

it's 25 commits behind master

#

how did you make the new branch? did you base it off your master?

mental nexus
#

Yep but I actually downloaded the latest master label.py and worked from that. Didn’t realize it would get confused by that. I’m definitely a novice.

slender iron
#

@rigid birch please ask here so others can help too

#

right, that's where the confusion comes from. it thinks you started from 25 commits back rather than newer

#

so it's trying to apply those changes to the latest

#

I recommend always doing git fetch adafruit and git checkout adafruit/main to start a new branch

mental nexus
#

Ok so what next? 😬

slender iron
#

my main branch ends up stale

#

I think the easiest thing is to remake your local version of the branch

#

so save the version of the file you want and then do those first two steps again

mental nexus
#

Ok will try and see what happens. I’ll have to issue a PR to see if it fixes it. So bear with me if there are a few PRs created and then deleted.

slender iron
#

no you don't πŸ™‚

#

leave the PR open

#

the PR is tied to the branch name

#

so all you need to do is update it

mental nexus
#

Ok so I’ll try and get the current fork branch back into shape.

slender iron
#

wanna hop in voice so I can walk you through it?

mental nexus
#

Let me take a shot and will ping you. A lot of activity at my house right now...,

slender iron
#

kk

rigid birch
#

Is there a video from Scott's live stream on how to flash the bootloader to the esp32 s2?

slender iron
#

I don't think there is but you also don't need it

rigid birch
#

What is the basic workflow for getting circuit python onto a Sola board?

slender iron
rigid birch
#

Thank you!

slender iron
#

sorry I didn't send it sooner

#

thanks to @idle wharf for writing it up

mental nexus
#

@slender iron just merged my master into the branch and it cleared all the missing commits. Now on to pylint.... thanks for your help! BTW I haven’t tackled building CP yet. It will wait another week.

lapis hemlock
#

@onyx hinge @slender iron I am done with ulab, at least, feature-wise. I will fix the documentation issues tomorrow or on Saturday, but I hope that doesn't hinder the release of 6.0.0.rc.

slender iron
#

np, we're not to rc anyway

lapis hemlock
#

How come?

#

You were gungho earlier.

slender iron
#

I'll release for sure. just a question of alpha vs beta naming

lapis hemlock
#

kk

manic glacierBOT
slender iron
#

all good πŸ™‚

tulip sleet
#

@slender iron what kind of size reductions are you seeing with gcc10?

manic glacierBOT
slender iron
#

~1k iirc

tulip sleet
#

ooh, that is nice for the small ports

slender iron
#

what build is interesting? I can run it now

tulip sleet
#

trinket is a good example

#

also maybe one of the cpx ones that is constantly in danger of overflowing

slender iron
#

trinket m0 de_DE has 1520 bytes free

tulip sleet
#

can you do gcc9 easily, or should I do it on the tip of something?

#

to see the diff

slender iron
#

no, I'm on my gcc10 branch

#

cpx de_DE has 2748 bytes free

#

looks at the CI build

#

ah, just force pushed it

tulip sleet
#

i am running tip of main

slender iron
#

kk, should be the same

tulip sleet
#

trinket de_DE is 164 bytes free

slender iron
#

this is with arch's 10.1. I'm not sure how exact it is with what arm provides

tulip sleet
#

cpx de_DE is 1056 bytes free with gcc9

slender iron
#

so ~1500 bytes or so

tulip sleet
#

cpx has more modules and has longints compared with trinket

#

that's an impressive improvement; I wonder what they are doing

#

we have not seen such dramatic improvements with the other gcc major version changes in the past

slender iron
#

ya, not sure what changed

#

need this change too: v

manic glacierBOT
manic glacierBOT
slender iron
#

Ok, I'll kick off the alpha build

tulip sleet
slender iron
#

ah, wrong link

#

switching to linux is messing up my hotkeys

tulip sleet
#

approved that

slender iron
#

thanks!

#

will circle back to it once the ulab change is in. need it for some added externs

manic glacierBOT
#

Looks like a good start! Found some debugging stuff that looks left behind, and I had some comments about the peripheral declaration - I don't think that having everything be an array is essential to the periph/ API when they're all just single index like that.

Beyond that, I'd like to understand better how the user actually declares SDIO in python, do you have an example sketch I can toy around with? I'm imagining it might be more practical to have everything constructed like board.I2C a...

#

I would prefer that this declaration be brought in line with other board "DEFAULT" devices, defined as a series of macros in the <board>/mpconfigboard.h file, similarly to DEFAULT_I2C_BUS_SCL and the other default busio objects. You can see the implementation of this in shared-bindings/board/__init__.c: https://github.com/adafruit/circuitpython/blob/6a46fd5b91d92609cf33eb93f1c4e24632451d25/shared-bindings/board/__init__.c#L51

In this case, you would need to do a pre-processor check to se...

#
[adafruit/circuitpython] New tag created: 6\.0\.0\-alpha\.2
orchid basinBOT
crimson ferry
#

Saola clone doesn't really need its own board or download, does it? So far, same pinout, runs alpha-1 WROVER. There are WROOM and WROVER variants, (IPEX and board ant), and with and w/o sensors.

#

(Gravitech Cucumber)

Addendum... looks like it may need some special definitions, at least the sensor version. It expects I2C0 SDA and SCL on 41 and 40 for the sensors. A few other expected assignments that seem to be more specific than the raw Saola as it is now.

manic glacierBOT
#

It looks like there is some level of intended portability of the same API code to devices which call the hardware block SDMMC:

STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sd.h:#define SD_TypeDef          SDIO_TypeDef
STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_sd.h:#define SD_TypeDef          SDMMC_TypeDef

.. which goes inside SD_HandleTypeDef, and

STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sd.h:HAL_StatusTypeDef HAL_SD_Init(SD_HandleTypeDef *hsd);
STM32F7xx_HAL_Driver/Inc/stm32f7xx_h...
manic glacierBOT
teal fern
#

@slender iron I tried again but I still get the same error, do you know of any way to use the "make" command on windows other than using a linux subsystem?

orchid basinBOT
teal fern
#

@slender iron I think I actually might be missing arm-none-eabi-gcc and im going to try and figure out how to install it

lone axle
#

I was able to build on windows inside of a linux virtual box if that counds.

teal fern
#

yeah im in a linux subsystem

#

but for some reason it isnt working

orchid basinBOT
teal fern
#

@slender iron i literally just completely reinstalled ubuntu and it still didn't work

slender iron
#

@teal fern sorry, I don't know much about building in WSL

low sentinel
#

@teal fern don't "install" it. Just download + extract. Personally - I don't even add it to my $PATH on wsl because I have a lot going on in there.

#

example make from /circuitpython root

(cd ports/atmel-samd && PATH=~/gcc-arm-none-eabi-9-2019-q4-major/bin:$PATH make BOARD=feather_m4_express TRANSLATION=en_US -j 8)
teal fern
#

haha I have very little experience with unix, how would I download + extract, also what is this example

low sentinel
#
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 && tar xvf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
teal fern
#

that errored 😦

#

tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

#

(thanks for helping @low sentinel btw)

low sentinel
#

what does gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 look like?

teal fern
#

gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2: command not found

low sentinel
#
shasum ~/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
3829ff61b2601c6cf061a5a275c2538a96a8d521  /home/kvc/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
teal fern
#

oh I assume you did not want me to run that as a command lol

low sentinel
#

run shasum ~/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2

teal fern
#

it returns this:
6487ac865e530e5c83a8ae34c12f3adc18b12186 /home/adinack/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2

low sentinel
#

cool! Then you've downloaded something that is not correct. Figure out the wget or download that link on your browser and get it into your wsl home directory

teal fern
#

I didn't download anythin

#

this is a brand new install

#

but I'll do that thanks!

low sentinel
#
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 && tar xvf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2

If you pasted this you attempted to download gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 from https://developer.arm.com/-/media/Files/downloads

teal fern
#

oh yeah I did run that

#

but it didn't download right? since it errored at the end?

low sentinel
#

Shasum shows you downloaded something different from what I did at that url

teal fern
#

if its the same url why would they differ??

low sentinel
#

I don't know, what's your network like? Got a weird proxy?

teal fern
#

nope, standard internet

tropic rain
#

I'm having trouble with the Circuit Playground express TV Zapper guide. I have a lot of details becuse I dug in a bit.
I am just trying to use the resultant code at the end of the guude that uses pulseio.PulseOut to send the data over the IR LED. Specifically the python code in cpx_main.py along with the data in codes.txt.
On line 10 of codes.txt the timing data for PulseOut.send() which is in a list stored in the key 'table' has an value for off time that is 95603 and this is bigger than an unsigned short which is specified when the array is built on line 67 of cpx_main.py and an excpetion is thrown. I tried changing the array instantiation to uses 'I' and I saw an error from the bindings for PulseOut which explicitly checks for datatype 'H' in the array. So we've got a data overflow becasue the data is too big. I did look to see if Pulseout.send() had changed over time with regard to datatype and it hasn't and I also checked to see if codes.txt had been modified and it hadn't. It seems like this never worked but I'm probably missing something.

teal fern
#

@low sentinel i just tried the command again and here is exactly what it says:
bzip2: Compressed file ends unexpectedly;
perhaps it is corrupted? Possible reason follows.
bzip2: Inappropriate ioctl for device
Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

low sentinel
#

Just do the wget by itself

teal fern
#

kk

low sentinel
#

(with the url obvs)

teal fern
#

haha yeah

#

success

low sentinel
#

Shasum it

teal fern
#

ooooooh

low sentinel
#

Does it look right?

teal fern
#

i think i understand

#

there were many

#

it was doing the (for some reason) corrupted one every time

low sentinel
#

Neat

teal fern
#

ok i shasumed the .3 one

#

what the heck

#

when I copy it the number changes

#

hmm

#

well here is what it is when I paste it:
3ATq2KXvPw9TEv6w8ED1ig8A71gB8ZcZpw

#

so...for some reason that only happens if I include the 3 in the beginning

#

ok I extracted it, what next?

low sentinel
#

Do you have circuitpython checked out and the build dependencies all apt-get installed? Cd to the root of the repo and

(cd ports/atmel-samd && PATH=~/gcc-arm-none-eabi-9-2019-q4-major/bin:$PATH make BOARD=feather_m4_express TRANSLATION=en_US -j 8)
teal fern
#

kk

#

it says this:
install: cannot change permissions of β€˜build-itsybitsy_m4_express/genhdr’: Operation not permitted

#

(btw i changed the feather to itsybitsy)

#

oh perhaps it is because it is running on a windows mounted drive

#

ill try it somewhere else

low sentinel
#

are you using wsl2?

#

I had that problem too. Just check it out in your wsl

teal fern
#

idk, all I know is it is ubuntu from the windows store

#

lol

low sentinel
#

you can use VSCode and the integration is amazing.
Also you can do explorer.exe . to open windows explorer at whatever folder you're in

teal fern
#

oh yeah! I did know that

#

success! thank you very much @low sentinel !!

low sentinel
#

Yep! Have fun

teal fern
#

thanks!

#

@slender iron building is working now! I am ready for the next step πŸ™‚

slender iron
#

great!

#

it's what decides if a pin is valid

teal fern
#

ok cool

manic glacierBOT
#

What do you think about async only being enabled on non-m0?

Async is useful everywhere; right now it's nowhere. There's no great loss if it's not available on m0 at the outset.

It might be a problem in the future, as it's a core language feature, but on the short-to-medium term it seems fine. Right now I'm happy to disable any target that does not easily build (given that there is a pretty healthy crop of boards that do build). If there is demand on those tiny boards the problems...

teal fern
#

i don't really understand this code sorry

#

i assume variable frequency is false in this case

slender iron
#

ya, I'd assume it's fixed

#

it's complicated code because it tries to share timers if it can

#

because if you have a bunch of servos they'll all be the same frequency

teal fern
#

thus they could use the same timer?

slender iron
#

exactly

teal fern
#

cool

#

so in my case I do not need a variable frequency

slender iron
#

the timer dictates the frequency and the channel dictates duty cycle

teal fern
#

ok cool

#

i do need a variable duty cycle, would we be able to do that?

slender iron
#

ya, I think so since the top would be dictated by the timer mode

teal fern
#

nice

#

so what are we needing to change here

#

add gpio 2 to some list of available pins?

slender iron
#

no, it's not that simple

teal fern
#

rip

#

could we hardcode gpio 2 as a pwmout with a set frequency?

slender iron
#

your pin has a wave_output of 0

teal fern
#

what does that mean?

slender iron
#

wave_output implies the channel of the timer

teal fern
#

i see

slender iron
#

and channel 0 is usually used for the top value

teal fern
#

what is top value?

slender iron
#

it dictates how high the counter counts before resetting

#

I'd recommend reading the TC section of the datasheet for an overview

teal fern
#

oh sorry it isnt gpio 2, its A5

#

ok will do

slender iron
#

On ItsyBitsy M4, pin A5 is PA06. Looking at the datasheet for SAMD51, only TC1/WO[0] is available on that pin. I wonder if that timer is used internally for something.

teal fern
#

yes i see that in the datasheet

slender iron
#

WO is wave output

teal fern
#

gotcha

#

is LUT look up table?

slender iron
#

ya usually

teal fern
#

yeah I am having extreme difficuly understanding this datasheet

slender iron
#

don't try to read the whole thing πŸ™‚

teal fern
#

haha

slender iron
#

the "functional description" of the TC section will be most relevant

teal fern
#

found it

slender iron
#

and should have decent drawings to understand how a TC works and what modes it has

teal fern
#

cool

slender iron
#

you'll notice "normal" versus "match" modes that change what the top value of the timer can be

teal fern
#

ok cool

#

here is a diagram i found

#

so it looks to me that we control the frequency (or duty cycle??) by changing TOP

manic glacierBOT
slender iron
#

frequency with top

#

I'm off for the night! good luck!

manic glacierBOT
teal fern
#

thanks!

thorny jay
#

Feature-wise, this stable release adds basic lower power support when in time.sleep() and initial ESP32-S2 support. The lower power work changed time keeping and may have introduced bugs. Please use 5.3.0 if you need a stable version of CircuitPython.

#

The first stable may need another word?

onyx hinge
#

@thorny jay updated to say "this unstable release", thanks.

manic glacierBOT
crimson ferry
#

@ionic elk these errors are expected in 6.0 on esp32s2? E (18118505) ledc: ledc_stop(428): LEDC is not initialized E (18118505) ledc: ledc_timer_rst(234): LEDC is not initialized

solar whale
#

@ionic elk where are you seeing that error? During build? Did you do make BOARD=espressif_saola_1_wrover clean first?

#

I just built latest main -- did not see that?

#

@crimson ferry sorry that was for you

crimson ferry
#

I get that with alpha-2 (that I pulled from S3 since it's not on circuitpython.org yet)

solar whale
#

when do you get it?

crimson ferry
#

last night Adafruit CircuitPython 6.0.0-alpha.2 on 2020-07-23; Saola 1 w/Wrover with ESP32S2

solar whale
#

I donde see ledc defined ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.2 on 2020-07-24; Saola 1 w/Wrover with ESP32S2

import board
dir(board)
['IO0', 'IO1', 'IO10', 'IO11', 'IO12', 'IO13', 'IO14', 'IO15', 'IO16', 'IO17', 'IO18', 'IO19', 'IO2', 'IO20', 'IO21', 'IO26', 'IO3', 'IO33', 'IO34', 'IO35', 'IO36', 'IO37', 'IO38', 'IO39', 'IO4', 'IO40', 'IO41', 'IO42', 'IO43', 'IO44', 'IO45', 'IO46', 'IO5', 'IO6', 'IO7', 'IO8', 'IO9', 'RX', 'TX']

#

how do you trigger the error

crimson ferry
#

it's in the debug console, not code... I believe LEDC is for PWM out

solar whale
#

OH -- I never look at the debug console -- just a sec

#

not even sure how to connect to it

crimson ferry
#

default USB connector... I use screen /dev/tty.***** 115200

solar whale
#

my mac won't connect to it...

#

says resource busy

crimson ferry
#

hm, it's usually the native/otg one that I have issues with

#

on Mac, it should be a SLAB

#

oh wait, with 6.0, it's some odd string

solar whale
#

I can get to the REPL ok

#

on the native USP (pins 19/20)

crimson ferry
#

(I always do ls -lt /dev/tty.* to know what I plugged in most recently)

#

yeah, not the native 19/20

solar whale
#

ok -- got it it was .SLAB...

#
I (412) cpu_start: Starting scheduler on PRO CPU.
E (2115) ledc: ledc_stop(428): LEDC is not initialized
E (2115) ledc: ledc_stop(428): LEDC is not initialized
E (2115) ledc: ledc_stop(428): LEDC is not initialized
E (2115) ledc: ledc_stop(428): LEDC is not initialized
E (2125) ledc: ledc_stop(428): LEDC is not initialized
E (2125) ledc: ledc_stop(428): LEDC is not initialized
E (2135) ledc: ledc_stop(428): LEDC is not initialized
E (2135) ledc: ledc_stop(428): LEDC is not initialized
#

not sure if that is new or not -- never looked before πŸ˜‰

crimson ferry
#

I think it's new with the PWM out changes 2 days ago

solar whale
#

ok -- sorry - I have no idea.

crimson ferry
#

thanks for confirming my sanity πŸ˜‰

solar whale
#

seems to boot OK and work normally

crimson ferry
#

yes, it's been working fine, haven't tried PWM out yet

#

gpio, i2c, spi, displayio all great. I do lose CIRCUITPY (volume gone from macOS) and/or my 19/20 terminal sometimes

#

another question, maybe for Scott this afternoon... we're starting to see some esp32s2 pins get locked down from wide-open matrix to specific uses, so I wonder what's the strategy... Adafruit typically I think preferences analog pins, so maybe we should leave pins for ADC1 alone? Also, Scott's and UnexpectedMaker's Feather adapter/boards make some pinout choices.

solar whale
#

I noticed when I loaded CP this time -- It appears to have cleared CITCUITPY

crimson ferry
#

I think for now it always does that since it's a bin dump onto the chip... hopefully we'll get a UF2 and leave the CIRCUITPY intact

manic glacierBOT
solar whale
#

Ah -- I could not remember how it behaved. Too many different boards....

crimson ferry
#

i feel... i pretty much remember just what I worked on last

manic glacierBOT
slender iron
#

@crimson ferry remind me later to talk about it. I was considering revving my breakout on the stream

#

goes for a run

lapis hemlock
#

I am at my wit's end...πŸ˜–

old smelt
#

@slender iron - have any time today to revisit the custom board lib discussion? I think we may have candidate ready to release

onyx hinge
#

@slender iron any advice on how to approach this problem, where sub-items are inconsistently appearing within the documentation's local table of contents? these are not all of the functions in "approx".

#

but all the functions DO appear in the page for ulab.approx itself

lapis hemlock
#

OK, that's also broken. approx should begin with bisect.

onyx hinge
#

worse, the sets of functions that appear are slightly different for "our" docs and the in-progress docs within the ulab repo

lapis hemlock
#

You mean the missing bisect e.g., don't you?

onyx hinge
#

right

lapis hemlock
#

So, what the heck is going on?

#

The screenshot is with the hand-crafted stubs, right?

onyx hinge
#

right

#

(I mean, I know what you're talking about but I'm as lost as you as to the solution.. which is why I hope tannewt or someone else has an insight to share when they're around)

lapis hemlock
#

Scott is jogging at the moment.

#

He had better run fastπŸ˜‰

onyx hinge
#

I see that now

lapis hemlock
#

OK, then I let you continue with your work. I should be around.

ionic elk
#

@crimson ferry I haven't run into that so far, but I don't use the debug USB output

#

@crimson ferry @solar whale when does this show up again, exactly? And does it lead to an actual circuitpython crash? It might be that I was triggering error messages over the debugging USB link that I missed simply because I wasn't looking at it, especially if they don't halt the program

#

I'll take another look today

#

Anyway, @onyx hinge, what's the format I need for the MicroSD card? FAT32 or something else?

#

just FAT?

onyx hinge
#

@ionic elk have you been alerted that your change may have caused the litex port to stop building? "Claim USB pins at startup to prevent overwrites"

ionic elk
#

Wat

onyx hinge
#

/usr/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld: build-fomu/shared-module/touchio/TouchIn.o: in function `common_hal_touchio_touchin_construct': /home/runner/work/circuitpython/circuitpython/ports/litex/../../shared-module/touchio/TouchIn.c:71: undefined reference to `common_hal_mcu_pin_claim'

#

I didn't fully chase it down but my guess is this recent change

crimson ferry
#

@ionic elk shows up at boot time, on the debug console, with or without a code.py. I haven't tested PWMOut specifically, but other functions don't seem affected.

onyx hinge
#

Anyway, yes, FAT32 (but not EXFAT) should work on SD cards. Except for a 64GB SD card, each one I've purchased has come pre formatted with something that worked.

ionic elk
#

@onyx hinge Shoot I read the warning: section '.bss' type changed to PROGBITS and thought it was a spurious error, totally missed the common hal thing

onyx hinge
#

Someone on this channel warned me that Windows would exfat-format a 64GB SD card, but Linux mkfs.fat does not

#

It happens 😰

ionic elk
#

@crimson ferry It shows up at boot, but only since PWM? I didn't add anything to boot - I didn't even add anything outside the module itself. Maybe the idf automatically detects when a module is being used and then tries to apply it elsewhere or something?

onyx hinge
#

I don't know what that message MEANS but it appears in all fomu builds. I think the message I pasted is the "real" error. /usr/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld: warning: section `.bss' type changed to PROGBITS

ionic elk
#

See that bit I have no idea, that doesn't sound like something I did

#

I did do some mucking with TouchIO though and might have missed something there

crimson ferry
#

@ionic elk OK, thanks, since it was an "E" just wanted to check if it was expected. I'm sure it will get sorted.

onyx hinge
#

yeah, you added a call to the function common_hal_mcu_pin_claim in shared-module/touchio and the linker says that is not defined

#

.. so I guess it needs to be added to the fomu / litex port?

ionic elk
#

Yeah Litex probably just skipped the redundant implementation of common_hal_mcu_pin_claim that most ports have in favor of just doing claim_pin.

onyx hinge
#

it is really frustrating when the CI is perceived as flaky because every once in awhile we miss that it's actually telling us something

ionic elk
#

But I actually need a non-redundant implementation for STM32 and so I'm forcing everything outside the ports to use the common HAL version

onyx hinge
#

and github actions sure has felt flaky this week

#

Makes sense, let one of us know if you need a hand writing the litex implementation but based on what you said it may be trivial?

ionic elk
#

Yeah I agree, I've had so many spurious failures that I sometimes just cruise right by real ones

#

Nah it's almost certainly trivial. Every port but STM is redundant, like I said: common_hal_mcu_pin_claim just calls claim_pin directly with the same parameters.

#

I needed claim_pin to use the pin port and number instead of the object, which is why stm is a little different

#

But in general I really prefer for anything in shared-module and shared-bindings to use common-hal interfaces instead of internal port ones - I've been trying to fix instances of that since I started working on Circuitpython.

onyx hinge
#

that's good work, I'm glad you're doing it.

lapis hemlock
onyx hinge
#

that's the conversion to use stubs instead of rst in the docs-in-C-source-files

lapis hemlock
#

Why don't other modules suffer from this? Or do they?

onyx hinge
#

I don't know.

#

is ulab the only example of a package that is in circuitpython or are there other examples of that?

lapis hemlock
#

I feel privileged by your question, but I haven't the foggiest idea.

#

If the question was addressed to me, that is.

manic glacierBOT
ionic elk
#

@onyx hinge fix up

manic glacierBOT
ionic elk
#

@onyx hinge do we not have a litex label?

onyx hinge
#

I don't see one so I created it

ionic elk
#

thanks I was about to do the same

lapis hemlock
#

Should ulab have vectorised implementations for copysign, pow, ldexp, fmod? These are all two-argument functions. Any practical use for them?

manic glacierBOT
ionic elk
#

@onyx hinge I feel like we could use a ulab label too, tbh

#

@crimson ferry did you delete your github comment? I think you were looking at the wrong commit but you probably already resolved that

#

@onyx hinge ok, I have your sketch loaded up, and it doesn't output any errors when the SD card is plugged in, but os.listdir('/sd/') doesn't output anything

#

any ideas?

crimson ferry
#

@ionic elk Yes, sorry about that, I was looking at old code.

ionic elk
#

@crimson ferry all good that's what I figured just wanted to check if you had any other questions

slender iron
#

@onyx hinge I'm not sure why there are doc issues

lapis hemlock
#

@slender iron I think Jeff popped an idea: are there other modules that are bound in the same fashion as ulab, so that we could compare?

#

And are circuitpython modules broken in the same way?

slender iron
#

maybe

#

I haven't looked closely

lapis hemlock
onyx hinge
#

@ionic elk do you expect files on /sd? A newly formatted card won't have anything. I don't think the "." or ".." directory entries are listed either.

#

if os.listdir returns the empty list [] for an empty SD card it may be correct

ionic elk
#

@onyx hinge I made some with my adapter

onyx hinge
#

okayyyyy

#

surprised you could get to the step of having the mounted filesystem but no files inside

ionic elk
#

so I'm not sure, maybe it tries to reformat?

#

I'll try making some of my own with storage

onyx hinge
#

not to my knowledge

ionic elk
#

@onyx hinge do I use storage or os to make directories and files?

onyx hinge
#

after you have "mount"ed it you would use os or just open()

lapis hemlock
#

@slender iron None of the modules, except ulab, has a level below the first one. Could this problem be related to the depth?

onyx hinge
#

microcontroller.pin is a submodule

#

but I'm not sure how it gets documented, since its content is different in each build

ionic elk
#

@onyx hinge nevermind - I just wasn't viewing the output. OS functions don't include the actual print

#

I just needed to put a print() around the listdir call

onyx hinge
ionic elk
#

I'm still kind of a derp with python sometimes

onyx hinge
#

assuming what you're looking at is this spi thing, you can exclude problems with the newer sdcardio module by using adafruit_sdcard

ionic elk
#

@onyx hinge not sure what you mean, this is all just me testing your sdio module with the sketch you included

onyx hinge
#

you're looking at sdioio ? okay.

ionic elk
#

I just didn't realize I needed to print the call, I thought it would output by itself but I was wrong

#

it's working great now

onyx hinge
ionic elk
#

oooh no I don't know about that

#

That's probably some gross HAL level gotcha

onyx hinge
#

given my workaround .. yeah I think so

ionic elk
#

Ok I merged the Litex fix

onyx hinge
#

awesome, thank you for fixing it

manic glacierBOT
mental nexus
#

(please forgive the personal celebration) Just built CP for the first time. Now let's try and break something!

idle owl
#

@mental nexus Congrats! Good luck on the breaking!

slender iron
#

@lapis hemlock ya, depth problem is likely

manic glacierBOT
#

See e.g., https://readthedocs.org/projects/circuitpython/builds/11523378/ (may need to be logged in to RTD as a CircuitPython collaborator)

Running Sphinx v1.8.5
Traceback (most recent call last):
  File "tools/extract_pyi.py", line 15, in 
    import isort
ModuleNotFoundError: No module named 'isort'
make: *** [stubs] Error 1

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/circuitpython/envs/latest/lib/python3.7/site-packages/sphin...
lapis hemlock
#

@lapis hemlock ya, depth problem is likely
@slender iron I'm baffled a bit: https://github.com/adafruit/circuitpython/blob/main/shared-bindings/ulab/poly/__init__.pyi and https://github.com/adafruit/circuitpython/blob/main/shared-bindings/ulab/fft/__init__.pyi have the same structure (two functions each), yet, fft is at least partially listed, while poly is not:

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython

#

I think I have run out of ideas for today.

slender iron
#

@lapis hemlock I don't have any ideas

lapis hemlock
#

Well, that makes us two.

#

But as a beauty plaster, I could generate the complete ulab documentation separately (I mean, a single .rst file), and you could simply include that. I am almost certain now that the recursion depth in the template is causing the problem.

#

If we generate the docs only for ulab, then we are again one level higher, so we would not run into said difficulty.

onyx hinge
#

hmmm this can't be healthy. ```>>> g = displayio.Group()

g.append(g)

lapis hemlock
#

This won't work out of the box, either. An __init__.pyi at the top level doesn't suffice for sphinx. There is no index.html here:

manic glacierBOT
ionic elk
#

@onyx hinge I think you gotta run translations again on your PR

idle owl
#

@onyx hinge I am updating the Localisation section on circuitpython.org. I'll tag you on the PR, if that's alright with you.

manic glacierBOT
onyx hinge
#

@idle owl that is awesome, happy to look at your improvements

#

@ionic elk sorry for the confusion over whether the tuple-of-pins thing was unique, I am betting I missed the right moment to call it to your attention. thanks for the note about translations

idle owl
#

My biggest issue with it was "Localization" in the context of the other headers sounds like localising the libraries, not CP core. But there are other bits that will work better moved around a bit, and copy tweaked.

onyx hinge
#

hmmmm that is a valid point, did you see a way to improve it?

idle owl
#

Yes. πŸ™‚

#

Working on it now.