#circuitpython-dev

1 messages Β· Page 272 of 1

ionic elk
#

dang it I guess I missed the stock of the stm32 feathers in the adafruit store. Was hoping I could pick some of those up, in case there's actually a difference between my board and Dan's

manic glacierBOT
meager fog
#

@ionic elk ok i think we're ready to start implementing some more boards in stm32 land

#

you could start with the meowbit

onyx hinge
#

I was thinking about that example of the preprocessor macro FOUR from earlier and I realized that FOUR*FOUR == EIGHT and EIGHT*EIGHT == SIXTEEN and I think so on

#

I chuckled

manic glacierBOT
#

6cce2d6 Implement Neopixel write, add defaults to f405 - hierophect
e1579a1 Merge branch 'pin-commonhal-additions' into stm... - hierophect
8a58af3 Merge branch 'pin-commonhal-additions' into stm... - hierophect
5f290d0 Merge branch 'pin-commonhal-additions' into stm... - hierophect
ee1559b Merge branch 'pin-commonhal-additions' into stm... - hierophect

plucky flint
#

@solar whale hurrah... I'm "polishing", fixing, testing and documenting today. All feedback greatly appreciated..! πŸ™‚

manic glacierBOT
solar whale
#

@tulip sleet just a followup on entering dfu on stm32f405 -- It seems to be hit or miss - it is workin OK most of the time for me this morning, but ocassionally it failes - here is the dmesg output for a failed attempt followed by a successful attempt (Ubuntu 18.04)

#
[Tue Nov 19 05:09:45 2019] usb 3-2.3: new full-speed USB device number 81 using xhci_hcd
[Tue Nov 19 05:09:46 2019] usb 3-2.3: device descriptor read/64, error -32
[Tue Nov 19 05:09:46 2019] usb 3-2.3: device descriptor read/64, error -32
[Tue Nov 19 05:09:47 2019] usb 3-2.3: new full-speed USB device number 82 using xhci_hcd
[Tue Nov 19 05:09:47 2019] usb 3-2.3: device descriptor read/64, error -32
[Tue Nov 19 05:09:48 2019] usb 3-2.3: device descriptor read/64, error -32
[Tue Nov 19 05:09:48 2019] usb 3-2-port3: attempt power cycle
[Tue Nov 19 05:09:48 2019] usb 3-2.3: new full-speed USB device number 83 using xhci_hcd
[Tue Nov 19 05:09:48 2019] usb 3-2.3: Device not responding to setup address.
[Tue Nov 19 05:09:49 2019] usb 3-2.3: Device not responding to setup address.
[Tue Nov 19 05:09:49 2019] usb 3-2.3: device not accepting address 83, error -71
[Tue Nov 19 05:09:49 2019] usb 3-2.3: new full-speed USB device number 84 using xhci_hcd
[Tue Nov 19 05:09:49 2019] usb 3-2.3: Device not responding to setup address.
[Tue Nov 19 05:09:49 2019] usb 3-2.3: Device not responding to setup address.
[Tue Nov 19 05:09:50 2019] usb 3-2.3: device not accepting address 84, error -71
[Tue Nov 19 05:09:50 2019] usb 3-2-port3: unable to enumerate USB device
#
[Tue Nov 19 05:10:00 2019] usb 3-2.3: device descriptor read/64, error -32
[Tue Nov 19 05:10:00 2019] usb 3-2.3: device descriptor read/64, error -32
[Tue Nov 19 05:10:01 2019] usb 3-2.3: new full-speed USB device number 86 using xhci_hcd
[Tue Nov 19 05:10:01 2019] usb 3-2.3: New USB device found, idVendor=0483, idProduct=df11
[Tue Nov 19 05:10:01 2019] usb 3-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Tue Nov 19 05:10:01 2019] usb 3-2.3: Product: STM32  BOOTLOADER
[Tue Nov 19 05:10:01 2019] usb 3-2.3: Manufacturer: STMicroelectronics
[Tue Nov 19 05:10:01 2019] usb 3-2.3: SerialNumber: 2059378C354D
stuck elbow
#

last time I saw errors like this, it was faulty cable

solar whale
#

@stuck elbow this is a 1.5M USB-C cable -- the 2M cable did not work well at all -- so it may be marginal at 1.5 M -- I'll try a shorter cable to see if it is more stable.

#

or it may be that these are low quality cables ... good point -- I have some better ones somewhere .... digging.

solar whale
#

@tulip sleet I think @stuck elbow is on to something regarding USB cables. I tried several cables and some do seem better than others. However I still do see somthing like this sometimes but it seems to recover itself. I am using USB A to USB c cables. I don't have any USB-C ports on this computer. ```[Tue Nov 19 06:43:39 2019] usb 3-2.3: USB disconnect, device number 19
[Tue Nov 19 06:43:41 2019] usb 3-2-port3: Cannot enable. Maybe the USB cable is bad?
[Tue Nov 19 06:43:41 2019] usb 3-2.3: new full-speed USB device number 21 using xhci_hcd
[Tue Nov 19 06:43:41 2019] usb 3-2.3: New USB device found, idVendor=0483, idProduct=df11
[Tue Nov 19 06:43:41 2019] usb 3-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Tue Nov 19 06:43:41 2019] usb 3-2.3: Product: STM32 BOOTLOADER
[Tue Nov 19 06:43:41 2019] usb 3-2.3: Manufacturer: STMicroelectronics
[Tue Nov 19 06:43:41 2019] usb 3-2.3: SerialNumber: 2059378C354D
[Tue Nov 19 06:44:03 2019] usb 3-2.3: USB disconnect, device number 21
[Tue Nov 19 06:44:04 2019] usb 3-2-port3: Cannot enable. Maybe the USB cable is bad?
[Tue Nov 19 06:44:05 2019] usb 3-2-port3: Cannot enable. Maybe the USB cable is bad?
[Tue Nov 19 06:44:05 2019] usb 3-2-port3: attempt power cycle
[Tue Nov 19 06:44:06 2019] usb 3-2.3: new full-speed USB device number 24 using xhci_hcd
[Tue Nov 19 06:44:06 2019] usb 3-2.3: New USB device found, idVendor=0483, idProduct=df11
[Tue Nov 19 06:44:06 2019] usb 3-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Tue Nov 19 06:44:06 2019] usb 3-2.3: Product: STM32 BOOTLOADER
[Tue Nov 19 06:44:06 2019] usb 3-2.3: Manufacturer: STMicroelectronics
[Tue Nov 19 06:44:06 2019] usb 3-2.3: SerialNumber: 2059378C354D

manic glacierBOT
ionic elk
#

@meager fog already on it! I'm adding the Meowbit, the PybNano, and the blackpill-style board you sent me. Anything else you want to add on there that I should pick up?

idle owl
#

carefully gaffer-tapes a Raspberry Pi to its USB-C cable to shove it off the edge of the balcony to get a GPS lock

#

now has to figure out how to remove the gaffer-tape

solar whale
#

@meager fog did a few more BLE radio distance measurements -- highly variable - start losing it badly at about 5m.

tulip sleet
#

@solar whale @timber mango I have one board that won't go into DFU at all. I am suspicious this is clocks problem, maybe having to do with factory calibration data getting damaged. That is just a hypothesis, only circumstantial evidence to suggests that. I also saw differences of DFU not coming up, based on different-length cables

#

i am going out soon but will be back in less than 2 hours

solar whale
#

@tulip sleet thanks -- let me know if theree are things I can test.

tulip sleet
#

@ionic elk are you using the RC clock or the 12MHz crystal for the Feather 405 base clock? It would be good to use the crystal clock. There is also a 32.768kHz clock on the board for RTC use

#

This may be part of the explanation of your slightly different timing values for neopixels, my board with a flaky neopixel, and also the DFU issues

#

but i need to look at other stuff too, such as what the DFU bootloader does for its clocks (presumably it uses an RC clock, since it doesn't know if there a crystals on board). I also wnat to see how factory calibration data is used for the RC clocks

solar whale
#

@meager fog followup on BLE radio range -- now receiveing at nealy 10m -- much reduced rate, but receiving -- not at all clear what impacts the range -- lots of variablility.

ionic elk
#

@tulip sleet I'm using the external clock for sure! you can view all the clock settings and divisors in peripherals/stm32f4/stm32f405/clocks.c. Still need to figure out exactly how we want those clock settings set, however

tulip sleet
#

i am worried the factory cal data has somehow gotten smashed, or is just not being used

ionic elk
#

We could have a discussion about that

#

I haven't implemented the RTC yet

tulip sleet
#

so RCC_OSCILLATORTYPE_HSE is the 12MHz xtal?

ionic elk
#
    RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
    RCC_OscInitStruct.HSEState = RCC_HSE_ON;
    RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
    RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
    RCC_OscInitStruct.PLL.PLLM = 12;
    RCC_OscInitStruct.PLL.PLLN = 336;
    RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
    RCC_OscInitStruct.PLL.PLLQ = 7;
    HAL_RCC_OscConfig(&RCC_OscInitStruct);
tulip sleet
#

i just haven't had time to look it up

#

high speed external, i guess

ionic elk
#

HSE on, PLL on with source HSE, divisor M set to the #MHz, PLL it to 168MHz, Q sets USB to 48MHz

tulip sleet
#

yes, trying to figure out why the bad board does USB in CIRCUITPY just fine, doesn't do neopixel clock well, and can barely do DFU (like 1 out of 20 times)

ionic elk
#

You could send it to me and I could take a look

tulip sleet
#

myabe so; anyway I have to leave now but will be back ~11:30am

ionic elk
#

HAL_RCC_GetSysClockFreq() is useful

#

Actually, yeah, the first thing to do would be to toss HAL_RCC_GetSysClockFreq(), HAL_RCC_GetPCLK1Freq(), and HAL_RCC_GetPCLK2Freq() into port.c and see what they return.

#

They're calculated off what the HAL hands them, but you could directly compare them to clockspeeds on SPI or the timers and see how they compare

stuck elbow
#

@ionic elk are you saying there is circuitpython for the meowbit now?

onyx hinge
#

good morning!

lethal abyss
#

what is the current status of the pygamer? It's been a while but I don't see anything that may looks like Arcada for exemple. is it abandoned?

stuck elbow
#

@lethal abyss you can use Stage on it

#

or DisplayIO, if you need larger sprites/tiles and don't mind a small speed hit

noble whale
#

Yes! but I'm surprised myself that there's not more activity around the fabulous potential of PyGamer (and not only with CircuitPython, but also with C++)

lethal abyss
#

maybe it's just me, I thought there will be content specific to the pygamer, some easy to go framework, something I can use with kids to transition from arcade.makecode to python

stuck elbow
#

it's difficult

#

and nobody has the time

lethal abyss
#

I perfectly understand

#

from a volunteer perspective

noble whale
#

Yes, it is very understandable, but the forum does not seem to reveal a particular request from the community either... it is a pity....

stuck elbow
#

I imagine there could be a contest posted to some game-making community

lethal abyss
#

Do you think there is enough libraries for making simple games with kids ?

stuck elbow
#

I have this really long-term dream of making a generic adventure/jrpg framework for CircuitPython, something like the early RPGMaker

lethal abyss
#

what could be the starting point of such a thing?

stuck elbow
#

there is enough right now for making games, but it requires experience and knowledge about how games work, so not for kids

#

a parser for the tmx files, I suppose?

#

or a converter from tmx to some binary format that would be easier on the memory

lethal abyss
#

is it the file format for tilemaps?

stuck elbow
#

yeah, for the TilEd editor

noble whale
#

It is precisely the ideal pretext to develop learning guides around video game programming with PyGamer... but it would require volunteers for this... who have time... or who wish to take it

stuck elbow
#

it's really annoying for me, because I would love to work on it, and I think I have some ideas about how to do it well, but there are also so many other things I could work on that seem more important

noble whale
#

I totally understand your frustration!

stuck elbow
#

I think that in the end what people want is free games and/or emulators to play the games they already know, and not writing new games

lethal abyss
#

what if I start something, even very basic, let's say adapt an existing python parser to circuitpython. Will it help?

noble whale
#

yes... that's the conclusion I came to as well (in another community)... and it's really a shame

lethal abyss
#

or is it better to start fresh

stuck elbow
#

I can't promise anything

lethal abyss
#

I know you, I won't expect promise you can't fullfill

#

but I'm not afraid of not having enough knowledge if I know my time is useful to more than one

stuck elbow
#

it would need to use displayio and not stage, by the way, because stage only has 16 tile kinds per layer

#

and you can't really do a proper map for an adventure game with that, unless you have a lot of layers

lethal abyss
#

a pity, I knew a little bit Stage πŸ™‚ but anyway

stuck elbow
#

displayio is very similar, only more flexible

lethal abyss
#

I strongly believe in both pygamer and 32blit, except I have a pygamer on my desk :)
I'll start tinkering around this idea, and I'll ask question on #help-with-circuitpython

stuck elbow
#

I'm not holding my breath with 32blit, unless they hire a whole team of programmers

lethal abyss
#

I don't see any difference with the pygamer

stuck elbow
#

yeah, and pygamer is not a resounding success

lethal abyss
#

I agree

stuck elbow
#

at least I can now write my games for ludum dare or whatever and say "you can actually get a console it runs on, you don't have to build it yourself"

#

which is an improvement from the previous situation

#

in a way

lethal abyss
#

let's say I'll get experience with pygamer, maybe 32blit, and I'll be ready for the mass produced pewpew M4 or whatever with screen πŸ˜‰

plucky flint
#

Hi folks, I've just updated the radio module to avoid duplications of received messages. Would love feedback..!

lethal abyss
#

@stuck elbow may I ask why you think it's easier to start with RPG? isn't a plateformer easier in its concepts for kids?

stuck elbow
#

pewpew m4 is really just pygamer without the extra flash, accelerometer, analog joystick or rechargeable battery

plucky flint
#

@solar whale thank you for testing and for the feedback. Glad it works. πŸ˜‰

lethal abyss
#

@plucky flint would love to test, but it involves BT boards I don't have.

stuck elbow
#

@lethal abyss an rpg is pretty much turn-based, nothing happens when you don't press anything, except for playing the animations, which makes it much easier than handling multiple moving objects and physics on top of that

lethal abyss
#

@stuck elbow oooh, I get it

plucky flint
#

General question... I've spent time making sure the code is well documented, but autodoc complains because my library tries to import something that isn't in the Python path (i.e. the BLE modules). I assume this sort ofthing has been encountered before..? Suggestions for "best practice" to resolve most welcome. πŸ‘

stuck elbow
#

@plucky flint we usually just make stubs in the docs directory

plucky flint
#

@stuck elbow ack

stuck elbow
#

I think that some of the stubs are automated, but not sure how that works

onyx hinge
#

getting bored timing builds It looks like the new gcc build is a tiny bit faster than the 2018q2 we've been using, but it regresses on binary size too. measurements are complicated by the fact that I started by measuring the native toolchain on debian stretch, and only later started measuring the exact right toolchain on xenial in docker...

#

oh and the one board I ran pystone on saw a performance regression too

#

whaaaaat, the binary size is not consistent from run to run?

lethal abyss
#

@timber mango we just had some off discord chat with @noble whale and we are wondering if you were thinking circuitpython TMX parser or external tool that build something more appropriate for pygamer?

onyx hinge
#

grreeat, cpb is slower but trinket m0 is faster when changing compilers

onyx hinge
#

OK, my inconclusive and incomplete results. Time to move on to something else, the case for moving to a new compiler is weak at best. OTOH there were no new problems encountered during the upgrade, so that is a big positive. https://docs.google.com/spreadsheets/d/10DX3tq3XJrXQu5x8h0nRsiWNATcOjbIXsCN1RznZ8WI/edit?usp=sharing

#

afk, will work on nrf i2s bugs next (tomorrow)

slender iron
#

@plucky flint sphinx can also automock imports

#

@onyx hinge seems like its comparable enough to switch to as long as everything builds

onyx hinge
#

@slender iron well that's another way to look at it

#

every combo I tested did build

#

if that's your reaction then I'll prepare a PR to switch; it'll mostly just touch the github build.yml

slender iron
#

cool, thanks

#

I have a bias to want to be on the latest thing

#

@tulip sleet where are we at with the new release?

tulip sleet
#

Just finished lunch. i have been preparing the release notes. I think we're pretty much ready to go. I just wanted to go over the remaining PR's to see if any should be brought in.

#

the release notes are done for the library; for CPy, I have to finish the changes list and the thank-you list

#

i think we can wait on gcc9, since it's not obvious it's an improvement.

slender iron
#

ok, sounds good @tulip sleet let me know if you want me to look at anything. I'm getting through my email and the forum now

tulip sleet
#

sure, I'm going to continue on the release notes. There are draft releases already saved

slender iron
#

kk

raven canopy
#

welp, looks like it'll be time to revisit cross-compiling gcc-arm for the RPi (aarch64 style). Unless I build in the cloud and dl firmware. It was going to happen anyway. 😁

main meteor
#

Cross-compiling can be a pain.

manic glacierBOT
graceful heart
#

Hi All! πŸ™‚ For the past month or so I've been on and off thinking about and adding features to this PR for the WSGI web app library (https://github.com/adafruit/Adafruit_CircuitPython_WSGI/pull/2)

The idea of the library is to have a simple and lightweight 'flask' or 'Sinatra' like web application framework that can be used in conjunction with the server functionality of the ESP32SPI lib, so you can host a web app from CPy that can serve HTML content and respond to HTTP Requests.

I would appreciate any feedback on the PR πŸ™‚ It's not meant to be complete, its simply a first pass at some core features like HTTP request routing and parsing requests into a defined input object.

tulip sleet
#

@slender iron do you want to review the draft releases? CPy is 5.0.0-beta.0 pre-release; lib is 3.0.0, and it's NOT a pre-release. I just pushed a PR to add a warning if 3.0.0 is imported into CPy 4.x or earlier.

slender iron
#

I can if you'd like

tulip sleet
#

I did copy-edit them, so if you don't want to bother that's fine

#

I don't have any qualms

manic glacierBOT
tulip sleet
#

@slender iron q re mocking sys.implementation.version. Various libraries check for sys.implementation.version[0] >= 3. This happens to work with CPython, by accident. I need to check for >= 4. So I think I'll need to add a mock sys to bleio_mock.py? I'm not sure there's any other way to do it.

slender iron
#

no, I think you should check that the implementation is circuitpython

#

sphinx will be CPython

tulip sleet
#

yeah, I was thinking of that, in addition to the version number

#

ok, sounds good kk

slender iron
#

πŸ‘

#

@tulip sleet I'd do new boards from alpha.5

tulip sleet
#

I did the new boards from 4 in prep for a listing in 5.0.0 final. I can add notations of which are new in beta.0

slender iron
#

ya, I figured

tulip sleet
#

I think maybe none actually

slender iron
#

it'd be good to save somewhere

tulip sleet
#

there are some on hold

slender iron
#

on hold?

tulip sleet
#

we had PR's but they are still in process

slender iron
#

ah ya, that's ok

tulip sleet
#

ok, I'll stash this somewhere for now. Maybe StringCar is new since alpha.5; I'll double-check

slender iron
#

the adabot PR includes a list too

#

so you can double check there

tulip sleet
slender iron
#

merged

manic glacierBOT
tulip sleet
#

@slender iron ok, release notes now has a list of new boards since alpha.5 and an adjacent list of new since 4.1.0, in line with breaking features since 4.1.0

slender iron
#

thanks!

tulip sleet
#

I think it's all ready. I will press the :button:

raven canopy
#

@onyx hinge oh nice! They were at least thinking of ARM servers.

ruby atlas
#

bleh, still going in circles with the call stack for mp_obj_subscr => instance_subscr => mp_obj_subscr => pixelbuf_pixelbuf_subscr and trying to call back to a subclassed (python) show() method. My previous changes broke the test suite, so now I'm back to carefully examining the stack and object passed along the way.

#

Any tips on how to look at the value of a qstr in gdb?

slender iron
#

@ruby atlas I think you can call the qstr to str function from gdb

#

I don't remember what it is though

ruby atlas
#

qstr_str

slender iron
#

I think you can just call it like p qstr_str(var)

ruby atlas
#
(gdb) p qstr_str(type.name)
$16 = 0x20029ae0 "NeoPixel"
#

yep!

#

thanks for the hint, that set me in the right direction!

slender iron
#

np πŸ™‚

ruby atlas
#

oy, i crashed gdb πŸ™‚

main meteor
#

Ouch, what do you use to debug that?

slender iron
#

gdb πŸ™‚

#

it offers to dump a core

ruby atlas
#

actually, it was just running away trying to extract an endless qstr.

#

(gdb) p qstr_str((*(*((mp_obj_type_t *)base)).base.type)) vs

$24 = 0x20029ae0 "NeoPixel"```
#

(yay casting)

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 5\.0\.0\-beta\.0
orchid basinBOT
solar whale
#

Congratulations on CP5 Beta.0 -- woohoo! blinka

half sedge
#

Hi, is there a Circuit Python related presentation proposed for Fosdem'20 in Brussels on 1+2 February 2020?

#

Like @stuck elbow are you planning something?

stuck elbow
#

no, I think I will skip this time

#

too much travel recently

half sedge
#

Fosdem is more an MicroPython place, with a stand there at least the last two years...

stuck elbow
#

well, I was sitting at that table for a few hours last time, showing my circuitpython stuff :P

half sedge
#

Yeah, sure...

stuck elbow
#

they are not picky

half sedge
#

Damien is from Australia?
And you are from Switzerland?
Who was holding that stand?
Was that someone from McHobby a Belgian distributor?

meager fog
#

@ionic elk hihi are you hacking today

manic glacierBOT
swift arrow
#

congrats all on CP Beta 0!!

meager fog
manic glacierBOT
solar whale
#

What’s with all theses messages?

idle owl
#

GitHub Actions I assume.

solar whale
#

Something new?

idle owl
#

Yeah fairly recent. Not so recent that they should only just now be showing up, but it's possible that they only post here for release builds, and this is the first release we've done since we had the whole thing set up? I'm not entirely certain there.

solar whale
#

Ah. Not a problem. Just curious. Thanks.

tulip sleet
#

@slender iron could you check the github bot about these success messages? I think I'm going to manually delete them for now

manic glacierBOT
raven canopy
#

hmm. i don't see anything in the GitHub blog about expanding the webhook delivery. checking discord's api...

manic glacierBOT
raven canopy
#

nope. nothing there. only thing i can't check is what payloads are selected to deliver on the repo settings.

manic glacierBOT
tulip sleet
manic glacierBOT
raven canopy
#

different webhook subscriptions, i imagine. πŸ€·β€β™‚οΈ

manic glacierBOT
strange cargo
#

so much success! can't wait to try 5.0 beta 0 later!

manic glacierBOT
manic glacierBOT
slender iron
#

sorry for the flood folks. my guess is that discord added support for the check success webhook. we had github sending everything to it and now I've only selected certain events

raven canopy
#

strange that they didn't blog it, or put it in a changelog (that i could see).

slender iron
#

probably will

manic glacierBOT
#

@hierophect Could you check the baudrate calculation in busio.SPI? I was using an SPI clock to try to test the difference between the "bad" and "good" STM32 Feathers I have, and I got odd SPI clock rates on both:

specified as measured on Saelae
160 MHz 20.83 MHz
40 MHz 10.42 MHz
16 MHz 5.208 MHz
15 MHz 5.208 MHz
8 MHz 2.632 MHz
1 MHz 328 kHz
100 kHz 164 kHz
manic glacierBOT
manic glacierBOT
onyx hinge
#

good morning. status: working on a PR to switch to gcc9

idle owl
#

Good morning!

plucky flint
#

Hey hey πŸ‘‹ A request for feedback. I've added unit tests (via PyTest) to my AdafruitRadio work and would like feedback on my approach. TL;DR, it runs using your local Python 3 (I use a venv for that), take a look at the README for instructions for the minimal requirements you'll need and how to run the tests, check out the two files in the tests directory of the project (https://github.com/ntoll/adafruit_radio/). The magic happens in conftest.py where I mock away the unavailable CircuitPython modules, you can see how I put all this together in the test_adafruit_radio.py file (note the use of the Radio based fixture). I like that it's very very simple and, with some polish, could be done via simple configuration. In any case, this is a first stab, and I'd love feedback. Thank you..! ❀️ adabot blinka

#

Note: I'm painfully aware that I don't have the full context of what folks need when writing modules for CircuitPython, when it comes to testing. I'm also painfully aware that (in a sense) I'm mocking away the CircuitPython universe in order to get the ease of testing on my development machine (without having to have a board). However, if the tests are like mine so far (i.e. they only exercise the code in my module) then it should be "OK" (note air quotes).

#

anyway... Mary (my wife) is just back and asking if I'd like to go for a coffee... how can I refuse. BBIAW to tidy things.

onyx hinge
#

@plucky flint having any automated testing seems to go above and beyond what is generally done in circuitpython libraries. I think you get a chance to guide how the rest of us think about it, not the other way around.

#

hmm does mac xargs have "-x", which stops with an error if the xargs argument list is too long?

#

it should, it's in POSIX

exotic pumice
#

I'm a bit out of the loop, what's the consensus on github actions? fairly good?

onyx hinge
#

hm, no, -x doesn't do what I wanted

#

@exotic pumice seems like it's a mixed bag right now, I guess the expectation is it's getting better.

exotic pumice
#

better than travis though?

onyx hinge
#

If you want to do things that go beyond just ci I think it's probably much more powerful

ionic elk
#

@meager fog @tulip sleet back up and running today, sorry I had a dr appointment eat up my whole afternoon yesterday. Thought I would be able to go back to work after but couldn't.

manic glacierBOT
#

@dhalbert Looks like everything is half of what it should be. I'll check it out. In terms of granularity, though, we aren't going to do much better - STM32 has a pretty limited divisor set for SPI. The actual values we're sorting from are:

bus clock
(168MHz / 2) => (PCLK2 = 84000000)

SPI values:
/2 42_000_000
/4 21_000_000
/8 10_500_000
/16 5_250_000
/32 2_625_000
/64 1_312_500
/128 656_250
/256 328_125

onyx hinge
#

@slender iron who is able to upload the new toolchain tarball to s3? I assume we don't want to fetch it from developer.arm.com every time, but rather do the same thing that was done for the last one.

manic glacierBOT
#

Passing the NULL pointer value char_written here is not correct, though the problem may go undiagnosed. Unlike other languages, C does not have "out" or "reference" parameters. Instead, the programmer manually emulates them by passing the address of some suitable value using the & operator.

Recommendation: The declaration should be UINT char_written = 0;, and the address of it passed to f_write: f_write(..., &char_written).

#

This will

  • include a possibly-invisible "\0" character at the end of the file, because "abc" is the same as the character array {'a', 'b', 'c, '\0'} with a size of 4 bytes.
  • not include a newline character at the end of the file. Technically, a text file has each line end with a newline character
  • (I don't know if we want to ship CRLF files for people suffering on Windows systems, or whether Windows now gracefully handles UNIX style text files)

Recommendation: add \n to the...

#

Besides my comments directly on the code, a build failed:

 Build pirkey_m0 for zh_Latn_pinyin took 12.46s and failed
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.

-48 bytes free in flash out of 188160 bytes ( 183.75 kb ).
26000 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).

Too little flash!!!```

By making this new fe...
onyx hinge
#

@slender iron drat: Build pirkey_m0 for zh_Latn_pinyin took 12.90s and failed with gcc9

#

region `FLASH' overflowed by 284 bytes

#

so did pyruler and trinket_m0

#

I'm still going to PR it and we can discuss strats on the PR

manic glacierBOT
idle owl
#

@onyx hinge Good plan with the PR.

slender iron
#

@onyx hinge I can upload it

onyx hinge
#

Hi @slender iron and good morning!

slender iron
#

πŸ™‚

idle owl
#

@gilded cradle The eInk Gizmo, uses SPI like the TFT Gizmo, right? Limor mentioned it was basically the same except for having a reset pin instead of a backlight pin. I'm doing the pinouts page and wanted to make sure I was doing it properly.

gilded cradle
#

Yes, I think so @idle owl. The eInk breakouts used SPI, so that would make sense.

idle owl
#

Looks like the breakouts use SPI, so I assume it does.. heh yeah exactly

#

Ok thanks

gilded cradle
#

πŸ‘

tulip sleet
#

i am back now - was at a non-work meeting

manic glacierBOT
#

This PR corrects an issue in the STM32 port where an incorrect bus clock was used to calculate frequency on several instances of the SPI peripheral, halving the clock rate. The module now correctly selects a bus clock based on SPI instance.

Since SPI was one of the first modules created for the port, I've also taken the opportunity to clean it up a bit to bring it more in line with the other modules.

#

@tannewt it has been almost 20 years since I did any proper C/C++ coding so I'm definitely not qualified to comment on the C code :man_facepalming:, but thank you for making these changes :+1: . As soon as they land I'll take the latest build and test with the adafruit_radio library. :shipit:

Question: is there a way to discover if the device is only BLE 4.x (i.e. not extended advertisements) which I could use to ensure the correct check on the length of the message is used in the `adaf...

plucky flint
#

@onyx hinge ack... I've added a bunch of comments and things to the relevant pieces of code so folks can see what I'm doing to make this work. What do you need from me to help facilitate feedback, suggestions and gathering of requirements module authors who want to write tests may need..? E.g. would a blog post telling the story of what I've been up to (published on ntoll.org) be helpful?

slender iron
#

@plucky flint the PR has artifacts

#

so you can test the extended advertising

plucky flint
#

@slender iron doh... I totally missed that. Thanks.

slender iron
#

np, it's new and has been flaky

#

it worked in this case though πŸ™‚

manic glacierBOT
plucky flint
#

hahahaha... that sentence "np, it's new and has been flaky" is basically the world of computers since 1960. πŸ˜‰

slender iron
#

haha

plucky flint
#

OK... I'm gonna quickly test with your PR and my lib. Give me 15 mins.... then I'm going to have to stop for the day (dad taxi duty in 30mins)

slender iron
#

ok, I'll be here if you have any questions

onyx hinge
#

@plucky flint ooh I shall subscribe to your blog! I'm not the author of any circuitpython libraries, so I can't offer to jump in, but one suggestion would be to find one or more library devs who are interested in trying to apply your approach, and work with them to find what commonalities there are

plucky flint
#

@onyx hinge πŸ‘

onyx hinge
#

you look like the best kind of blogger, intermittent and not trying to monetize anything πŸ™‚

plucky flint
#

Thank you! πŸ™‚

slender iron
#

@plucky flint unit tests look perfect

plucky flint
#

πŸ‘ it was an interesting problem to approach. I'll write up tomorrow in a blog post. Would welcome feedback from old hands at writing CircuitPython modules.

#

It also has limitations / gotchas which I'll also explain / explore (mainly due to potential problems of too many mocks)

slender iron
#

even with gotchas it's better than no testing

manic glacierBOT
plucky flint
#

Sending works... I need to re-jig the AdafruitRadio subclass of Advertisement, but I've run out of time. I'll check/test in the morning. FWIW, it's all looking good. πŸ™‚

#

-> AFK to dad taxi kids in a manic recreation of the travelling salesman problem.

#

catch you folks tomorrow.

#

πŸ‘‹

ivory yew
#

@plucky flint I did something similar but used stubs instead of mocks

plucky flint
#

@ivory yew stubs as in code stubs in the repos of the module to be tested..? I wanted to avoid having "spare" code hanging around, hence the mocking approach. There's +/- to each way (hence my asking for feedback so we get to a solution that works most of the time for most of the people with caveats and gotchas well highlighted). I'm open minded to anything that works in a simple, easy to grok manner. πŸ™‚

#

@ivory yew πŸ‘ and thanks for the heads up. I reckon folks probably want to be able to do both depending on their need. Flexibility is key. πŸ˜‰

ivory yew
#

I really try to avoid mocks, especially mocks without specs.

plucky flint
#

Oh yes.... absolutely

#

In this case, I guess mocks are more like spies (i.e. objects you can use to observe the side-effects of internal behaviours of the code being tested)

ivory yew
#

I'm still trying to figure out the best way to do this myself, but I've been taking this approach so far with more confident results than just magicmocking the universe.

#

When I'm feeling better I'm happy to talk about some testing approaches and stuff.

plucky flint
#

Amen.... mocks are both really useful but also feel like a big bazooka with which to shoot yourself in the foot.

#

I love exploring this sort of stuff... so when you're feeling better (get well soon!) please don't hesitate to ping me.

#

I'll brain dump into a blog tomorrow as a start.

stuck elbow
#

then again, your documentation is not supposed to be finding errors in your code

#

you have tests for that

#

(and sphinx also lets you test code snippets in your docs, by the way, for which mocks are actually useful)

plucky flint
#

anyway.... I'm being "looked at" by my kids. Gotta go.

#

@stuck elbow this is for mocks in actual modules (conversation has moved away from Sphinx).

#

anyway -> :car:

stuck elbow
#

ah, sorry

manic glacierBOT
timber remnant
#

A new version of my EDGE badge microphone hacking from Supercon is at https://github.com/tomacorp/edgemicscope . Now the scope has adjustable gain, offset, and timebase.

slender iron
#

nice @timber remnant !

#

if you have time, you should show it on show and tell today

#

(4:30pm)

timber remnant
#

How do I learn more about show and tell?

slender iron
pastel panther
#

@timber remnant The easy-mode is to hang out in #live-broadcast-chat a bit before 4:30PM PST and wait for the link to StreamYard. If you can't get in, keep trying as space will open up as people leave

stuck elbow
#

I think I'm done

pastel panther
#

OH. MY. JEEBUS. @stuck elbow That is beautiful . Tindie link ASAP PLZ

stuck elbow
#

@pastel panther I haven't figured out how I want to handle it yet

#

I don't want to go to the expensive Swiss post office with a bag full of packages every day, that's for sure

gilded cradle
#

Very nice @stuck elbow! You could increase handling time and just go 1-2 times per week.

pastel panther
#

@stuck elbow understood. like @gilded cradle said, shipping weekly is a thing as long as you're clear about it. For impatient people you could always charge for rush shipping& handling if you wanted to

stuck elbow
#

I will rather find a fab in China that is willing to manufacture, store and ship them. Will make the shipping costs much lower too.

pastel panther
#

ya, probably makes sense.

gilded cradle
#

@idle owl, I just verified that the eInk gizmo is indeed using SPI.

idle owl
#

@gilded cradle I figured, I cribbed your pinouts text from the TFT gizmo. Thanks for verifying. Did you get yours?

gilded cradle
#

No, I just looked at the schematic.

idle owl
#

Ah fair enough

#

Was about to status update in Slack and wanted to make sure I was accurate about your status

gilded cradle
#

Yeah, I should get it tomorrow and then can make sure we have a working library. Until then I can probably wire up a breakout.

idle owl
#

No rush. I have plenty to do.

gilded cradle
#

Ok, then I'll wait

idle owl
#

Unless Limor wants it rushed, which I guess I'll find out.

gilded cradle
#

Yeah

ionic elk
#

I love how ST likes to just change this tiny handful of pins between MCUs of the same family, so i have to manually compare every page of their pinout charts when making a new MCU definition looking for the easter eggs they hid for me. I swear some engineer over there likes to toggle a couple things in every silicon edition just to keep us on our toes.

main meteor
#

It would help if they offered a downloadable pin map.

ionic elk
#

really

#

That way I wouldn't have to manually inspect whether they decided to take out a single RX pin on a random pin for giggles. Or add in a single new timer output because why not

main meteor
#

@wanton fiber says that ST is really responsive, maybe we should suggest that.

meager fog
#

@ionic elk hihi are ya working on new board defs?

onyx hinge
#

OK where was I before I got distracted by a little play with this riscv dev board? working on the tick performance stuff...

manic glacierBOT
ionic elk
#

@meager fog yep I'm hacking away

meager fog
#

@ionic elk ok lemme know what board you are gonna do next and ill order it πŸ™‚

manic glacierBOT
ionic elk
#

I'm doing the Meowbit, the PybNano, and the blackpill all at once

tulip sleet
#

@ionic elk I'm testing the SPI PR, and trying to create a second SPI instance besides SCK/MOSI pins. Are there other pins that would work? thanks

#

A0/A1, SCL/SDA, D9/D10, etc., don't work

ionic elk
#

peripherals/stm32/stm32f405/periph.c is the place to check

meager fog
#

has alts

ionic elk
#

I remember there was a python sketch somewhere that went through every combination of board pins and gave options for what worked

tulip sleet
#

ooh, great, thanks

ionic elk
#

but it was for i2c

tulip sleet
#

i was going to run that; I mistakenly thought that a wide variety of pins would work (like on nRF)

meager fog
#

nope the mux table is very strict

#

you can use A2/3/4 maybe

tulip sleet
#

yah, SPI1 looks good

#

tnx to both of you

ionic elk
#

Are you testing my new PR?

#

SPI1 should be on a separate bus clock from SPI2

manic glacierBOT
ionic elk
#

also @meager fog I'll be in NYC next week - I'd love to say hi if anyone is in the office! If everyone's away for thanksgiving I understand of course.

manic glacierBOT
ionic elk
#

@meager fog I'll need new PIDs for these new board defs, right? Could use three pairs, meowbit, pybnano, and blackpill.

tulip sleet
#

@ionic elk it appears I have to specify SCK/MOSI/MISO. It's not possible to omit MOSI or MISO for read-only or write-only SPI. Is this a restriction of the STM HAL? On the other ports this is possible.

manic glacierBOT
ionic elk
#

@tulip sleet no, that's a restriction of how I sort, and should be fixed. That's a pretty major retool though, and should probably be a new issue/PR.

#

Needs the whole pin picker algorithm to be different, similar to UART.

tulip sleet
#

sure, I'll open an issue

manic glacierBOT
wanton fiber
#

yeah the F4 HAL absolutely allows that

ionic elk
#

it's no problem, the SPI module was one of the first I added and needs some revisions at this point

#

By the way, is the Meowbit actually open source? Or am I hacking?

#

Not seeing a schematic or anything so I'm just kinda eyeballing the unlisted connections here

manic glacierBOT
#

Code is at https://github.com/tomacorp/edgemicscope
Tested versions of CircuitPython are 5.0.0 Beta 0 and 5.0.0 Alpha 5.
Hardware is the AdaFruit EDGE Badge, as distributed for the Hack-A-Day Superconference 2019.
After updating a lot of points on the display, two calls to refresh() are required:

board.DISPLAY.refresh(minimum_frames_per_second=0)
# Don't know why this second refresh is required.
board.DISPLAY.refresh(minimum_frames_per_second=0)

To reproduce the problem...

slender iron
#

@onyx hinge look in tinyusb for the interrupt

manic glacierBOT
manic glacierBOT
slender iron
#

@solar whale I have CTS working. πŸ™‚

solar whale
#

I’ll be interested to see where I went wrong.

slender iron
#

I fixed the internals

#

it has to be paired

solar whale
#

Look forward to trying it.

slender iron
#

πŸ™‚

#

trying to get apple notifications going too

solar whale
#

Cool! Lots of new toys πŸ˜€

slender iron
#

hopefully pairing will unlock HID too

tawny creek
#

@indigo wedge did ja order the nRF5340 PDK?

indigo wedge
#

@tawny creek No, haven't done anything with nRF in quite some time now

#

But the dual core architecture is an interesting challenge

idle owl
#

Serial console errors rendering on eInk are kind of entertaining. TFTs it more or less renders in realtime. eInk it takes a bit then flashes as it renders. Feels like it's trying and failing to catch up.

onyx hinge
#

ugh why is particle xenon so janky, and why did I bring it (instead of the feather nrf52840) with me to the coffee shop. And no j-link.

#

oh well, nothing that chugging my coffee and heading home can't cure πŸ™‚

manic glacierBOT
onyx hinge
#

gcc 9 release notes:

Inliner defaults was tuned to better suits modern C++ codebases especially when built with link time optimizations. New parameters max-inline-insns-small, max-inline-insns-size, uninlined-function-insns, uninlined-function-time, uninlined-thunk-insns, and uninlined-thunk-time were added.
maybe should check whether these can be tuned back to gcc7 values and get us under size limits on those little m0 builds

manic glacierBOT
onyx hinge
#

yay, trinket m0 + zh_Latn_pinyin fits again with gcc9

#

so maybe we can have nice things

manic glacierBOT
manic glacierBOT
slender iron
#

@ionic elk what are you working on today?

manic glacierBOT
manic glacierBOT
#

@tannewt I think your assessment about the USB interrupt is right: as it's contained in tinyusb right now, we'd need some more changes before we can use it to trigger background tasks sooner.

It looks like I have some failed builds to attend to but they're shallow (use of ticks_ms global need to be converted to function calls), so it should be ready for stylistic checks.

Any suggestions on a way to benchmark the possible USB performance regression you're concerned about? That would be ...

manic glacierBOT
#

Ok @dhalbert please take another look. Printing now includes the module by overriding the print method.

Adafruit CircuitPython 5.0.0-beta.0-19-g5e857fdb6-dirty on 2019-11-21; Adafruit Feather nRF52840 Express with nRF52840
>>> import _bleio
>>> raise _bleio.BluetoothError("test")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
_bleio.BluetoothError: test
>>> e = _bleio.BluetoothError("test")
>>> str(e)
'test'
>>> repr(e)
"_bleio.BluetoothError('test'...
ionic elk
#

@slender iron Hi, just saw your mention. Had some mail stuff I had to do this morning but working on board defs now

slender iron
#

how is that going?

ionic elk
#

it's just data entry basically, what's up?

#

Got something else you'd like to push up in the priority queue?

#

I do need PIDs and VIDs for the USB, to finish up these board profiles

manic glacierBOT
#

I may have asked for too much. Here's CPython:
testing.py:

class MyException(Exception):
    pass
Python 3.6.8 (default, Oct  7 2019, 12:59:55) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import testing
>>> raise testing.MyException
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
testing.MyException
>>> str(testing.MyException)
"<class 'testing.MyException'>"
>>> str(testing.MyException(...
slender iron
#

@ionic elk I'm wondering which ones you have done and which you have left to do.

manic glacierBOT
#

Easy enough. Please take another look.

Adafruit CircuitPython 5.0.0-beta.0-20-g521c7531b-dirty on 2019-11-21; Adafruit Feather nRF52840 Express with nRF52840
>>> import _bleio
>>> raise _bleio.BluetoothError("test 2")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
_bleio.BluetoothError: test 2
>>> e = _bleio.BluetoothError("test 2")
>>> str(e)
'test 2'
>>> repr(e)
"BluetoothError('test 2',)"
slender iron
#

is there an issue where you list the boards that need usb ids?

bleak tiger
#

Hi, I have a M4 Express feather (CP 5 alpha 5) driving a 4.2" display using the eink friend.

I can display text with displayio and Label when using the built in terminalio font but if I attempt to use a bitmap font with bitmap_font.load_font("/Helvetica-Bold-16.bdf"), the code will run but the eink will not update.

#

Posted to the forum but wondered if anone here could help?

ionic elk
#

@slender iron no I mostly saw people asking here on the discord so I figured it wasn't issue appropriate. Should I open one?

#

As for progress, I just wrapped up testing the PYB Nano, which is working like a charm

slender iron
#

ya, that'll be easiest to track. or add it to the board issue

ionic elk
#

Moving on to blackpill now. I've cut the Meowbit into a separate branch since it's obviously going to depend on TFT Displayio and I didn't want to hold the others up

slender iron
#

that's ok to look at it in a second PR

#

are you waiting for me to look at TFT displayio?

ionic elk
#

I'd rather revisit it first - I'm hoping it might actually have had something to do with the SPI bug Dan caught, which would be convenient

#

I can get some saleae pics and stuff

slender iron
#

ok, either way

manic glacierBOT
manic glacierBOT
short phoenix
#

By using something like a wifi breakout, it’s not possible to create a new network, it just lets something connect to an existing one right?

stuck elbow
#

the esp32 itself can create a new network, no problem β€” not sure if the nina firmware lets you do it, though

tulip sleet
#

i see stuff about ESP32 softAP (access point), but not sure what supports that. We have no guides for that

crimson ferry
manic glacierBOT
manic glacierBOT
#

Hiya.

I've been playing with an FT232H and ili3941 display as per this guide: https://learn.adafruit.com/tft-sidekick-with-ft232h/overview

I'm finding on my Ubuntu 18.04 LTS server writing an Image to the display is resulting is high CPU. My server is an Atom J4105, it's a pretty nice low power x86 server (https://ark.intel.com/content/www/us/en/ark/products/128989/intel-celeron-j4105-processor-4m-cache-up-to-2-50-ghz.html)

import board
import digitalio
import adafruit_rgb_dis...
manic glacierBOT
short phoenix
#

So @stuck elbow if i use an airlift breakout i can just connect my microcontroller to it and not have to involve home wifi? Also is this only a hardwired connection or is it wireless (sorry for asking a probably stupid question πŸ˜…)

tulip sleet
#

@short phoenix What do you want to do? Normally you have the Airlift connect to your home wifi so you have internet access. Do you want to have a private network so other devices can connect to the Airlift?

manic glacierBOT
short phoenix
#

@tulip sleet i was thinking a little bit of both but i guess you can only use a home wifi for esp32/airlift. That’s fine but i’m curious... are there any breakouts or microcontrollers that create a private network?

tulip sleet
#

@short phoenix the ESP32 NINA firmware, which is loaded onto the ESP32 on the AIrlift boards, can create a local access point so other devices can connect to it. I don't know if we expose this in any way. See this Arduino thread for now: https://forum.arduino.cc/index.php?topic=585266.0

#

create_AP()

#

we don't seem to have any examples

short phoenix
#

Thanks a bunch!

manic glacierBOT
lone sandalBOT
solar whale
solar whale
onyx hinge
#

good morning!

#

ugh I haven't set up j-link on my new linux computer yet

idle owl
#

@tulip sleet I set up to make my own builds so I could test my current refactor - it was getting all the audio code into the base class using a couple of lines of code to make the differences in audio setup work, so I needed to make sure Express worked even though Bluefruit did. It works. There's about 1k difference in the UF2 size, the new one being bigger, but doing an import of the library and checking gc.mem_free() shows that there's about 100 bytes more available after import with the new version, which is to say, essentially no difference in that case. So, good to know there.

onyx hinge
#

@idle owl that's due to changes in the frozen-in mpy files? that seems not bad at all

idle owl
#

@onyx hinge I refactored the library entirely so all the common code is in a base class, and then there is the express module which is nearly empty, and now there's a bluefruit module which has a couple of new features we could never fit into the express module due to CPX memory constraints.

#

We're going to freeze it in without the bluefruit module because memory. But I wanted to see what my refactor did. So I checked.

onyx hinge
#

@idle owl cool, sounds like that approach will work out then

idle owl
#

The bluefruit module will eventually have bluetooth stuff in it too once that's solidified.

onyx hinge
#

is there much new stuff for bluefruit? the audio is a little different, that's the only part I focused on.

idle owl
#

So now you can from adafruit_circuitplayground.bluefruit import cpb and use all the same code concepts as you did using cpx.

#

Audio is the major difference between the two, but I added new features to the library such as sound_level and loud_sound.

#

So you can print the sound levels like the light levels now, and use them for thresholds if you'd like, and you can use a loud sound as an input.

#

Requires a buffer for the sound levels to work, and it was too much for cpx.

#

CPB on the other hand πŸ™‚

#

Hardware wise, the Bluefruit has bluetooth, CPX has IR, the chips are different, and the rest is basically identical.

#

So all the features people wanted out of that library can probably now go into the bluefruit module. Sound levels and loud sound had come up multiple times, so that'll be good to get that added.

manic glacierBOT
#

When I was referring to a clear method I was thinking that midi_in.buffer_overflow would need somehow to be cleared but your example code suggests when you read the value and it is true then it auto-clears the buffer_overflow property so the next time it's read it's false?

On the counter front, I was thinking about the classic model seen on networking stacks. E.g. IP has a wide range of counters like Udp: receive buffer errors. If the application isn't that interested in loss it can ig...

tulip sleet
#

@solar whale there's no reason I know of that it was omitted; just an oversight. I will make a PR that turns the network stuff on for all builds

#

@onyx hinge @idle owl I am going to work on a simple mechanism to alter what's in a frozen library based on board. My latest idea is to have an optional freeze.py that's run during the CPy build, and can decide what to include based on BOARD, etc. There would be a dummy adafruit_circuitplayground/bluefruit.py that simply throws an explanatory error on import.

onyx hinge
#

@tulip sleet my mind went way crazier, thinking that we needed to add a preprocessor to the freeze process. let's not go there if we can avoid it.

#

"take file from board/ if present, from usual location otherwise" could work too

tulip sleet
#

yes, I was originally going to have extra directories that were board-specific, but just having the general ability to run a script to do whatever seems easiest and most flexible. Kind of like conf.py.

#

when freezing happens, the code to freeze is copied to a temp directory, so we can do whatever we want there and not disturb the submodule directory.

ionic elk
#

@tulip sleet I'm having issues with this elcrow board - do you figure I should split it off into another branch, so we can just merge the PYB Nano by itself?

tulip sleet
#

yes, just put it in a separate PR after you debug it

ionic elk
#

After I debug it?

#

Not sure what you mean. Should I remove it from my PR?

tulip sleet
#

i mean if/when you get it to work. Narrow the current PR to not include it (i'm a little confused)

#

i don't see the elcrow board in PR #2196

ionic elk
#

Ok I'll do that. My primary problem is that it's a huge pain to flash - they put boot0 on a button, and even when pressed it fails 90% of the time. It reminds me of the issues I had dealing with knockoff STM32F103C8 Bluepills - it's super finicky

ruby atlas
#

I'm beginning to think I could really benefit from an interactive debug/brainstorm/coding session with someone to figure out how to make _pixelbuf pixelbuf_pixelbuf_subscr (via instance_subscr) be able to call a python subclass .show() without also breaking the unit tests (and breaking subscripts of subclasses of native classes for other uses).

ionic elk
#

So I'd kinda be fine with just dropping it altogether if this isn't a widely used board. They don't have public schematics either without a Baidu account so I can't even see if they rigged up USB correctly

#

it's the "blackpill"

#

For the record, the PYB Nano is the exact same MCU on nearly the same formfactor, and has basically none of these issues

tulip sleet
#

I'd just mention that to Limor then, that it's flaky

#

do you have only one sample?

#

maybe you got a bad one?

#

@ruby atlas scott knows the most about subclassing stuff; one of us would want to look at the code first, I think. Soon, but maybe not today.

ionic elk
#

@tulip sleet I've only got the one so it could be a fluke, for sure

#

I'll try switching over to OpenOCD and see if that gets better results than my st-util program. But given that I've got the Nano and Discovery working without issue I'm pretty confident in my flakyness assertion

tulip sleet
#

@ionic elk Are you trying to load it with DFU? the flakiness sounds like the same flakiness I have with the bad STM Feather. BTW, I spent some time on it: clock freqs seem fine (I looked at SPI clock rates), voltages seem OK, it's very mysterious. Next would be to Saleae the status neopixel to see why it's erratic.

#

i have two more '405 feathers arriving today

ionic elk
#

I'm trying to load it with an STlink over SWD, so it's a bit different. I'm not using a bootloader

tulip sleet
#

but I thought SWD didn't care about BOOT0

ionic elk
#

I might do a big round-up of different ways of flashing stuff onto an STM32 today

#

it does if there's code already running

#

it has trouble halting the target otherwise

ruby atlas
#

@tulip sleet hoping i get back to hacking later today, so maybe i'll be able to sort it out. i think i just need to just focus on it for a few uninterrupted hours (which has been really really really hard to get, so I've been poking at it a few minutes at a time here and there).

solar whale
#

@tulip sleet thanks -- I tested it on the GCM4 and posted a .uf2 to the forum post in case the poster wants to try it.

tulip sleet
#

@ionic elk do you have the RESET line connected? Does that make a difference

#

@solar whale thank you! I am preparing a PR but not done yet

onyx hinge
#

well huh, i2sout on particle xenon works WAAYY worse than I remember it, even at the ref of my pull request 😦

ionic elk
#

@tulip sleet reset is also on a button πŸ™„

tulip sleet
#

no reset pin or pad??

ionic elk
#

actually, I may have missed it

#

I don't have a schematic so I have to go by pin names only but there's this little R pin so that's probably it. I'll try that

tulip sleet
#

i generally don't need the RESET connection when doing J-Link with SAMD, but no idea about STM

ionic elk
#

I don't usually either but these buttons don't seem to be doing the job

manic glacierBOT
onyx hinge
#

sigh, this was one of those unproductive mornings. Didn't make any progress on nrf i2sout, and maybe fried my black silkscreen metro m4 express. it'll reach the bootloader, but not start circuitpython.

tulip sleet
#

@onyx hinge can you get Arduino blink to run on it?

onyx hinge
#

@tulip sleet I didn't try that yet.

#
    at asf4/samd51/hpl/rtc/hpl_rtc.c:71
71        hri_rtcmode0_wait_for_sync(dev->hw, RTC_MODE0_SYNCBUSY_SWRST);
``` It hangs here, with the SWRST bit of "calendar" staying set forever...
#

(I briefly powered it from a 12V DC adapter on the DC jack, which is out of spec)

tulip sleet
#

oops 😦 :sparky

onyx hinge
#

I'm going to stop for lunch and come back to i2s for at least another hour. and order a fresh metro m4 express, I guess.

tulip sleet
#

yah, maybe you can get them to ship it today. do you have a feather m4 to substitute? I have at least two of everything for this kind of reason

onyx hinge
#

I have other m4ish boards, and this was not for my current project, just running some neopixels, so I'm not going to sweat getting a replacement right away.

#

(I'm honestly surprised that feeding it 12v for a short time caused a problem, it's just going to the 5v linear regulator and I thought those were all pretty robust, but adafruit says 7-9V only)

tulip sleet
#

is the 3.3v output still ok?

onyx hinge
#

I'll check after lunch, if you think it's worth doing any further troubleshooting on the board.

#

seems weird to me that it'll enter bootloader, run swd debugging, ... but other stuff is just broken. It must have a small amount of magic smoke remaining.

manic glacierBOT
#

Enable network and ps2io for SAMD51 builds. Disabled explicitly on boards that don't want this.

Original issue was that network was not enabled on Grand Central. See https://forums.adafruit.com/viewtopic.php?f=63&t=158985. Thanks @jerryneedell for answering forum query!

Not enabling on nRF or STM32F4 because no testing has been done on those boards. nRF in particular might not interact well with the SoftDevice if they each enabling/disabling interrupts in competition with each o...

onyx hinge
#

(no, there was no visible smoking or anything like that, just referring to the idea of magic smoke)

manic glacierBOT
slender iron
#

@ruby atlas I'm happy to be a second set of eyes

solar whale
#

@tulip sleet I see some build errors on your PR fr the ethernet -- did those boards really run out of flash -- on an m4?

#

@onyx hinge I thought 12V was OK for a metro_m4_express On the pinout page it says The DC Jack is a 5.5mm/2.1mm center-positive DC connector, which is the most common available. Provide about 6V-12V here to power the Metro. There is no fuse on this connection so you can draw more current, up to 800mA between the 5V and 3.3V supplies, and 2A from Vin.

#

hmmm -- on the overview page it says Power the METRO M4 with 7-9V polarity protected DC or the micro USB connector to any 5V USB source. The 2.1mm DC jack has an on/off switch next to it so you can turn off your setup easily. The METRO will automagically switch between USB and DC. ruh roh -- which is it?

tulip sleet
#

so I'm not sure why it would fry itself

#

if the 12v adapter is not well regulated, its unloaded output voltage may be >20v

#

maybe even just briefly

solar whale
#

Should the conflicting limits on the 2 pages of the guide be fixed?

tulip sleet
#

Yes, a forum post would be a good idea. thank you

solar whale
#

will do

#

same conflict for grandcentral m4 guide -- also reported in forum

slender iron
#

@idle owl @tulip sleet is there enough room in CPX to store the bluefruit code? Could just add a check to it to validate the correct board.

tulip sleet
#

not with certain languages (guess, not tested)

#

and this is just the initial code; there will be BLE additions

slender iron
#

please try it first. I'd really like to avoid custom freezing mechanics for a single use case

manic glacierBOT
onyx hinge
#

@tulip sleet 5V and 3.3V rails read close to nominal values. the board didn't heal over lunch, but at least I'm not hungry anymore.

#

I am going to set this aside and get back to looking at the nrf stuff which is my actual goal for the day πŸ™‚

#

I was more distressed until I saw that the cat is on the silk of the current pink version of the metro m4 express too

ruby atlas
#

@slender iron okay will ping you when i have something more concrete to discuss.

onyx hinge
#

@tulip sleet thanks again for trying to help me troubleshoot, and thanks for understanding that I preferred to step away for a bit before continuing.

tulip sleet
#

np, having a fresh mind is fine; I'm not waiting around πŸ™‚ And the only reason to spend time on this is if you have a suspicion this might be a more systemic issue, other than just a fried board. I have had failed boards 3-4 times; sometimes I want to make sure it's not a production problem, but sometimes it's just broken

#

there is always a reason; whether it's worth figuring out the reason is the question

onyx hinge
#

I had the board since ages ago, no problems, spent the last 2-3 days running a big neopixel strip from it (USB powered). I KNOW that the last thing I did before it didn't work anymore involved plugging in this 12VDC power adapter. So, my gut check about how it "should have been" okay aside, it seems like the incorrect power supply is a logical culprit.

slender iron
#

@tulip sleet what was the issue you had with ble hid on ios? I can see that I'm notifying but it doesn't type into the sms app

#

got it working on mac

tulip sleet
#

gamepad HID must NOT be present

#

is it still commented out?

slender iron
#

yes I thought so

tulip sleet
#

i'm looking at the PR's

slender iron
#

which one?

tulip sleet
#

the library ones, because Thach found an issue that I missed, and I'm trying to remember what it was

slender iron
#

ah ok

#

I'm only paired, not bonded

manic glacierBOT
#

When using frozen bytecode compiled into the "firmware" (obviously not quite true in the Unix port), and said frozen bytecode has mp_type_bytes object(s) defined, and said object(s) are used as default arguments to functions generated SIGSEGV. After researching, I found this is due to the behavior of making certain things "long_lived". My specific failure occurred in make_str_long_lived, specifically trying to assign str->data, but in my case, "str" is a "ROM" pointer. In other words it is no...

tulip sleet
#

@slender iron that didn't matter, but make sure to forget the device on iOS before re-pairing; sometimes that seems to matter

slender iron
#

hrm

#

it seems like it isn't remembering since I turned off the bond bit

#

it asks me to pair each time

tulip sleet
#

it will still ask to pair, but it might be remembering a bad key or something. Delete it from the devices list after disconencting and see if that makes a diff

ionic elk
#

@meager fog @slender iron would you like to sync up on stm32 priorities? I've reorganized my Basecamp todo list - let me know if you'd like anything moved up or down, or if you have new stuff you'd like to see added.

tulip sleet
#

@slender iron i think what Thach found was a missing report id in the descriptor, but that was fixed long ago. it's lost to Slack history timeout (grrr)

slender iron
#

@ionic elk please email me a link and I'll look monday

#

@tulip sleet I should have the good descriptor. I can see that the phone subscribes to the notifications πŸ˜•

tulip sleet
#

i just tried to type into a google search box or something. did you try a different app

slender iron
#

I tried notes too

tulip sleet
#

right notes was what i used too. give me a bit to try to reconstruct this. there are traces of a fix somewhere, I just have to find it

slender iron
#

I'll push my latest library code

onyx hinge
#

ripping out and redoing my i2s wiring. The bottom trace is the "LRC" (fast clock) of i2s referenced to GND, and I'm pretty sure it should be much more square than that..!

#

.. measured nearest the MAX 98357A I2S DAC breakout

#

ooookayyyy, the wire from the -BUS to the breakout board GND was bad

#

three hours down the drain for that??

main meteor
#

Widlarize that wire!

onyx hinge
#

g! define widlarize

tulip sleet
#

@slender iron I think the problem that Thach found was a missing report ID in my descriptor. I can't find the code where it WAS missing, but based on my hug and status reports, it sounds like that. I would just make sure that the report you are sending contains a report ID of the correct value.

onyx hinge
#

ideally I think there would be wire visible here

slender iron
#

@tulip sleet I think it's ok because I'm getting the report ids from the descriptor itself

tulip sleet
#

@slender iron I had originally commented out everything but the keyboard device while debugging, but forgot . In that case, there should have been no report ID. I think maybe the bug was that I was still passing one in, or when I restored the rest of the devices I forgot to put it back

#

i just mean make sure your report does contain a report id

slender iron
#

oh, I do remember that

tulip sleet
#

so your issue may be something else

#

you mean you remember my description of the bug?

slender iron
#

my descriptor has three report ids in it

#

ya, that if you only have one report you omit the id

tulip sleet
#

right, some devices care, some don't

#

MacOS didn't care, iOS did

#

i didn't mean to leave it in for just one device, it was a typo, basically

slender iron
#

I have keyboard, mouse and consumer control atm

tulip sleet
#

i had same combo

slender iron
#

I'm checking the update interval now

#

"connection interval"

tulip sleet
#

i was doing xcode event logging and all kinds of stuff; it was being delivered, and just disappearing after that

slender iron
#

ah, I haven't gotten that far

#

did xcode help?

#

my bug from yesterday was that I had the incorrect report uuid. the desktop nrf connect helped me find that

tulip sleet
#

it just verified to me that the event was ok. I was using the "monitor"? I can't remember. it produces reams of output; it was not pleasant to sort through

#

there is some filtering but it's not great; i am glad I'm not doing iOS development

slender iron
#

I'll try it later if needed

tulip sleet
#

there were two main processes receiving the data, bluetoothd and BLEsomething, and I filtered the huge event stream on those (and there was still a lot of chaff)

slender iron
#

k, sounds like something to try after lunch πŸ™‚

onyx hinge
#

huh this makes my feather nRF52840 disconnect from usb: ```jepler@eric:/media/jepler/CIRCUITPY$ dd if=/dev/zero bs=512 count=200 of=/media/jepler/CIRCUITPY/zero

#

a smaller amount of data (e.g., 100 blocks) doesn't

#

USB disconnects, light throbs yellow. didn't see anything useful in gdb yet.

#

Old value = 0
New value = 8
0x0002ca14 in allocate_stack ()
(gdb) where
#0  0x0002ca14 in allocate_stack ()
#1  0x000541d8 in main ()
manic glacierBOT
#

To trigger, I run dd if=/dev/zero bs=512 count=200 of=/media/jepler/CIRCUITPY/zero.

With a debug build, I can capture this traceback:

Breakpoint 4, reset_into_safe_mode (reason=reason@entry=GC_ALLOC_OUTSIDE_VM)
    at ../../supervisor/shared/safe_mode.c:84
84	void __attribute__((noinline,)) reset_into_safe_mode(safe_mode_t reason) {
(gdb) where
#0  reset_into_safe_mode (reason=reason@entry=GC_ALLOC_OUTSIDE_VM)
    at ../../supervisor/shared/safe_mode.c:84
#1  0x00027dc4 in gc...
tulip sleet
#

@onyx hinge can be helpful to set a breakpoint on HardFault_Handler

onyx hinge
#

@tulip sleet I did something slightly different, but I think the traceback in that issue I just filed is relevant

#

it actually looks sorta like an ill-timed write during soft reset calls allocation functions when it's forbidden...? not confident of that diagnosis yet.

#

afk

tulip sleet
#

@onyx hinge flash write is pretty slow on nRF, so maybe we run out of heap trying to buffer al lthe data coming in while waiting for flash write

tulip sleet
#

@slender iron @onyx hinge @ionic elk cancelling all checks in a GitHub Actions check run is actually really slow. I had a subjob fail due to network problems, so I cancelled the run in order to restart it, and it's taken many minutes to stop all the subjobs.

onyx hinge
#

@tulip sleet yeah the UI needs polish. I hadn't yet tried cancelling one wholesale, but I can only imagine.

#

I wonder if there's a CLI/API tool you could fire and forget instead

tulip sleet
#

it's not possible to cancel the subjobs individually yet

#

at least from the UI

onyx hinge
#

oh I think I misunderstood what you meant

#

I can echo general frustration though

tulip sleet
#

it is still pretty flaky. kind of 0.8 instead of 1.0

#

and now they're all stopped, but the "Cancel Check Suite" button is still there, so I can't force a re-run.

manic glacierBOT
solar whale
#

@slender iron thanks! Will take a look at it over the weekend.

tulip sleet
#

@solar whale it is working in general, I think, except on iOS: keyboard not working on iOS

short phoenix
#

Is it harder to use an airlift breakout board compared to a featherwing when using something like the Feather M4 Express

#

Like I was thinking of using the quad 2x2 featherwing kit, and I would rather save some space on that since there's only 4 spots and use a breakout, would this work?

#

(mention me if you reply to this please)

main meteor
#

@short phoenix While it may be easier to use the Wing, the breakout will work fine (it's basically an SPI peripheral) and save you the slots on the 2x2. You can stack Wings if you put stacking headers on them, which may or may not be easier, depending on what Wings you're playing with. I'll admit I'm a little curious what you're building that would use 5 Wings at once.

solar whale
#

@slender iron @tulip sleet I'm afraid my git skills are not up to being able to properly merge scott's changes in tannewt/central_paring in to master to check things out. I'll wait for a PR.... If you have time, I'd love to know how to get the links above to be merged into my fork. When I try it, I end up with a 4.0 build ??? I'll try to figure it out.

short phoenix
#

So @main meteor i just wanna have a breakout in case i get another board that’s not feather. But all i would need to do on the 2x2 feather and wings board is to wire over an empty spot for a feather over to a breadboard with airlift breakout on it?

main meteor
#

Should work fine.

#

Doesn't even need to be an empty spot if there's a Wing with stacking headers

tulip sleet
#

@solar whale I just clone other people's repos directly and build inside them, so I don't have to merge. You could clone into a separate tree, or you could add it as yet another remote to an existing tree, but a separate clone is simpler. I think Scott was just showing what the diffs are from the current master, and not necessarily implying one should merge.

manic glacierBOT
solar whale
#

@tulip sleet i tried that but must have done something wrong. Will try again later. Just clone Scott’s repo, checkout central_pairing and build, correct.

tulip sleet
#

right

solar whale
#

hmmm -- that reults in ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha-3621-ga69cffd57-dirty on 2019-11-23; Adafruit Feather nRF52840 Express with nRF52840

#
 2144  cd circuitpython_tannewt/
 2145  git_update
 2146  make -C mpy-cross/
 2147  git checkout central_pairing
 2148  cd ports/nrf/
 2151  git_update
 2153  make BOARD=feather_nrf52840_express clean
 2154  make BOARD=feather_nrf52840_express 
 2155  cp build-feather_nrf52840_express/firmware.uf2 /media/jerryneedell/FTHR840BOOT/
 2156  history
```  git_update does ```git submodule sync
git submodule update --init --recursive
git submodule foreach --recursive 'git fetch --tags'

#

I must be missing something

solar whale
#

@tulip sleet I think I am not completely crazy... I tried just cloning Scott's repo and building master and stll get a 4.0 build so I think the rest above makes some sense. I'll give up on this for now. 2161 git clone https://github.com/tannewt/circuitpython.git circuitpython_tannewt 2162 cd circuitpython_tannewt/ 2163 git_update 2164 make -C mpy-cross/ 2165 cd ports/nrf 2166 make BOARD=feather_nrf52840_express clean 2167 make BOARD=feather_nrf52840_express 2168 cp build-feather_nrf52840_express/firmware.uf2 /media/jerryneedell/FTHR840BOOT/ result ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha-3014-g9fb635b60 on 2019-11-23; Adafruit Feather nRF52840 Express with nRF52840

quasi fjord
#

his work is probably in a different branch than master, so you'd need to checkout that branch.

#

git branch --list to look for likely suspects

tulip sleet
#

@solar whale Scott's tags are not up to date in some way. I've noticed this in the past.

#

it may have to do with his original fork being from MicroPython instead of adafruit/circuitpython

solar whale
#

@tulip sleet the problem is that the latest BLE code will not run if it sees a 4.0 tag.... I was just trying to create something to test, but as I said, probably best to just wait for a PR. I'll just read the code for now.

tulip sleet
#

@solar whale the current problem with BLE HID on iOS is fairly deep, so don't feel you need to spend time on this. Scott will circle back after the weekend on it.

manic glacierBOT
#

@dhalbert @tannewt
I'm not all that happy with changing the signature for subscr globally, but couldn't find a non-breaking way to ensure native subscript methods are able to call instance methods.

The issue was that mp_obj_subscr calls instance_subscr that then called mp_obj_subscr with self->subobj[0] (which is the native type). The native subscr could no longer call the non-native subclass method because the argument to pixelbuf_pixelbuf_subscr was the native class and not the NeoPix...

rain hinge
#

Can someone point me in the right direction? I am trying to test out the E-ink Gizmo, but I can't find any refrences.

old smelt
rain hinge
#

Let me look again. I glanced through it, but I wasn't sure if it was relevant to the E-ink one as well

old smelt
#

Ah - ok, I am not certain either. @gilded cradle is the resident display expert. Maybe she'll catch this thread and chime in?

gilded cradle
#

I wrote an example for using it.

rain hinge
#

awesome, thank you!

gilded cradle
#

yw

old smelt
#

Thanks @gilded cradle !

gilded cradle
#

yw @old smelt, thanks for pinging me

rain hinge
#

Success11111

#

sorry, @gilded cradle I meant Success!!!!!!

gilded cradle
#

Sweet

rain hinge
#

Thank you @gilded cradle and @old smelt !

karmic token
#

I know the Pybadge has a guide out for nes emulation but has anyone done gameboy or gameboy advanced emulation on it yet?

flint lantern
#

Where can I find a good guide for porting Circuit Python to a new board and writing a library for it? I've got a board design I'm working on that would be perfect, but it's an STM32F446 board and I need CAN (which means a new library).

tulip sleet
#

@flint lantern See https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython for procedures for adding a board, but it mostly assumes it's for an existing chip. It's more work to support a new chip variant. The STM32F4 port is under active development by @ionic elk, and a CAN native module would be welcome. A new chip and a new module are both non-trivial amounts of work and require careful study of the code base.

flint lantern
#

@tulip sleet Thank you! Do you know what @ionic elk 's fork is? I'd like to make sure I track that.

ionic elk
#

@flint lantern I use my fork for git flow only, so you'd be better off simply following the Adafruit master, I think.

#

We try to keep the PRs pretty small, too. So I typically never have a significant body of finished work that isn't being actively submitted.

flint lantern
#

@ionic elk Ok, that makes life easier. So, I noticed that you have linker and startup files for each supported chip -- are those substantially identical to what STM32CubeMX pumps out, or are they special?

ionic elk
#

Regarding STM32F446 - probably a chunk of work since but it is at least still in the Foundation line rather than moving up to Advanced, which might entail extra changes. You'd want to start by taking a look at the definitions for the F405, then comparing the datasheets to see what's different in terms of pin defs. The MCU vs Package distinction needs a refactor so you might need to ask questions if things seem unclear.

#

Linker files are very different from the ones CubeMX generates, to support internal flash!

#

If you have a development board with SPI flash on it that's not as relevant, but if you don't have external flash you'll need to follow my existing linkers or you won't be able to use a filesystem, store code, etc. REPL only.

flint lantern
#

I've got a custom board, so no external flash...

ionic elk
#

You'd need to follow the existing linkers then, for sure.

flint lantern
#

I guess I can compare the CubeMX output for the two chips to each other and to your linker script and figure out what I need to change.

ionic elk
#

Is this a project with an existing history of using CPy? Not to try and discourage you, but CAN is usually something I associate more with an RTOS

flint lantern
#

Brand new project -- the idea is a board that can interpret incoming data from a car and control a bunch of LED strips. I figure CPy provides the most straightforward and accessible programming interface. I was looking at micropython as well but @slender iron convinced me I ought to look at CPy.

ionic elk
#

Hmm, well, I'm not sure where CAN would be on the current priority list. I love learning new peripherals but my only experience with it was a college professor waving a 5 inch thick binder describing the protocol around to emphasize how crazy embedded can get. Might be a bit of a haul

#

Maybe there are some good mediation chips you could try before diving in?

#

CAN to UART or something like that

flint lantern
#

The STM-provided CAN driver isn't too bad as these things go.

#

CAN is really an awesome bus, all things considered.

#

I'm just a greenhorn figuring out how to wrap a CPy driver around it.

ionic elk
#

Sure thing! You could check out the implementations of SPI and UART to get an idea of how things are operating now. If you submit a PR, I'll be on hand to test and review it.

flint lantern
#

I was thinking of copying the Python interface over from micropython.

ionic elk
#

You'll need to fit it into the Common HAL bindings. We don't use the machine API

#

Actually, I don't think we even have a common HAL for CAN.

flint lantern
#

By 'machine API', do you mean the Cube HAL?

#

Yes, I noticed that there is no common HAL for CAN at this time.

ionic elk
#

I meant Micropython's API. I'm not a micropython person though! I'm just a C guy, I barely touch the python stuff πŸ˜“ you'd need to ask @tulip sleet about that when he's awake again

round sigil
#

Just wondering if anyone can help. I'm trying to run the 'screen' command to connect to my circuit playground express (I'm running circuit python). When I connect I get a blank screen, no REPL. It worked fine yesterday, so I am puzzled. I'm typing "screen /dev/tty.usbmodem14401 115200". I've checked the port is correct with ls /dev/tty.* as before. Don't know what I'm doing wrong. I really need the output to the console for debugging. Anyone have any ideas? (I'm on Mac Os).

#

I see an error that briefly says 'sorry could not find a pty'?

#

Never mind, seems the code wasn't running. Thought I'd receive a message about syntax or similar.

stuck elbow
#

Make sure you don't have it open by anything else

tulip sleet
#

@round sigil if you have a code.py running, you'll see nothing until it prints something or you type ctrl-c.

ionic elk
#

@tulip sleet following up from yesterday, has there ever been any interest in a CAN common hal component?

tulip sleet
#

@ionic elk There hasn't been strong demand, and most of the chips we are using now don't support CAN. Adding CAN support is a value-added cost bump to the basic chip, so it raises the cost of the chip. Also it appears you still need an external transceiver chip in many cases

#

maybe some kind of CAN featherwing would make sense

ionic elk
#

I figured the same in terms of ease of use. But it does look like quite a lot of the ST chips support CAN out of the box - everything in the foundation line and the F12 and F13 in the access line support it.

slender iron
#

@ionic elk no need for us to do it since Pierce is looking into it. We should just answer questions and give API feedback.

ionic elk
#

Sure, I don't know your process of deciding on new python-exposed APIs

#

Wasn't sure if there were extra steps/considerations.

slender iron
#

Hi all, our community meeting is tomorrow at 11am Pacific / 2pm Eastern here in this text channel and the matching voice channel. Everyone is welcome to attend to discuss all things blinka. The notes doc for tomorrow's meeting is here: https://docs.google.com/document/d/1TuHZGiIFaJoudoecozZjlu0P7LEzi64EXh7w9L7CevE/edit?usp=sharing

manic glacierBOT
tulip sleet
#

@onyx hinge I added some notes to your in-the-weeds topic

onyx hinge
#

@tulip sleet thanks! I am sure I have missed previous discussion on this topic

tulip sleet
#

np

lunar crown
flint lantern
#

@slender iron , @ionic elk Many of the STM32F4 series have one or two CAN interfaces built in, but each one requires an external interface trip to provide the correct electrical interface. The external chips run $0.50-$1.00 each in bulk and tend to have some very impressive isolation specs -- 15 kV HBM is not at all uncommon.

#

@lunar crown Amusingly, I have some prototypes of a very similar board I made myself for this project. Mine has a 5V boost converter so it will play nice even on battery. πŸ™‚

#

@slender iron , @tulip sleet How do you feel about copying the micropython CAN API over? It seems to touch all the necessary points and doesn't have a lot of fluff. The only thing I think it's missing is a function to calculate all of the bit timing stuff from a given data rate. Here's a link to the docs for it: https://docs.micropython.org/en/latest/library/pyb.CAN.html

onyx hinge
#

@flint lantern my impression is it's desired for all hw drivers in circuitpython to be implemented using the common-hal structure, so just copying a set of file from micropython is unlikely to be satisfactory. I'm less sure what is considered good API design, except that simplicity and generality is favored over covering every HW feature

#

Perhaps the underlying hardware differs too much for that though..

#

For instance in the address matching capabilities

slender iron
#

@flint lantern the micropython api is a good place to start but there are a couple changes that will need to be made

flint lantern
#

@onyx hinge I'm proposing that as an example of what an API might look like, not how the underlying code is architected. Hardware filtering is extremely common in CAN hardware, to the point where I'm not aware of a CAN transceiver (either uC peripheral or external chip) that doesn't have it, although the number of available filters differ and there are some other features around them available on some chips that I have no real interest in exposing via API. If there is a transceiver that doesn't have hardware filtering that someone wants to use in the future, it can be implemented in software.

#

@slender iron What kind of changes?

slender iron
#

we'd merge together MP's constructor and init methods

#

our constructors also take in pin objects rather than peripheral number

#

CAN.state would be a property rather than a function

flint lantern
#

So, if a particular peripheral only operates on only a few pins, how do you deal with user input of incorrect pins?

slender iron
#

throw an exception

flint lantern
#

πŸ™‚

slender iron
onyx hinge
#

@flint lantern makes sense to me, you have to start somewhere

flint lantern
#

It might be difficult to implement CAN.state() as a property without an auxiliary function to read it out of the underlying hardware on demand.

#

The obvious thing to do is update it every time one of the hardware interrupt fires or the user calls any other function. However, there are times when the underlying hardware can increment the error counters without triggering an interrupt.

marble hornet
#

hey, I;m trying to make a new board def based of the m4 express. I have everything working except one of the pins i want to use overlaps with the MICROPY_HW_LED_RX

#

i know many boards don;t have this, and they just seem to not have that def in the mpconfigboard.h. but when i comment it out the board does not boot into cp. it just blinks

#

nm! it went away. it must have been something else

tulip sleet
#

@flint lantern It is fine to have the .state property call some function to read the state as necessary. For instance, when we have a driver that reads a temperature sensor, .temperature will do a transaction with the sensor to get the temperature.

#

and we don't have callbacks, so rxcallback() can't be implemented directly. But you can have an interrupt handler that gets called and adds a message to a fifo, and then have a property that returns how many messages are in the fifo, and another to read from the fifo (e.g. like the way UART works)

#

You might want to look at other CAN API's and see how they are structured (e.g. if there are other Python ones). They may be better or worse.

onyx hinge
onyx hinge
#

good morning