@onyx hinge Jeff, I have inserted stubs for the newly-created function trapz here: https://github.com/v923z/micropython-ulab/tree/documentation Is the format OK?
#circuitpython-dev
1 messages Β· Page 317 of 1
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
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.
If so, I can do this for the rest, so that you would no longer have to write the docs.
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.
except for that time some jerk tried to cook a steak at 10pm and caused the whole building to evacuate.
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.
Oi!
@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.
@ivory yew Give the cat to steak jerk to hold for the duration, I suppose.
like, maybe there has to be a blank line after the last :param? not sure
@blissful pollen Gah, yeah, that's fair.
I have checked it with extract_pyi.py, and compared against the existing docs.
nice, cool!
Do you think we could make it for the 6.0 release?
I can work on this tomorrow night.
@blissful pollen I'm in northern NJ, and when certain dignitaries come to town, they scramble fighter jets for escort. Rattles my walls.
It seems possible -- we are talking about a beta release next.
@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.
What is the timeframe?
beta release this week, but this can be done independently imo
@ivory yew Figures. Sounds like something my cat would do.
@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
the word "dignitary". it may have meant something different to people born before 2020.
She didn't sulk much but when she did she made sure I knew it.
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.
@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?
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.
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.
That's correct: https://micropython-ulab.readthedocs.io/
π please ping me again about this if you don't see movement on my end.
I see you have added (some) types, def trapz(y: ulab.array, x=None, dx=1.0) -> float:, this is good
ttyl
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.
you are awesome, thank you
Can someone tell me if the Arduino Due is supported by Circuit Python?
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
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+?
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.
Aah I see. So the current entry level CircuitPython board would be the Trinket M0?
Or the identical looking Seeeduino Xiao?
Those both do work but a more powerful chip is a better experience for not much more money
something with more RAM
@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.
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 ...
@warriorofwire are you aware of this?
@low sentinel
https://github.com/micropython/micropython/pulls?q=is%3Apr+async+generator
https://github.com/micropython/micropython/issues?q=is%3Aissue+async+generator+
https://forum.micropython.org/viewtopic.php?f=15&t=85 might be the most promising places to look. A lot of discussion re pend_throw(); not sure how much is relevant to the next() issue
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'...
So the idea is, someone COULD reenable CIRCUITPY_NETWORK in a custom build for 6.x but we wouldn't accept it in a pull request?
Hmm, I'll look into it. Thanks for the report!
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, ...
So the idea is, someone COULD reenable CIRCUITPY_NETWORK in a custom build for 6.x but we wouldn't accept it in a pull request?
Ya, if they really need it.
:+1: Note, we make no promises how fast AnalogIn is so 64x would be ok.
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.
Fixes https://github.com/adafruit/circuitpython/issues/3170
The absolute transform needs to be subtracted in all cases, not
only when the coordinate system is transposed.
@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.
Okay will do. Thank you. I will try out this build tomorrow.
coroutines don't have next; they also call themselves coroutines.
This does not change the fact that async def methods are generators,
but it does make them behave more like CPython.
This also turns on async in mpy-cross so tests will pass, though the exception thrown by the mpy-cross byte code is not very helpful.
I tested this out today on a PyGamer with the code provided in the issue.
This does resolve the issue, the VectorShape is now moving with the Group.
Thank you!
@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.
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...
@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...
Hi All - general question: Does a PR need an associated issue?
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
@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.
@ionic elk What do you mean by "convert into a 32-bit number"?
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
But how is this fraction encoded in the 16 bits?
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
Ah OK.
0x7FFF/0xFFFF ~= 1/2, etc
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. π
Right 0x10001 is just the same as my bitwise operation
Yeah exactly.
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 annotationsinto each .pyi to solve the problem of forward references - Use the standard
astmodule instead ofastroid
[adafruit/circuitpython] Issue opened: #3183 Option to use higher gcc optimization levels for builds
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...
@gilded cradle I would feel free to merge Brent's PR. I don't think anyone but Brent has the hardware to test it π
Sounds good
@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...
Thanks for testing in exponentiation. This covers all the bases I was worried about, so we can merge. Thank you for your patience.
I don't think that MicroPython is using clang-format. They are using astyle IIRC.
@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
it should be possible. what are you trying to do?
Really nothing crazy, size_t max_duty = log2(LEDC_APB_CLK_HZ/frequency);
I mean I could make a big table but this seemed cleaner
why do you need log2?
Am I being dumb? is there another easy way of doing that equation?
I don't understand what you are trying to do
I could make a recursive log function myself I guess, I don't know how sophisticated log2 is behind the scenes
or why you are doing what you are doing
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)
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
Here's a hyperlink. We need to know the bits of resolution since we want to get the maximum number of them for a given frequency - they're a required parameter for the setup of the PWM module: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions
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?
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)
size_t max_duty = log(LEDC_APB_CLK_HZ/frequency) / log(2); is that expression if you're missing log2 right?
I'm actually missing log
woops
I use log2 but it appears to be complaining about inlining log
but that would def work if that was the issue π
MP_NEED_LOG2 :slow_parrot:
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.
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
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
$(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
I think you want it on the $(CC) line like the ST version
I think this is a bit unique to bitmap modifications because it takes time to mutate it. When a refresh comes in it'll refresh the mutated area of the bitmap. Keeping those changes local will make that rectangle smaller. This also applies to tilegrids that are greater than 1x1 tiles.
Very cool! Please make these changes.
This looks great! Thank you!
The tests are a bit unhappy. I think you need to add a skip condition to the test.
Want to make this TypeError explicitly?
looks like GCC 10 reduces code size
did you fix the gcc10 memset issue?
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
i missed what you said yesterday: are you doing dev on linux now due to laptop heating?
@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.
what error do you get?
same as before, undefined reference to 'log'
kk
This is awesome! Thank you! Are you using these in a specific editor? Want to help us auto-deploy to pypi as well?
@dherrada Can you take a look at the conflict here? I just merge some other improvements to extract_pyi and this needs an update. Thanks!
This is great! Thank you!
@tannewt Sure. I do have a bunch of changes to extract_pyi that I did locally and haven't pushed yet, but they should be in a separate PR.
@tannewt put it down to wrap up PWMOut on the ESP32-S2, still gotta address Jeff's comments. Probably can get that done today or early tomorrow.
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.
anyone have experience with -fmerge-all-constants?
looks like we get a few hundred bytes back
(though it may mess pointers up)
@thorny jay you can make your own Buttons class, see https://github.com/python-ugame/circuitpython-stage/blob/master/pygamer/ugame.py#L68-L91
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?
@thorny jay yes. https://github.com/adafruit/Adafruit_Blinka_Displayio/issues
Sorry, I thoughtyou meant displayio specific
@thorny jay you can make your own
Buttonsclass, see https://github.com/python-ugame/circuitpython-stage/blob/master/pygamer/ugame.py#L68-L91
@stuck elbow Thanks, I was talking about "gamepad" the library you wrote: https://circuitpython.readthedocs.io/en/5.0.x/shared-bindings/gamepad/GamePad.html
No, a lot of modules haven't been ported over yet.
right, but you don't have to use the gamepad library for the buttons for the ugame games to work
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.
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.
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?
only the ones that don't use hardware
Like uLab?
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.
we aren't really targeting the pi -> feather case because cpython will have extra apis
And if I do Feather => Pi, then I need to avoid the missing modules.
or implement them
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).
This is intentional to prevent nested with statements.
I'm using a Metro M4 WiFi and the RGB Matrix Shield w/ bodge wire. I wrote a simple script that displays a bitmap using the usual display
Yes, it could be an array of values that are more than a single byte.
I noticed using a small palette bitmap doesn't seem to result in this issue, so maybe it's a memory thing.
@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.
because it's awaiting an invalid type?
Yeah, it's like TypeError: object str can't be used in 'await' expression
ah. I wonder where we'd need to add that check
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.
I agree. I'll look into it π
thanks!
I did have to bring in the patch Damien made. It didn't start without it.
This PR adds the PWMOut module to the ESP32-S2, using the ESP32 LEDC peripheral and driver. The ESP32 LEDC driver has 4 timers and 8 channels that are fully multiplexed across all pins - IE you can have 8 different PWM outputs at 4 different frequencies across any IO pin on the module. Up to 40MHz is supported, although the resolution of the duty cycle will greatly decrease as speed increases,...
uPy allows normal generators to be awaitables
:sigh:
I do, but if you catch TypeError only, the test run that does
MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float
fails.
cool
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("`, `") ~ '`'...
Re-ran the jobs because "test" didn't get run the first time.
Looks good. The wroom build failure might be just a glitch.
This more specifically happens when bit_depth is 3 or higher.
bast_pro_mini_m0 is getting pretty ridiculous
188420 bytes used, -4 bytes free in flash firmware space out of 188416 bytes
Maybe someone wants to take a look and suggest where I might find 4 errant bytes to give back? I have more changes to make in this code so I'm a little concerned about this particular target.
https://github.com/adafruit/circuitpython/pull/3178/files
@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
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.
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...
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.
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.
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)
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).
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.
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.
Changes due only to #3161, which moved some messages to a different file.
@low sentinel @slender iron https://github.com/micropython/micropython/pull/6272 and its corresponding issue may be of interest
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. π
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!
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
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.
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.
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. π
I thought the French pretty much had their own Internet
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.
In Belgium, one typical translation point for our stuff is https://shop.mchobby.be/en/ shop and blog.
Shop powered by PrestaShop
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.
it's very similar with Polish
He is likely an official resealler of Raspberry Pi stuff and Adafruit stuff.
but I noticed this is more about tutorials and documentation, and less about error messages
Yes, his work is on the documentation, and original content too.
they don't read the error messages no matter what language they are in, they just say "it doesn't work, help"
Or you "google" the error message.
yes
This is where translated error message are a problem.
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.
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.
you know, back in the days of DOS, we had a version of DOS translated to Polish
including all the commands
There were French version of LOGO and BASIC.
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
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...
Possible. You mean. Patent, Electronic Voting, Licence, Hacking society, ...
but yes, there are lots of electric engineers active in Germany who don't speak English
So there was that French person that jumped into the meeting. I don't have the nick-name and if I should contact him.
it's recorded
I'll have a look.
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"
Same here.
I blame the Great Vowel Shift, of course
I mean us native speakers can't pronounce english either. I even said pronunciation as "pronounciation" until like, two years ago.
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.
I can rereview when you're ready, @ me
@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.
@onyx hinge Jeff, have you 5 minutes for a short discussion? Here is my proposal: https://github.com/v923z/micropython-ulab/tree/documentation/code
@jepler Ok this passes on my machine and should be good for another review.
Good session, nRF52840 (particle xenon):

Bad session, STM32F405 feather

Notice how outside the "40 00 00 00 95" packet sent to initialize the SD card into SPI mode, the MOSI pin stays high on nRF but doesn't on STM. I believe this is because the write_value (a stati...
I've taken the liberty of punting this to @hierophect but can take it back if that's preferred.
@lapis hemlock hello
I can check it out, I'll add it to my list.
okay, give me a moment to wrap up something else and I'll hop in
kk
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...
@lapis hemlock I'm ready π thanks for your patience
No problem.
@slender iron if you had a second to join me and @lapis hemlock in Amelia for a bit of renaming discussion
bast_pro_mini_m0is getting pretty ridiculous
@low sentinel I've been poking at this build too. I think I disabled COUNTIO
@slender iron For 6.0, ulab is going to move the spectrum function into fft, an incompatible change.
@lapis hemlock it builds!
some of the markup is not quite right but so be it; we can fix it once we can see it rendered
@onyx hinge Thanks!
Oh, I almost forgot: would it make sense to insert a link to the numpy documentation for each function?
that would be fine. I didn't do it out of laziness.
@onyx hinge sorry, I've been distracted getting my linux box going π
Take your time.
@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
meh, I like to be up to date. no fun that it wipes efi entries
@onyx hinge thanks, I will take it over now.
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
@slender iron have you ever considered the STM32WB line, by the way?
I have a friend who's working with it
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
@lapis hemlock https://github.com/jepler/circuitpython/tree/ulab-restructure-document http://media.unpythonic.net/circuitpython-docs-with-ulab/shared-bindings/ulab/index.html [temporary copy]
@onyx hinge Some of the modules, e.g., poly, do not list their functions.
OK, I do not know why that is
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...
Looks good. The wroom build failure might be just a glitch.
@lapis hemlock those are the only definitions in the .pyi file, not sure why
@onyx hinge I also noticed that the very first function of the other modules is missing. I will look into this.
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
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.
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
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.
@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
@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.
Hey everyone,
I am wondering if you guys have a timeline for resolving this issue. I have an M4 express that is getting stuck in safe mode and I am looking for solutions. Any recommendations, including breakout board solutions, would be super helpful.
@slender iron No worries, I had a hug report I didn't want to forget. Realised I only had last week's link.
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
This fixes the error of multiple definition that I've been finding during linking process.
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_...
What do you think about async only being enabled on non-m0?
@slender iron ESP32-S2 PWMOut is ready for your review.
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.
Is the problem with the bast pro mini that it has more pins than other small boards like trinket and gemma?
Ok, sorry, you mentioned you liked pings outside the github ones so I figured I'd mention it.
if it's been 24+ hours then feel free to ping me
most days I have a dozen or so things to look at
Ok, thanks! Looks good!
Translations update from Weblate for CircuitPython/main.
Thanks for looking into this!
Have you seen: https://github.com/joedevivo/vscode-circuitpython ? I believe it just needs the stubs updated.
@teal fern what OS are you on? looks like it can't find arm gcc
Could it be this patch is unnecessary in the quest to solve this issue #3179?
Ya, I think so. Can you just always add extern? That's what I did with my gcc10 changes. https://github.com/tannewt/circuitpython/tree/gcc10
Overall, this is looking pretty good! I need to get the ESP going with my Linux box to test.
I don't think you want to do this if the timer is shared. Only later if taken is false.
Don't set this here. By relying on pwmout_reset this variable can be in .bss instead of .data.
Just call set_duty_cycle to remove duplication.
Normally, you would make the declaration site be extern:
extern const char nibble_to_hex_upper[16];
extern const char nibble_to_hex_lower[16];
and in the one source file which defines them,
const char nibble_to_hex_upper[16];
const char nibble_to_hex_lower[16];
By doing this, the somewhat magic preprocessor macro EXTERN is not required.
:+1: We'll need newer ulab for GCC10 too. #3179
A few jobs failed; I tried a re-run, and it's skipping other things. But the union of successful jobs is fine, so I'll merge this after they stop running.
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:
- The long-running bigint calculation script from issue #2949
- The script from https://pastebin.com/BAUS82X9
- The ulab simple benchmark script from https://learn.adafruit.com/ulab-crunch-numbers-fast-with-circuitpython/a-simple-
ben...
This is probably making it too complicated, but I wonder if it would even make sense to compile different objects with different optimization levels, so even if there isn't enough room to optimize everything, you can have the most vital parts optimized...
Don't the CFLAGS from lines 90, 97 and 104 interfere with this?
Note that in py/py.mk, gc.o and vm.o will be compiled -O3 if SUPEROPT_GC or SUPEROPT_VM are set to 1 (which is the default). So could you make sure that this change is not overriding that higher optimization level? Thanks.
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
Instead of adding this flag for individual boards, I think it would make sense to do -O2 by default for all SAMD51 and nRF52 Express boards. There may be space problems on non-Express boards.
Thank you for doing all this testing! We have not pursued this, and it's really nice someone is.
@simple pulsar we have been seeing a lot of flakiness on GitHub Action jobs today. I'll restart that PR.
While looking at #3190, I realized that both py/gc.o and py/vm.o are compiled -O3 by default. We have turned that off for GC on small builds (SUPEROPT_GC =0), but not for vm.o. Compiling vm.o as -O2 instead of -O3 gains back 416 bytes on a trinket_m0 build.
@tulip sleet Thanks. I think it was travis the last time I did this.
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...
@dhalbert See comment below. I think we will need to implement this on a board-by-board basis.
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...
I don't think we can always use INTERNAL_FLASH_FILESYSTEM = 1 as a guide. There is at least one board (sam32) that has that set but has 1M of flash (i.e. plenty for the 10% size increase). And, future chips may well fall into that same category. I would consider it safer to have a separate flag.
π We'll need newer
ulabfor GCC10 too. #3179
I think the issue concerns microcpython itself, and not the user modules. The relevant C flag is set in the Makefile, and not in the user-level make fragment. I haven't tried to compile with GCC10, but ping me, if there is a problem.
@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...
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_...
Do you mean ledc_hal_set_duty_cycle? I would need to create an analog of the internal ledc_hal_context_t pointer to use it, and it's not included a part of ESP's API Reference as an internal function. Unless you meant make my own, which I'll assume unless you say otherwise.
The CI failure here appears to be RISCV related, so it shouldn't hold this up.
@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.
Hello. I noticed this call is different to another one, it doesn't pass fixed_length boolean from self, is that intentional? https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/master/adafruit_ble/characteristics/__init__.py#L206-L214
@simple pulsar I think you're right
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_...
It could be related to the target_frames_per_second=60. I removed that from my MatrixPortal library and I can get it working solidly at bit_depth=3, but it still fails on 4.
@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.
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."
We could declare it STATIC, though, it's not going to fix anything.
OK, I will make it static.
either it should be STATIC or it should have a declaration in a header that is included
Was that the only error, or did the compiler/linker bail out at the first one?
it stops at the first one
I think that was probably the only addendum, so it should be OK now.
Sorry for the mix-up.
crazy idea: we could defrag pointers that only exist in python objects if we cannot allocate after a collect
πͺ it's amazing how productive sitting down and working for a couple of hours uninterrupted is πͺ
π―
anyone have anything they want to do before a 6.x beta?
@slender iron yeah we still want to get this incompatible ulab change in
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
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
+1
I think the pystack might be too small
issue #2082?
I think importing circuitplayground lib was the "worst case" that made us bump the C stack size
@tulip sleet yup
@tannewt this is the incompatible change I mentioned on discord
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
ya, will look. ideally I'll release today so I want to get things in for it
If you can hold on for an hour or so, then I can merge the norm function and its documentation into ulab/master.
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...
@mental nexus ping me if you need help with git for #73
Is there issue CI checks seeming to be stuck showing waiting?
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
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
@onyx hinge want me to review your SDIO PR or are you still working on it?
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.oandpy/vm.oare compiled-O3by 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.
@ionic elk that would be grand
u bet
For the pin checking I followed the "new" spi way and was happy how little code it ended up being.
I meant common_hal_pulseio_pwmout_set_duty_cycle. No need for a separate static function.
H.m I don't think I actually tested the 1 data pin case
One more thing then good! Thanks!
Wow that went right over my head. Yes, good idea.
@onyx hinge I have just seen that you had to fix the code in ulab.c. Many thanks, and sorry for the slip-ups!
@lapis hemlock no problem
I just wish we had a better workflow for you to see and corect these problems first
Well, I could have compiled it locally. But perhaps, we could add circuitpython to the github workflow.
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, ..
Oh, that's a good point.
@dahanzimin you will need to git pull to get the RTC fixes.
We might run into an infinite recursion.
@dahanzimin you will need to
git pullto get the RTC fixes.
@hierophect thank you for your support, I will continue to cheer.
@tulip sleet did you want to leave .packet_size on PacketBuffer for 6.x?
If you pull request the update of ulab you will of course get the errors in our own actions runs @v923z
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.
@onyx hinge what's the data tuple in pins.c?
@ionic elk sdio has 4 "data" pins. I put them in a tuple.
Is that to avoid making a peripheral file? Or is it something we should be doing for other peripherals?
@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
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
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?
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
Ah, so it's an equivalent to SPI_FLASH_MOSI_PIN style defaults, but without an out-of-port shared-module or supervisor component?
it's like board.MISO except that it's 1-or-4-pins-in-a-tuple
Ok, so the difference is the 1-or-4 part?
+ { 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
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
@ionic elk I'm not sure how that would work, can you show me? It would probably work for clock and command.
@slender iron I was doing it on a linux subsystem since "make" does not work on windows
Added and corrected some type annotations.
@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.
frustrated with github actions today
@mental nexus I think the issue is with your branch
Hmm. Do I need to merge the master back into it and then make my updates?
it's 25 commits behind master
how did you make the new branch? did you base it off your master?
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.
@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
Ok so what next? π¬
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
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.
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
Ok so Iβll try and get the current fork branch back into shape.
wanna hop in voice so I can walk you through it?
Let me take a shot and will ping you. A lot of activity at my house right now...,
kk
Is there a video from Scott's live stream on how to flash the bootloader to the esp32 s2?
I don't think there is but you also don't need it
What is the basic workflow for getting circuit python onto a Sola board?
have you seen this: https://gist.github.com/askpatrickw/0a276c7e2d4f54e442b2cb6eaa0d32ea
Thank you!
@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.
@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.
np, we're not to rc anyway
I'll release for sure. just a question of alpha vs beta naming
kk
Add lots of missing extern and bring in Damien's fix.
all good π
@slender iron what kind of size reductions are you seeing with gcc10?
@jepler Jeff, I fixed a number of indentation errors in the documentation. I can extract the stubs from the code without glitches. I don't know, whether the .rst files compile, though. I will check that out tomorrow.
~1k iirc
ooh, that is nice for the small ports
what build is interesting? I can run it now
trinket is a good example
also maybe one of the cpx ones that is constantly in danger of overflowing
trinket m0 de_DE has 1520 bytes free
no, I'm on my gcc10 branch
cpx de_DE has 2748 bytes free
looks at the CI build
ah, just force pushed it
i am running tip of main
kk, should be the same
trinket de_DE is 164 bytes free
this is with arch's 10.1. I'm not sure how exact it is with what arm provides
cpx de_DE is 1056 bytes free with gcc9
so ~1500 bytes or so
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
ya, not sure what changed
need this change too: v
This is for IkigaiSense Vita board to use CircuitPython.
Looks fine! Thanks for doing this earlier rather than later!
Two jobs are stuck. I think you could just merge.
Two jobs are stuck. I think you could just merge. [I think there's an echo in here.]
Ok, I'll kick off the alpha build
@slender iron I'm not sure what you meant by needing this too (above): https://gist.github.com/askpatrickw/0a276c7e2d4f54e442b2cb6eaa0d32ea
ah, wrong link
switching to linux is messing up my hotkeys
approved that
thanks!
will circle back to it once the ulab change is in. need it for some added externs
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...
Do you want to keep these in here? Do you feel they'd be helpful for future problems?
Should this also be implemented in I2C.c, etc?
[adafruit/circuitpython] New tag created: 6\.0\.0\-alpha\.2
Automated website update for release 6.0.0-alpha.2 by Blinka.
New boards:
- makerdiary_nrf52840_m2_devkit
- makerdiary_m60_keyboard
- raytac_mdbt50q-db-40
- tinkeringtech_scoutmakes_azul
- bless_dev_board_multi_sensor
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.
Because the number stored in r is displayed in the message "SDIO Init Error %d"
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...
There is no board.SDCard(), which is what these defines are intended to facilitate.
The SDIO SD card is created as:
sdioio.SDCard(clock=board.SDIO_CLOCK, command=board.SDIO_COMMAND, data=board.SDIO_DATA)
//| Example usage:
//|
//| .. code-block:: python
//|
//| import os
//|
//| import board
//| import sdioio
//| import storage
//|
//| sd = sdioio.SDCard(
//| clock=board.SDIO_CLOCK,
//| command=board.SDIO_COMMAND,
//| data=board.SDIO_DATA,
//| frequency=25000000)
//| vfs = storage.VfsFat(sd)
//| storage.mount(v...
By analogy with board.SPI(), this would create the "default SD card" object if necessary and return it. It would apply only to boards with a standard SD card slot built in (e.g., Adafruit Grand Central, where it would be an sdcardio.SDCard using a SPI bus and on Feather STM32F405 it would be an sdioio.SDCard using an SDIO bus)
board.SDCard() is a honking great idea, but neither stm nor samd have it at the moment. I entered an issue so that adding it can be prioritized: https://github.com/adafruit/circuitpython/issues/3197
@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?
not sure which order these two should go in, or whether calling timer_disable is redundant now.
OK, I have one semi-question, feel free to merge if the answer is "yes it's fine that way" and CI is happy.
If it's too niche an idea feel free to close this up.
This was fixed by google and can be backed out, right?
@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
I was able to build on windows inside of a linux virtual box if that counds.
I saw this as fixed even before this fix went on, so yes.
@slender iron i literally just completely reinstalled ubuntu and it still didn't work
Maybe put in a comment that the arrays exist to future proof against the H7
@teal fern sorry, I don't know much about building in WSL
@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)
haha I have very little experience with unix, how would I download + extract, also what is this example
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
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)
what does gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 look like?
gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2: command not found
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
oh I assume you did not want me to run that as a command lol
run shasum ~/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
it returns this:
6487ac865e530e5c83a8ae34c12f3adc18b12186 /home/adinack/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
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
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
Shasum shows you downloaded something different from what I did at that url
if its the same url why would they differ??
I don't know, what's your network like? Got a weird proxy?
nope, standard internet
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.
@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
Just do the wget by itself
kk
(with the url obvs)
Shasum it
ooooooh
Does it look right?
i think i understand
there were many
it was doing the (for some reason) corrupted one every time
Neat
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
and here is what I see:
so...for some reason that only happens if I include the 3 in the beginning
ok I extracted it, what next?
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)
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
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
Yep! Have fun
great!
@teal fern you'll want to look at this set of code: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/common-hal/pulseio/PWMOut.c#L162
it's what decides if a pin is valid
ok cool
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...
i don't really understand this code sorry
i assume variable frequency is false in this case
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
thus they could use the same timer?
exactly
the timer dictates the frequency and the channel dictates duty cycle
ya, I think so since the top would be dictated by the timer mode
nice
so what are we needing to change here
add gpio 2 to some list of available pins?
no, it's not that simple
your pin has a wave_output of 0
what does that mean?
wave_output implies the channel of the timer
i see
and channel 0 is usually used for the top value
what is top value?
it dictates how high the counter counts before resetting
I'd recommend reading the TC section of the datasheet for an overview
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.
yes i see that in the datasheet
WO is wave output
ya usually
yeah I am having extreme difficuly understanding this datasheet
don't try to read the whole thing π
haha
the "functional description" of the TC section will be most relevant
found it
and should have decent drawings to understand how a TC works and what modes it has
cool
you'll notice "normal" versus "match" modes that change what the top value of the timer can be
ok cool
here is a diagram i found
so it looks to me that we control the frequency (or duty cycle??) by changing TOP
Let's try a rebase and see what shakes loose
@tannewt okay, this passes after a rebase so the can is kicked one commit further down the road.
thanks!
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?
I don't know how to change release text: https://github.com/adafruit/circuitpython/releases
@thorny jay updated to say "this unstable release", thanks.
I believe this is left-over from the first version of this PR and can be removed.
Thanks for the changes! pewpew_m4 is failing; it needs -Os, I assume
One interesting thing which doesn't need to be done in this PR is to do the -Os only for particular language builds that don't fit.
@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
@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
I get that with alpha-2 (that I pulled from S3 since it's not on circuitpython.org yet)
when do you get it?
last night Adafruit CircuitPython 6.0.0-alpha.2 on 2020-07-23; Saola 1 w/Wrover with ESP32S2
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
it's in the debug console, not code... I believe LEDC is for PWM out
It happens even with no code.py
OH -- I never look at the debug console -- just a sec
not even sure how to connect to it
default USB connector... I use screen /dev/tty.***** 115200
gotta remember which connector on this one: https://discordapp.com/channels/327254708534116352/327298996332658690/735988493406437468 (oops)
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
(I always do ls -lt /dev/tty.* to know what I plugged in most recently)
yeah, not the native 19/20
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 π
I think it's new with the PWM out changes 2 days ago
ok -- sorry - I have no idea.
thanks for confirming my sanity π
seems to boot OK and work normally
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.
I noticed when I loaded CP this time -- It appears to have cleared CITCUITPY
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
I think it's fine, you're just more explicit about calling the tim->DIER &= ~TIM_DIER_UIE than the other peripherals. I'll revisit this when I try and fix the flickering issue.
Ah -- I could not remember how it behaved. Too many different boards....
i feel... i pretty much remember just what I worked on last
Everything's working and the one CI failure seems extraneous, so I've merged this. I'll keep working on the RGBMatrix fix as a separate PR.
@crimson ferry remind me later to talk about it. I was considering revving my breakout on the stream
goes for a run
@onyx hinge There are some dark forces at play here: I have just checked out the latest circuitpython with the hand-made ulab stubs, and run make html locally. I got http://media.unpythonic.net/circuitpython-docs-with-ulab/shared-bindings/ulab/index.html, and not https://circuitpython.readthedocs.io/en/5.3.x/shared-bindings/ulab/__init__.html . So this means that we can't emulate the build process on the local machine, something is still missing.
I am at my wit's end...π
@slender iron - have any time today to revisit the custom board lib discussion? I think we may have candidate ready to release
@lapis hemlock the second link is the "5.3.x" docs, you should probably compare to the "latest" docs https://circuitpython.readthedocs.io/en/latest/shared-bindings/ulab/
@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
OK, that's also broken. approx should begin with bisect.
worse, the sets of functions that appear are slightly different for "our" docs and the in-progress docs within the ulab repo
You mean the missing bisect e.g., don't you?
right
So, what the heck is going on?
The screenshot is with the hand-crafted stubs, right?
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)
I see that now
OK, then I let you continue with your work. I should be around.
@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?
@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"
Wat
/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'
https://github.com/adafruit/circuitpython/pull/3198/checks?check_run_id=907265285 seen here (PR run) but presumably applies to main branch
I didn't fully chase it down but my guess is this recent change
https://github.com/adafruit/circuitpython/runs/907263216?check_suite_focus=true main branch failing similarly
@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.
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.
@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
Someone on this channel warned me that Windows would exfat-format a 64GB SD card, but Linux mkfs.fat does not
It happens π°
@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?
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
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
@ionic elk OK, thanks, since it was an "E" just wanted to check if it was expected. I'm sure it will get sorted.
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?
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.
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
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
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?
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.
that's good work, I'm glad you're doing it.
@onyx hinge circuitpython 5.3 was released on the 30th of April. I think the issue has snuck in with this commit: https://github.com/adafruit/circuitpython/commit/afc84c2fd115aa1c7a80bd5d83834c30c4563a6c#diff-67a0fc625b53a9ae4b6b4063d04d09a5
that's the conversion to use stubs instead of rst in the docs-in-C-source-files
Why don't other modules suffer from this? Or do they?
I don't know.
is ulab the only example of a package that is in circuitpython or are there other examples of that?
I feel privileged by your question, but I haven't the foggiest idea.
If the question was addressed to me, that is.
[adafruit/circuitpython] Pull request opened: #3199 Litex: fix microcontroller common\-hal interface
The shared-module TouchIO was recently modified to remove all instances of claim_pin in favor of common_hal_mcu_pin_claim, as part of a general effort to remove internal port functions being used in shared-bindings or shared-module. Litex needs a common_hal_mcu_pin_claim function to account for this change.
@onyx hinge fix up
OK to merge if the build completes
@onyx hinge do we not have a litex label?
I don't see one so I created it
thanks I was about to do the same
Should ulab have vectorised implementations for copysign, pow, ldexp, fmod? These are all two-argument functions. Any practical use for them?
In ports/esp32s2/common-hal/pulseio/PWMOut.c, lines 36,38,40,42 seem to be unused remnants, I assume we want to allow any pins for LEDC:
#define LEDC_LS_CH0_GPIO (18)
@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?
@ionic elk Yes, sorry about that, I was looking at old code.
@crimson ferry all good that's what I figured just wanted to check if you had any other questions
@onyx hinge I'm not sure why there are doc issues
@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?
Where is the documentation for the other modules? E.g., there is nothing in https://github.com/adafruit/circuitpython/tree/main/shared-module/struct, but https://circuitpython.readthedocs.io/en/latest/shared-bindings/struct/index.html exists.
@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
@onyx hinge I made some with my adapter
okayyyyy
surprised you could get to the step of having the mounted filesystem but no files inside
so I'm not sure, maybe it tries to reformat?
I'll try making some of my own with storage
not to my knowledge
@onyx hinge do I use storage or os to make directories and files?
after you have "mount"ed it you would use os or just open()
@slender iron None of the modules, except ulab, has a level below the first one. Could this problem be related to the depth?
microcontroller.pin is a submodule
but I'm not sure how it gets documented, since its content is different in each build
@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
@ionic elk https://learn.adafruit.com/micropython-hardware-sd-cards in case it helps
I'm still kind of a derp with python sometimes
assuming what you're looking at is this spi thing, you can exclude problems with the newer sdcardio module by using adafruit_sdcard
@onyx hinge not sure what you mean, this is all just me testing your sdio module with the sketch you included
you're looking at sdioio ? okay.
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
there's also https://github.com/adafruit/circuitpython/issues/3176 and for some reason I thought it was the context of the discussion
given my workaround .. yeah I think so
Ok I merged the Litex fix
awesome, thank you for fixing it
Thanks for the fixes. I've tested this on my Feather F405 and it's working great. I'm still a little iffy on the tuple in boards/pins.c just because it isn't a technique shared by other ports. @dhalbert or @tannewt, maybe you could give us a second opinion? If they have no objections then this looks good to me.
(please forgive the personal celebration) Just built CP for the first time. Now let's try and break something!
@mental nexus Congrats! Good luck on the breaking!
@lapis hemlock ya, depth problem is likely
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...
The data pins tuple is used in two places in atmel-samd: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/same54_xplained/pins.c#L4
Tested on my feather_stm32f405_express -- works!!
@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,fftis at least partially listed, whilepolyis not:
I think I have run out of ideas for today.
@lapis hemlock I don't have any ideas
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.
hmmm this can't be healthy. ```>>> g = displayio.Group()
g.append(g)
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:
The data pins tuple is used in two places in atmel-samd: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/same54_xplained/pins.c#L4
Now why didn't that come up when I grepped for it? In that case I've got no issues.
@onyx hinge I think you gotta run translations again on your PR
Just a couple minor things. Thank you!
//| Writing a buffer or slice of length zero is permitted, as it can be used
Why is the = ... not needed?
//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced
Looks good to me! Thank you!
Looks like we need to add isort to the doc requirements.txt
@onyx hinge I am updating the Localisation section on circuitpython.org. I'll tag you on the PR, if that's alright with you.
Thanks for the fixes. I've tested this on my Feather F405 and it's working great. I'm still a little iffy on the tuple in boards/pins.c just because it isn't a technique shared by other ports. @dhalbert or @tannewt, maybe you could give us a second opinion? If they have no objections then this looks good to me.
@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
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.
hmmmm that is a valid point, did you see a way to improve it?