#circuitpython-dev

1 messages Β· Page 304 of 1

tulip sleet
#

the recent issue with SAMD21 not working with the lower_power PR was a TinyUSB thing, but it only manifested on my Dell i5, not on Scott's AMD box

ivory yew
#

hehe doubt it

raven canopy
#

maybe i'll throw rasbian on an SD and test real quick. really wish they'd switch to a arm64 kernel; would make this easier than having to rely on Ubuntu's RPi images. πŸ˜„

tulip sleet
#

night, all, @ivory yew you're welcome, and @raven canopy good luck!

raven canopy
#

but i understand the backport issues they'd have with older Pis
nn @tulip sleet! thanks for the bug report link!

ivory yew
#

ah yes

#

got SPI working

#

my latency is very very acceptable now

manic glacierBOT
raven canopy
#

@ivory yew πŸŽ‰ (we had no doubt you'd get it... :D)

ivory yew
#

psh I did

#

I am well into uncharted territory right now

#

(for me, at least)

#

USB hosting, SPI slave, writing using Atmel/Microchip's silly C libraries.

raven canopy
#

ASF4. its... well, it is. hehe

ivory yew
#

Harmony is supposed to be different.

#

Maybe not "better", but different.

#

but meh, I'm invested here, so whatevs.

#

I've been super disappointed in the docs around this stuff

#

I mean, there's a literal 4 line example for SPI slave. A maybe a 2 sentence description.

raven canopy
#

The best part is when the docs say one thing, the errata says nothing, and it still doesn't work. I'm looking at you TC->PPW->direct_pin_capture. πŸ˜„

manic glacierBOT
manic glacierBOT
#

Simmel had USB HID disabled in order to save space. However, the board
configuration did not set USB_DEVICES, causing it to inherit the default
device bouquet of MSC,CDC,MIDI,HID. This in turn caused HID to be included
in the USB Configuration Descriptor.

For some reason, this was not a problem in an earlier version of tinyusb or
circuitpython. However, in the most recent version this has rightfully
caused asserts to appear during configuration.

Re-enable USB_HID for now, as it ...

manic glacierBOT
#
k0d

I think the main thing I like about them compared to using toml, xml, json etc is that you can easily reference other nodes. For example gpios = < &gpiob 0x0 0x0 >;

One alternative would be to create some nice data structure in python? Then we don't need to parse it.

The reason I'd like to use a system like this is to avoid having too many places to change when adding a new port/soc/board.

simple pulsar
#

@tulip sleet I've not made a note of the conditions but I've done some fairly normal things with Adafruit boards and managed to get Windows 8.1 in a state where 1) the device isn't recognised anymore by Windows and 2) a reboot is required and 3) shutdown of Window is borked and maybe pauses "forever" (at least 5-20 mins). It's very infrequent. I did have one just over a week ago. I might have seen this three times in total.

stuck elbow
#

that sounds like a problem with Windows or one of its drivers

simple pulsar
#

@stuck elbow That's what I would assume normally and was why I'd not mentioned it to date but Dan was talking about Linux keeling over due to possible USBisms.

idle owl
#

@tulip sleet @onyx hinge Am I correct in seeing there's no unstable release right now of CP?

onyx hinge
#

@idle owl I think that's right. @slender iron mentioned wanting to make an unstable release after lower power was merged so hopefully that'll happen soon

idle owl
#

Ok. Thanks.

manic glacierBOT
ionic elk
#

@lucid solar was your issue with UART reproducible (the BUSY issue you mentioned)? Or was it just a HAL question? If you were getting a HAL_BUSY usually that means something is wrong with the interrupts.

lucid solar
#

@ionic elk it's fixed, was because I was switching from interrupt based to polling, and it didn't reset properly.

manic glacierBOT
idle owl
prime flower
#

@idle owl got it, asked Sean to post πŸ™‚ , looking at MMQT this AM

#

thanks

idle owl
#

@prime flower Thank you for following up!

manic glacierBOT
tidal kiln
#

@raven canopy @tulip sleet yep - i'm seeing lock up's with arduino. it's a complete hardware freeze of the PC. mouse cursor doesn't even move. have to power cycle to recover. it happens with a basic sketch upload, right after upload is complete and it resets the board. of course it doesn't happen 100% of the time and i haven't been able to find a way to make it happen in a repeatable way for testing.

raven canopy
#

@tidal kiln i'm at 100% repro on a RPi headless with Ubuntu 20.04. its almost immediate once i go to bootloader. ssh pipe breaks, and activity LED is steady. still trying to get better traces, but the lockup isn't helping. πŸ˜„

tidal kiln
#

yep. it's not an easy thing to debug. and i always run into it when i'm trying to get something else done. so just punch my way through.

manic glacierBOT
#

@k0d it's an interesting idea to have the serial console simultaneously to USB - is there a particular application that you have this in mind for? Did you check out the port level supervisor/serial.c files that exist in most ports? Most of the time, it's automatic to switch to a serial connection when USB is set to 0.

Existing implementations aren't very sophisticated because the use is kind of rare, and they don't use the UART module (by design), so this is definitely a more complete imp...

slender iron
#

I mean, there's a literal 4 line example for SPI slave. A maybe a 2 sentence description.
@ivory yew That's one reason I prefer register level. The data sheet is pretty thorough on what to do with the registers.

idle owl
#

@tidal kiln Hmm, do you have any suggestions for wording on the note for saying lux isn't calibrated? Is "Note: lux isn't calibrated!" enough or is there some better way to word that with more information?

tidal kiln
#

@idle owl that seems fine

idle owl
#

Ok thanks

#

@tidal kiln Tagged you on the PR.

ivory yew
#

@slender iron I'm not quite ready for that relentless experience just yet, but I certainly came close. πŸ˜›

manic glacierBOT
tulip sleet
#

@raven canopy if you give a recipe for what you're doing on the RPi, I can try to reproduce and get a USB trace. Which boards do you see this on?

raven canopy
#

@tulip sleet Metro M4, bootloader 3.6 & 3.9. able to repro with a double-reset and screen session via reset(BOOTLOADER). again, this is only on the RPi w/20.04 which uses the dwc_otg driver. my laptop uses 18.04 & xhci and hasn't presented any issue for me.

idle owl
#

@lone axle Do you have a CLUE?

tulip sleet
#

do you see this only on M4?

raven canopy
#

well, so far yes. I tested a Grand Central yesterday (bootloader 1.x something) and it didn't have any issues; haven't tested newer bootloaders yet. i can try a M0 and nRF later.

#

i've been assuming that the issue was with my software/dependencies this whole time. its usually the case... πŸ˜„

tulip sleet
#

do you mean you call reset(BOOTLOADER) in the arduino program? Does it do anything else before that?

idle owl
#

@prime flower Thank you for labelling library issues - I really appreciate it!

raven canopy
#

no, in CircuitPython. connect board, CIRCUITPY enumerates. start screen session, and do:

import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.BOOTLAODER)
microcontroller.reset()
idle owl
lone axle
#

@idle owl Yep I do.

raven canopy
#

@tulip sleet and double-tap triggers the same. no diff in the dmesg/udev that i can see so far.

idle owl
#

@lone axle Interested in a coding quest?

tulip sleet
#

@raven canopy @tidal kiln I'm trying to figure out if it's TinyUSB in CircuitPython or the bootloader USB impl (which is not TInyUSB except on nRF), or the Arduino USB.

#

Try Arduino Blink and see if double-tap does the same thing. That's yet another USB impl.

gilded cradle
#

@idle owl yep, I can.

idle owl
#

@gilded cradle Thanks!

tidal kiln
#

@tulip sleet @raven canopy sry, can't help test right now.

raven canopy
#

now i have to remember where i put my Arduino... 🀣

lone axle
#

@idle owl For sure!

tulip sleet
#

@tidal kiln np, if the RPi is reliably bad, we can get traces from that, and I don't have to keep waiting for my regular dev machine to reboot πŸ™‚

#

@raven canopy I meant Arduino Blink on the Grand Central

idle owl
#

@lone axle Keen. I'll tag you on a GitHub issue I created, and we can start a discussion there.

raven canopy
#

@tulip sleet badly worded joke. i haven't loaded Arduino IDE in like 2 years. πŸ˜‰

tulip sleet
#

OK πŸ™‚ good luck updating it all

raven canopy
#

so use Grand Central (which didn't have issues), not Metro M4?

idle owl
tulip sleet
#

oh, I thought you were varying the bootloaders, no whichever one is bad is fine

raven canopy
#

kk

idle owl
tulip sleet
#

@idle owl it appeared to be a bug at first, but the underlying code is simple and seems to be doing the right thing. You or I could ping the OP and ask if this was resolved, since it's been a while

idle owl
#

@tulip sleet sounds good.

#

@tulip sleet If you could ping, I would appreciate it.

raven canopy
#

@tulip sleet no lockup with Arduino Blink -> bootloader via double-tap.

tulip sleet
#

@tidal kiln and your issues may have different causes 😦

raven canopy
#

let me know if you want some udev/etc.

prime flower
#

@idle owl np! I do that with the IO issues too, will keep doing on cpy-rel.

timber mango
#

@raven canopy I have a real true blue Arduino UNO R3 and an Arduino Mega R3.

onyx hinge
#

snagging a bite real quick before the meeting

tulip sleet
#

@slender iron do you want to talk about PacketBuffer for 10 mins now, or can be after you have lunch after the meeting

slender iron
#

@tulip sleet I can now

modern wing
#

Good afternoon -- happily lurking for the meeting.

onyx hinge
#

om nom nom complete

lucid solar
#

@onyx hinge something nice?

onyx hinge
#

@lucid solar just a small portion of leftover lentils

#

tasty though

ivory yew
#

I'll be text-only today.

sterile bronze
#

lurking today

modern wing
#

Loud and clear Scott

thorny jay
#

lurking or text only. My notes are in the doc.

uncut nexus
#

lurking

old smelt
#

Lurking

lucid solar
#

oops, I forgot to go into the voice room (facepalm)

idle owl
timber mango
#

I am having trouble with my status update in the document.

#

Text Only

onyx hinge
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

ICYMIΒ (In case you missed it) – the IoT Monthly Newsletter from AdafruitDaily.com went out today! If you missed it,Β subscribe now! – You’ll get one fab newsletter each month. The next newsletter go…

timber mango
#

OK. It should be one topic for This week with two items below it.

onyx hinge
#

Mentioned @adafruit, @CircuitPython and @tannewt in the latest MicroPython News Roundup:

https://t.co/lQxBwKbKZg

Especially loving the inspiring way that you folks are running the business in such a difficult time. Stay safe and keep up the amazing work! ❀️

thorny jay
#

Not bias, it's a great news roundup.

onyx hinge
#

Springer just made 400+ textbooks free to download, including CS books on Python, deep learning, data science & AI.

Full list: https://t.co/Ny9NWjPeB1

#MondayMotivation #ML #DeepLearning #AI #CS #BigData #Python #Scala #TensorFlow #Programming #Coding

Retweets

197

Likes

380

raven canopy
#

@timber mango i indented your bullets. is that what you wanted?

onyx hinge
#

Thought it would be fun to show a quick video of an Evo M51 board and an Adafruit Industries AirLift flinging some data to Ubidots.

Learn more about Evo here: https://www.aloriumtech.com/evo/


Learn more about Alorium Tech here: https://www.aloriumtech.com/

Other...

β–Ά Play video
tidal kiln
#

lurking

onyx hinge
timber mango
#

Whom ever fixed my status update, thank you. πŸ™‚ πŸ™‚

raven canopy
#

iirc, libraries include all reviewers/commenters. core & blinka might be different. i'd have to re-dig into it.

old smelt
#

@onyx hinge - thanks for posting those links. I'm on another call so just watching out of the corner of my eye. πŸ™‚

onyx hinge
#

@old smelt you're welcome ! PT would talk and paste links at the same time, but lately I've been doing it to help out whoever's running the meeting

lucid solar
#

I used blinka for the first time this week, thanks @gilded cradle

gilded cradle
#

That great to hear @lucid solar

onyx hinge
#

@unkempt dove we're doing "hug reports". Will you have any to share today, or are you just listening (lurking)?

ivory yew
#

re: converting a m0 feather to a hostess featherwing - maybe. No promises.

lucid solar
#

I just ordered a Serpente today! Looking forward to it arrive.

timber mango
#

@ivory yew What is a hostess featherwing?

unkempt dove
#

@onyx hinge i am just listening thanks

slender iron
#

welcome!

ionic elk
#

LOL

onyx hinge
#

(guides github repo are still on travis at the moment)

raven canopy
#

TravisCI gets no love... 😦

slender iron
#

ya, CI's are under appreciated

raven canopy
#

to be fair though, they can cause some frustration. hehe

lucid solar
#

and github actions is being annoying now...failing on my PR checks.

slender iron
#

ya, actions has been unstable

solar whale
#

😍

unkempt dove
#

hi

idle owl
#

@slender iron Can we do my status update after yours? I need to head out in 10 minutes.

#

Thanks!

ivory yew
#

@slender iron have you tweeted about that? Happy to retweet it and see if any of my C++ friends have ideas.

slender iron
ivory yew
#

motorin'

manic glacierBOT
ivory yew
#

yessss match cpython sockets

slender iron
#

@inland tusk don't forget to mute again

onyx hinge
#

yay for submitting that PR dan!

modern wing
#

+1 terraria -- really fun game, and the updates add a lot.

lucid solar
#

Love Terraria....I have my own server....have to invite you @lone axle

timber mango
#

@slender iron I absorb new information like a sponge. πŸ™‚

slender iron
#

πŸ™‚

onyx hinge
#

when compressed does the information leak back out?

timber mango
#

@ionic elk I am waiting for two Toasty boards. πŸ˜‰

onyx hinge
#

check with limor for exactly what she's looking for

ionic elk
#

Quick question, do we have international font support in DisplayIO?

ivory yew
#

Out here making mp3 players like it's 2004. I love it.

prime flower
#

yay rfm9x fixes!

ionic elk
#

if I wanted fully translated debug information, for instance

solar whale
onyx hinge
#

@ionic elk depends what you mean exactly. Non-ASCII can be displayed. Terminalio has more limitations than the generalized Label.

gilded cradle
#

Broom is a nice touch

lucid solar
#

@solar whale gorgeous shed, fancy coming to Sweden to build one for me?

onyx hinge
#

advanced rendering like shaping and ligatures is way out there, right-to-left text layout is probably something you could code in Python as needed

ionic elk
#

Do we have character support for japanese/chinese?

ivory yew
#

Real on the nose for you to use your wood shed to store wood.

onyx hinge
#

and of course just the problems of storing, say, a repertoire of CJK characters in RAM, which is how fonts work now

ionic elk
#

I see stuff get spit out as unicode so I figured I just needed to install something

#

but yeah given the sizes I wasn't sure if it was supported

solar whale
#

@lucid solar would love to visit Sweden again, but I think I'm " one and done " for sheds ...

ionic elk
#

It almost certainly would be for the STM32-grade flash sizes but maybe not for other stuff

slender iron
#

check joey about the international font stuff too

ionic elk
#

@slender iron is joey a person or a software

slender iron
#

person

ivory yew
#

a "joey" is a baby kangaroo, obvs.

onyx hinge
#

@ionic elk do you want to write up an in the weeds for what you're thinking about? or cover it outside the context of the meeting?

ivory yew
#

swdio sounds awesome

ionic elk
#

I was just curious if it was a quick answer I don't mean to drag everyone into a discussion!

slender iron
#

joey castillo who is doing open book

ionic elk
#

ohhh

#

Yeah I can try reaching out

ivory yew
onyx hinge
#

sometimes

timber mango
#

@ivory yew Uh oh! You are on @slender iron's radar!

ivory yew
#

I stay on his radar. I live like a mile away from him. πŸ˜›

gilded cradle
#

ChipSnek

raven canopy
#

@slender iron you're referring to this, correct:

Adafruit CircuitPython 5.2.0 on 2020-04-09; Adafruit Grand Central M4 Express with samd51p20
timber mango
#

Yes, the Circuitpython brand needs to be protected.

solar whale
#

Shrubery

onyx hinge
#

eel theme here

thorny jay
#

There is already an alternate name in the recommendation on CP trademark.

ionic elk
#

CIRCUITSHRUBBERY

crimson ferry
#

No. 2 The Larch

lucid solar
#

EmbeddedPy

thorny jay
#

I cannot find the name, but I read it while preparing my talk.

ionic elk
#

🌳 🌳 🌳 🌳

lucid solar
#

Can you not write something like "Based on CPY" ?

thorny jay
#

If you choose not to meet these requirements, then we ask you call your version of CircuitPython something else (for example, SuperDuperPython) and not use the Blinka logo. You can say it is β€œCircuitPython-compatible” if most CircuitPython drivers will work with it.

#

So I vote for SuperDuperPython

ivory yew
#

DefinitelyNotCircuitPythonISwear

timber mango
#

The word "Circuit" should not be in any new name, but "Python" can be in the name. So it could be SHRUBBERYPYTHON or something of the same form. πŸ˜‰ πŸ™‚

ivory yew
#

Adafruit CircuitPython 5.2.0 (Non-Adafruit build) on 2020-04-09; Adafruit Grand Central M4 Express with samd51p20 or something?

lucid solar
#

Based on Adafruit CircuitPython 5.2.0 on 2020-04-09; Adafruit Grand Central M4 Express with samd51p20

slender iron
ivory yew
#

@lucid solar I like that too

lucid solar
#

@ivory yew that's nice

thorny jay
#

Branding
While we are happy to see CircuitPython forked and modified, we’d appreciate it if forked releases not use the name β€œCircuitPython” or the Blinka logo. β€œCircuitPython” means something special to us and those who learn about it. As a result, we’d like to make sure products referring to it meet a common set of requirements.

lucid solar
#

CircuitPython 5.2.0 (Non-Adafruit build) on 2020-04-09; Adafruit Grand Central M4 Express with samd51p20 I removed the Adafruit at the start @ivory yew

timber mango
#

ShrubberyPython, based on Circuitpython, created by Adafruit Industries.

tulip sleet
#

in REPL message: "CircusSnake (fork of CircuitPython) ...."

lucid solar
#

Probably remove the version # also

ivory yew
#

I like @lucid solar's + this:

Python based on Adafruit CircuitPython 5.2.0 on 2020-04-09; Adafruit Grand Central M4 Express with samd51p20
Note: This is a non-upstream build of CircuitPython. This build is not supported by the CircuitPython community.
This notice can be removed by setting the INTERPRETER_COMMON_NAME build variable.
onyx hinge
#

I wouldn't put the instruction there

lucid solar
#

I get the point of a different name, I just feel that we shouldn't call it something new....just write Python, for example.

ivory yew
#

@onyx hinge something like:

Python based on CircuitPython 5.2.0 on 2020-04-09; Adafruit Grand Central M4 Express with samd51p20
Note: This is a non-upstream build of CircuitPython. This build is not supported by the CircuitPython community.
See {short_url} for more details.
onyx hinge
#

I like that better @ivory yew

ivory yew
#

we can have a page explaining the branding stuff and how to remove the warning if you're establishing a real fork.

timber mango
#

ShrubberyPython, based on Circuitpython from Adafruit Industries

ivory yew
#

I honestly don't think we need a default separate name if we do that^

tulip sleet
#

"based on" -> "forked from" ??

ivory yew
#

"based on" has some precedence I think

slender iron
#

"circuitpython-compatible"

raven canopy
#

ArduPy..."forked". kind of. trying to be diplomatic πŸ˜„

tulip sleet
#

i also wonder about what the micropython folks will think about "based on", since we are "based on " MicroPython

ivory yew
#

We're not using any of their branding or trademarks, though

#

and that's the distinction

ionic elk
#

I'd like to see the warning contain something about tutorial compatiblity

ivory yew
#

like if they set the build variable for the name that could change to:

NewNamePython 5.2.0 on 2020-04-09; Adafruit Grand Central M4 Express with samd51p20
#

we'd drop the "based on CircuitPython" altogether if they set a new interpreter name

ionic elk
#

neopython

#

NuPython

thorny jay
#

Sorry, I have to leave here the meeting.

ionic elk
#

Python for microcontrollers based on CircuitPython 5.2.0

onyx hinge
#
 * enable pull request creation (DONE, but re-disabled temporarily)
 * enable google Cloud Translation (MT) (DONE)
 * some sort of backups (DONE; digitalocean weekly backups)
---- soft launch here?
 * Move the github authentication API keys to adafruit organization
 * Move the github PR creation to adafruit organization (adabot?)
 * enable weblate.circuitpython.org via DNS
---- launch here?
 * Move the Google Clould Translation (MT) to adafruit organization
    cost: $20 / 1 million characters translated (probably not a lot of $$)
 * Move the digitalocean droplet to adafruit organization
ionic elk
#

Python for microcontrollers based on CircuitPython 5.2.0 on 2020-04-09; Adafruit Grand Central M4 Express with samd51p20 Note: This is a non-upstream build of CircuitPython. This build is not supported and may break compatibility with libraries and tutorials. See {short_url} for more details.

#

I'd like to somehow imply that using the Circuitpython trademark is also not ok but I dunno if that makes it bloated

onyx hinge
ivory yew
#

Note: This is a non-upstream build of CircuitPython. This build is not supported and may break compatibility with libraries and tutorials and may not be distributed as an official CircuitPython build. ?

ionic elk
#

@ivory yew Noice. Concise

ivory yew
#

I get paid for my concise words.

#

πŸ˜›

ionic elk
#
Python for microcontrollers based on CircuitPython 5.2.0 on 2020-04-09; Adafruit Grand Central M4 Express with samd51p20
Note: This is a non-upstream build of CircuitPython. This build is not supported and may not be distributed as an official CircuitPython build, as it may break compatibility with libraries and tutorials
See {short_url} for more details.
ivory yew
#

I like it

ionic elk
#

got rid of the double "and"

tulip sleet
#

"non-upstream build" -> "build of a fork of" ??

ivory yew
#

non-upstream also applies to local builds

#

which most folks don't think of as a "fork"

lucid solar
#
Note: This is a non-mainline build of CircuitPython. This build is not supported and may not be distributed as an official CircuitPython build, as it may break compatibility with libraries and tutorials
See {short_url} for more details.
ionic elk
#

Yeah I think a lot of custom builds won't consider themselves forks

#

which would be confusing

tulip sleet
#

how about just "unofficial"?

ivory yew
#

fine with me

ionic elk
#

sure

tulip sleet
#

it's symmetric with the mention of "an official CircuitPython build"

ivory yew
#

yup

raven canopy
#

think: USB logo/cert. at least, that's how i always analogize it. πŸ˜„

ionic elk
#
Python for microcontrollers based on CircuitPython 5.2.0 on 2020-04-09; Adafruit Grand Central M4 Express with samd51p20
Note: This is an unofficial build of CircuitPython. This build is not supported and may not be distributed as an official CircuitPython build, as it may break compatibility with libraries and tutorials
See {short_url} for more details.
ivory yew
#

πŸ‘Œ

#

chef's kiss

slender iron
onyx hinge
#
+++ b/_board/feather_m4_express.md
@@ -6,7 +6,9 @@ name: "Feather M4 Express"
 manufacturer: "Adafruit"
 board_url: "https://www.adafruit.com/product/3857"
 board_image: "feather_m4_express.jpg"
+oshwa_certification: https://certification.oshwa.org/us000242.html
 features:
+  - OSHWA Certified
   - Feather-compatible
   - Battery Charging
idle owl
onyx hinge
#

did you try -Wl,--trace-symbol=SYMBOL ?

#

πŸ™‚

lucid solar
#

@slender iron ping me if you can't solve it within a day.

onyx hinge
#

thanks all! πŸ‘‹

#

thanks for your patience with my in the weedses

solar whale
#

πŸ‘‹

modern wing
#

πŸ‘

onyx hinge
#

in about 3 weeks we DO have a deviation from Mondays. Check our calendar!

slender iron
raven canopy
#

thanks everyone!

gilded cradle
#

bye

modern wing
#

It's gotten warm on the east coast too

onyx hinge
#

oh oh, I forgot one other thing we'll need, a webhook from github to weblate so it updates when circuitpython master branch is pushed to

slender iron
#

@onyx hinge I can help with all of that. I'm a github admin

idle owl
manic glacierBOT
#

PacketBuffer needs to know about its Connection to determine .incoming_packet_length and .outgoing_packet_length. When its Characteristic is remote, the Connection is know via the Service, but when the Characteristic and Service are local, the Connection is not easily found. Right now, PacketBuffer grabs the conn_handle by spying on GATTS write operations, and also notices disconnections.

It might make more sense for the Python program simply to pass the `Connection...

manic glacierBOT
manic glacierBOT
#

I think the main thing I like about them compared to using toml, xml, json etc is that you can easily reference other nodes. For example gpios = < &gpiob 0x0 0x0 >;

I think that makes it harder to understand.

One alternative would be to create some nice data structure in python? Then we don't need to parse it.

I think we'll end up with TOML in the long run but it's a very low priority. What we have now is well documented and well understood.

The reason I'd like to ...

orchid basinBOT
manic glacierBOT
slender iron
#

@onyx hinge did you mean to include your checkout v2 change in the swedish PR?

manic glacierBOT
#

Builds should default to a different name instead of CircuitPython. That way forks and their builds (including dev builds) are not branded as CircuitPython. We’d have an environment variable to specify it and set it in our CI. No one else should set it to CircuitPython (but other names are totally cool.) Name ideas (bonus points for it being a Monty Python reference):

  • VoltageEel
  • ElectricEel
  • ElectricSnake
  • PhysicEel
  • EelTronics
  • EmbeddedEel
  • Eels on a PCB
  • Lumberjack
  • Bl...
manic glacierBOT
#

Thank you for the PR!

I think that these changes are too invasive to take as is. (All of the _UNAVAILABLE defines are changing a bunch of stuff.) Instead, I'd like to see this build on top of UART by calling the common_hal constructor directly. The only thing UART will need to do it is a "alert me on a character" callback like tinusb has.

Leveraging the existing UART code will:

  1. Simplify the conf...
onyx hinge
#

@slender iron it should probably be its own thing but I don't think it'll hurt. Just bringing the new build up to standards

manic glacierBOT
#
k0d

I think that these changes are too invasive to take as is. (All of the _UNAVAILABLE defines are changing a bunch of stuff.) Instead, I'd like to see this build on top of UART by calling the common_hal constructor directly. The only thing UART will need to do it is a "alert me on a character" callback like tinusb has.

Leveraging the existing UART code will:

  1. Simplify the configuration in ...
#

The common_hal implementation of STM32_UART requires there to be an active 'python session', so it doesn't work in certain situations, this is kind of a higher level than the python uart modules. I find it hard to explain this, but it didn't work...I tired it...that's why this PR took so long to make.

Did you try statically allocating the struct for it? You should be able to pass in a statically allocated struct to the construct and then never_reset it to keep it alive throughout VM runs.

manic glacierBOT
#

@dhalbert link to an example please? :)

shared-module/displayio/__init__.c and .h. The primary_display_t objects in displays are allocated statically, and include displayio_fourwire_obj_t in a union. Fourwire includes an SPI object: see shared-module/displayio/FourWire.h.

Also see common_hal_busio_spi_never_reset() calls in shared-module/displayio/FourWire.c.

It's a bit complicated because dynamically allocated heap objects can get copied into the static space: s...

slender iron
#

I sorted out the error when linking esp32s2. I needed -fno-rtti for linking and also -u newlib_include_pthread_impl

ivory yew
#

huzzah

raven canopy
#

@tulip sleet @tidal kiln of course. spend an evening reading/setting up kdump, put 3.9 bootloader and CircuitPython back on the Metro M4...and now it won't cause the lockup.

#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

lucid solar
#

I sorted out the error when linking esp32s2. I needed -fno-rtti for linking and also -u newlib_include_pthread_impl
@slender iron is it linking 100% now?

slender iron
#

Yup! Haven’t tested the binary though. I think I pushed the change

#

Will go heads down on it tomorrow

manic glacierBOT
#

I’m no expert, but if you open up being able to change which tile is at the origin, then any other types of scrolling could be added as wrappers around it.

Currently scrolling requires rearranging the tilegrid, which tends to be rather slow. If you’re mostly scrolling in one direction, then is actually faster to move a bunch of smaller tilegrids and just update the x,y locations of each.

So anything you can give access out of the C code will likely give performance benefits.

Maybe @desh...

manic glacierBOT
manic glacierBOT
#

Thanks very much for providing the review and comments. I've now made a few changes:

  • Changed to class Counter
  • Fixed (I think) the submodules
  • Increment on every edge detection
  • Changed the build so that other platforms are excluded (for now)
    The build is still failing on the pyruler board (DE language) - any advice on how to get it down by 60 bytes?
half geyser
#

Can anyone tell me the story behind SPIM3 on NRF? It seems like it's the preferred SPIM controller, but it also seems like it requires an additional 8 kB of RAM to work around a hardware bug. Is that correct? Why is it more desirable?

timber mango
#

Hi Everyone, I'm a noobie in coding but very exciting by all the upcoming projects i can accomplish. I really would like to be able to code on circuitPython o my own, or at least modify the code the way i want. So i decided to start learn Python. As persons of experience, is it a good idea? do you have any recommendations? Thanks in advance and have a nice day !

lucid solar
#

Hi @timber mango and welcome blinkacomputer
Do you have a CircuitPython board?

timber mango
#

Hi @lucid solar
i do, but maybe a little old now, i have a Playground Classic. which is not python language. I want to at least go to Express version

lucid solar
#

Yes, that's correct, it doesn't support CircuitPython. The Playground Express is a great board to get.

#

It's always fun to get the Neopixel LEDs flashing first.

timber mango
#

and i love LED πŸ™‚

lucid solar
manic glacierBOT
#

An Update:

I've been trying to hunt down where the BLE libraries schedule a timeslot using the SoftDevice's Timeslots API on the nRF52840... Still haven't found it, but I'm thinking this concurrent multi-protocol idea isn't very feasible since

  1. The BLE stack has to be disabled when the radio is being used for a different protocol. I think the same applies to the ESB protocol. Also, I'm not sure if BLE configuration needs to be reloaded when its scheduled timeslot is executed.
  2. Ti...
manic glacierBOT
#

With the most recent patches, issuing time.sleep(x) issues a wfi instruction. This aggressively puts the CPU to sleep. However, this appears to cause USB to no longer enumerate. While this is not an issue with a device that's powered off of USB, if a device has its own battery, then this will prevent the device from enumerating during sleep.

Steps to reproduce

The following code.py should trigger this bug:

from time import sleep
sleep(60)
#

I believe at least part of the problem is due to the fact that there doesn't seem to be anything listening to the USBDETECTED and USBREMOVED events. This patch adds that in:

diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c
index 539a9cf90..24a0c4bdd 100644
--- a/ports/nrf/supervisor/port.c
+++ b/ports/nrf/supervisor/port.c
@@ -67,6 +67,10 @@ static void power_warning_handler(void) {

 const nrfx_rtc_t rtc_instance = NRFX_RTC_INSTANCE(2);

+#if N...
tulip sleet
#

@half geyser

Can anyone tell me the story behind SPIM3 on NRF? It seems like it's the preferred SPIM controller, but it also seems like it requires an additional 8 kB of RAM to work around a hardware bug. Is that correct? Why is it more desirable?

#

@half geyser SPIM3 can run at 32MHz; the other SPIMs can only run at 8MHz. The hw problem is that SPIM3 doesn't do contention management properly on the RAM block it's using, so any access to that RAM at the same time it's doing a transfer can cause corrupted data.

There is workaround code in nrfx that doesn't use a whole 8kB block, but it doesn't work with the soft device. (NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED)

We thought it was worth wasting most of the 8kB block (the buffer is potentially a lot smaller) to allow for higher SPI speeds, which is particularly important for driving a display.

#

the RAM is segmented into blocks or regions (I forget the exact terminology), and 8kB is the size of one of those

#

We allocate the SPIMs in busio.SPI() in order of preference, so SPIM3 gets allocated first.

manic glacierBOT
lucid solar
#

@tulip sleet do you have some time to help me with the debug_uart issue? I've got it to create it, but it HardFaults when trying to output the 'banner' (Adafruit CircuitPython 5.2.0 on ....) So I don't think it creates the object properly.

manic glacierBOT
#

Here's the fully workshopped version:

Python for microcontrollers based on CircuitPython 5.2.0 on 2020-04-09; Adafruit Grand
Central M4 Express with samd51p20
Note: This is an unofficial build of CircuitPython. This build is not supported and may not be
distributed as an official CircuitPython build, as it may break compatibility with libraries and
tutorials
See {short_url} for more details.
#

if we were to do it with a name I'd do something like this:

NiPython for microcontrollers based on CircuitPython 5.2.0 on 2020-04-09; Adafruit
Grand Central M4 Express with samd51p20
Note: NiPython is our name for unofficial builds of CircuitPython. These builds are
not supported and may not be distributed as official CircuitPython builds, as they
may break compatibility with libraries and tutorials
See {short_url} for more details.
manic glacierBOT
#

The phrase "Python for microcontollers" might cause confusion. That phrase is used several times to describe Micropython.

I don't see that as a big issue, it's used persistently in the Circuitpython docs as well. And I think it actually plays into the point, that without being official builds are just another subversion of the Micropython base concept but without any guarantees attached.

tulip sleet
#

@lucid solar do you have a backtrace from the call to HardFault_Handler? Did you set a breakpoint there? Is your code committed?

lucid solar
#

yes, yes, no ;)
I've made MP_DEFINE_CONST_FUN_OBJ_0(debug_uart_obj, debug_uart); I assume that I have to call that at some point manually to init the object? As it's outside of the python VM?

tulip sleet
#

is debug_uart a function? That is just a macro

lucid solar
#

Yeah, it is a func

tulip sleet
#

right, you need to create it somewhere. I am guessing it creates the UART object in a static place, not on the heap.

lucid solar
#

@tulip sleet I'm missing something...just not sure where πŸ˜‰

tulip sleet
#

do you want this to be usable from Python, or is it some compile option for doing debugging prints from C code?

#

i thought it was the latter but may be wrong

lucid solar
#

When running code.py, it needs to catch ctrl+c, and outputs when print() is called
When waiting for "any key to enter repl", that's outside python, but needs to catch any key
When inside repl, it needs to catch the keys and print the output.

tulip sleet
#

you mean it's a duplicate of the REPL serial connection?

lucid solar
#

yes

#

Exact same as what goes over USB

tulip sleet
#

in micropython this is dupterm or something like that

lucid solar
tulip sleet
#

yes, I'm just suggesting that it might be code to study

lucid solar
#

This should be available always...even if the py VM isn't running

tulip sleet
#

so do you want the debug-uart to be created when CPy starts? Then it should be created in main.c or something main.c calls. And should it always be created? Are you dedicating some pins to it?

#

i'm thinking you could piggyback on the multiterminal code to do the input handling, since the mechanism is already there

#

it's not clear to me it does output too, but it could be extended to do that. I don't know of anyone using multiterminal now, so not sure if it definitely works

lucid solar
#

I was thinking of creating it in serial_init, as that's where usb_init is called

tulip sleet
#

that sounds fine, but it's dedicated pins?

lucid solar
#

yes

tulip sleet
#

so just call common_hal_busio_uart_construct() in serial_init(). You don't need the pins.c addition.

#

i see that common_hal_debug_create_uart() basically does that

lucid solar
#

yeah πŸ˜‰

tulip sleet
#

MP_OBJ_FROM_PTR(&debug_uart) in serial.c serial_init() doesn't do anything, that's just a type-casting macro

lucid solar
#

Yeah...ignore that...shouldn't have been committed

tulip sleet
#

so if you call common_hal_debug_create_uart() in serial_init(), I think that should do it

lucid solar
#

ok...am testing on the board now...

#
    n_bytes=<optimized out>, 
    has_finaliser=<optimized out>, 
    long_lived=<optimized out>)
    at ../../py/gc.c:489
#2  0x08066d0c in common_hal_busio_uart_construct (self=0x2000a2a4 <debug_uart_obj>, 
    tx=0x809c628 <pin_PD08>, 
    rx=0x809c630 <pin_PD09>, rts=0x0, 
    cts=0x0, rs485_dir=0x0, 
    rs485_invert=false, baudrate=115200, 
    bits=8 '\b', parity=PARITY_NONE, 
    stop=1 '\001', timeout=1, 
    receiver_buffer_size=64)
    at common-hal/busio/UART.c:218```
slender iron
#

multiterminal was only ever implemented on esp8266

lucid solar
#

it goes into safemode after that

tulip sleet
#

The trouble is that the UART constructor creates a buffer on the heap, and there's no heap yet

#

so you need to add some way to have a statically allocated buffer

#

(I think, still looking to confirm)

#

right, the _construct calls ringbuf_alloc()

lucid solar
#

Yeah...that's why I didn't think it could be done...(easily)

tulip sleet
#

the _construct also looks for a free UART, but you want a particular one in mind. So don't call _construct, but do most of the work it does, using the dedicated UART and static buffer and object. Or add some args to _construct()

#

I'm wondering if this is useful on other than STM, as an option. There are times when we want to do debugging and USB is broken, but we'd want it to be compile-time optional and usually off, since we don't want to use up valuable pins

#

it's just the STM dev board that has these not-very-useful pins available?

slender iron
#

@tulip sleet I asked for _construct to be used

tulip sleet
#

well, we need an optional arg to pass in the ringbuf

slender iron
#

and suggested adding a pointer parameter to _construct

tulip sleet
#

ok, I didn't read the comments

lucid solar
#

and suggested adding a pointer parameter to _construct
@slender iron I missed that comment...or didn't understand it maybe πŸ˜‰

slender iron
#

I could have been more specific. sorry!

lucid solar
#

Nah, it was because I read that at ~02:00 and didn't re-read it today

tulip sleet
#

ok, great minds think alike πŸ™‚

slender iron
#

πŸ˜„

tulip sleet
#

also you would need something to specify the specific UART periph you are using

lucid solar
#

do I need to have common_hal_debug_create_uart (shared_module)? or just call common_hal_busio_uart_construct directly myself?

tulip sleet
#

if it's a convenient abstraction, then keep it. If you are not exposing this UART to Python, then it doesn't need to be in shared-module. It can just be some extra code in serial.c or somewhere in supervisor. share-module is for implementing things that have a Python interface

slender iron
#

you don't need to pick the periph. just provide the pins to construct

tulip sleet
#

ah good point

lucid solar
#

ok...I think I get it now...will test it out...

tulip sleet
#

i thought the periph was special somehow

slender iron
#

nope, it's just a UART connected to another chip

#

we might need a baudrate but that should be all I think

#

it'll simplify all of the init

tulip sleet
#

do we need all the UNAVAILABLE stuff or is it just another UART?

#

or are there other reasons for that

slender iron
#

we shouldn't

#

but we need to add something to uart to alert when a ctrl-c is entered

tulip sleet
#

is there latent support for that via multiterminal?

slender iron
#

no

#

multiterminal was only implemented on esp when all of the serial processing was port specific

tulip sleet
#

it's still in the doc, maybe we should remove it

lucid solar
#
    tx=0x809c690 <pin_PD08>, rx=0x809c698 <pin_PD09>, rts=0x0, cts=0x0, 
    rs485_dir=0x0, rs485_invert=false, baudrate=115200, bits=8 '\b', 
    parity=PARITY_NONE, stop=1 '\001', timeout=1, 
    receiver_buffer_size=64) at common-hal/busio/UART.c:181```
#

GPIO_InitStruct.Alternate = self->tx->altfn_index;

slender iron
#

ya, maybe

#

I haven't looked at it in a while

tulip sleet
#

@lucid solar if you look for uses of MICROPY_KBD_EXCEPTION, that will help you find where the interrupt char (default is ctrl-c, but could be something else) is handled

lucid solar
#

@tulip sleet thanks, I think I understand that bit ok.

slender iron
#

πŸŽ‰

manic glacierBOT
#

Am I Overthinking This?

It would be easier if I could treat the protocol being used as a singleton (only BLE is used or only ESB is used). This doesn't mean I'm giving up, I'm just having trouble reading the Circuitpython source code in regards to the SoftDevice implementation. I think I'll push forward with a custom build for the nRF52840 dongle (super cheap) that only employs the ESB protocol (and disallows BLE).

A custom build is probably easiest. Right now we only enable t...

manic glacierBOT
#

@dhalbert - would you envision something like this?

import time
dir(time)
['class', 'name', 'localtime', 'mktime', 'monotonic', 'monotonic_ns', 'sleep', 'struct_time', 'time']
time.time()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotImplementedError: No long integer support
time.mktime('12:34')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotImplementedError: No long integer support
time.loca...

idle owl
#

@timber mango Consider the Circuit Playground Express or Circuit Playground Bluefruit as the best place to get started. Both have all kinds of sensors, LEDs, buttons etc built in. The Bluefruit includes Bluetooth. There is a library designed to make getting started super simple. Here is the guide for it: https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express/circuit-playground-express-library

Adafruit Learning System

Get started with just a few lines of code!

lucid solar
#

@slender iron @tulip sleet does it make sense I also need to construct the TX/RX pins in serial_init?

tulip sleet
#

the pin objects themselves are static; they aren't constructed

#

pin_PA_00 or whatever

lucid solar
#

When I try to write to the UART, it calls this mp_raise_ValueError(translate("No TX pin"));

tulip sleet
#

what are your arguments to _construct()?

lucid solar
#
                                    115200, 8, PARITY_NONE, 1, 1.0f, 64, buf_array);```
#
    const mcu_pin_obj_t* tx = MP_OBJ_TO_PTR(DEBUG_UART_TX);```
#
$9 = (const mcu_periph_obj_t *) 0x0```
tulip sleet
#

that is weird ... looking

#

I think you'll need to step through the complicated uart assignment code in _construct and see why self.tx is not being set. Check that the arg coming in is not NULL too , but it shouldn't be.

manic glacierBOT
lucid solar
#

@tulip sleet it's calling common_hal_busio_uart_write before common_hal_busio_uart_construct it seems

tulip sleet
#

OK πŸ™‚

lucid solar
#

run_boot_py before serial_init

tulip sleet
#

the idea is that boot.py is run before any USB setup, so it can modify it if necessary

lucid solar
#

Yeah, I see that...where is best for this code then?

tulip sleet
#

if you want the debug uart to be functional then, then its initialization should be moved further back. It's fine to create a new routine if you have to

lucid solar
#

ok...thanks

tulip sleet
#

a reminder that the code is not sacred, don't be afraid to change it, but consider the larger structure and keep the style, etc. this is probably obvious to you

lucid solar
#

Yeah, I try to not change too much...but sometimes you just have to.

#
void serial_init(void);
``` Just made this...simple I think
manic glacierBOT
lucid solar
#

@tulip sleet I've got it writing just fine now...still have to fix the reading, but that's something I can fix.

tulip sleet
#

yay!

manic glacierBOT
#

The STM32 timer system has multiple different kinds of timers - basic, general purpose, and advanced - which are typically tied to pins or specific peripherals. In comparison to other ports, the timers have somewhat limited multiplexing to pins, with some timers only having a single viable pin and vice versa.

Currently, to avoid taking pin-timer combinations out of the "pool", multiple modules are competing for the "basic timer" set, which have no pin assignments at all. However, there ar...

#

I'd like to understand better why you needed these additions, given that I don't see them added anywhere in the rest of the PR. In general, the ST HAL does not recognize a global "pin number" system, and the GPIO banks are dangerous to iterate through due to overlap with system features (BOOT, OSC), which is why I opted for a bank vs mask approach across the STM32 port. If you have a particular implementation or algorithm that you need these for, let me know so I can take a look and potential...

#

TinyUSB requires application to call tusb_hal_nrf_power_event() within the power handler.
https://github.com/hathach/tinyusb/blob/master/src/portable/nordic/nrf5x/dcd_nrf5x.c#L630

The power IRQHandler is used and shared with SoftDevice therefore it cannot be actively handled when SD is enabled. The above modification by @xobs is part of the initial init_usb_hardware() when enabling USB (with SD not enabled yet). I am not sure how WFI() affect the power peripheral, but in case it does...

#

I misunderstood that my main performance issue was due to the autorefresh that redrew the tilegrid after each change. I changed my code to turn autorefresh off before re-arranging all the tilegrids, followed by turning autorefresh on again. This made a huge improvement.

I'll close this out as a misunderstanding on my part about the performance limiting factor. For the scrolling I was doing, the limiting factor was the auto refresh, not the redefinition of the tilegrids.

manic glacierBOT
#

common_hal_mcu_pin_number, common_hal_mcu_pin_claim and common_hal_mcu_pin_reset_number are functions added already to the nrf and samd ports, and required by rgbmatrix. See shared-{bindings,module}/rgbmatrix/RGBMatrix.c for uses.

protomatter has a fundamental assumption that there is a numbering scheme for all pins, and that given a valid pin number you can get pointers to the GPIO registers (set and reset at a minimum) and the bit offset within those registers for the set or res...

manic glacierBOT
#

Issue #2812 - throw a NotImplementedError instead of "AttributeError: 'module' object has no attribute" for time functions that require long ints on platforms that do not support those.
It will now look like:

>>> import time
>>> dir(time)
['__class__', '__name__', 'localtime', 'mktime', 'monotonic', 'monotonic_ns', 'sleep', 'struct_time', 'time']
>>> time.time()
Traceback (most recent call last):
  File "", line 1, in 
NotImplementedError: No long integer support
zinc maple
#

EduBlocks for CircuitPython has got a refresh in the beta. Some new features are:

  • Account system for file saving and sharing
  • Split view (Blocks and Python on same screen)
  • Few ui updates
  • Translations
onyx hinge
#

@slender iron if you have some time to work on github settings now that we're shifting to hosted weblate .. the recommendation is to install the "weblate app". Apparently what I can do is "request" this, which I guess is going to be reviewed by a github project admin such as you?
https://docs.weblate.org/en/latest/admin/continuous.html#github-setup https://github.com/apps/weblate

GitHub

GitHub is where people build software. More than 50 million people use GitHub to discover, fork, and contribute to over 100 million projects.

#

" A request to install Weblate has been submitted on the @river quest account. "

#

(sorry for the unintentional mention, woops)

manic glacierBOT
#

Sorry, I should have been clearer in #2812, I was thinking more like this:

STATIC mp_obj_t time_not_implemented(void) {
    mp_raise_NotImplementedError(translate("No long integer support"));
}
MP_DEFINE_CONST_FUN_OBJ_0(time_not_implemented_obj, time_not_implemented);

and then reference that in `time_modules_global_table, for each unimplemented function, e.g., for one of them:

    { MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&time_not_implemented_obj) },

Locally, I tr...

#

By the way, I would suggest that you not work on the master branch in your fork. Instead, create a branch for this particular fix, and commit to that branch. Then your master won't get out of sync with upstream. See https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github/always-work-on-a-branch.

Also, you will need to do make translate before pushing your changes, because you've added a new translate() string. Otherwise the builds will fail.

lucid solar
#

@slender iron can you create a doc for next weeks CPY meeting?

manic glacierBOT
slender iron
#

@lucid solar yup! thanks for the reminder

lucid solar
#

No problem...just ready to start my hug_reports/status_updates

slender iron
#

Here is the notes document for Monday’s CircuitPython Weekly meeting. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1bzaYoTmWls07acn7JB4z0CX9BiTymQH-22rwZzXIObE/edit?usp=sharing

tulip sleet
#

@slender iron I was going to make a new release of ble MIDI. Your last release was 0.8.0. Do you want to keep the sub 1.0.0 releases or should I bump it to 1.0.0?

slender iron
#

@tulip sleet either is fine for me

#

@onyx hinge looks like its been approved

tulip sleet
#

i'll do 1.0.0, since it's functional

slender iron
#

πŸ‘

tulip sleet
#

will do in a bit; just going out

slender iron
#

k, np

onyx hinge
#

@slender iron great, I'll see what happens if I have it try to push changes back to github...

#

hmmm there's an option in weblate to update .po files from .pot files. I wonder if we could change 'make translate' to just update the .pot file.

#

On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 15215 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
This seems really wrong

slender iron
#

I didn't want that in case folks edit .po files manually

timber mango
#

Circuitbrains is almost funded! The only need $671.00 more. I know we can help them. Several of us have already pledged for two of them. Are are others here who would like to see Circuitbrains become a reality?? https://www.crowdsupply.com/null-byte-labs/circuitbrains-deluxe/updates/reduced-funding-goal

Crowd Supply

We have big news for all of you. After bouncing some ideas back and forth with Crowd Supply, we have been able to find a way to reduce the funding goal for this project. This means that it is much closer to becoming a reality. There are only a few days left on the campaign. If...

ionic elk
#

I feel for those folks but I was worried about it from the moment I saw that it didn't come with USB. That's just such a big barrier to a board that seems Circuitpython focused.

raven canopy
#

being end-product/project focused, i can see why they only broke out lines. def not the "standard" blinka board, though.

ivory yew
#

Yeah it works great for things like Sol which have the USB port in a specific spot and us a different connector (USB B)

#

I'd love to see a breakout/programming board for it.

kind river
#

It probably wouldn't be too hard to make a USB "cover" that could be soldered or just pressed on top of it for programming. It would have been nice if the USB and power pins were together though.

lone axle
#

on a busio.SPI object is there some way to access to baudrate that it was configured to use?

#

I found some old code trying to access that value like this spi._spi.baudrate. I'm not certain if it ever worked but now it does not because there is no _spi attribute.

tulip sleet
#

It is the actual frequency, not the requested frequency, so you can tell how it got altered by the granularity of the peripheral setting

manic glacierBOT
lone axle
#

Thank you

crimson ferry
#

@lone axle That's in a library? I think it could be useful to expose that from within libraries since user code accessing .frequency just get the default, 24MHz I think, since the bus is typically unlocked in user code.

lone axle
simple pulsar
lone axle
#

They were printing the value of the baudrate to show that the library was not respecting previously set values.

#

.frequency does return 250000 for me if I don't configure the spi for anything specifically myself.

crimson ferry
#

yeah, the only way to get the actual frequncy for a given SPI device now is to be within it's unlock code

#

But it could be useful to know the actual

lone axle
#

it does also show new values if I set them with configure

crimson ferry
#

but I believe that's configuring a global default, unless you are within the code that is accessing a specific device unlocked. for example, If I do .frequency in my user code, I'll get 24 or 25MHz, whatever it is, but as each library is invoked, those devices will use their own specific configured SPI frequencies (but the user can't find out what they are at the library API level)

#

because user code running devices through libraries only sees the SPI bus unlocked (corrected my just prior statement)

crimson ferry
#

just realized I can cheat sometimes: with esp._spi_device as espspi: print(espspi.frequency)But for displayio.FourWire...?

crimson ferry
#

LOL```spi = board.SPI()
while not spi.try_lock():
pass
spi.configure(baudrate=microcontroller.cpu.frequency)
spi.unlock()

ivory yew
#

Why not just go ahead and multiply it by two, just to be sure you get the max.

crimson ferry
#

πŸ˜„

#

engineers always multiply by two, right?

#

just in case

#

that did get me up to 45MHz on Teensy 4.0

timber mango
#

No, they multiply by a power of 2 :wink: :stuck_out_tongue_winking_eye:

crimson ferry
#

2 is a power of 2 :p

timber mango
#

Of course, but that is finite. :p

crimson ferry
#

SAMD51: cpu=120MHz, max spi=24MHz, esp=8MHz. Teensy 4.0: cpu=600MHz, max spi=45MHz, esp=7.5MHz

#

it would be useful to know what actual speed spi displays are running at

crimson ferry
#

Is there a way to shift another ~512K of flash on the Teensy 4.0 to the CIRCUITPY volume? It seems it only gets 1MB of the 2MB, whereas SAMD51 chips with 512K+2MB get 2MB.


Itsy Bitsy
   (1024, 1024, 2024, 544, 544, 0, 0, 0, 0, 255)

Teensy4.0
   (512, 512, 2001, 8, 8, 0, 0, 0, 0, 255)```
slender iron
#

ya, it shouldn't be too hard

crimson ferry
#

should I make an issue?

slender iron
#

most imxes will have more than 2mb though

crimson ferry
#

so on 51J20 (like PyPortal) I'd assume only half of the on-chip 1MB is full?

#

Teensy's all I have for now (dev boards are overkill for me)

slender iron
#

Β―_(ツ)_/Β―

#

are you filling up the 1mb filesystem on the teensy?

crimson ferry
#

It's not critical right now, I can delete some libraries for peripherals I can use on other boards, I just got caught off-guard when I hit it sooner than expected compared to SAMD boards. Another 512K would be really nice though.

slender iron
#

ya, we could adjust it. it's just hard to change in the long term without erasing the existing fs

crimson ferry
#

ah, so someone loading 5.4.x or w/e would get zapped, makes sense. No issue then, I'll keep pushing with what's here πŸ™‚

slender iron
#

πŸ‘

half geyser
#

Thanks for the explanation, @tulip sleet ! That really helps a lot.

blissful pollen
#

I managed to convert one of the AHRS algorithms (Mahony the easiest) to circuitpython to see if it would run. Happy to report it seems to do okay on a Feather M4 express. I'm getting the same results as the original C arduino code and have it running on a LSM9DS1 sensor via I2C
https://github.com/gamblor21/CircuitPython-AHRS

#

Interestingly enough either North/South or East/West are reversed in the original and in my version - or I am doing something wrong with the sensor setup (quite possible)

idle wharf
#

I managed to convert one of the AHRS algorithms (Mahony the easiest) to circuitpython to see if it would run. Happy to report it seems to do okay on a Feather M4 express. I'm getting the same results as the original C arduino code and have it running on a LSM9DS1 sensor via I2C
https://github.com/gamblor21/CircuitPython-AHRS
@blissful pollen I had no idea what AHRS is, so I looked it up and gave you a PR. πŸ˜‰

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I am using an M4 ItsyBitsy and would like to create a custom console for when I plug my computer into the USB port on the ItsyBitsy. I don't know how to access the Tx and Rx pins on the USB port and I don't know if I would be able to use them even if I did know what pins they were since the REPL uses them. And yes I know that there is input() and print() but I need background processes to occur even while the user is using the console (since input() holds the whole script).

Is there any wa...

manic glacierBOT
half geyser
#

Here's a strange one: I'm debugging Circuitpython on an NRF52833. My debugger is a Raspberry Pi running openocd. For whatever reason, reset halt doesn't work. reset works, and halt works, but it just won't reset halt.

#

This is particularly frustrating because the only reliable way I've found to reprogram it is to do nrf51 mass_erase, followed by reloading the softdevice and bootloader.

#

Here's an interesting hint as to what could be going wrong: it can't reboot into the bootloader anymore. That is, resetting the device appears to reset even the POWER block.

stuck elbow
#

I thought NRF52833 is not supported? only NRF52840

timber mango
#

The nRF52833 is a new chip.

#

Adafruit is supporting it

half geyser
#

I've been adding support for it. The PCA10100 is supported, as is Simmel which is a thing I'm working on.

#

Ooh, I'm glad I mentioned something. That caused me to look into openocd. For whatever reason, a "sysresetreq" isn't working, but "vectreset" is. So in openocd if I do cortex_m reset_config vectreset then I can flash it.

manic glacierBOT
manic glacierBOT
blissful pollen
#

@idle wharf Hey thanks! By the time I was committing things I was half asleep so some more explanation is good

manic glacierBOT
manic glacierBOT
#

I thought it was odd that it seemed to somewhat work even without that patch.

The strange part is I can see the events fire, and I see the tusb_hal_nrf_power_event() function fire with all three kinds of events, but it still just does not work. Do we need to be calling tusb_task() more often now?

My guess is that there is an interrupt we need to enable so that it wakes up from WFI. Did you confirm that it works when the actual WFI call is commented out? This looks very similar...

slender iron
#

any objections to me releasing 5.4.0-beta.0 today?

lucid solar
#

@slender iron I've made a bit of progress with SWDIO, I've got an 'empty' module working (I can import swdio), so I understand what needs to be created. What I'm working on now is a 'spec' for the Python module itself, what methods/properties etc etc it needs.

prime flower
#

@slender iron no objection, only encouragement!

slender iron
#

nice @lucid solar !

idle owl
#

@simple pulsar CPB guide updated. Thanks for catching that.

simple pulsar
#

@idle owl np - i've been writing some code for the CLUE, then realised most of it would work on CPB+Gizmo so I've made it run on both, hence the interest

manic glacierBOT
ionic elk
#

@slender iron would you consider problems with getting japanese/chinese characters to display in Circuitpython to be too esoteric to make issues of?

idle wharf
#

@slender iron would you consider problems with getting japanese/chinese characters to display in Circuitpython to be too esoteric to make issues of?
@ionic elk FYI: There are blog posts and learning articles about CP supporting Unicode Fonts... https://blog.adafruit.com/2019/05/29/new-guide-pybadge-conference-badge-with-unicode-fonts-conference-badgelife-circuitpython-pybadge-adafruitlearningsystem-adafruit/

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

A new guide in the Adafruit Learning System:Β PyBadge Conference Badge With Unicode Fonts Get ready for your next conference with the PyBadge Conference Badge. With this simple project, not only can…

#

My_Point: So I would think its expected to work.. πŸ˜‰

slender iron
#

@ionic elk an issue is always good. Not sure it’s worth the effort to fix though

ionic elk
#

Seems like it's an Adafruit_CircuitPython_Display_Text issue anyway

#

not really with anything core

ionic elk
manic glacierBOT
lucid solar
#

@slender iron @ionic elk Could you advise what would be the minimum RAM/Flash for a STM32 CircuitPython compatible mcu?

slender iron
#

for SAMD21s its 32k ram and 256k flash

#

192k flash would be equivalent if it had external spi flash

lucid solar
#

ok...I'm looking at the F411RE, that's got 512/128...so plenty πŸ™‚ It's nice when I'm producing only a few boards, so an extra $ doesn't matter.

slender iron
#

πŸ‘

manic glacierBOT
onyx hinge
#

@slender iron @tulip sleet do you want to weigh in on the naming of this new module for interfacing to SD cards? sdcard_spi has been suggested. I only want to rename it once 😜

tulip sleet
#

@onyx hinge I'm not clear why sdio was rejected?

#

or sdcardio

onyx hinge
#

I think because

A SDIO (Secure Digital Input Output) card is an extension of the SD specification to cover I/O functions. SDIO cards are only fully functional in host devices designed to support their input-output functions (typically PDAs like the Palm Treo, but occasionally laptops or mobile phones). These devices can use the SD slot to support GPS receivers, modems, barcode readers, FM radio tuners, TV tuners, RFID readers, digital cameras, and interfaces to Wi-Fi, Bluetooth, Ethernet, and IrDA. Many other SDIO devices have been proposed, but it is now more common for I/O devices to connect using the USB interface.

#

SDIO is overloaded and it doesn't do any of these things

tulip sleet
#

sdcardio is too much like "cardio?

#

there are already a couple of GitHub repos called "SDCardIO", which is actually good, I think, since this is related

#

what would be in the namespace below "sdcardio" (or whatever name)?

timber mango
#

Sdcardio sounds like a heart exercise.

onyx hinge
#

@tulip sleet right now a single class SDCard that is constructed almost like an adafruit_sdcard.SDCard (except that it takes a Pin, not a Digitalio, for the chip select line right now)

tulip sleet
#

I kind of like sdcardio, despite the accidental "cardio" part, since it matches all the rest, and it's different than "sdio", which I agree would be confused with a widely (?) known acronym.

strange adder
#

Curious if there are any thoughts to add a dev board+circuitpython support for the Dialog Seminconductor Smartbond DA145XX or DA146XX product lines?

lucid solar
#

the DA145xx looks underpowered (RAM/ROM)

#

DA1469x would work theoretically

strange adder
#

They target ultra-ultra-low power IOT market

#

with integrated bluetooth

lucid solar
#

"DA14695 Development Kit – USB" looks nice...it has a built-in debugger and hub so you can use the USB from the DA14695 and debugger at the same time.

strange adder
#

I just got a DA14531-00FXDEVKT-U 2 days ago for a particular project I have in mind. Pretty cheap.

lucid solar
#

I would say DA14695-00HQDEVKT-U is the minimum you'd need...I might get one, I like the idea of the debugger/hub

strange adder
#

Yeah, Keil debugging is a cinch. You can use JTAG or debug over UART

#

But if I remember correctly the newer DA145XX series consumes around half the power of the DA146XX

lucid solar
#

Shame they only do BGA packages...or it'd be nice to add to some projects I have

slender iron
#

@onyx hinge sdio is my preference actually because we can make it a generice API for both SPI and SDIO modes. SDIO can then be supported with an available SDIO peripheral then

#

also consider it would be cool to allow boards to construct them and have them long lived

onyx hinge
#

and substitutible for the "/" drive even

slender iron
#

maybeeeeeee

onyx hinge
#

well, maybe

#

you'd have to put it deep in the device config in C, I think

slender iron
#

@strange adder native USB is a must too. doesn't look like the DA14531 has it

strange adder
#

oic, thanks!

slender iron
#

πŸ‘ always interesting to see different micros

ionic elk
#

Is it possible to load a font from an SD card?

crimson ferry
#

@ionic elk absolutely

ionic elk
#

@crimson ferry cool.

#

also, though, I'm finding that making a foreign-language text group takes a full 40 seconds to create? On both STM32 and Atmel M4

crimson ferry
#

I always check "/" first, then if SD Card is present, check that if not found on "/" πŸ™‚

ionic elk
#

Seems crazy slow

crimson ferry
#

fast SD card? i tend to use Class 10 / A1 or better (probably overkill), load font and load glyphs at startup doesn't seem to take much time

#

time is relative I supppse πŸ˜‰

ionic elk
#

This is just from SPI flash

#

on a 250KB font

manic glacierBOT
ionic elk
#

I'm afraid if I go trying it on a 2.5MB font (chinese) it'll take all day

#

By which I mean 6 minutes. which is still a long time to make one text box

crimson ferry
#

1.4 seconds for a 32-point font (220K), loading ~15 glyphs. About the same time to load ~45 14-point glyphs (SAMD51). I expected more variation.

ionic elk
#

That's a LOT faster than my setup

crimson ferry
#

What's the alternative for lots of glyphs and / or large point sizes

ionic elk
#

Is it impacted by font size?

crimson ferry
#

I would think so

raven canopy
#

@tulip sleet @tidal kiln just so i can jinx it, i think i've found the issue/solution to the bootloader woes. after comparing 3K lines of udev debug, tracking block setup/teardown, and testing a rule, i think we're running into this: https://github.com/systemd/systemd/issues/7587
i can't say definitively, but i think it may be either the HID objects or block device isn't getting torn down completely which throws the cycle of death when it re-enumerates.

ionic elk
#

What's the size of the font you're using? I've been trying it on 250kb-350kb fonts that are 12pt, and I'm getting about 40s for 12 glyphs.

crimson ferry
#

The 32 is 220K, the 14 is 114K

ionic elk
#

Seems like my performance is clearly quite a bit worse

#

over an order of magnitude

#

1-2 seconds would be totally acceptable for my application but 40s is, uh, not

slender iron
#

@ionic elk loading glyphs from a bdf file is a linear search through a text file

ionic elk
#

@slender iron yeah it makes sense to me that it wouldn't be super fast, but anecdata is reporting a load time of 1.4 seconds for a library and number of glyphs just slightly smaller than mine

#

so I'm guessing I've got something else going on

slender iron
#

the glyph position in the font matters

ionic elk
#

ah, that could be it.

lucid solar
#

@slender iron what does FREEZE ../../frozen/circuitpython-stage/pygamer mean?

ionic elk
#

I don't suppose it'd be possible to give it an offset to start counting from? Hiragana starts at 12353, if it does that for every glyph, makes sense it might be bogging down

slender iron
#

@lucid solar it means that the stage python code is parsed and stored into flash

#

@ionic elk you really want a cache of byte offsets into the bdf

#

utf-8 offset won't help you

lucid solar
#

aha...just wanted to check that it wasn't meaning that it was freezing the code at some point...as I'm checking that my changes build on a out-of-port board before I commit.

ionic elk
#

@slender iron I assume this would have to be a manual rewrite of Label then

slender iron
#

not necessarily, the font loader that Label uses

#

are you doing this on adafruit time?

ionic elk
#

no of course not

slender iron
#

πŸ‘

ionic elk
#

personal project that I was hoping to get done in an hour this morning and didn't quit on because I'm stubborn

slender iron
#

@ionic elk I understand that. πŸ™‚ storing an offset cache in the BDF font would speed it up

#

also having label bulk load new glyphs would too

ionic elk
#

I don't see offset cache as an option in otf2bdf 😬 : is that something I need FontForge for?

slender iron
#

there is a binary version of bdf called pcf that would also be faster to search since it's binary

#

you'd do it manually in bdf

ionic elk
#

How does label bulk load? Is that documented somewhere?

slender iron
#

it doesn't bulk load "load_glyphs" to the font iirc

ionic elk
#

So, some rewrites but not super crazy ones

slender iron
#

optimizations

ionic elk
#

ye

#

Might need a pretty big table for Kanji

#

But if it's designed for SD use that might not be a big deal

#

From working today it seems like fitting a Kanji font of any readable size on 2MB internal flash is basically impossible. It's tantalizingly close but just barely doesn't fit.

slender iron
#

did you talk with joey yet? he has his own format for storing a bunch of characters

ionic elk
#

I have not, maybe he could have saved me some pain today

#

FontForge is the devil by the way, I would recommend not recommending it.

slender iron
#

do you know of something better?

ionic elk
#

otf2bdf works great

#

MakerMelissa recommends it in the badge tutorial.

#

If you just want to view them BirdFont is clunky but at least it doesn't segfault every other minute.

manic glacierBOT
ionic elk
#

Sorry if I've made some grumpy messages here, I spent a lot more time than I expected on FontForge today, sorry.

slender iron
#

np, I'm heads down on esp32s2

timber mango
#

@ionic elk I am sure anyone who has tried to use FontForge will understand. I installed and tried it once, got several segfaults, and immediately removed it. πŸ˜‰

manic glacierBOT
#

Strange, the failed checks don't happen when I build locally...it's also not related to my changes. Known issue?

The errors may be due to some kind of submodule sync problem: one is from STM, and the other has to do with protomatter. Could you merge from upstream and also do git submodule sync and git submodule update? Also make sure your pushes are from a branch with everything added.

#
k0d

Strange, the failed checks don't happen when I build locally...it's also not related to my changes. Known issue?

The errors may be due to some kind of submodule sync problem: one is from STM, and the other has to do with protomatter. Could you merge from upstream and also do git submodule sync and git submodule update? Also make sure your pushes are from a branch with everything added.

Fixed, thanks!

ivory yew
#

making some good progress on my USB host featherwing

#

got this tiny little bit of code working today:

hostess_midi_in = HostessMidiPortIn(spi)
upstream_midi_out = usb_midi.ports[1]

while True:
    # Get a MIDI event from a USB
    # MIDI device connected to the
    # Hostess Feathering
    midi_event = hostess_midi_in.read()
    
    if midi_event is not None:
        # Send the MIDI event to the computer
        # over this Feather's USB MIDI connection
        upstream_midi_out.write(midi_event)
        print(midi_event)
manic glacierBOT
manic glacierBOT
slender iron
#

@vale spire does the xtensa stack grow up instead of down?

onyx hinge
#

according to some doc I found, it grows down as we're accustomed to [Xtensa Instruction Set Architecture (ISA) Reference Manual p.588]

manic glacierBOT
mental nexus
#

@lone axle Thanks again for pointing me in the right direction on a few things (USB host controller for UART and write access to the CircuitPython file system) and for your encouragement!

#

You can now edit and run CircuitPython code all on the same hinged duck.

#

It was a fun couple of weeks and I learned a ton! Thanks to all the community members for their β€œcan do” attitude and willingness to help us less knowledgeable folks get better!

half geyser
#

A quick update on my reset issues yesterday: It seems that, for whatever reason, resetting this board (a Simmel board base on an nRF52833) now causes a brownout event. That's the source of my reset woes. The RESETREAS is all zeroes, which indicates a brownout. The GPREGRET and GPREGRET2 retained registers are also zero. Doing a core reset does not cause this problem. So it's not a problem with circuit python, it's a problem with how I'm using this chip.

#

I'll keep looking for the cause of the brownout. I don't think it's caused by VDD drooping during reset, since it's connected to a relatively beefy power supply. And the thing only draws a few mA.

ivory yew
#

@mental nexus that's rad.

mental nexus
#

Thanks @ivory yew , it was a labor of love.

#

In the process I created a simple text terminal class that can write to a display using displayio tilegrids. It has basic scrolling function and keeps track of the entry point. For the editor running on the crberDΓ›CK, I used three terminals, one for main text area, a highlighted one for the status row and one single tile terminal for the cursor. I’ve never released anything on github but if this could be useful to someone I can figure it out.

half geyser
#

I'll keep looking for the cause of the brownout. I don't think it's caused by VDD drooping during reset, since it's connected to a relatively beefy power supply. And the thing only draws a few mA.
Interestingly, reset works just fine until circuit python is started, then it stops until I reflash the board. The plot thickens...

half geyser
#

Huh. It's the write to NRF_UICR->REGOUT0 that's causing it. Interesting...

#

Setting it to 3.0V (instead of 3.3V) seems to fix the issue.

broken kettle
#

The voltage from the battery IS 9V

There are 6 number of globes.

How much voltage are across each globe

There is 1 glove and then 2 globe and then 3 globe. What are the brightness of the globes

#

Help

low sentinel
#

Can I not retain an arg pointer that I get in a shared-bindings _make_new function?

#

I have an arg like { MP_QSTR_some_list, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} } and when I inspect it during _make_new it is sane (mp_obj_list_get shows lengeth=5) so I hold that .u_obj on a shared-module's some_type_t structure. Later when I go to use it, mp_obj_list_get shows length 1393 and I crash because there were only ever 5 items in the list.

edit:

self:20004570 calling action
self:20004574 doing action on self

Logging pointer addresses made it obvious that I was calling a function on the address of a member in another "class" function. :sigh:

broken kettle
half geyser
#

Final update on my NRF52833 woes: VDD got disconnected, and I was powering it off of VDDH. This apparently works fine, except reset is all wonky as the regulator resets itself causing a brownout. I re-shorted VDD to VDDH, and now it's behaving like it should. Thanks everyone for hearing my stream of consciousness debugging session!

manic glacierBOT
manic glacierBOT
#

@hathach You're right, I didn't see that the event was already being hooked. So the patch I made probably doesn't seem necessary.

However, it does appear as though the OUT data isn't getting ACKed for whatever reason. And it's always the same descriptor. At least it's consistent.

The contents of the USBD_INTEN register prior to unplugging:

(gdb) x 0x40027300
0x40027300:     0x0185d57d
(gdb)

And after plugging back in, while the host is waiting for the device to ACK ...

main meteor
#

@broken kettle This doesn't really belong in #circuitpython-dev . However, did you figure it out?

broken kettle
#

Yeah I did mate @main meteor thanks for caring man love you ❀️

lone axle
#

@mental nexus that is awesome!

mental nexus
#

Thanks @lone axle I really appreciate your help.

manic glacierBOT
#

When I connect it when it's in this state, this is the output I receive:

USBD Unplugged



USBD Bus Reset
USBD Setup Received 80 06 00 01 00 00 40 00
  Get Descriptor Device
  Queue EP 80 with 18 bytes
USBD Xfer Complete on EP 80 with 18 bytes
  Queue EP 00 with zlp Status
USBD Xfer Complete on EP 00 with 0 bytes
USBD Bus Reset
USBD Setup Received 80 06 00 01 00 00 12 00
  Get Descriptor Device
  Queue EP 80 with 18 bytes
USBD Xfer Complete on EP 80 with 18 bytes
  Que...
#

Description

Pressing Ctrl-C to interrupt time.sleep() will cause time.sleep() to instantaneously return on NRF until the board is reset.

Steps to reproduce

In the REPL, run:

import time
time.sleep(100)

While it's sleeping, press Ctrl-C. The REPL will come back. Then run:

time.sleep(100)

The REPL will return instantly.

Workaround

Performing a soft- or hard-reboot re-initializes the sleep timer and gets it working again.

slender iron
#

@sour lynx do you know the best way to get the current stack pointer? I need it for garbage collection

uncut nexus
#

Anyone have experience building older versions of CircuitPython? I have run 'git checkout' on 5.0.x and 5.1.x and they build; but when I load them they both end up in an infinite loop in DummyHandler.

hushed hedge
#

@mental nexus Well, that's a hack that quacks! We may be only a small amount of 3D printing away from a CircuitPython TRS-80 Model 100.

mental nexus
#

Quack-hack, that’s a good one. I’m thinking it’s more VIC-20 or Commodore 64 but I picture it powered by a python that quacks running on a hamster wheel.

hushed hedge
#

I'll have to ask one of my python-owning friends how successful they are at getting it into a hamster wheel.

slender iron
#

@uncut nexus they should work. make sure you update submodules as well

uncut nexus
#

yes, did that. Thanks!

#

@slender iron - does the platform you're needing a stack pointer for support '__builtin_frame_address(0)' in the compiler?

slender iron
#

not sure. I didn't know that was an option

#

tries it

#

looks like it does! thanks @uncut nexus !

sour lynx
#

@sour lynx do you know the best way to get the current stack pointer? I need it for garbage collection
@slender iron There is cpu_hal_get_sp function in #include "hal/cpu_hal.h"

#

however... keep in mind that with Xtensa Window ABI, not all previous stack frames are guaranteed to be on the stack.

#

at most 48 physical registers from the previous stack frames may still be in CPU registers, not flushed onto the stack.

#

I remember explaining to micropython folks how to handle garbage collection because of this, lemme find the bit of code...

#

basically, make a recursive function which uses 8 physical registers per call β€”Β call it 64/8 times and all the registers are guaranteed to be on the stack.

slender iron
#

Ok interesting! Will look a bit later. Mainly now I’m not getting the right range with the getstartofstack method from free rtos

sour lynx
#

pxTaskGetStackStart(NULL) should be okay, i think

#

and the size should be about the size of the stack size you specify during task creation. For the main task (where app_main runs) it is given by CONFIG_ESP_MAIN_TASK_STACK_SIZE

slender iron
#

Ya. That’s what I’m doing for size. When I get the current frame it’s a higher address than the start of the stack though

onyx hinge
#

is the "start" the initial SP address, or just the lowest byte of the allocated memory region?

#

n/m the docs say what it's supposed to mean

#

Returns the highest stack memory address on architectures where the stack grows down from high memory, and the lowest memory address on architectures where the stack grows up from low memory.

simple pulsar
#

@slender iron Is using assembler a no-no here?

sour lynx
#

Ya. That’s what I’m doing for size. When I get the current frame it’s a higher address than the start of the stack though
@slender iron makes sense β€” start of the stack is literally the start of the stack memory region, i.e. its lowest address

#

Not the logical start of the stack, i.e. address of the first frame.

slender iron
#

@sour lynx that’s not what the doc implies

#

@simple pulsar assembly is ok if that’s the only way

sour lynx
#

Indeed! The doc says it is the other way around. Let me check what upstream freertos does.

slender iron
#

I couldn’t find it in freertos 10

#

(Seems like it’s always the lowest address though)

sour lynx
#
FreeRTOS

How to see upper/lower bound of a task’s stack?Posted by awillson on January 15, 2016Hello, I am working on a RAM test routine that needs to skip the current RTOS task’s stack. How can I retrieve the current task’s upper/lower stack boundary? Thanks! How to see upper/lower bou...

slender iron
#

So it’s always the lower address?

sour lynx
#

Yes, lower address.

slender iron
#

Kk. Thanks!

sour lynx
slender iron
#

I made lots of progress yesterday

sour lynx
#

i guess we didn't check the docs. Have filed an issue internally to get this fixed.

#

is there a way to avoid rendering gigantic link preview images here?

slender iron
#

K thanks! Really appreciate your help

#

You can delete them after the fact I think

sour lynx
#

tnx

onyx hinge
slender iron
#

Only other weird thing I’m seeing is that my makefile can’t build bootloader.bin but I can if I call ninja directly

#

Will keep poking stuff today. The partition api is working well for our file system

#

@onyx hinge the esp32 docs generally apply to the s2

slender iron
#

welp, I have the right range now. circuitpython caused a freertos "stack overflow" with it's own canary value

#

@sour lynx is there any way to provide idf.py monitor an .elf?

tulip sleet
#

@idle owl @slender iron I have some library code that uses time.monotonic_ns(). pylint on GitHub actions is complaining about this, because it's based on Python 3.6, which doesn't have monotonic_ns(). That I can understand, but I don't understand why https://github.com/adafruit/Adafruit_CircuitPython_BLE_MIDI doesn't have this problem also, because it also uses monotonic_ns(). Did either of you special-case that somehow?

#

the other libraries that uses monotonic_ns() have backup code to simulate it. On the nRF boards, that's not necessary, since it's always present

slender iron
#

what is the complaint you are getting?

tulip sleet
#

that the method doesn't exist

#

i don't get this when running pylint locally, because it's based on 3.8 locally, which makes sense

#

the latest GitHub Actions for ble_midi are fine, and don't show that error, which is the weird part

#

i don't see it special-cased in .pylintrc for the library

slender iron
#

I didn't do anything special

#

double check your pylint versions

tulip sleet
#

yes, there may be a diff for ble_midi. tnx

#

@slender iron oh, adafruit_ble_midi disables "no-member" at the very top; that's why

slender iron
#

ah

tulip sleet
#

i also used ulab in adafruit services, and blinka doesn't know about it, so it complained about import order. that's another problem, not a big deal

slender iron
#

@onyx hinge looks like your stm rgbmatrix PR may have broken the build

manic glacierBOT
#

A recent very good guide article also needs precise timing to maintain the timing of its serial async protocol: https://learn.adafruit.com/clue-teletype-transmitter/code-the-tty-transmitter

This example isn't a reason to support precise timing from Python (which is impossible). It's a reason to expand PulseOut to support DAC output in addition to PWM carriers.

#

Ok, now I understand what was happening and would prefer the original way.

The original *static_rbuf version was copying the values in the struct into ringbuf_t within the object including the buffer length and pointer.

This is better than the version that sets it before because code outside of common_hal shouldn't access struct members except .base. The members of a common_hal struct are up to the implementation and external code shouldn't access them directly because they may no...

idle owl
#

@tulip sleet Did you get sorted?

tulip sleet
#

@idle owl, yep, all set, though in the long run there are some things to fix, like adding dummy ulab to blinka and narrowing "no-member" in ble_midid

#

tnx

idle owl
#

@tulip sleet Ok, sounds good.

onyx hinge
#

@slender iron I just saw your note from an hour ago. I'll look into it. Wasn't it green when it went in!?

tulip sleet
#

@onyx hinge I thought so too, or maybe there was one red-herring bad build

onyx hinge
#

anyway, it sure doesn't build now, I agree with that much

manic glacierBOT
tulip sleet
#

@onyx hinge @slender iron I have been building locally from the tip with no trouble. I just pulled and updated submodules (no changes) and built one each of stm, atmel-samd, and nrf with no errors

onyx hinge
#

I see what's going on, I think

tulip sleet
#

oh wait no, not on m4

onyx hinge
#

@tulip sleet did you build stm32 feather or one of the stm boards that actually failed?

#

wait, is it m4/samd51 that's failing? Then I don't know what's going on after all

tulip sleet
#

i didn't know what was failing, just feather, so no protomatter. Metro M4 is failing

#
../../lib/protomatter/core.c: In function '_PM_row_handler':
../../lib/protomatter/core.c:442:13: error: dereferencing 'void *' pointer [-Werror]
  442 |             *core->addrPortToggle = newBits ^ priorBits;
      |             ^~~~~~~~~~~~~~~~~~~~~
../../lib/protomatter/core.c:442:35: error: invalid use of void expression
  442 |             *core->addrPortToggle = newBits ^ priorBits;
      |                                   ^
onyx hinge
#

maybe there are two things wrong

#

pull request soon, sorry for the trouble!

ionic elk
#

STM32 has a hang at startup right now, just put in a revised issue and PR

onyx hinge
#
GitHub

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

GitHub

Testing performed: on stm32f405 feather, all pins change in plausible ways
on a logic probe. Didn't actually drive a display yet.

#

but if you look within the logs of build-arm capablerobot_usbhub, you see that it actually built:

e7eef6f0c Merge 6dfe9ab606352b36f8d295b250ac7118c459618b into 2d7cf4b792afa1b6755b9575b84cae4b65ae7ab9

#

which is not at all the claimed ref. The CI built some other ref than the one that the PR merged.

tulip sleet
#

and this is checkout@v2, right? oy

onyx hinge
#

yeah

tulip sleet
#

PRs were flaky for at least a few days recently. I had a PR that didn't show two new commits until I pushed a third

onyx hinge
tulip sleet
#

@onyx hinge thank you figuring that out and filing the issue

sour lynx
#

@sour lynx is there any way to provide idf.py monitor an .elf?
@slender iron no, looking at the code i don't see any. But you can run tools/idf_monitor.py directly β€” see --help for options.

Edit: idf.py finds the ELF file name from build/project_description.json β€” this file is generated by the regular CMake build. If you can overwrite project_description.json and put a custom ELF file name in there, then idf.py monitor will pick it up.

timber mango
#

@gilded cradle Is there a way to tell which type of display is connected to the HT16K33 controller?

manic glacierBOT
slender iron
#

@sour lynx ok nice! I’ll try that

manic glacierBOT
onyx hinge
#

@tulip sleet you're welcome. I wish I had also done more thorough local build testing but .. I didn't.

gilded cradle
#

@timber mango I don't believe so. It's the same chip but just hooked up to LEDs differently, so there's not really a way to automatically ID it.

timber mango
#

OK.

simple pulsar
#

@idle wharf The channels correspond to different frequencies which propagate in very different ways in non free space plus possible effects on tx/rx in each device. Knowing them is at least beneficial in grouping the different RSSI data. How much information can be gleaned from them, particularly in a non-static environment, is an interesting topic. I've been sticking updates in https://forums.adafruit.com/viewtopic.php?f=53&t=164851 .

idle wharf
#

Nice job @simple pulsar or as we say in my family.... "Like a Walters!" πŸ˜‰

#

@slender iron I watched your deep dive from last week... and wanted to let you know they're not boring.

I don't work down at the C\Hardware level and hearing you explain how things are mapped across each layer is very interesting and helps deepen our understanding of what's going (and what could possibly be going wrong) when we're up in the CP runtime.

slender iron
#

thanks @idle wharf ! glad you are enjoying it

#

@lucid solar just pushed to my branch

crimson ferry
old smelt
#

Does anyone know how Mu determines if it sees a CircuitPython device?

I am running a custom build for our board, and it appears to be working:

Adafruit CircuitPython 5.0.0-beta.2-13-g7387f6092-dirty on 2020-05-07; Alorium Technology Evo M51 with samd51p19

But when I try to use Mu for the Serial connection, I get this error:

#

Is it looking for a specific VID/PID?

raven canopy
old smelt
#

Ah. Ok.

#

Thanks.

#

Should that file also show up in the local install directory for Mu?

raven canopy
#

i'm not sure. i haven't dug into how they ship binaries (or not binaries) for each OS.

old smelt
#

Ok. Don't see it in the app package.

#

I'll do some more digging. I can interact with the REPL via other means, so I'm good for now

#

Thanks

#

for your help!

raven canopy
#

yw!

manic glacierBOT
#

In looking at https://github.com/hathach/tinyusb/blob/master/src/portable/nordic/nrf5x/dcd_nrf5x.c#L292-L297 it almost seems as though this isn't actually firing.

One thing I can see is that the _usbd_q is getting written to but not read from. If I break into the debugger while it's doing wfi, I see that wr_idx != rd_idx:

(gdb) p *_usbd_q
$10 = {
  role = 1 '\001',
  ff = {
    buffer = 0x2000b740 <_usbd_qdef_buf> "",
    depth = 16,
    item_size = 12,
    overwritable...
crimson ferry
#

@old smelt Mu serial breaks for me when I have more than one CP device plugged in (contributing factor possibly renamed CP volumes, macOS)

manic glacierBOT
manic glacierBOT
manic glacierBOT
fathom trellis
#

Just in case anyone here is interested, I'm doing a live-streamed Q&A tomorrow at 9am PDT and talking about CircuitPython, the VS Code device simulator express plugin (currently supports cpx, microbit, and clue) and the PyBadge project I had put together for PyCon.

more details and a link at:
https://twitter.com/mbcrump/status/1258411407051116544

πŸ“… 5/8 at 9 AM PST (Noon EST)
πŸ’œπŸ‰ Nina Zakharenko @nnja
πŸ“š Learn about CircuitPython, device simulator express, PyBadge

Join us & ask questions live!

πŸš€ https://t.co/j4J4rEJTVd

πŸ§žβ€β™‚οΈ@gregor_suttie - Mod

#python #livestreaming #coding #hardware

manic glacierBOT
#

Note that this patch doesn't actually work, because you cannot run tud_task() with interrupts disabled, as it will possibly deadlock:

Program received signal SIGINT, Interrupt.
edpt_dma_start (reg_startep=0x40027010) at ../../lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c:104
104           while ( _dcd.dma_running )  { }
(gdb) bt
#0  edpt_dma_start (reg_startep=0x40027010) at ../../lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c:104
#1  0x0002f1f6 in xact_in_prepare (epnum...
manic glacierBOT
#

I've applied this patch to my local copy of tinyusb, which causes it to poll the interrupt handler if interrupts are disabled. This seems to prevent the deadlock:

diff --git a/src/portable/nordic/nrf5x/dcd_nrf5x.c b/src/portable/nordic/nrf5x/dcd_nrf5x.c
index 12435ea2..acc1af58 100644
--- a/src/portable/nordic/nrf5x/dcd_nrf5x.c
+++ b/src/portable/nordic/nrf5x/dcd_nrf5x.c
@@ -101,7 +101,11 @@ static void edpt_dma_start(volatile uint32_t* reg_startep)
     else
     {
     ...
manic glacierBOT
half geyser
#

What causes OSError: [Errno 5] Input/output error in the auto-reload terminal? Is there any way to get a more descriptive error?

#

Right now I'm seeing that happen when I save, but after about ten-twenty seconds it re-evaluates, even though I haven't saved it. Is the error due to a file that hasn't been fully flushed?

stuck elbow
#

more descriptive errors take up flash space

half geyser
#

If I do import io; io.open("code.py").read(), then exit the REPL, it works.

stuck elbow
half geyser
#

It reloads itself after about 20 seconds and actually works, but it immediately says OSError: [Error 5]. Makes me think there's a synchronization issue somewhere. Where would be a good place to add a breakpoint to try and trap the error as it's generated?