#circuitpython-dev
1 messages Β· Page 265 of 1
I just purchased a new Feathre M0 RFM9x LoRa (https://www.adafruit.com/product/3178). I'm trying to get https://github.com/adafruit/Adafruit_CircuitPython_RFM9x to work, but I'm getting an error. I've loaded the adafruit_bus_device and rfm9x libraries. Here's what I get: > rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/troy/lora/Adafruit_CircuitPython_RFM9x/adafruit_rfm9x.py", line 367, in init
RuntimeError: Failed to find rfm9x with expected version -- check wiring
it looks like the library is looking for a specific version: if version != 18:
raise RuntimeError('Failed to find rfm9x with expected version -- check wiring')
@tacit zenith that usually indicates a wiring issue or incorrect pin assignments. If you are running the "simpletest" did you uncomment these lines https://github.com/adafruit/Adafruit_CircuitPython_RFM9x/blob/master/examples/rfm9x_simpletest.py#L19
that worked. Thank you!
random hardware question, when I touch A0 on a cpx with my rust-hal, I get a bit of noise from the speaker. Does cpy have a way to prevent this?
@exotic pumice disbale the speaker amp
@tidal kiln for real almost done with the guide
replicating the instructions on a clean windows box turned out to be a real journey
turns out neither hyperv nor virtualbox can cope with the ft232h
not surprising. vbox passthrough is a pain...
yeah other devices it has worked for me
but because you force it to libusbK it is π¦ π¦ π¦
and then turns out that disabling hyperv can really wreck yor win10 install
i feel like i learned a lot lol
if i haven't broken it, i don't understand it. π
Adventures in Japan continue. A sculpture by Niki de Saint Phalle that is relevant to circuitpython
@tidal kiln woo guide is live after fighting some kexts, windows 10 and many old software pkgs
@tidal kiln pt will blog it for ya
@meager fog woot! thanks!
@tidal kiln whats next for ya
we have a couple more old-style Python libraries that we have CircuitPython for
@tidal kiln whee
archived and all issues/pr's closed!
hiya tried burning that to my f405 feather but it didnt enum, by chance did you compile the wrong firmware.bin?
Hi all, tomorrow's community meeting is just under 12 hours away. I'm excited to chat with everyone. All are welcome to participate. The meeting happens here in the CircuitPython voice channel at 11am Pacific / 2pm Eastern. Meeting notes doc is here: https://docs.google.com/document/d/14NbReysUfBp2V8u8U1XDLdUZT6xx1lNCgwx6Uctz8SE/edit?usp=sharing <@&356864093652516868>
You'll need to add a never_reset check here when you add external flash support otherwise the filesystem will stop working on first reset.
Comment this out before merging please.
I think your approach here is close. I'd rather have the high end speed-wise instead of the low end. I'm not sure why libraries are defaulting to SPI speed in the 100s of kilohertz. I don't know of any parts that need speeds that slow.
The configure API states it's best effort for this reason. Just make sure frequency returns the real speed in case it needs to be debugged. (I think a couple presca...
I think it can get here if the given baudrate is really slow (less than plck / 256) and that's ok. Just set it to 256.
Sorry I'll be missing another weekly meeting y'all. But it's worth it for the food.
It seems that circuitpython (5..0.0 beta 4) is not quite ready for PDMin on the Monster M4ask : I get "Invalid clock pin", and looking at the code it's clear that this pin combination is not handled. Should I submit a bug report, or is it something you're working on already ?
@sacred blade if it hasn't already been reported it will be helpful to file an issue on GitHub so we can track it. I don't know the specifics (I don't have an m4sk), but if Arduino can do that then circuit python should be able to too.
Thanks!
hiya tried burning that to my f405 feather but it didnt enum, by chance did you compile the wrong firmware.bin?
Whoops sorry that's for the F412! I totally forgot in the moment we had the 405 up and running, ha! If you still have your 412 kicking around you could try that but I'll get the 405 build up and running today, just haven't added the periph definitions for it quite yet.
Ah, that's what that's for. I guess I was thinking somehow that it used a different API. I'll implement that today.
@meager fog I'd forgotten - the reason I don't have a F405 build up and tested yet is because I didn't have a usb C cable to connect to it with. I'll send a new binary as soon as it comes in today.
The prescaler is actually modified by the stm32_baud_to_spi_div, which takes it in as a pointer reference. So it's also saved here with an updated value.
Do you want me to throw a python message in there or anything?
This seems to have been fixed somewhere along the way. Working now in alpha.4 with latest libraries. I hadn't tested again until the past couple of days since I hadn't seen anything in release notes that looked relevant. Closing this issue.
@tannewt I'm a little confused by your non-comment question about SPI checking. There isn't anything preventing pins that are not actively claimed from being used? The only things that are checked are
a) core checking to make sure a pin isn't claimed, which doesn't take place here
b) making sure the pins selected are a valid combination for an SPI
c) making sure the SPI module itself selected via that pin combination is free for use. This doesn't check the pins.
There's no restriction ...
This also sort of ties into the RSS feed issue (https://github.com/adafruit/circuitpython-org/issues/291) as we need a way to sort by newly added boards to add to the RSS feed. One option would be to add a date field to each _board/* file as we add them.
@hierophect The case I'm talking about is when a set of pins has more than one SPI that can use it. As written now, it'll only ever check the first SPI to see if it's free. This will prevent it from using a secondary SPI on the same set of pins. This only happens when multiple SPIs are in use which is common when one is used from external flash.
@ionic elk haha ok
USB C is the fuuuuuuuuuuuuuuuuture
except for everone else who has to scramble to get adapters
@tidal kiln at yr convenience plz add FT232H here https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/faq-troubleshooting
@tidal kiln and then mirror that into the '232h guide
@idle owl @slender iron cant make meeting today. added hugs to notes.
@tidal kiln cheers, thanks
@meager fog okie doke. will do.
@tidal kiln its a great guide, you did amazing on it. im now using it a lot on my compy to quickly test CPython stuff with libraries instead of wranging my Pi
neat. thanks!
Sorry, the example still doesn't work. But my more complex app now does. I'll look into the usage differences to see what the magic is.
im ok bumping libraries to 1MHz, probably was slower for debugging purposes :)
@slender iron @ionic elk i'll wait on testing SPI on the F405 till ya have a build for me, no rush π
@meager fog did the last CI build make a 405 bin?
ooh i dunno
i think we aren't making S3 builds yet
i have to remind @ionic elk to PR that into the build script
oh ya, it's not here either: https://github.com/adafruit/circuitpython/runs/241846182
(top right)
we should do that right away
@ionic elk are ya workin' today?
looks like our board check isn't checking stm32f4s
ya, np
I'm looking into why it isn't failing the CI
it's supposed to fail if a board dir is added but not to the CI
just not failing
@hierophect The case I'm talking about is when a set of pins has more than one SPI that can use it. As written now, it'll only ever check the first SPI to see if it's free. This will prevent it from using a secondary SPI on the same set of pins. This only happens when multiple SPIs are in use which is common when one is used from external flash.
Ah, I see what you mean. I guess this would only ever come up for 1 and 3 or 4 and 5? So, the specific scenario would be using SPI 4 on a differ...
Well, the usage difference is that I'd completely forgotten that I employ the usual trick of re-creating the object each time when some update functionality isn't working (duh).
But, played with changing x and y in the loop and some perhaps helpful behaviors become apparent. With the last part of the code changed to:
# Group 1
splash.append(displayio.Group(max_size=1, scale=1, x=0, y=0)) #dummy
font = terminalio.FONT
text_area = Label(font, text="01234567890123456789", color=0xFF...
hi @meager fog I'm here!
I fixed most of scotts PR stuff this morning and JUST got the USB C
Currently digging out of a pile of JST headers dumped on my desk but I'll get you a build momentarily
@ionic elk can you add the 405 boards to the github CI file too?
will do
all good i have an F412 too - i didnt realize which it was. however we should set the PR-build-thing going so you dont have to do either :)
thanks
@ionic elk yah if you do the github CI thing as a separate mini PR we can have auto-built bin's which makes testing super ezzzz
Hi all. Could someone please point me to the source of audioio and audiocore? Iβve searched various Adafruit github repositories without success.
Iβm exploring making the perceived loudness even across all audible frequencies on the CPX.
@pearl notch the source is in the circuitpython repo
ports/atmel-samd/common-hal/<module>
python -> C is in shared-bindings/<module>
Ah, goodie. Thanks, Scott!
np
@slender iron Just reading meeting notes... sorry had to re-open that issue #2137 π¦
haha, no problem π
@solar whale, can you load a new UF2 via USB-C iPad? I wasn't able to on lightning iPhone with camera adapter (at least as of a couple of weeks ago).
@meager fog oh nuts I can't program it either because I don't have the special SWD header π¦ gotta get my bootloader setup up and going.
BAH
I'll throw a binary up on github anyway, it SHOULD work
Do we have the top of the hour meeting doc link yet? I looked up above for a ways.
I usually search for @ circuitpythonistas
@pearl notch
since that's usually in the post message
@ladyada 405bin. PR coming as soon as I can remember where that setting is...
firmware.bin.zip
@slender iron ok I give up where's the CI setting again
...nevermind I found it LITERALLY SECONDS after I hit enter
π
@pearl notch https://docs.google.com/document/d/14NbReysUfBp2V8u8U1XDLdUZT6xx1lNCgwx6Uctz8SE/edit?usp=sharing
<@&356864093652516868> Todays weekly meeting starts in ~13 minutes. Hope to see you there! Here is the notes document - please feel free to add your notes even if you'll be present in the meeting, it's super helpful! https://docs.google.com/document/d/14NbReysUfBp2V8u8U1XDLdUZT6xx1lNCgwx6Uctz8SE/edit?usp=sharing
Am I correct that the only volume control with CircuitPython and the CPX is the magnitude of the sample itself?
@pearl notch I believe so, yes.
I think mixer can do it now in 5.x
Ah nice!
Time for me to move to 5. π
Let us know if you find any issues please!
@crimson ferry the Bootloader File system does not show up on my iPad
Thanks, I had similar issue (some dialogs popped up and it was grayed out), a couple of public betas ago.
good afternoon ! just lurking...
good afternoon @nimble narwhal
thanks ! you too...
lurking and hello all
lurking
lurking
Having headphone issues... Text only if I make it.
text mode for me
hugz to carter for the epic ft232h work - much appreciated and unlocks some neat use cases
lurking
SIPB 50: Physical Computing - Dan Halbert, great talk by Dan!
https://youtu.be/Zk7WBOunlsg
SIPB 50 schedule: https://sipb50.mit.edu/ To find out more about Student Cable Video Productions and how you can participate, visit: sctv.mit.edu
CircuitPython on any Computer with FT232H, Powerful computers can now use the power of CircuitPython libraries
https://learn.adafruit.com/circuitpython-on-any-computer-with-ft232h/overiew
https://youtu.be/CZ6TtvYJTeI
The new STM32F405 Feather that we designed runs CircuitPython at a blistering 168MHz - our fastest CircuitPython board ever! We put a STEMMA QT / Qwiic port ...
There are over 28,000,000+ Raspberry Pi units
https://blog.adafruit.com/2019/09/26/farnell-has-now-sold-15-million-raspberry-pi-units-total-pi-units-out-there-28-million-latest-market-share-and-more-farnell_avnet-raspberry_pi-raspberrypi/
There are over 79+ CircuitPython boards
https://circuitpython.org/downloads
CircuitPython Organization
Learning IoT with Python and Raspberry Pi by E.I. Horvath, E.A. Horvath
https://www.barnesandnoble.com/w/learning-iot-with-python-and-raspberry-pi-ei-horvath/1133345171?ean=9780578549361
Made with Mu - Improving Programming Education and the Alchemist's Tower
https://testandcode.com/89
https://youtu.be/GNOya_OZxjg
Test & Code - Python Testing & Development
Nicholas Tollervey is working toward better ways of teaching programming. His projects include the Mu Editor, PyperCard, and CodeGrades. Many of us talk about problems with software education. Nicholas is doing something about it.
A "play through" of my PyWeek 28 entry. Apologies for the sound quality. My aim was simple: to create an experience reminiscent of the mysterious exploration...
MicroPython trademark (contacted PSF, Damien)...
https://forum.micropython.org/viewtopic.php?f=2&t=6971&p=39702#p39702
October is Open Hardware Month, stories each day
https://www.oshwa.org/2019/07/26/october-is-open-hardware-month-2/
October 8th, 2019 is Ada Lovelace Day
https://findingada.com/
It definitely is
5
It's down to 4 this year.
they don't even have to be merged
Jesus what is it with 2019 and the Outrun theme
Haha. I was thinking the same last night. 
are we back in the 80s
Nice! I want to look into the hacktoberfest more.
If you are new to Git and GitHub and want to contribute to the CircuitPython project, check out this guide: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
Old issues. Not PRs.
Anecdata is in the notes
You're welcome!
lurking
Great work Brent!
thanks, mike!
anytime π
No it's not just you.
Have to drop off early today. Have a great week, all!
Ok I gotta head out for a class too, see you later everyone
πΆ π΅ (phone keyboard...)
Silence?
ya, me too
π
@pearl notch Thanks!
My mom took a Photoshop class and the teacher kept calling it βAdobeβ.
(I contracted at VMware for over 6 years.)
@gilded cradle Iβve been learning to use PIL myself. I made graph βpaperβ with it, to use with my graphics tablet.
Awesome! It can do some really cool things.
Nailed it!
Yes, I would like to be one of those βistasβ, please.
@pearl notch Done!
Thanks everyone!!
Thanks!
Thanks everyone
Test

Gotta run. π
@tidal kiln mind chiming in on this thread? https://forums.adafruit.com/viewtopic.php?f=60&t=156951
Have to go too, have a good week!
[adafruit/circuitpython] New branch created: tannewt\-patch\-1
060e81d Fail when boards are missing too - tannewt
speaker mute is a "power shutdown" pin on the amp
So how does freezing modules work? There's no way to make it only freeze one part of a lib?
@slender iron @idle owl @errant grail I misread the code before. There is not a new sine waveform generated prior to the playing of each note.
So without going deeper than I want to right now, I wonβt be able to speed this up.
It didn't seem quite right what you were saying, but it's been so long for me that I figured I was missing something. π
if not self._sample:
self._generate_sample(length)
Plus I sounded so confident. π
It's a good look!
Heh heh
I removed turning off the speaker and that didnβt stop the clicking. So Iβll abandon that, too for now.
Equalizing the volume would require generating several sine waveforms at different amplitudes. Iβll still consider that.
@idle owl the current frozen config is done at the library level
@slender iron Library level? like the configuration is in each library?
no, the board def lists the library names to include
hmm ok.
@slender iron Ahh.... hmm ok.
@pearl notch Are you measuring output level with Audacity with a direct connection to the audio output or with a microphone?
only freezing part would be confusing too
Confusing how?
@errant grail with my fancy r, o with a slash through it, d, e mic
only parts of it would be available by default
Right, but you said we don't use spi_device and the CPX lib is only frozen into one board, so freezing only the .express module wouldn't limit functionality.
@pearl notch Ah. That should produce a fairly flat response. I suspect speaker resonance is the primary issue, then. Sounds like you're on a path to measure the resonance curve so that it can be adjusted in code?
@errant grail Are you saying the measured amplitude differences is caused entirely by resonance?
In any case, yes, my aim would be to produce a measured result with equal amplitudes
Yes, assuming that the signal voltage provided to the amp is constant.
I doubt that the tone routines play with amplitude based on frequency. Haven't confirmed that, though.
Do you have an o'scope to look at the amp input signal?
I have a little digital one. That sounds like fun. I would have no idea where to connect it on the CPX.
Let me take a look at the CPX...
even though we don't use it, it's confusing if the user tries to use it and only the other part of the lib is frozen in
@pearl notch I suspect that you could connect the scope to A0 and GND, but I'll confirm.
I guess I'm confused as to how someone could use a frozen lib on a different board without loading the UF2 onto the wrong board.
you don't need to swap the uf2
@pearl notch Yes, A0 and GND. You'll see a DC bias on the signal of about +1.6v on A0 between notes. The sine waveform will start at +1.6v and rise up and down from there. You won't be able to see the effect of the speaker on/off signal on A0, though.
if we remove spi_device from the cpx build and the user tries to use it, then it'll be a weird error
Ok, so specifically with the CPX lib. If we froze in only the express module, how would that limit users?
it wouldn't unless they try to use something weird accidentally
It would fail now if they tried to use something weird.
@errant grail Iβll try it! Wow, that was fun!
That's easy enough.
The amplitude is constant.
@prime flower Ping me when you're around, I have a question.
@idle owl I'm around
The simpletest.py in this folder, would it make sense for it to live in the /examples/ folder? Or is it specific to mqtt and that's why it's in the mqtt folder.
@pearl notch Good to know. Still, it would be worthwhile to make it more constant from the speaker.
@idle owl that simpletest is specific to testing the MQTT class.
I could rename files within the examples folder to adafruit_io_mqtt_xyz and the other to adafruit_io_http_xyz
Sorting through the lib infrastructure issues, and it not having a libname_simpletest.py is triggering the check. However, if it makes sense in those folders, then I will have the checks updated instead.
It's both, you can use the lib with the mqtt or the http client, they're meant to be separate interfaces.
@idle owl I can't think of another library which follows that directory structure, I can change it if folder searching wont work.
@prime flower I'll let you know, thanks.
@errant grail Thanks for suggesting the oscilloscope. Other than playing with it, this was my first real use of it! Iβm gonna make a little video.
np - i'd ideally like to keep it for future mqtt/http libraries (i think sep. folders makes it clear that there are two sep. clients) but could change it
I think it's nearly trivial to make it search folders. Simply needs to be added.
I created an issue for it and will find out.
@crimson ferry heya - re: your issue on ESP32SPI, I just put together a decent test setup to debug both nina-fw (on the ESP32) and circuitpython code simultaneously. it does get hairy and have glitches, working on some ideas to simplify it (especially the workflow).
I don't think you need the check below anymore since self->sck won't be set. Do you want to set a bool here to check below to produce the better error message?
well, if I set a bool, I have to then de-set it if it actually finds one after the first failure, so that's three lines of code and a new variable to replace one check. Would you still prefer that?
initial tests sucessful! tried writing multiple bytes as well as an echo test, there's some debug printf's you can get rid of please :)
import busio
import board
import time
spi = busio.SPI(board.PA05, board.PA07, board.PA06)
while not spi.try_lock():
pass
spi.configure(baudrate=10_000_000)
buf = bytearray(1)
i = 0
while True:
buf[0] = i
spi.write_readinto(buf, buf)
print(buf[0])
i = (i+1) % 256
time.sleep(0.1)
@ladyada did you mean to close this?
@ladyada also were you using the old F412 bin or the new F405 one? I've cleaned up the debug messages for the F405 build, but the F412 one was from before I made those changes. I'll have a new copy for you for the F412 momentarily.
F412: try giving this a spin.
firmware.bin 2.zip
ah testing with the F412 - i gave away my last F405 so i have to make another batch by hand tomorrow, im F405'less till then :)
@ladyada bummer! give that latest F412 bin a try then, and I'll double check the F405 here, just got my cables in :)
ok that solved the debug prints - thanx! after this PR you wont have to give me bin's anymore, they'll be autobuilt
PR looks ok but did not actually test!
@errant grail Given a wav file with a recording of a chromatic scale, how can I condense that to just the maximum amplitude of each note in the scale? Iβm playing with scipy wavfile now. Iβd like a split and max.
@ladyada CI was happy to test that everything builds. The library versions are already in the bundle so we should have heard about any issues with them already.
@ionic elk i can test the other SPI busses on the 412 if you know what they are
@ionic elk @slender iron if y'all have a moment to discuss post-SPI work lemm eknow
I'm around
I'm here
SPI pins BTW
const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = {
SPI(1, 5, &pin_PA05),
SPI(1, 5, &pin_PB03),
SPI(2, 5, &pin_PB10),
SPI(2, 5, &pin_PB13),
SPI(2, 5, &pin_PC07),
SPI(2, 5, &pin_PD03),
SPI(3, 6, &pin_PB03),
SPI(3, 7, &pin_PB12),
SPI(3, 6, &pin_PC10),
SPI(4, 6, &pin_PB13),
SPI(4, 5, &pin_PE02),
SPI(4, 5, &pin_PE12),
SPI(5, 6, &pin_PB00),
SPI(5, 6, &pin_PE02),
SPI(5, 6, &pin_PE12)
};
const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = {
SPI(1, 5, &pin_PA07),
SPI(1, 5, &pin_PB05),
SPI(2, 5, &pin_PB15),
SPI(2, 5, &pin_PC03),
SPI(3, 6, &pin_PB05),
SPI(3, 6, &pin_PC12),
SPI(3, 5, &pin_PD06),
SPI(4, 5, &pin_PA01),
SPI(4, 5, &pin_PE06),
SPI(4, 5, &pin_PE14),
SPI(5, 6, &pin_PA10),
SPI(5, 6, &pin_PB08),
SPI(5, 6, &pin_PE06),
SPI(5, 6, &pin_PE14)
};
const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = {
SPI(1, 5, &pin_PA06),
SPI(1, 5, &pin_PB04),
SPI(2, 5, &pin_PB14),
SPI(2, 5, &pin_PC02),
SPI(3, 6, &pin_PB04),
SPI(3, 6, &pin_PC11),
SPI(4, 6, &pin_PA11),
SPI(4, 5, &pin_PE05),
SPI(4, 5, &pin_PE13),
SPI(5, 6, &pin_PA12),
SPI(5, 6, &pin_PE05),
SPI(5, 6, &pin_PE13)
};
const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = {
SPI(1, 5, &pin_PA04),
SPI(1, 5, &pin_PA15),
SPI(2, 5, &pin_PB09),
SPI(2, 5, &pin_PB12),
SPI(3, 6, &pin_PA04),
SPI(3, 6, &pin_PA15),
SPI(4, 6, &pin_PB12),
SPI(4, 5, &pin_PE04),
SPI(4, 5, &pin_PE11),
SPI(5, 6, &pin_PB01),
SPI(5, 6, &pin_PE04),
SPI(5, 6, &pin_PE11)
};
ok so i did cursory testing of SPI so i think you're going to be able to merge it in a bit
so next up you could EITHER
fix up internal Flash storage so it is actually 48KB instead of 24 KB
OR
get SPI flash chip going
I have a lot of other cleanup stuff to do too
@pearl notch Should be able to do that in Audacity using Effect: Normalize.
But SPI flash is the most exciting
spi flash is my vote
SPI Flash it is! by unanimous decison π
woo
good to learn how to debug and add new definitions
Ok, I've got all the chips in for that as well
it will let us test drivers/feathers and such
π
ok after SPI Flash, then we can do cleanup, more board defs
since we have the majority of built ins
how are we on analog?
Sounds good, I've got the cutsy boards you asked for
analog in works
Analog's done
UART?
DAC isn't
dac does not
no UART
uart is not done either
we ninjaing each other
that's a lower priority for me - uart is usually a fairly easy peripheral
it'd be good to finish modules like analogio and busio
oki i think uart before dac
makes it easier to track and explain
dac's hard
@errant grail going to private chat
DAC for STM32 HAL is pretty streightforward from what I can see but I agree, UART makes more sense first
sooo... SPI Flash, then UART, then DAC?
what about cleanup?
π
tan, where ya want cleanup?
Need to add package management, flash restructure, etc
I think cleanup needs to be more specific
are there issues for the individual ideas already?
I think getting internal flash happier would be good
Package management (lots of STM packages), flash total size fixes and cache buffering implementation, macro cleanup and restructuring
moving various helper functions to board leve
oh you mean physical ic packaging
yeah
lol
It's not in a good spot right now, it'll be hard to expand to BGA
there's often 7+ package options for STM
and that's not even counting power pin mods
let's get issues for these ideas here: https://github.com/adafruit/circuitpython/issues?q=is%3Aopen+is%3Aissue+label%3Astm
I think the packaging stuff will be driven by the boards we want to support
also improving the workaround in I2C, which has an issue
Yeah this would just be prepping for that, really
I bet there are a number of boards we can add with what we have
Adding the 405 was weirdly painful, I'd like to make it better for new ones
ya, the internal flash is really weird
Anyway, happy to make issues for everything. But in terms of order, SPI Flash, UART, DAC, then new boards?
it'd be good to add as many boards as we can before worrying about bga
new boards may be better after spi flash
Still want me to do that bootloader tutorial too? Would love to do some writing, and it'd make it easier to support people on the F405
I think that could come after spi flash with more boards
Any board that uses the F405 will be pretty easy, so cleanup could be avoided if we just stick to boards using that.
ah, meowbit is a 401
the discovery boards seem to thave SPI flash on it too
ya, I'd definitely start there
Yes, F412 has QSPI chip.
makes internal flash less urgent
not qspi?
Can you force regular SPI on a QSPI?
ya
yes all qspi chips are SPI
just slower reads
so you can always pull HOLD/WP high and now its a SPI chip π
also, dont send it the command to start QSPI mode π
F412 Discovery flash chip SUPER old though, obsolete, can't be bought. Is it still pretty simple to add just the settings and roll with it?
the F412 is no longer made?
No, just the QSPI chip on it isn't shipped by digikey or anything
edited message that was unclear
ya, it should still be simple to add the chip definition
it isnt very hard to add support for it - just make the JEDEC id match up
we have some other winbond 25Q chips supported
Gotcha. Ok, so what's the final verdict on priority? Issues for all cleanup, SPI flash on F412/feather, add support for other F405 devboards and maybe 401, UART, DAC, remaining cleanup?
yah make issues for everything
SPI Flash support on F405feather, then discovery boards
then UART
DAC
and then we'll look at other F405 devboards and 401
feather is likely easier since the flash def should be in cp already
I wanna say tools/device.h?
oh ya
Has there been a scan of PR's recently? I noticed https://github.com/adafruit/Adafruit_CircuitPython_DotStar/pull/35/commits lingers and two of mine haven't been applied: https://github.com/adafruit/Adafruit_CircuitPython_MIDI/pull/13 and https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/pull/39 (I did that minor tweak for that one)
GitHub
chopped methods out of adafruit_midi/init.py
updated examples in README.rst and midi_simpletest2.py to just use new API, deleted midi_simpletest.py as it purely used old API and other example r...
GitHub
This is an implementation of json_transform (was json_transforms) described in #38.
Developed for and tested with nasa.py a new version of NASA image viewer from Adafruit Learn: PyPortal NASA Image...
You don't need to unset it, only check it if the pins are NULL. (Before the "Invalid SPI pin selection" error.)
also wanted to bring up one wacky idea again: would we ever want to consider adding a USB breakout for the Nucleos? A lot of people have those, but we can't really use them right now because there isn't any direct USB access.
@ionic elk they'll be very close
@ionic elk we have osme breakouts for usb c/microb
if they wanna try wiring up fast
is it plain USB FS?
No, they don't have direct USB to the chip at all, in most cases
then how do you add USB?
ok yah id just tell em to wire the breakout
Yeah we could consider adding support to the nucleos then, even if they're a bit less accessible. They're super common, I've seen way more of them than the discoveries
@simple pulsar we have lots of libraries and PRs, often a tester/reviewer is needed - see if you can find someone to trade a PR with, they can test yours and you test theirs π
@ionic elk ok yep can add them after we get peripherals squared away
@simple pulsar I'm looking now. feel free to post a message on the PRs themselves. That'll cause them to hit my inbox which I sweep most days.
@meager fog coolbeans. I'll get the cleanup issues logged and then get right on SPI
one last thing - would you like me to put my huge dev journal in the port dir as a readme type document?
you should be set for this week taskwise
@ionic elk i defer to @slender iron on dev journal dox
can you post it as a gist somewhere so I can look at it?
sure, let me sanitize it a bit and send to you to see if you think it'd have any value
is gist a literal thing I don't know about or just a turn of phrase, btw?
like is there a gist.io I should use
also @slender iron if you could just check out that one note I made on SPI, I think we should be done. Just a style question, whether we should keep the line as is or add a couple extra to make it more variable centric.
aha it was real
@ionic elk did you see my "You don't need to unset it, only check it if the pins are NULL. (Before the "Invalid SPI pin selection" error.)" response?
guess it didn't load, let's see
@slender iron responded to forum thread
thanks @tidal kiln
ya, exactly. because at that point you know the SPI is free
which is why you don't need the second copy of the test
sure. It's still 2 lines vs one, but it does seem more readable
π lines are cheap
wait, is there an edge case here where we could misidentify the error?
depends on what the code is
@prime flower Sounds cool, I wouldn't mind taking a look when you're ready.
sorry I just had to think about it for a sec. If it's on, it means there was a valid pin combination you tried and it failed because it was busy, so it's never viable to say it was a bad pin configuration. I just got worried about it continuing to go through possible failure conditions with the flag still active.
What are the possible values of "default_value" at this point? Looking at build_module_map it will be 1 or "None" since 0 is false and int() is used to convert the value to an int.
@slender iron other quick style question to save time, would you prefer:
if (spi_taken) mp_raise_RuntimeError(translate("Hardware busy, try alternative pins"));
mp_raise_RuntimeError(translate("Invalid SPI pin selection"));
or have the full else and brackets? Since both errors halt execution, there's no point to the else, right?
full else with brackets please
ok glad I asked.
it's easier to read
mp_raise requires micropython specific knowledge that someone browsing the code may not know
pushed
k looking
@pastel panther ping me when you're around, Found a thing with RTD that needs to be done when you're setting it up.
Looks good! Thank you!
@ionic elk go ahead and merge once the CI is happy
im not allowed π¦
@ionic elk now you can
im mearly a circuitpeasant, content in my lovely filth
I have been knighted! Thank you good sir
@idle owl I am around
@pastel panther Ok. When you add things to RTD, you need to add adabot as a maintainer. If you disappeared, we wouldn't be able to do anything with any of these: ```
https://github.com/adafruit/Adafruit_CircuitPython_LPS35HW
https://github.com/adafruit/Adafruit_CircuitPython_BD3491FS
https://github.com/adafruit/Adafruit_CircuitPython_DS3502
https://github.com/adafruit/Adafruit_CircuitPython_JWT
https://github.com/adafruit/Adafruit_CircuitPython_MSA301
https://github.com/adafruit/Adafruit_CircuitPython_TLV493D
https://github.com/adafruit/Adafruit_CircuitPython_PCT2075
https://github.com/adafruit/Adafruit_CircuitPython_SSD1305
The LPS35HW one isn't working right, but I can't look into it until you add Adabot. So I can try to figure it out if you add it.
The only real outliers at this point in time are audiocore and audiomixer (https://github.com/adafruit/circuitpython/blob/master/py/circuitpy_mpconfig.mk#L88).
audiocore:default_value = "CIRCUITPY_AUDIOPWMIO, CIRCUITPY_AUDIOIO".audiomixer:default_value = "CIRCUITPY_AUDIOIO".
I imagine audiosynth will follow the same suit.
#2021 lists a couple other outliers that have not been addressed yet, at the py/circuitpy_mpconfig.mk level.
@idle owl ok, will do. I followed this which didn't mention it:
https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs
Presumably because it's not adafruit centric
Correct. I would need to add an internal page with that on it.
fixed the lps (wrong alias), adding adabot now
@slender iron I went through all 140 issues on all the libs, and only one is a good first issue. I also went through the lib infrastructure issues and created issues for everything that would be a good first issue and labelled it. We're going to add Hacktoberfest to all of them. Should at least provide something for newcomers to do. Came out to 19 issues I think. There are not a lot of good first issues at the moment.
@pastel panther Thanks!
sure, np
@idle owl awesome! Thanks! I'll brainstorm more
Sounds good.
@tidal kiln hihi
@idle owl @slender iron there appears to be 101 issues across the landscape (core + libs) labeled as good first issue. do we want all of them marked as Hacktoberfest, or just the libs?
_ * 101 number gathered from a search on github (org:adafruit label:"good first issue" org:adafruit label:"good first issue" repo:Adafruit_CircuitPython)_
@meager fog heyhey
@raven canopy I would say yes. If we labeled it, then it's probably good for it.
kk. should have majority of it done tonight..
yep. already saw that, and planning on ignoring them.
@tidal kiln I went through the FT232H guide. Two things: 1. It works in VMWare Fusion on Windows 10 running on Mac OS. 2. The first "Setup" page is a little confusing - you link the official pyftdi installation instructions, which I went through first, and you don't mention that the Windows instructions aren't the same. It still worked in the end, but I had to undo some things first.
@idle owl thanks. ill take a look.
@tidal kiln ok i replie to your basecamp
i think there's some fun ft232h projects you could do, if you have any desire to
@idle owl @slender iron looks promising so far. will spend the rest of the night in "no push mode" to get a better feel for when it can go live.
{
"url": "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Motor/issues/31",
"number": 31,
"title": "Example should be renamed to include simpletest",
"labels": [
{
"id": 783374807,
"node_id": "MDU6TGFiZWw3ODMzNzQ4MDc=",
"url": "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Motor/labels/good%20first%20issue",
"name": "good first issue",
"color": "7057ff",
"default": true
}
],
"state": "open",
"locked": false,
"author_association": "MEMBER",
"body": "Example `motor_servo_sweep.py` should be renamed to `motor_servo_sweep_simpletest.py` to fit with CircuitPython library standards."
}
-> github.post("/repos/adafruit/Adafruit_CircuitPython_Motor/labels", {'name': 'Hacktoberfest', 'color': 'f2b36f', 'description': 'https://hacktoberfest.digitalocean.com'})
-> github.patch("/repos/adafruit/Adafruit_CircuitPython_Motor/issues/31", {'labels': ['good first issue', 'Hacktoberfest']})
@raven canopy Brilliant!
who knew ~75 lines of code could save so much time? π
Oi...
Hi folks - I'm starting a WebUSB project using TinyUSB. Is there a CP interface yet?
@tough flax interface to do what?
Yes, Circuit Python. I'd like to send data to a Javascript App via WebUSB... I can do it in Arduino
But prefer Circuit Python
As for "what for", I am making a device that will allow Occupational Therapists (and other ATPs) to test a variety of switches and other measurement tools to get "intent" out of an individual
My first pass will be a CPX sending data to a web page running Javscript.
Easier to code a web interface that takes raw data & presents it on the user's laptop
Is there an STA library for CP with Airlift?
eg. use case - create a mini web-server ( something like: https://electropeak.com/learn/create-a-web-server-w-esp32/ )
yes
β€
@tough flax we don't have a separate serial link over usb but you can probably reuse the existing one. I don't know of any webusb example code though
It's OK - I will start with Arduino and chat with @tulip sleet after Rosh Hashana and perhaps @gentle bronze as well - no rush on this
Hi, last year some github issues were marked with a hacktober label, will this year be the same?
What is the difference between circuitpython and the normal python?
Normal Python is a fairly heavy-duty language that requires more resources to run than are normally available on microcontrollers, so MicroPython was created as a smaller subset that could run on a microcontroller. CircuitPython is a derivative of MicroPython with some expanded capabilities.
@granite crow yes. There are some actually still marked from last year, and we're working on the rest currently.
I think itβs version 4. Itβs whatever came by default on the Adafruit Metro
M4 Airlift.
Zach
Le jeu. 26 sept. 2019 Γ 11:31, Scott Shawcroft notifications@github.com a
Γ©crit :
@3ach https://github.com/3ach What version are you using? I'm actually
very surprised three worked. I think I've knocked it down to 1 in 5.x. All
display objects and their busses are statically allocated so they can live
outside the vm. The limit is controlled by CIRCUITPY_DISPLAY_LIMIT
<https://github.c...
@granite crow They don't need to be labeled to count for Hacktoberfest. We label the easy ones for new people to find.
@idle owl updated the setup page, how's it sound now?
https://learn.adafruit.com/circuitpython-on-any-computer-with-ft232h/setup
@meager fog ft232h project ideas? sure. ping me or can just add in basecamp if you want.
@crimson ferry yep! I started on some "workflow" stuff this morning on a branch of nina-fw (https://github.com/brentru/nina-fw/tree/certificate-work). I've added a modified makefile to allow commands for uploading the serial passthru uf2, loading the binary via esptool and popping open miniterm for uart.
inspired by the esp-if make firmware flash monitor workflow, but with more steps
Cool! I saw your guide too, that will be handy for a lot of people. @sly falcon and I were talking a few days ago about where best to store and archive all of the NINA binaries... circuitpython.org? Github? Someone may want to try the latest or stick with 1.2.2 tried and true, or... without jumping between various documents to find the downloads.
@crimson ferry I'll ask @meager fog and get back to you, we might want a S3 bucket for all the binaries
@slender iron i can't recreate this. they say REPL works fine. could that still happen if flash were bad?
https://forums.adafruit.com/viewtopic.php?f=60&t=156951#p774157
@meager fog D:
@tidal kiln Looks good, thanks for the update
Maybe make the last sentence bold
Regardless, it's much clearer
@idle owl cool. thanks. for the VMWare stuff - maybe ping limor? i only did the linux section.
@tidal kiln I think she wanted a note added somewhere that it runs in VMWare. Not an entire section. The Windows instructions work in VMWare
I found a really skinny one and bent the pins so I'm ok
Is there any chance we could get some solder bridges or something to rerout for SWDIO and SWCLK? Those would be really handy off duponts
@idle owl ah. ok. so just a simple note at the top of this page maybe?
https://learn.adafruit.com/circuitpython-on-any-computer-with-ft232h/windows
It's VMWare Fusion for MacOS, so maybe on the Mac page? I'm not sure which section makes more sense :/
@ionic elk squidgin
@meager fog or maybe some of the GPIOs could be swapped out for them? It's not like they're useless pins, they're just PA13 and 14. I could tie their never-reset status to a debug flag
hiero, they dont have any special functions :/
so they're only there for people who really want debug
there's so few pins, i like having it this way
its pretty rare for people to need debug
it's true it's a super tight fit
that's ok. Did all the other pins you pick have an altfunction?
@tidal kiln ya, if flash fails the repl will work but the fs won't
@slender iron any REPL way to check that?
@ionic elk yah
the os.listdir() they did is usually what I do
for example, CAN is on 9/10
@idle owl added quick note here. seem good?
https://learn.adafruit.com/circuitpython-on-any-computer-with-ft232h/mac-osx
@meager fog what would you think about having a little extended-header baggie option to go with the f405? I had to really poke around the A2 shelves to find ones that'd fit in a breadboard.
@ionic elk you mean stacking headers?
Just stuff to elevate it so it can be used on a breadboard while debugging
could use 2 sets of https://www.adafruit.com/product/2830
one above and one below
that's exactly what I meant
@tidal kiln Yah looks good
Should have searched better!
@idle owl cool. thanks.
@ionic elk all good π
@ionic elk lemme know when you start on the SPI flash
and i can suggest some attack vectors
@slender iron and OSError: [Errno 19] Unsupported operation is expected behavior if flash is bad?
I thiiiiiiink so
it can happen if it's a different chip too but I don't know if we have different version of the small flash chip
ok. i'll ask them for some more details. also to try something other than a Pi just to get that out of the equation.
I'd just replace it. They said they tried other CP boards with the Pi and they work fine
and if it's a usb thing then the os.listdir() would work fine
@meager fog oh whoop I've been working on it for like an hour
what are your suggestions? I've gotten everything wired up and it compiles, but I don't see any filesystem yet
@ionic elk ok have you verified with your scope that you are seeing SCK/MOSI and CS toggle on the right pin
Not yet, I'll go grab the A2 Saleae
@ionic elk ok an oscilloscope will work better for this
Only just got to the testing phase, had to piece through all the macro defines and get openocd to recognize the 405 first
but a saelae will work too, gotta clip onto the lil legs
okidoke
why ya using openocd not jlink?
I tend to go for stlink because it's already on the discoveries
so I don't even have to worry about it most of the time
well, when you get to the point of togging data on those lines lemme know
sure thing
That's some attractive PCB routing.
I'm always in awe of the feathers
They're like little jewels of circuitry. However, I wouldn't want to hand-assemble one.
Then again, I think the Teensy 4 has some 0201 parts on it, eek.
@meager fog hang on, doesn't mosi need to go to miso and vice versa? Or do you swap terminology on the flash chip for convenience? Looking at the Feather schematic
hmmm. I could have sworn I needed to switch them for the BMP280 though
should not be unless we miswired something
and other cases
SPI naming is consistant
Yeah seems like I'm just getting it mixed up
That was my original memory of SPI from the other times I've used it, I don't know why I got it mixed up recently. Must have messed up my wiring.
Yeah, MOSI and MISO are great at reducing confusion, avoiding all that RX/TX guesswork.
@ionic elk you will never forget now!
MOSI is "master out, slave in" and MISO is "master in, slave out".
@meager fog and it is a GD25Q16C on this feather, correct?
yep
sorry.... is there a sales or customer service channel? for pre sales questions...? ive got stuff in my cart.. and am reluctant to purchase without some hand holding....
thanks in advance
@north silo try asking in #general-tech or one of the help-with channels
Danke!
Ah, ok. I was misreading the code above.
Why restrict on the length here? all() (all True) and any() (any True) can do truthiness of iterable values.
@ionic elk you are getting confused with uart which is tx to rx
@idle owl nice job with hacktoberfest! cool to see some new folks already π
To those following my CPX audio research yesterday (especially @errant grail), I used https://github.com/tyiannak/pyAudioAnalysis to read my audio recording of the chromatic scale and extract these βenergyβ values, which conveniently show how loud each note is. I can use this data to build a βvolume levelerβ in CircuitPython.
@meager fog, I have the logic analyzer going, did a control test with the BMP, and now I've got it rigged up to the flash chip. I'm seeing CS drop down, but no other activity. Any tips before I dive into the debugger, since you brought it up earlier?
@ionic elk nothing else going sounds like the SPI may have been reset or never inited
@slender iron I'll check that first, then.
cs usually works because we don't use the spi peripheral to manage it
Is there a way to attempt to force the flash to reload without restarting the chip power? There might be mp error messages I'm missing because they only occur directly after power-on.
@slender iron Yep, didn't take long.
@ionic elk I use the debugger at that point and put breakpoints at the critical parts
@slender iron actually, I blanked on my setup, but this was actually for a SPI test of that line WITHOUT the flash system.
As in, I do not see any activity when attempting to manually use the SPI pins attached to the flash memory, using the internal flash and without SPI memory enabled.
@pearl notch Excellent analysis!
Fixes #1696.
- Needed to update tinyusb to bring in HID fixes necessary for gamepad to work on XAC controller.
- Added HID OUT interface descriptor to match many existing devices. Not yet supported by CircuitPython libraries.
To use the XAC-compatible gamepad descriptor, add a line like this to, say, ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk:
USB_HID_DEVICES=XAC_COMPATIBLE_GAMEPAD
@ionic elk hihi checkin in - did ya work out getting SPI twiddling?
Hacktoberfest labels assigned! π
https://github.com/issues?utf8=β&q=is%3Aopen+is%3Aissue+archived%3Afalse+label%3AHacktoberfest+org%3Aadafruit+
@slender iron @idle owl, we can discuss how to deploy in a more static presence later (adabot or otherwise). I'll be out for most of the night.
Never used either, so I didn't even think about them. Makes much more sense. Thanks!
@idle owl any reason issues are turned off for this repo?
https://github.com/adafruit/Adafruit_CircuitPython_MPRLS
So, we have a fork of the CircuitPython repository. I think I made the correct changes... @jepler @ladyada could you doublecheck that I got everything correct before I submit a pull request.
Flash Memory Configuration:
I think I configured the flash chip properly. The datasheet is linked in the comments.
- I couldn't find a listed startup ti...
@meager fog no I've had no luck so far. SPI isn't activating at all on that channel - only the SSEL line is active for very brief periods, compared to a control test on the default SPI line, which shows activity on SLK and MOSI.
I believe it's probably tied to the fact that SSEL is pulled high by default on the feather, where as for the default case with the 280 or an empty line, SPI is either floating or low. I was going to refresh on the documentation for the whole protocol tomorrow morning/
Since some other stuff came up for me this evening.
I was able to build the firmware.uf2 file (linked below) and it appears to work. However, I am having issues testing if the flash chip is working properly.
I was following the Adafruit guide for the Feather M0. After my attempt to use the Arduino Example to read the flash failed, I was trying to upload another example. I deleted the boot.py and code.py files; then...
@tidal kiln Probably an accident. I enabled them.
cool. thanks. figured it was just something like that.
@gilded cradle Ran into issues with making the fritzing, needed PhilB to step in, and so I moved onto the other Fritzing I needed to create. Hoping tomorrow for yours because I need Limor's input on this one before I can move onto doing the weird editing for yours.
Ok, thanks @idle owl.
@ionic elk ?? the pullups, if any are pretty small so that wouldn't affect SPI functionality
I'm adding a Gizmo example to ImageReader, but getting through automated test challenges like the 7735 driver.
@ionic elk so its probably something else
@tulip sleet I think we need to move the local service stuff out of peripheral
because servers are almost entirely independent of connections
the only thing that needs a connection handle is notify/indicate
read and write ignore it
do you mean move the services list out? Right now both central and peripheral have remote services lists, and only peripheral has a local services list. This is probably just because I hadn't implemented a central with local services
i didn't have an object to put it in. who will hold the local services list?
it can be a global
so Adapter
I think I'd move more into Adapter and unify Central and Peripheral into Connection or remote device
hid = HIDService(HID_DESCRIPTOR)
device_info = DeviceInfoService(software_revision=adafruit_ble.__version__,
manufacturer="Adafruit Industries")
adafruit_ble.advertise(hid, appearance=961)
k = Keyboard(hid.devices)
kl = KeyboardLayoutUS(k)
print("Start typing:")
while True:
c = sys.stdin.read(1)
sys.stdout.write(c)
kl.write(c)
does that conflict with your idea of multiple peripherals? probably not, since in SD it is not really separate
that's the hid server example code I want
multiple peripheral connections are ok but they see the same view of the server
it's fine, I think it's fine, just make sure that user code specify its role easily (peripheral or central)
peripheral and central are implicit in how the connection is established right?
yes, and in advertisign
advertising is separate I think since a central can attempt to connect to a BLE address without a scan
notice that you are kinda moving toward a more procedural interface from an oo one. It's fine, but because of the multiple roles it's really difficult to have fixed-role objects
i mean that the purpose of having a Peripheral or Central class is decreasing. It's all connections, it's all dynamic, the device roles shift as the device takes on different roles over time
ya, totally
e.g. above you have adafruit_ble.advertise() instead of periph.advertise()
it can be both at once to different other devices
right
is it possible to have multiple connections between the same two devices?
from the code writer point of view, it means that the code writer has to know more about the BLE model in an implicit way, rather than via knowing what the classes are
a phone could pretend to be two centrals, i don't see that a peripheral would know
i just think that the easy stuff should still be easy (e.g. doing Bluefruit protocol stuff should have a nice wrapper), to avoid our end user having to understand BLE fully
does that involve wrapping connection management?
in this example the server doesn't care if anything is connected
I could have the service get advertised by default
you mean in the HID example above? What would hang if there was no connection? I think the user program may want to know when there is a connection, to report status, decide to do something else, etc.
would kl.write() hang?
nothing in the example would hang. However you could read the list of active connections to know
although that still doesn't handle if you care if someone is subscribed to your characteristic
I'm asking what would happen if there's no connection by the time you get to kl.write()
or the adaptor class could have a sleep_until_connect() function
it would still write the attribute value
but it would only end up in the local table
i don't think that's good, the program wants to tell the user whether there's a connection yet or not, so the user knows not to type, for instance
e.g. still need a .connected property
on the local server though? Or is a list of active connections enough?
it's ok to not care if something is connected though
it can be a separate concern
the example above is like a tiny version of screen; i want to know whether I'm connected or not
while not _bleio.adapter.connections:
pass
print("Start typing:")
while True:
c = sys.stdin.read(1)
sys.stdout.write(c)
kl.write(c)```
and suppose connection goes down during while True loop?
check the connections in the loop too
the current examples all poll about the status of the connection
I know, but do they need to?
yeah but it could be a connection to a different service
right now they need to know when to start advertising again
right
and they might decide to not start advertising; it shouldn't necessarily be only automatic
like if the connection is really flaky, they might give up
e.g. a remote sensor wants to report that the connection to the central is really flaky
by turning on an LED or somethign
ya
this is relevant
it's not really possible to know if a peer cares about a service
the only clue is whether it enables notify/indicate on a characteristic
i see what you mean, but you do care if you are connected at all.... I do think there might be examples where the CCCD is checked to see if anyone is listening. There might be examples in Bluefruit52lib for that
looks
I like the top level Service instatiation for the local service in my example
interesting that both scanner and advertiser can restart on disconnect
I think that's good, too. just maybe do have an easy way to check for a connection, as we already discussed. I don't think you need to return a list of the connections: that will potentially generate Python garbage, just a .connected is ok
ya, could have both
you need a list of connections in case you care about something already connected
central is more complicated, because it initiates the connections, and won't start doing anything until it has set up a connection it's interested in
it does not want to read from a service until there's somethign to read
right,
that's where you'd check the list of existing connections and scan if the device you are looking for isn't connected already
i think maybe we are rediscovering why the SD API is like it is
there is a little discussion of simplifications in the micropython BLE PR that just got merged, nimble vs SD, I think
I did get the hid descriptor parsing going
woot!
also we don't know how much of the spec was, "well, we did this already, so just take it"
ya
i appreciate the fresh blood you have brought to BLE. I would say fresh look but I think there's some blood there too π
heh, I'm enjoying it
just blowing my mind every day or two
I may want to split local vs remote for service and characteristic
the high level api may not use it but it may be nice to build on
i thought about that but there was a lot of shared code. on the other hand i did split device into central and peripheral
right, ultimately it's very functional, not oo
It's probably not wise to rely on the underlying BLE stack (nimble, nordic, bluedroid) being able to add services "later on". In other words, the common denominator here would be to assume that all services must be registered at the same time. from damien is interesting because ble is designed to indicate when services change
well, that is what the generic attribute service is for
designed, yes, but not necessarily implemented that way. and as I mentioned, the Apple library (and I think the Android one too) are not as flexible as you might expect. The Android API has gone through several revisisions to make it better
π
by functional I mean the API has to be functional (repeating what I said before)
watch out or you'll end up on a standards committee
heh
ya, I agree gap is functional because it manipulates global state
gatt feels oo to me
but the gatt objects get bound to connections, so that's the dynamic part, as you have done
they are self-describing, it's reminiscent of ASN.1
the remote services do
heh, asn.1 sounds like protocol buffers too
standard interface description language for defining data structures that can be serialized and deserialized in a cross-platform way.
"network management" interfaces are a lot of a.b.c.d.e kind of paths, and they are kidn of like characterisitics
π
Oh hey... Great talk at MIT.
I wonder if scan should be async
@slender iron scan is typically implemented by calling a callback for each received advertisement
hiya sounds like the flash chip setup may not be right. you can start a PR if you'd like. is @edspark able to help out? they did the other boards. let us know either way!
we also have a guide here you can follow https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython
the irony that my first qualifying Hacktoberfest PR, is automating Hacktoberfest label assignment. π€£
@old smelt what did you have to change in rect?
In init:
self._palette[0] = fill
else:
pass
#self._palette.make_transparent(0)```
@ionic elk hiya lemme know if yr working on SPI today
commented out the make_transparent() call. (Added pass to keep the else)
then in the fill setter added make_opaque() to allow colors again:
def fill(self, color):
if color is None:
self._palette.make_transparent(0)
else:
self._palette[0] = color
self._palette.make_opaque(0)```
@ionic elk i have more stm32 feathers now so i can test
@old smelt that is really weird that it breaks it
I agree. But right now how all the Palette and Bitmap stuff works is still murky to me. I thought if I shared this, it might generate some ideas for those know understand the details better.
did you try reproducing it without the shape library?
narrowing down the breaking code can be super helpful
Not yet. I was headed there. I was trying all the shapes first to see if they all had the same behavior. Got as far as rect vs roundrect and discovered I could (1) fix the problem with rect, and (2) not with roundrect.
That detoured me a bit. But I'll keep moving in that direction.
I also tried recreating on the M4 Express and TFT in case there was something happening in the PyPortal libs that was unique. So far, no difference.
@meager fog yeah I found the source of the error.
@slender iron is there a way to manually define an SPI flash chip with circuitpython, the way you can with the arduino libraries?
@ionic elk I don't know what you mean. I don't do arduino at all. You should be able to use busio.SPI to talk to it from user code
Sorry - what I meant was, is there an interface in circuitpython for manually reading and writing to the flash chip, or would I be recreating flash commands on via busio?
there isn't for doing the filesystem stuff
once you have it talking to the chip though it should be easy to set up the internal stuff to do it
Sure. For now I'm just trying to double check that my SPI line is working as it should.
right, I wouldn't worry about the filesystem stuff then, just read the chip id
@ionic elk there's a line where the JEDEC is read out
halt the debugger there and print it out
he isn't seeing any activity on MOSI and SCK last I heard
yah that needs workin' first π
@gilded cradle or @pastel panther are you planning on reviewing @plucky flint 's PRs to circup?
unclear if "yeah I found the source of the error." fixed that or not
ah ya
Yes @slender iron
awesome, thank you!
@slender iron I'm working on the travis integration atm. thanks @gilded cradle
π
c3dda7c add parsing for 'MINIMAL/DEFAULT'; process incl... - sommersoft
c53ad5f Merge branch 'master' of https://github.com/ada... - sommersoft
01ec3b9 use 'any()' vs 'len == 1 & == False' - sommersoft
22b7050 Merge pull request #2180 from sommersoft/suppor... - tannewt
Code looks ok. CI failed because STM files got shuffled around in the TinyUSB update.
@meager fog @slender iron sorry, been in the weeds. I've got the SPI line working, there was a dumb index mistake in the pin assignment system that we missed because it won't occur for the first pin set of a given SPI peripheral.
Now I've got the SPI flash rigged up, and my logic analyzer says it's talking to it a LOT, but it doesn't seem to ever finish
Wondering what's a reasonable amount of time for that to finish
@gilded cradle The TFT Gizmo fritzing object is pushed, but it's not ready. I'll let you know when it is. Wanted to let you know so if you saw it, you didn't try to use it yet.
@ionic elk did ya put a break on the JEDEC check line?
Ok, thanks Kattni. I'll wait on it.
it could be busy-polling
Here is a diff for folks who want to see the changes: https://github.com/adafruit/circuitpython/compare/master...sparkfun:master
Flash start up time should be ok. For the bitmask you'll want 0x02 since quad enable is bit 1 in the status register. You could try lowering the maximum speed to ensure it's not related to that.
Linker script looks right.
For board config, you'll want to add the QSPI pins if you switch to that. In SPI mode, it should not reset the pins automatically. I don'...
@meager fog Looks like I'm running into an infinite loop related to HAL timeouts but that's up next
@ionic elk are you getting the old chip going? it's possible it's stuck waiting for a write to complete or something
the initial format shouldn't take more than a second
@slender iron I think I've found it - there's this spi_flash_read_command that happens very early, and it doesn't configure the SPI before that. So it's just in its floating initialization state
which isn't really floating or anything, but there's no guarantee that it's appropriate for the board
Why is external_flash trying to do reads before it's even set the baudrate?
@ionic elk link me to the call you are looking at please
that first read is trying to figure out what chip it's talking to
so the default baudrate should be fine
what is the default baudrate?
I mean, there's the chip default baud, but that can be different for any given board
And the program never even hits configure before this point. So the baud it's attempting to read at could be literally anything.
@gilded cradle Alright, with Limor on the assist, it's all set to go. The fritzing object is ready. For the "wiring diagram" you'll want to put it on a CPX - you won't see the CPX, but it shows all the mounting holes on the Gizmo connected and green. Same as with FeatherWings essentially.
Ok, thanks Kattni
Sorry about the delay, that one was tricksy from the beginning.
Yeah, I saw your struggle
There was a whole issue before that too π
There was something in the .brd file named with a ' in it, and it barfed. Phil had to dig to find out why.
Ah, yeah
@solar whale @crimson ferry did some hacking on nina-fw the last few days, just tested it out this PM with AWS IoT (device certificate and PSK are hardcoded into nina-fw for now)
@ionic elk SPI should be usable before a configure call
@slender iron is there a specific default frequency you'd like me to target?
atmel starts at 250k so I'd do the full divisor for stm
ok
configure can then be used to boost it up
well, still no dice
I was seeing some ugly stack corruption in the SPI flash startup before, I'll try and determine if that's still happening.
@prime flower nice π
@sly falcon Thanks for including info about Arduino team's work in their nina-fw for enterprise in the PR notes. I made sure not to take the command addresses they are spec'ing out
the ones I took are nicer anyways π
heh...you're welcome! didn't even know it'd come in handy....err...I mean...I totally planned it that way π lol
@sly falcon I did a lot of "under the hood work" for nina-fw's WiFiSSL library as well (you'll prob see the PR in tomorrow). Added user-defined certificate/psk along with an active connection timeout managed by wifinina (not circuitpython code)
dopeness π€
more verbose error logging, and a new makefile which has a esp-idf inspired workflow for setting a SAMD51 device into serial passthrough mode -> flashing nina-fw binary to the ESP32 -> uploading circuitpython to the device -> uart serial with esp32
@prime flower so...you touched it last, so you're the new NINA fw person, right? right?? π
lol, I actually like working on it. It's just a lot of active cross-referencing between esp-idf, nina-fw, and the mbed docs.
oooo....I'm liking this makefile work of which you speak...that sounds really cool
oh hey....that's something I hadn't caught onto yet....mbed docs?
Tooling that helped me not go insane π
does the mbed stuff help with the esp-idf portion or the nina portion?
@sly falcon Yep, so the WiFiSSLClient uses a few mbed function calls (like here, to mbed's ssl library: https://github.com/arduino/nina-fw/blob/master/arduino/libraries/WiFi/src/WiFiSSLClient.cpp#L240)
they're usually included in the header(s): https://github.com/arduino/nina-fw/blob/master/arduino/libraries/WiFi/src/WiFiSSLClient.h#L24
gotcha
probably why I didn't know about it - that's a portion of the code I haven't poked in
The part I "figured out" was that the esp32-arduino BSP's "WiFiSecure" arduino library references these as well and I was able to use their implementation of connect.
so I was able to start working backwards from there. As a result - looking at how esp32-arduino "cores"/"libraries" implement the esp-idf might be the best jumping off point for @crimson ferry when they write the AnalogWrite/AnalogRead impl.
heh...I did do a bit of poking in the arduino-esp32 core on Espressif's repo...and my head started to swim
but this was probably a bad weekend to try to wrap my brain around code, anyway
I'll definitely look at it again
this is the downside of having a hobby too closely related to my day job....when I get home, I'm often brain fried and don't want to look at code or a computer again for many hours π
@gilded cradle @tidal kiln @pastel panther @slender iron @tulip sleet When doing releases on CircuitPython libraries, please start updating the boilerplate to point to https://circuitpython.org/libraries for the bundle download. I've been doing it as I make releases, so the next time we copy/paste it, it's been updated, but it obviously needs to be manually done at least once. Thanks!
@idle owl will do. It might be worth checking if github supports actual templates
Not sure if they do for releases, but I'll look into it.
This PR adds the infrastructure for SPI flash support to STM32 development boards that support it, such as the Feather F405. It also fixes a pin assignment issue with the previous flash iteration.
@ionic elk woo ok lets try out that auto-generated-build-PR thing!
@slender iron ok i only need to be shown once - where do i find the files generated form https://github.com/adafruit/circuitpython/pull/2186/checks?check_run_id=245330123
@meager fog it only appears after the whole check suite is done unfortunately
it'll be in the top right of that page
all good - yah i thought maybe it moved - i will review when thats done π
π
doesnt take so long
I don't believe it has
@sly falcon I feel that, between grad. school and work. But I like both! If you get stuck or have q's regarding the arduino-esp core let me know and I'll try to help out.
@meager fog when micron says that their memory is 128Mb or Mbit, do they mean megabits or mebibytes?
and if it's the first, would I put in 16MiB or the true 15.2588 value?
138Mb is mega BITS
so divide by 8 for mega BYTES
sneaky!
flash memory is almost always classified in terms of bits
eg the 25Q16 is 16 megabits = 2 MBytes
yeah the math is fine I'm just trying to match terminology lol
noice
Oh, too bad. The F412 only has the flash chip connected to the QSPI peripheral, which I guess is completely separate from regular SPI
So that one will have to wait
@prime flower word...thank you! π
Adafruit CircuitPython 5.0.0-alpha.4 on 2019-09-15; Adafruit Monster M4SK with samd51j19
>>> import audiobusio
>>> import board
>>> mic = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Invalid clock pin
This is in [common-hal/audiobusio/PDMIn.c](https://github.com/adafruit/circuitpython/blob/22b7050c4cd8f2cad31657f91dd4a217b0444a76/ports/atmel-samd/common-hal/audiobusio/PD...
I think 2kB is 2048 bytes. 2MB is 1024 times that.
@ionic elk yah that is not surprising - we can do QSPI later, its usually not super hard
@ionic elk with the extra space you have now you can test BMP280 and such
please do!
yeah :( we could not use the I2S pins because there's no I2S ont he G19 - so instead we connected them to an SPI port - PDM is SPI-like!
now...in theory, we could adapt PDMIn.c to allow using SPI instead! or maybe do a user-space library....
for now we're only supporting PDM mic within arduino :)
BMP was working on the last version actually, @meager fog, but now we can do the OLEDs which is super cool
@sly falcon @prime flower I was looking at Arduino core and comparing to IDF. Unless I missed something, IDF may be the more direct route. Arduino core does analog read very low-level whereas IDF seems to do it with two setup calls and one read call. I'll add some notes in the issue.
Also just got the meowbit in so display stuff is definitely up there
just had a meeting'
@crimson ferry yep, IDF is the way to go if you can
@ionic elk ok back
so for i2c i cant get oled to work it has an error when sending data
i am like 95% its due to a buffer limitation, like you have a fixed i2c buffer
and we're tring to push too much
because with oleds we wrte a big chunk of display at once
Traceback (most recent call last):
File "code.py", line 20, in <module>
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 191, in __init__
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 83, in __init__
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 116, in init_display
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 166, in show
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 205, in write_framebuf
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 205, in write_framebuf
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/helpers/bus_device/adafruit_bus_device/i2c_device.py", line 112, in write
OSError: [Errno 5] Input/output error
I'll see if the HAL has a max buffer size
But you just pass in a pointer and a length so there's nothing I can squarely lay blame on out the bat?
well the first chunk of the display gets blanked
thats why i think tis a size liitation, i think we are trying to write 128x32 bits = 512 bytes
and its got some limit of 32 or 64 byte
so when we call
def write_framebuf(self):
"""Blast out the frame buffer using a single I2C transaction to support
hardware I2C interfaces."""
with self.i2c_device:
self.i2c_device.write(self.buffer)```
it writes the first n bytes, then falls over
this is my guess based on other i2c implementations
sensors only xfer like 16 bytes at a time max
Hmm, what would be the traditional fix for that?
@ionic elk well, start by making an issue
and try replicating with an i2c oled and the ssd1306 library+example
@slender iron @tulip sleet dy'all know what has to be enabled to make board.I2C() exist on a new port
like the 'default' bus thingy
ok tested PC9685 and AMG8833 featherwings
IS32FL is having same I2C buffer size issue as SSD1306
@ionic elk also make an issue to enable the random module on the build
I think you made one for that already
@ionic elk oh ok rad
ok here's a fix for SPI, when the pins are not valid, throw a valueerror not runtimeerror
to match the other ports
Traceback (most recent call last):
File "code.py", line 7, in <module>
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/dotstar/adafruit_dotstar.py", line 98, in __init__
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/dotstar/adafruit_dotstar.py", line 88, in __init__
RuntimeError: Invalid SPI pin selection```
^ that should be a ValueError
god it's so nice having decent flash
@meager fog noted, I'll get that in there
flipping flip my mac has spontaneously decided to shake up the default programs for all my files again.
I'm moving to linux the second I can get a new PC at my desk, this is ridiculous.
lol
oki
k dotstar wing tested besides that valueerror/runtimeerror thiing works
ill test SPI now with sd card
@meager fog would the busy SPI line error be a value or runtime error? Or is that not a big deal either way?
@ionic elk @meager fog for default devices like board.I2C(), there are definitions in boards/*/pins.c and DEFAULT_* in boards/*/mpconfigboard.h.
@ionic elk you should mimic whatever the SAMD error is
Dealing with the builtin modules was one of those things I'd like to handle as a part of general cleanup
yah add an issue for these, and you can get thru them
just bumping into these on the way thru testing π
@meager fog there's not really a great alternative on other ports because they don't have peripheral conflicts of the same kind.
hmm ok but busy/unavailable SPI pins are a generalized problem
for unavailable, at least, please make it valueerror π
that way the dotstar library can catch it
You're only going to run into the sort of invisible peripheral conflicts on the STM32. It's a consequence of abstracting away the fact there are distinct SPI and I2C peripherals that each have multiple combos, but still exist under the hood
I'd like to think of a better way of presenting it that lets people know what's going on without sacrificing the ease of use, but it's tricky.
@ionic elk right, but we can work around them