#circuitpython-dev

1 messages Β· Page 264 of 1

idle owl
#

Adding a note to the notes about the timecodes.

slender iron
idle owl
#

@slender iron what do you mean video description

slender iron
#

that'll be the youtube link

#

the bit that goes in the description when uploading the video

idle owl
#

(also that's valid for the current notes doc)

slender iron
#

yup, just wondering if you had it

idle owl
#

oh. Using the phrase "description" confused me. πŸ™‚

slender iron
#

I tend to do most of whats at the top of the notes and swap in the notes link

idle owl
#

ah fair enough. I'll start doing that.

slender iron
idle owl
#

Got it thanks

slender iron
#

youtube is 95%

ionic elk
#

@slender iron how confusing they just call it the F4 discovery. I was wondering how there could not be a F405/407 discovery

slender iron
#

ya, it's inconsistent

#

it's a 407 though iirc

#

must have been first

crimson ferry
#

There's a process that surfaces new PRs for review, right? I can only tag from a couple of prior contributors, which is probably not optimal.

slender iron
#

most folks get emailed for every pr

#

@tulip sleet do you want to chat ble?

#

or are you about wrapped up for the day?

tulip sleet
#

@slender iron I have time

idle owl
#

@slender iron Yep got it, thank you.

slender iron
#

@idle owl want in on ble talk?

idle owl
#

Yah

slender iron
#

kk

tulip sleet
#

I'm going to try in the browser so my client doesn't freeze up

ionic elk
#

@slender iron what kinds of things cause stack hardfaults?

pearl notch
pastel panther
#

@pearl notch I did, thanks πŸ™‚

pearl notch
#

Any code improvement suggestions are most welcome.

pastel panther
#

ok

#

@slender iron you guys are done with BLE talk?

slender iron
#

@ionic elk I'm not sure what a stack hardfault is

#

@pastel panther we're still chatting. wanna join?

pastel panther
#

ya, why aren't you doing it in a public channel?

slender iron
#

video

pastel panther
#

whatever

#

ok

#

@slender iron I did want to join

slender iron
#

yup, on it

pearl notch
#

I’ve noticed that on the CPX the higher frequencies sound much louder than the lower ones. Would there be any interest in a library enhancement to equalize those levels? (Or perhaps it’s been discussed.)

fading solstice
#

writebytes2

#

Hi, @gilded cradle I have bee trying to use a Raspberry Pi 4 to drive a 1.54in square E Paper display. I get the following error. Do you have any idea whats up?

#

'''Creating display
Traceback (most recent call last):
File "epdexample.py", line 33, in <module>
rst_pin=rst, busy_pin=busy)
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_epd/ssd1608.py", line 76, in init
sramcs_pin, rst_pin, busy_pin)
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_epd/epd.py", line 79, in init
self.sram = mcp_sram.Adafruit_MCP_SRAM(sramcs_pin, spi)
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_epd/mcp_sram.py", line 68, in init
spidev.write(self._buf, end=2) # pylint: disable=no-member
File "/home/pi/.local/lib/python3.7/site-packages/busio.py", line 163, in write
return self._spi.write(buf, start, end)
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 57, in write
self._spi.writebytes2(buf[start:end])
AttributeError: 'SpiDev' object has no attribute 'writebytes2'

raven canopy
#

@pearl notch I thought that was more about perceived loudness with higher frequency sine waves; not that they are actually louder.

pearl notch
#

@raven canopy I carefully chose the word β€œsound” above, but not carefully enough. πŸ™‚ I did indeed mean β€œperceived to be”.

raven canopy
#

Hehe. Yeah, I chose poorly too. I didn't mean to sound that combative/dismissive. πŸ˜‰

pearl notch
#

I took it in the friendly spirit

#

I’m thinking of a linear or curved function, or perhaps a graphic equalizer with bands.

raven canopy
#

Is there a tidy filter to normalize it? i haven't dealt with behind the scenes normalization

pearl notch
#

So much vocabulary here I don’t know. Tidy? Today I learned β€œcircup”.

crimson ferry
#

Has anyone successfully tried using ESP32SPI on an open Wi-Fi AP (ssid only; no password)? I can only get RunTime Error: Unknown error 0x00 in adafruit_esp32spi.py in connect_AP(), which in this case indicates WL_IDLE_STATUS. All the code seems to be in place to do it, but something isn't happening.

raven canopy
#

Tidy, as in "neat and/or small".

pearl notch
#

Heh heh. By filter I assume you mean a function that takes a frequency and returns an adjustment volume.

gilded cradle
#

@fading solstice make sure you are running spidev 3.4 or later.

fading solstice
#

@gilded cradle I know I am not. I think its 3.3 OS says the spidev requement is satisfied via adadruit_blinka (3.3). And I tried pip3 uninstalling spidev and couldn't

gilded cradle
#

Can you run pip3 install ––upgrade spidev?

raven canopy
#

@pearl notch yep. I picked up that term from my slight forays into DSP.

fading solstice
#

i will try that

gilded cradle
#

Cool

fading solstice
#

@gilded cradle That command got me the version 3.4. Thanks

gilded cradle
#

😎

sly falcon
#

@crimson ferry I haven't tried that, but given some time, I think I could setup a test environment for that...maybe this weekend

crimson ferry
#

@sly falcon Thanks, I'm just a little baffled, each layer seems to have the pieces for ssid-only, but I can't get it to connect. (was trying to help another user in the help channel, but this wasn't as easy as I thought)

sly falcon
#

That's weird. I mean....I can definitely think of good use cases (guest/captive portal networks), but I bet it's not a common use for CP devices...so maybe that's why it's never been tested or validated

#

/shrug

#

@crimson ferry btw, all this work I have talked about helping out with, assumes the local electrical utility doesn't shut off power in my area...which they've threatened to do this week to prevent wildfires like we had in 2017 (I live in Santa Rosa, California)

#

so...yeah

#

good times

crimson ferry
#

@sly falcon Wow, good luck with that. At your convenience just chime in on that new issue.

#

The main thing I had on the back burner for open wi-fi was a facility on a roaming device to log data locally, and upload whenever it found an open wi-fi to connect to.

crimson ferry
#

@sly falcon LOL n/m the open wi-fi thing... it works, operator error o_O

sly falcon
#

@crimson ferry Thanks - I appreciate that!

#

@crimson ferry heh...no worries....brain fuzzes happen...glad you got it working! πŸ™‚

onyx hinge
stuck elbow
#

is that a deep-fried donut?

tulip sleet
#

@onyx hinge last time I was in Akihabara was 1988. Pretty amazing then. Have a great time!

craggy galleon
#

@nimble narwhal This appears to fix the issue. We can now measure both 3v3 and 5v0 without overflowing. Not sure if it is a 'good fix' but it is a fix nonetheless. SAMD51G19.

def get_voltage(pin):
    return 1.0 * pin.value / 65535 * 3.25 * 2
solar whale
#

@prime flower Ive been playing with an ATECC608 and the Circuitpython lib you created. It all works, but it is not clear to me how to actually put it into use. I thinkI'm just missing something.... Can you provide a brief explanation of what we can do with this breakout?

prime flower
#

Glad it's working - the utility is to lock private keys (TTN Network IDs, priv/pub rsa keypairs, as an example) into the chip so it can authenticate against a server without someone being able to extract the private key from your project @solar whale

#

Currently, you can use it for offloading cryptographic functions or math, such as random number generation (can generate large arrays of random numbers incredibly fast), SHA-256 hashing and AES-128 signing

#

@solar whale The future goal is to get CircuitPython's ESP32SPI socket working with certificate files so we can authenticate with Amazon AWS IoT or Azure without setup headache or re-authentication. I'm also looking at re-tooling a few libraries (like TinyLoRa and RSA) to utilize an optional ATECC module.

ionic elk
#

@meager fog @slender iron my F405 work is starting to descend into clock arcanery related to tusb (differences between the Pyboard and F407 discovery, basically). Would you like me to press on, or change gears back to SPI support?

slender iron
#

@ionic elk push everything to a branch, link me to it and start spi. I’ll take a look in a couple hours and ping you when I do. Gotta run first

solar whale
#

@prime flower thanks!

prime flower
#

@solar whale np - the JWT/JWS generation is where I think I'll start (Google Cloud uses this to auth.) adding this optional hardware acceleration since it doesn't req. certificates.

solar whale
#

Sounds good -- I'll be happy to try it when you are ready for testers.

prime flower
#

awesome - thanks! If you spot any libraries out there which would benefit from the breakout- plz tag me and I'll look into it

meager fog
#

@onyx hinge awesome!

#

@onyx hinge eat lots of trainstation food πŸ™‚

#

@ionic elk @slender iron what he said - i did notice that ST is pretty flexible on what crystals people use to drive their boards, which makes for fun clock setup. πŸ™‚

#

@tidal kiln lemme know if/when you are looking at the ft232h guide

#

i wrote some fun example code you can use πŸ™‚

ionic elk
#

@meager fog @slender iron nevermind I licked it. Was a PLL miscalculation related to higher value oscillator. Had to go back and double check my numbers. Sneaky, was masquerading as as a flash problem by crashing only in my flash functions 😐

meager fog
#

CLOCKS MAN

#

they'll GET YA

#

good work debuggin πŸ™‚

ionic elk
#

CLOCKS INDEEDY

slender iron
#

yay! nice work! getting the clocks happy is a big hurdle

ionic elk
#

also @meager fog Skunk from Scul says hi

meager fog
#

@ionic elk for the feather, im using the same crystal setup as the pyboard

#

hi skunk

ionic elk
#

Ok, so it'll be a 12MHz?

#

Note that's different from the F407 discovery, which is just a regular ole 8MHz

#

@meager fog So do you actually have a feather prototype yet? I don't have a good idea of your turnover speed

meager fog
#

i have it yes

#

its built, works with micropython

#

its very pyboard-esque

ionic elk
#

Cool, this should work with it then. Let me rig up a board def for it and I'll include it in the PR

meager fog
#

okidoke

#

i will try it!

ionic elk
#

Do you have a pyboard?

meager fog
#

i do!

#

i have to go to meetin's soon

#

so may not get to testing it asap

ionic elk
#

Well, actually, how are you programming these?

meager fog
#

BOOT0 + stm32cube

#

so give me a bin

ionic elk
#

Oh ok I should try that. The pyboard is annoying because it shares the LED pins with SWD, so if you use the LEDs you can shut off your debugger.

meager fog
#

correct...

#

i dont know why they did that

ionic elk
#

it is very bleh

meager fog
#

😦

#

i ran out of USB C connectors otherwise id send you a feather

#

im getting more soon

ionic elk
#

I might actually have some? But I guess probably not the right layout

#

Anyway also if you could ping Mike about that tutorial too now that it's early in the week

#

I'll get some bins together for the pyboard/feather for you to try

manic glacierBOT
manic glacierBOT
meager fog
#

@ionic elk ill be back from my meetin' in an hr or so

#

will look then

#

@ionic elk can you send over any deets/docs about what you have for the guide you wrote already

#

so we can split it up logically πŸ™‚

manic glacierBOT
ionic elk
#

@gentle bronze how are you currently managing HS vs FS on the F405? Since they have different numbers of endpoints.

#

@meager fog I'll need some VIDs/PIDs for the Feather as well

idle owl
gilded cradle
#

Sure, I'll take a look

idle owl
#

Thanks! Limor stepped away and I'm trying to finish this set of issues.

gilded cradle
#

No problem

idle owl
#

Beautiful, thank you!

gilded cradle
#

yw

#

Thank you

idle owl
#

I think this is the last of the libs that didn't work with circup

gilded cradle
#

Awesome

idle owl
#

Releasing them all now.

gilded cradle
#

Sounds good. πŸ˜„

idle owl
#

@plucky flint I think I released the last of the libs that don't work with circup. If you're still having issues with any after they are released in the bundle today or tomorrow, please let me know. Thanks!

meager fog
#

@ionic elk hihi ok backky

#

you need VID/PIDs?

#

how many

ionic elk
#

I'm not really sure how they work I - is it a company identifier or an individually licensed thing?

meager fog
#

it should be unique per 'program'

#

not per board

#

because it has to match drivers

ionic elk
#

So, for all of circuitpython generally?

meager fog
#

er not sure what you mean

ionic elk
#

So I already have IDs for the STM32 discovery boards that you gave me

meager fog
#

basically for eachboard you need unique vid/pid for bootloader, arduino code, circuitpython code

ionic elk
#

Should I just use those?

meager fog
#

yeah we shouldnt reuse ST's because we have our own drivers

#

we get 65535 - theres plenty

ionic elk
#

lol

#

Ok, well, I need some for the Feather F405 (is that the right name?) and then I'm not sure where to look for what I should use for the pyboard

meager fog
#

@ionic elk ya ask me and ill assign em

#
                                PID 0x8059  # arduino
                                PID 0x805A  # circuitpython

#
                                PID 0x805B  # arduino
                                PID 0x805C  # circuitpython```
#

you need one for the '411 too right?

ionic elk
#

If you haven't given me one already. I don't know if you can check that in your system

#

The discoveries both have different IDs, but I don't recall if one of them was a placeholder from the CubeMX code... D:

meager fog
#
                                  PID 0x805D  # arduino
                                  PID 0x805E  # circuitpython```
#

evrey time you make a new build, ask for a new VID/PID

ionic elk
#

A new build as in a new bin? Or a new board?

meager fog
#

@ionic elk a new board definition

#

e.g. "F411 discovery" thats a board definition

#

each board definition needs a unique VID/PID

#

dont recycle them or use the vendor VID/PID

#

@ionic elk ok reviewing your bluepill guide here's the scoop

#

we dont stock or support the bluepill, so as is, if you publish this as is, you'll become the number one source for about 400k people asking for bluepill support

#

which i dont think you want πŸ™‚

#

so we have to adapt or adjust what you wrote so that it does not become your full time job

#

lets start with a guide on how to use STM32cubeprogrammer + BOOT0 to install bin/hex files

ionic elk
#

by STM32cubeprogrammer do you mean both the STM32Cube program and Stlink programmer/debugger?

#

Happy to reduce scope I can definitely see how that'd be an issue

#

Though for the record I'd certainly be down to do more post-beginner stuff at some point.

#

But for the guide itself, of an approximate list of topics, say STM32 hardware, STM32Cube exports, HAL introduction, Bootloader programming, STLink programming, GDB servers, and GDB debugging, what would you see remaining?

#

just bootloader programming to start?

meager fog
#

@ionic elk i thinkliterally like "you have a bin or hex...and a board. how do you get it on?"

#

and use the built in DFU bootloader

slender iron
meager fog
#

@ionic elk ok tested all digialio and analog on the feather f405 - works good!

#

will do i2c next

ionic elk
#

@meager fog Ok, that's fine. Let me know if you'd like me to do the DFU bootloader guide but I'll put the old guide back on the shelf.

#

moving onto SPI now

manic glacierBOT
waxen loom
manic glacierBOT
meager fog
#

@ionic elk ok scott's gonna do reviews in the mornin so we'll keep that PR open, please move forward on SPI

errant grail
#

StringCar M0 Express is alive and running CircuitPython using a Trinket M0 build! Still need to define the flash parameters, but we'll call this a victory!

meager fog
#

yay 🏎

gentle bronze
manic glacierBOT
plucky flint
#

@idle owl stonking stuff and thank you! I'll be doing some testing today, so I'll let you know if I see any issues. πŸ‘

plucky flint
#

@idle owl ok... just been checking and all Adafruit maintained modules have valid / correct version information. Hurrah. However... there's a single module (this one... https://github.com/mrmcwethy/Adafruit_CircuitPython_APDS9960) that's not Adafruit maintained but still included in the bundle -- it doesn't have the hoped for version information and so I see the following output after updating to yesterday's auto-build of the bundle:

$ circup list
Found device at /media/ntoll/CIRCUITPY, running CircuitPython 4.1.0.
The following modules are out of date or probably need an update.

Module             Version  Latest   
------------------ -------- -------- 
adafruit_apds9960  unknown  unknown
#

Happy to be guided by you WRT what to do with this. Thanks!

craggy galleon
craggy galleon
#

Does anyone have any ideas on this one? I haven't changed anything. it seems that there is an issue in either i2c_bits.py or i2c_device.py.

I don't think it is the higher up libraries.

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 10, in <module>
  File "/lib/adafruit_ina219.py", line 164, in __init__
  File "/lib/adafruit_ina219.py", line 309, in set_calibration_32V_2A
  File "/lib/adafruit_register/i2c_bits.py", line 88, in __set__
  File "/lib/adafruit_register/i2c_bits.py", line 74, in __set__
  File "adafruit_bus_device/i2c_device.py", line 147, in write_then_readinto
TypeError: extra keyword arguments given

FYI Line 10: ina219 = INA219(i2c_bus, 0x41)

wind trellis
#

@craggy galleon I reported that here maybe a week and a half ago. The adafruit_bus_device module compiled into CircuitPython seems to be out of date and the calling signature of i2c.write_then_readinto() has changed.

craggy galleon
#

Can it be fixed? Do you have an issue number to quote?

wind trellis
#

I didn't open an issue on it. I guess I should have. You can work around it by saving a copy of i2c_device, either .py or .mpy, one not in adafruit_bus_device.

craggy galleon
#

I have another library that works using i2c_device. The INA219 is using I2CDevice. So I guess these classes have different signatures like you pointed out.

wind trellis
#

The version that's in the driver bundle worked ok for me.

#

Not every I2C device driver uses write_then_readinto(), so maybe that accounts for the difference.

craggy galleon
#

I guess so...

solar whale
#

Are you using the most recent version of adafruit_bus_device,adafruit_register and the sensor libraries from the latest bundle?

#

adafruit_register was updated in August with a change for this.

craggy galleon
#

I have no idea, it is whatever is compiled into CPY 5.0.0 master branch.

#

For the adafruit register library, I downloaded it directly from github master.

solar whale
#

when?

craggy galleon
#

CircuitPython build: last week (Friday), Adafruit Register: 3 hours ago and dumped into lib/ folder.

#

Adafruit CircuitPython 5.0.0-alpha.4-8-gbd4282a-dirty on 2019-09-17; Robo HAT MM1 with samd51g19

solar whale
#

hmm -- ok -- then please file an issue. can you post the code you are getting the erros from and I'll try to reproduce it.

craggy galleon
#

Sure thing!

manic glacierBOT
#

There seems that there is an issue in either i2c_bits.py or i2c_device.py. When I run the INA219 CircuitPython example, it errors out. The correct address has been entered as I tried with an incorrect address and I get a different error.

I downloaded the latest version of adafruit_register and put it in the lib/ folder on my CIRCUITPY drive.

REPL Output

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most rec...
craggy galleon
#

@solar whale - as above.

solar whale
#

OK -- soldering the header on my ina219 and I'll give it a try in few minutes.

craggy galleon
#

Cool! Thanks! I'll standby

solar whale
#

hmmm -- works for me ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.4-72-g7f1bc48a8 on 2019-09-20; Adafruit Grand Central M4 Express with samd51p20

import ina219_simpletest
ina219 test
Config register:
bus_voltage_range: 0x1
gain: 0x3
bus_adc_resolution: 0x3
shunt_adc_resolution: 0x3
mode: 0x7

PSU Voltage: 0.868 V
Shunt Voltage: -0.000030 V
Load Voltage: 0.868 V
Current: -0.000300 A

#

first suggestion is make sure you don't have multiple copies of adafruit_register/ installed. (like both .py and .mpy) versions.

#

also checking when the changes were merged in to CP ...

craggy galleon
#

Ok - I'll have to have a play tomorrow - it's 11:49 PM now.

solar whale
#

Good night -- and good luck πŸ˜‰

ionic elk
#

@meager fog when do you figure you'll have some extra F405 feathers to send? Unfortunately, none of my boards have SPI or QSPI flash except the F412, and the Micron N25Q128A13EF840E doesn't have an entry on devices.h.

raven canopy
craggy galleon
#

@raven canopy that was more the line I was thinking. I don't want it in the Bundle πŸ˜‚ πŸ˜‚ thanks for the link. I'll check it out.

prime flower
#

@solar whale thanks for the fix within ESP32SPI - teamwork! βœ‹

#

I do wonder why it takes a long amount of time for WiFiNINA to obtain a valid NTP, or what the exact execution time is. We could handle it more gracefully if I knew a range and could add a bit of padding.

solar whale
#

It is puzzling and the time varies from a few seconds to > 15 seconds. It also seems to be related to the situation I see a lot where my first attempt to connect to my SSID fails. That is also when it takes 15 seconds to get the valid time.

#

just had one that needed 4 retries

#
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.4-72-g7f1bc48a8 on 2019-09-20; Adafruit Grand Central M4 Express with samd51p20
>>> 
>>> import ntp_simpletest
Connecting to AP...
could not connect to AP, retrying:  ('No such ssid', b'Needell Airport')
Failed to obtain time, retrying in 5 seconds...
Failed to obtain time, retrying in 5 seconds...
Failed to obtain time, retrying in 5 seconds...
Failed to obtain time, retrying in 5 seconds...
Seconds since Jan 1, 1970: 1569424132 seconds
struct_time(tm_year=2019, tm_mon=9, tm_mday=25, tm_hour=15, tm_min=8, tm_sec=52, tm_wday=2, tm_yday=268, tm_isdst=-1)
It is currently 9/25/2019 at 15:8:52 UTC
>>> 
prime flower
#

I don't have enough experience with the ESP-IDF to debug it :\

solar whale
#

I keep trying to find time to look into it more, but it keeps slipping by....

prime flower
#

Arduino didn't add it in their fork of WiFiNINA, but it might be worth it to timebox myself and try adding it in, if not only for the setCACert functions.

tulip sleet
#

@slender iron I have Damien's LittleFS PR compiling but am now trying to figure out how to call it neatly from bonding code. When you're around would like to talk to you about extmod/vfs* and whether it's now is the time to refactor that into shared-*/. There is no clean interface to an arbitrary filesystem now except through the python interface. If you look at, say, main.c, we are calling oofatfs routines directly.

#

lotta technical debt here

pastel panther
slender iron
#

@tulip sleet I'd be happy to see a shared-bindings for the filesystem stuff

#

some of it should probably land in supervisor too

#

eatin cereal now but can chat later if you like

idle owl
#

@plucky flint I think maybe the wrong one is in the bundle. Because we forked it and have been maintaining it. I'll look into it.

plucky flint
#

@idle owl thank you..! πŸ™‚

idle owl
#

@plucky flint How did you find the info as to which repo it was pulling from? If I click on it through the Bundle repo, it goes to the Adafruit version.

#

There's no version info in the Adafruit version either though, so regardless we need to fix it.

plucky flint
#

Hmm... OK. So circup just downloads the bundle (which isn't a rate limited download). GitHub has rate limiting (which we quickly run into) if I were to try to ping each repos for the latest version number. Aaaaannnnd, on top of that, the version number isn't added until Adabot does its work. πŸ˜‰

#

Does that make sense..? The order of the "recipe" is 1. Check if there's a new bundle compared to what circup currently has cached locally, 1a If there's a newer version, download that. 2. Check the cached version of the bundle for version numbers. 3. Do whatever the next step is given the command issued by the user.

#

If I were to ping GitHub API for individual repos version details I have two problems. 1. This call is rate limited and quickly breaks. 2. The version information isn't there anyway because Adabot adds it. πŸ˜‰

idle owl
#

It makes sense but I think my question wasn't clear enough. Where did you get the URL you sent me in the message earlier that indicated that the bundle contained a library that wasn't an Adafruit lib?

plucky flint
#

Aha... sorry. It's the end of the day here and I'm sleepy. πŸ™‚ I just did a search on GitHub and this was the only Python repository with that name associated with it. So it's a best guess on my part.

idle owl
#

Ah

#

Ok.

plucky flint
#

safe to ignore my searching IYSWIM if you have a canonical location.

idle owl
#

Then the issue is that we missed updating that lib, and it's not an issue with a non-Adafruit lib in the bundle.

#

Fixing that lib right now.

plucky flint
#

Aha... stonking stuff. We got there in the end. πŸ‘

idle owl
#

πŸ˜„ Indeed we did.

plucky flint
#

Hurrah!

#

Once that module is updated in the bundle, then circup should just workβ„’ πŸ˜‰

idle owl
#

Excellent!

plucky flint
#

Computers are awesome (when they work).

idle owl
#

Hopefully I beat the bundle release today.

plucky flint
#

Good stuff.

#

Question about the bundle... I presume the daily release only kicks in if there's been an update..?

#

(to a module in the bundle)

idle owl
#

Correct.

#

But it's at random times.

plucky flint
#

Cool... I assumed that was the case.

tulip sleet
#

@slender iron sure ping me when you're free

plucky flint
#

OK... it's my youngest son's birthday and I need to step away for cake, candles and family singing shenanigans. Catch you later....

#

Also, someone asked yesterday in the meeting about my approach to testing. I'll write something up on my blog.

#

...and post a link here.

#

ciao ciao

idle owl
#

ciao!

sly falcon
prime flower
#

@sly falcon Yeah, I'm curious what the execution time of that is, since it doesn't come in until after ~15sec from the initial call

sly falcon
#

@solar whale word...I need to look at a few things this week for @crimson ferry, but I'll see what I can do to get that example code running and see what I can see

solar whale
#

@sly falcon no rush from me! I also hope to fine time to poke/prod it myself

sly falcon
#

ok, cool

#

oh god....sorry, @solar whale and @prime flower got my replies swapped there

#

I'd suggest that I need more coffee, but I'm not sure that's a good thing lol

solar whale
#

πŸ˜‰ no problem. Foe me, the priority is that dog needs a walk 🐢 back later

sly falcon
#

haha....see ya!

slender iron
#

@tulip sleet just got to my desk

meager fog
#

@ionic elk hihi

#

first up ya gotta get general busio SPI workin - i

ionic elk
#

@meager fog sure I don't mean it in a pressure-y way more just thinking about when I'll be working on it.

#

If things go ok with SPI but I don't have boards for Flash I'll probably go back and do a bunch of board related cleanup stuff while I wait for SPI/QSPI test boards.

idle owl
#

@tulip sleet My CPB isn't showing up in the Bluefruit Connect app. Tried it with two different piece of code that look pretty much the same. I have no idea how to troubleshoot this. Any suggestions?

#

Ok, oi. Started as a me-issue, needed the libs. Now I'm getting ImportError: no module named 'bleio'.

#

wait... need the prerelease of BLE.

#

@tulip sleet Nevermind, apparently I did know how to troubleshoot it, I simply forgot. It's sorted.

gilded cradle
#

Yeah, I'll take a look

idle owl
#

@tulip sleet I could still use eyes on the code to make sure it has everything it needs and nothing it doesn't, since I modified your fancy example. My simple example doesn't work anymore with the new API evidently.

#

@gilded cradle Thank you!

gilded cradle
#

yw

tulip sleet
#

@idle owl i was talking with Scott about filesystem stuff. I can still look at at the code. I have to go food shopping in a few minutes.

idle owl
#

It works.

tulip sleet
#

This looks fine and is canonical. Scott is thinking about how to change this all up but that's not done yet. This is it for now.

idle owl
#

Thanks. Yah I know it'll change.

#

Β―_(ツ)_/Β―

#

I'll submit a PR with it to the BLE repo.

tulip sleet
#

The three while loops and the isinstance checking is how it always works

meager fog
#

@ionic elk ok i have a feather f405 for u

#

Please place a new order on Adafruit.com. For shipping, please choose the FASTEST SHIPPING!

During Step 4 of checkout, select the payment option β€œPURCHASE ORDER.” And then, from the options that appear, select β€œREPLACEMENT ORDER.”

For the Step 5 Replacement Authorization Number, please use: RMA FORPHIL

While a note about payment for purchase orders will appear, no payment is required. This replacement order is free of charge. Remember to choose PURCHASE ORDER > REPLACEMENT ORDER as the payment option and we'll send this out right away!
#

email me and pt with the order number after you place it

slender iron
#

@ionic elk grab other spi devices like a display (https://www.adafruit.com/product/661) and https://www.adafruit.com/product/2651 to test with. Also https://www.adafruit.com/product/1212 to solder flash chips onto for testing

manic glacierBOT
#

I am currently doing the following to drive three displays, but would like to add a fourth. I get a 'too many busses' error if I just allocate four more pins.

displayio.release_displays()
for d in range(3):
    cs_pin = 13 - (d * 3)
    rs_pin = 13 - (d * 3) - 1
    dc_pin = 13 - (d * 3) - 2
    
    spi = board.SPI()
    tft_cs = getattr(board, "D" + str(cs_pin))
    tft_rs = getattr(board, "D" + str(rs_pin))
    tft_dc = getattr(board, "D" + str(dc_pin))

    display_bus =...
idle owl
#

@gilded cradle FYI if I search for "circup" in Learn, your guide is nowhere to be found. It brings up all the CircuitPython guides instead which I'm curious as to how that's happening. Anyway, point is, you might want to email Learn dev about it so people can find the guide more easily.

gilded cradle
#

Ok, let me look. I might need to add some keywords or something.

manic glacierBOT
gilded cradle
#

@idle owl, it's down a couple rows when you search. I have it in the title, tagline, description, link. I'm not sure what else to add.

idle owl
#

@gilded cradle Hmm wasn't even on the first page for me.

#

Oh I missed it.

#

No you're right.

#

Yah not sure why it's not coming up higher. Algorithm must take other things into account.

gilded cradle
#

Yeah, maybe I should have started the title with CircUp or something

idle owl
#

I feel like it should regardless. Otherwise the product guides that all start with "Adafruit" wouldn't search as well.

gilded cradle
#

Yeah, there's room for improvement

idle owl
#

@plucky flint Looks like I beat the bundle release. So CircUp should be good to go!

solar whale
#

@sly falcon a good start -- I downloaded ESP-IDF 3.3 and built the current adafruit nina_fw -- I just accepted all the default config changes. It builds and runs. Now to look at what all those changes were ... Note: still getting NTP timeouts at startup.

meager fog
#

@ionic elk hiya checkin on the order thingy

sly falcon
#

@solar whale nice! I was kinda thinking it would compile nicely against 3.3...glad to hear that it did.

#

I'm helping @crimson ferry with some stuff, and my plan is, as part of that work, to submit a PR to get the Adafruit fork of NINA built against 3.3 going forward...so update the docs to reflect that, etc.

crimson ferry
#

@sly falcon I haven't dug into it... any cool new features in 3.3 jump out at you that we might want to expose later?

sly falcon
#

heh...I haven't gotten that far. I was looking into newer versions of the IDF for the NTP issue Jerry is working on, and discovered that they've released a few new 3.x versions since I last updated the docs

#

IMHO, the biggest thing 3.3 has going for it, is it's a LTS (Long Term Support) release with support until March of 2022

#

sure, if particularly cool features come out in the 4.x version they're working on, we can look into that....but the NINA firmware seems to be particularly persnickety to update, so my thought is that we don't want to rev it more often than we really have to

#

or, as an alternative, we have a version that Adafruit can use on shipping hardware, and then another version/branch/thingy that folks who are willing to dive in and get their hands dirty can mess with for advanced features

#

in case anyone wants to read up

crimson ferry
#

Cool, thanks for all that. I'll dig in. It does make sense to minimize the general Adafruit NINA updates.

prime flower
#

@sly falcon One thing I was taking a look at today was moving WiFiClientSecure from the arduino-esp32 library to wifi-nina so we can use certificates

#

Not sure what you've done regarding the IDF, but I'm not sure entirely where to go regarding implementing that since arduino already implemented the WiFiClient within WiFiNINA, possibly we can pull the SSL library and functions?

sly falcon
#

@prime flower oh man....thinking about what you just said is breaking my brain...heh.....thinking about this while trying to do my day job hurts sometimes πŸ˜‰

prime flower
sly falcon
#

got it. So the stuff I'm planning on doing re: the IDF, is simply documentation updates and then I was going to post a binary for folks here like Jerry and anecdata to use if they want

#

From Jerry's message earlier, it sounds like simply compiling against v3.3 of the IDF "just works"....no code changes required

#

so, in theory, the SSL stuff you wanna do, shouldn't conflict with what I was going to do

#

did I answer your question? I'm not convinced I did

prime flower
#

It shouldnt conflict.

sly falcon
#

ok, cool

prime flower
#

Updating to v3.3 would be great, though.

sly falcon
#

agreed

#

that March 2022 date is very attractive from a support perspective

prime flower
#

There's actually a wifi provisioning service v3.3 adds, too, but CircuitPython handles provisioning pretty well rn

sly falcon
#

okie

#

I've never asked, but it would be interesting at some point to know what would cause Adafruit to start shipping the newer NINA binaries with the WPA2 Enterprise support and the work you're doing

#

but I think we can save that for another day

#

I would think moving to v3.3 of the IDF would help

#

but maybe there's other reasons Limor is hesitant

#

Β―_(ツ)_/Β―

raven canopy
#

@tidal kiln maybe try:

if platform.python_implementation() == "CPython":

though that "can't assign to expression" is a weird SyntaxError for that line... πŸ€”

tidal kiln
#

it's not liking the use of const() in the try

#

works if i just change to simple assignment

raven canopy
#

but doesn't complain about line 45. hooray. πŸ˜„

#

only other shot-in-the-dark: put the math in a set of parens?

#

const((320*240)), to explain myself better.

tidal kiln
#

even this throws the error

try:
    _BUFFER_SIZE = const(1)
except ImportError:
    _BUFFER_SIZE = const(2)
raven canopy
#

hrm. odd. that seems like a mpy-cross bug...

tidal kiln
#

yah. and you're right. the line number reported was off.

raven canopy
#

nothing is jumping out in the micropython issues.

stuck elbow
#

const() is a hack and should only be used at the beginning of the file, in global scope, without conditionals

tidal kiln
#

was wondering if it was something like that

#

so really no way to conditionally do this and still use const?

stuck elbow
#

because the way it is implemented, it does search and replace while parsing

#

you can't have conditionals, because at the time const is being replaced, no code has been run yet

raven canopy
#

TIL. thanks for the clarification @stuck elbow. would something like this work?

# If we're on CPython, we have more memory, so get a big ol chunk!
is_cpython = False
try:
    import platform
    if "CPython" in platform.python_implementation():
        is_cpython = True
except ImportError:
    pass

if is_cpython:
     _BUFFER_SIZE = const(320*240)  # blit the whole thing at once
else:
    _BUFFER_SIZE = const(256)
stuck elbow
#

no

#

imagine you are doing the const() substitution yourself

#

just replacing every instance of that variable with a number

#

what number will you use?

#

you can only use const() when the value is known before the program runs

#

otherwise it wouldn't be a constant anymore, would it?

tidal kiln
#

ok. so will just revert to a regular variable.

#

is that really a huge hit? for just one parameter?

stuck elbow
#

no, it's undetectable

#

generally speaking, const() doesn't really do much

tidal kiln
#

cool. thanks @stuck elbow

crimson ferry
#

@sly falcon Where does the 1.3.1 binary live now? The Ent stuff was merged, but the NINA repository doesn't seem to have a place for the binary, only instructions for creating it. I wonder if it's worth an issue or PR, or at least a pointer to a place where the various versions are kept so people can pick what they need.

#

Good point about not having a lot of refreshes, Adafruit probably wants to ship something reasonably consistent. And it's a whole different process (than UF2 or code/libs) for newer users to upgrade their NINA FW.

sly falcon
crimson ferry
#

Cool, thanks. It seems important that the complete history of released binaries is available in some official place, especially as we envision several changes over time.

amber bronze
#

Does CircuitPython's time module support strptime?

crimson ferry
sly falcon
#

@crimson ferry I'm down with that. Maybe we can get an official Adafruit person to help us out with a place to keep those?

#

I know @meager fog added my first binary I released with WPA2 Enterprise.....let me check Learn to see if that's still there

crimson ferry
#

So it's buried in Learn assets. Even that is OK (but not ideal) as long as there is a listing of available binaries for download.

sly falcon
#

agreed

#

there are several firmware release things that are done via Learn guides

#

Β―_(ツ)_/Β―

crimson ferry
#

That's not a bad idea. Or if not that, GitHub.

sly falcon
#

but on that note, I'm heading home....I'll be back in a bit

crimson ferry
#

right on

ionic elk
#

@meager fog sorry I missed your message - wasn't feeling well and went offline for the afternoon. I'll put everything in first thing tomorrow.

meager fog
#

@ionic elk all good - just mkaing sure we didnt miss it!

lone sandalBOT
crimson ferry
#

@sly falcon @solar whale @prime flower I could be misinterpreting, but the Arduino guide on WiFi.getTime() says "Get the time in seconds since January 1st, 1970. The time is retrieved from the WiFi module which periodically fetches the NTP time from an NTP server." ...reads like it doesn't actually do an ntp on-demand. I'm looking through the code now to see if I can figure it out. May explain the startup delay.

#

This was for WINC1500: https://github.com/arduino-libraries/WiFi101/issues/125, but I wonder if it's implemented the same on ESP32. My round-trip response times for esp.get_time() are usually 6-10ms, which tells me I'm not likely to be going out to the internet for those calls (my pings are in the tens of ms). Tempting to roll my own ntp over udp.

Addendum: yup, Arduino ESP8266s on the same network running artisinally hand-crafted ntp over udp are getting ntp round-trip durations in the low 10s of ms, like ping as expected.

orchid basinBOT
umbral dagger
#

Haha.. I'm watching "Better Than Us" (a Russian version of the "what is wemade sentient androids" trope) and there's a closeup of code on a screen and it's Python.

crimson ferry
sly falcon
crimson ferry
#

ugh

sly falcon
crimson ferry
#

and depending on ESP to get ntp on some interval

sly falcon
#

Also, in that first link (line 508) is the reason why @solar whale was getting zero if requesting the time was done immediately after the wifi connection came up

crimson ferry
#

hasn't been fetched yet by ESP

sly falcon
#

Basically, what the NINA firmware is doing is providing a highly abstracted set of functions and there's really a lot going on behind the curtain

crimson ferry
#

yeah, and I know it's only milliseconds, but I like to be in control of as many of the sources of error as possible

sly falcon
#

heh

#

when I first started working on the NINA firmware a few months back to add the WPA2 Enterprise functionality, I hadn't had any prior experience with the NINA stuff or the IDF.....it's all really cool stuff....

crimson ferry
#

At some level, it's black box though, right? All of the IDF is an API?

sly falcon
#

The ESP32 side of things works pretty well....personally, I think we just need to add a bit more behind the scenes stuff on the ESP32SPI CP library to take into account the ESP32 might not be ready for us yet

crimson ferry
#

'0' basically indicates that?

sly falcon
#

well...yes, it provides an API and a ton of libraries that do the heavy lifting

#

and, I think (haven't spent time digging into this yet), some FreeRTOS stuff, too, that's running on the ESP#2

#

yup - the zero means the SNTP library hasn't gotten time from a NTP server yet

#

it does use 3.....and it's not using country/location specific hosts in the NTP Pool Project...so my first take, is that those three servers are fine

crimson ferry
#

yeah, especially since there are no fractional seconds being returned πŸ˜‰

sly falcon
#

but it's something to keep in mind for the future...maybe we want to extend the NINA firmware to allow those to be set manually if so desired

crimson ferry
#

That would be a natural thing to do.

sly falcon
#

heh

crimson ferry
#

udp/ntp gives fractional seconds, so my Arduino clocks are always right and matching to the second πŸ™‚

#

iirc DNS to *.pool.ntp.org does some geography optimization --> yeah "Looking up pool.ntp.org (or 0.pool.ntp.org, 1.pool.ntp.org, etc) will usually return IP addresses for servers in or close to your country. For most users this will give the best results."

sly falcon
#

hah! beat me to that!

#

ok....I'm gonna go relax for a bit before bed... hope you have a good rest of your day/night, @crimson ferry

crimson ferry
#

thx (night), have a good one

smoky zenith
#

I just noticed some of the neopixel products imply they won't work with the blooming selection of circuitpython products (not usable by interpreting microcontrollers), I suspect that is revisable
https://www.adafruit.com/product/1138

plucky flint
#

@idle owl it works! Hurrah. Thank you. πŸ™‚

manic glacierBOT
plucky flint
#

(This IS a first draft, PR's also most welcome)

solar whale
#

@smoky zenith I don't think that waring excludes CircuitPython since the Neopixel driver is part of the C "core". I may be wrong on this, @tulip sleet or @slender iron can you comment on this?

stuck elbow
craggy galleon
manic glacierBOT
manic glacierBOT
ionic elk
#

I really probably should have picked this up by now from the weekly meetings but does the monster eyeball bonnet thingy work with Circuitpython?

#

Also @meager fog parts ordered whenever you're online again. Just need the F405 added to the order - wasn't sure if there was something I was supposed to link for that to be done automatically, or if it was just the email to you? If I should add something else just let me know.

#

@slender iron what kinds of flash chips should I grab off digikey?

meager fog
#

@ionic elk eyecode is in arduino only

#

@ionic elk here are the instructions for when you order and you need something added

#

Please place a new order on Adafruit.com. For shipping, please choose the FASTEST SHIPPING!

During Step 4 of checkout, select the payment option β€œPURCHASE ORDER.” And then, from the options that appear, select β€œREPLACEMENT ORDER.”

For the Step 5 Replacement Authorization Number, please use: RMA FORPHIL

While a note about payment for purchase orders will appear, no payment is required. This replacement order is free of charge. Remember to choose PURCHASE ORDER > REPLACEMENT ORDER as the payment option and we'll send this out right away!
#

Then email pt and myself with the order number

#

the feather was sent out

meager fog
#

@ionic elk were you planning on hand-wiring SPI flash with an 8-SOIC breakout?

slender iron
#

@meager fog that's what I was suggesting for testing

meager fog
#

get 5 pcs of each memory size - note the smaller-capacitty chips come in 0.15" or 0.2" widths. once you get to 4/8/16 they may only be available in fat 0.2"

#

@tidal kiln when u have a moment we can chat about SPI

tidal kiln
#

ok. go for it.

meager fog
#

so i didnt get any complaints about SPI packet length on windows, so could be a pyusb thing on linux (which is OK)

#

a limit of 16kb per packet?

#

if so, please add the chunkin' within Blinka

#

because rgbdisplay should be agnostic - it sends out a buffer, underlying protocol says how thats done

tidal kiln
ionic elk
#

@meager fog I have a bunch of the SOIC boards already and also got some more as @slender iron suggested, so I should be good for breakouts. I'll grab the GDs and the clip now.

meager fog
#

@tidal kiln odd cause 135x240x2 > 16KB

#

@tidal kiln still...thats fine, just 'slice' the bytearray in Blinka if its > 16KB

tidal kiln
#

yep. doing that now and seems to work.

#

so there are two things - setting _BUFFER_SIZE

#

and also that pyftdi limit

#

so no need to limit _BUFFER_SIZE because of pyftdi

#

just need to chunk-ify the write

meager fog
#

@tidal kiln yeah ideally we should not have to know its an FTDI

#

it should be transparant

tidal kiln
#

it will be. similar to check for CPython.

#

i guess it could be added in blinka?

meager fog
#

@tidal kiln yeah put it in blinka

#

libraries shouldnt have different behavior based on the hardware used

tidal kiln
#

gotcha. workin on that now.

meager fog
#

@tidal kiln were you able to get the TFT working thru ft232h?

#

or not at all?

tidal kiln
#

yep. it works.

meager fog
#

refresh speed reasonable?

tidal kiln
#

haven't really tested that yet

#

hit this spi write issue, so started working that

#

have only done a single screen write so far

manic glacierBOT
#

@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.

I'm unsure if that's how I want it to keep working because the terminal can only show on one screen at a time now. If we stick with that, then ...

tidal kiln
manic glacierBOT
meager fog
#

@tidal kiln cute πŸ™‚

#

@tidal kiln on linux you may be able to run the fbcp demo. very slow but functional πŸ˜„

#

@ionic elk yay i was going to do more testing of libraries but ran out of disk space, is there a reason we picked 32KB for the internal flash? these chips are fairly chonky, could maybe fit 128KB?

ionic elk
#

@meager fog The STM32 has wonky flash sectors: 4 segments of 16KB, 1 of 64kb, and then a bunch that are 128kb. Not only that, but the first segment of 16KB HAS to have the interrupt table in it, so that's out.

meager fog
#

we dont put it at the end of flash?

ionic elk
#

So we only get 48KB left without using the 64KB sector, which is hard to buffer when writing. On the 405, I could use the CCRAM as a buffer section to get better flash utilization.

meager fog
#

whats the last sector?

ionic elk
#

Last sector?

meager fog
#

we separate out a sector for file storage yes?

#

and we hve to erase the whole thing at once?

ionic elk
#

Yes so here's what we have: Sector 0(16KBx1) stores ISR vector/startup code. Sectors 1-3 (16KBx3) are the fat filesystem. Sector 4 (64KB) and sectors 5-7 (128KBx3) are used for code.

#

All sectors must be bulk erased

#

So if you don't want to wipe them, you need to copy them to RAM, which is hard when the size of the sector IS the size of your RAM, or half of it D:

#

Micropython saves a little extra flash by forcing the ff object into sector 0 alongside the ISR vector but that doesn't really free up any extra filesystem space.

cerulean pawn
#

which MCU is this?

ionic elk
#

The real savings are when you use the 64KB of CCRAM on the F405 to buffer the filesystem. Or, on the F412, we could allow the 64KB sector to be used since we've got 256KB of RAM

#

This is all the STM32 MCUs

#

@cerulean pawn they all share the same flash organization, just different quantities of it. If we go up to high end ones like the F469 we would get some more sectors of 16KB after the 128K ones.

cerulean pawn
#

for some reason I remember that F407 etc had 512byte sectors which could be erased one by one

ionic elk
#

I'll have to look into that maybe it's something special

#

Foundation-line specific feature or some such. But Micropython doesn't make use of it so I'm not optimistic

cerulean pawn
#

(I might be wrong, I haven't been doing anything with ST chips for some time)

meager fog
#

@ionic elk how does micropython handle this?

#

im weirded out by it πŸ™‚

#

128KB is basically all the RAM

ionic elk
#

It is, yes! Big pain

#

Only difference between my approach and micropython is that I don't use the 64KB section in the filesystem because that's half the ram on most starter line chips.

meager fog
#

oh they use a 64KB?

#

man that sux

ionic elk
#

They use the three 16KB, and then the 64KB

#

But on the 405 they buffer the 64KB in CCRAM

meager fog
#

and is CCRAM not workin?

ionic elk
#

I don't know what they do for starter line chips that don't have CCRAm

meager fog
#

or just havent gotten to CCRAM hacking

ionic elk
#

It's there I just haven't written it yet yes πŸ™‚

meager fog
#

lol ok

#

ok well long term we may have to do that if we want to support a wide range of boars

#

but for now - you'll get SPI going fast i think

ionic elk
#

Because it's only the F405, F407 and other foundation lines that have it

#

the F411 and F412 don't have it

meager fog
#

so we'll just use our tried-n-true SPI Flash tekniq

ionic elk
#

truetrue

meager fog
#

ok thanx!

#

@tidal kiln wanna bump both libs and re-try?

tidal kiln
#

sure.

ionic elk
#

Also @meager fog I just want to check, you're seeing 32KB even though I've got 48K set out for it... that's natural for a FAT filesystem, right? I assumed it's using 16KB for some internal purpose

#

I see the same thing to be clear, just never questioned it. Figured it was organizational use.

#

Or should we be seeing the full 48K? Something I need to fix?

meager fog
#

@ionic elk hmm thats odd, no idea whats up with the missing 16kb

#

could ask scott or dan when they're around

#

lemme plug in my feather

ionic elk
#

Also, @meager fog is there any example code for the ssd1306 that uses SPI?

meager fog
#

there is

ionic elk
#

I'm setting up a control for my SPI tests on the FeatherM4E but I can't find anything,

#

it's all I2c

meager fog
#

use

#

and then

#

people rarely use SPI for these displays

#

if you have a BMx280

#

or similar sensor, those are our 'gold standard' for test because they do both read and write

#

whereas SSD1306 is write-only

ionic elk
#

Oh there it is

#

Yeah I just missed it when I was browsing through

#

BMx280? is that a display?

meager fog
#

all good πŸ™‚

#

its a sensor

ionic elk
#

oh yes ok I see

meager fog
#

available with both i2c/spi interfacs

#

so a good test board

ionic elk
#

I actually may have just gotten one of those on Scott's suggestion

meager fog
#

could be!

ionic elk
#

I could also probably test it with some of my epaper

#

though we don't have libraries written for that so I'd have to spin my onw

meager fog
#

thats also write-only

ionic elk
#

I'm not sure if the waveshare ones are, they do connect MISO

#

but maybe it isn't used

ionic elk
#

What is PIL? from PIL import Image, ImageDraw, ImageFont

tidal kiln
#

python imaging library

ionic elk
#

I'm getting this error ImportError: no module named 'PIL'

meager fog
#

its CPython

ionic elk
#

Something I need to include that's not on the lib page?

meager fog
#

hiya please do the following

#

take this example

#
#oled_cs = digitalio.DigitalInOut(board.D5)
#oled_dc = digitalio.DigitalInOut(board.D6)
#oled = adafruit_ssd1306.SSD1306_SPI(WIDTH, HEIGHT, spi, oled_dc, oled_reset, oled_cs)
ionic elk
#

Sure I've got that one working

#

sorry, should have said.

meager fog
#

thats the only test you should be running

ionic elk
#

I was just hoping to get this image one going, was wondering why it wasn't importing successfully

meager fog
#

it wont work

#

please just do that test

#

that the only test you need to do πŸ™‚

ionic elk
#

ok, np

meager fog
#

@gilded cradle please update your pillow examples with this text

gilded cradle
#

Ok, thanks

#

Should I add the copyright too?

meager fog
#

no

#

just the text i linked to

gilded cradle
#

Ok

tulip sleet
#

@solar whale @smoky zenith I believe you are referring to this in the product description: Our detailed NeoPixel Uberguide has everything you need to use NeoPixels in any shape and size. Including ready-to-go library & example code for the Arduino UNO/Duemilanove/Diecimila, Flora/Micro/Leonardo, Trinket/Gemma, Arduino Due & Arduino Mega/ADK (all versions). That was written years ago and could be revised.

ionic elk
#

@meager fog btw, I did get NameError: name 'FileNotFoundError' is not defined when I didn't have the .bin in the directory, rather than the text error as written. Is that a setup issue or something I should note somewhere?

meager fog
#

for the font?

#

@gilded cradle please work with @ionic elk to update any guide or text

solar whale
#

@tulip sleet I think he was referting to but it will not work with the Basic Stamp, NETduino, any other interpreted/virtual machine microprocessor

#

and assuming that ruled out CircuitPython

tulip sleet
#

@solar whale ok thanks, will see about revising these in the long run

solar whale
pearl notch
#

@raven canopy , we were talking about perceived loudness vs. actual loudness. According to Audacity, in my experiment, the magnitude of the higher frequency notes is greater.

gilded cradle
#

@ionic elk which example gave you the error with the missing bin file?

stuck elbow
idle owl
#

@tulip sleet Can you glance at another code.py for me to let me know if it's correct for now?

tulip sleet
#

sure

idle owl
#

Still think we should have built map_range into CircuitPython somehow, it's the most used thing out of simpleio and it's annoying to have to use simpleio only for that purpose.

tulip sleet
#

code looks good. I would just copy the map_range def into the sample code; it's so simple

idle owl
#

is it? looked long to me. I'll look again.

#

Thanks for checking my code

#
def map_range(x, in_min, in_max, out_min, out_max):
    """
    Maps a number from one range to another.
    Note: This implementation handles values < in_min differently than arduino's map function does.
    :return: Returns value mapped to new range
    :rtype: float
    """
    in_range = in_max - in_min
    in_delta = x - in_min
    if in_range != 0:
        mapped = in_delta / in_range
    elif in_delta != 0:
        mapped = in_delta
    else:
        mapped = .5
    mapped *= out_max - out_min
    mapped += out_min
    if out_min <= out_max:
        return max(min(mapped, out_max), out_min)
    return min(max(mapped, out_max), out_min)```
#

Not super long I guess, but not short either.

tulip sleet
#

there is a simpler one you just used the other day in some other code; this is more robust but mostly unnecessary

#

looking...

idle owl
#

hmm

tulip sleet
#
def map_range(x, in_min, in_max, out_min, out_max):
    mapped = (x-in_min) * (out_max - out_min) / (in_max-in_min) + out_min
    if out_min <= out_max:
        return max(min(mapped, out_max), out_min)
    return min(max(mapped, out_max), out_min)
#

but even simpler that doesn't bother to do the if check, will find that one too

#
def scale(value):
    """Scale an value from 0-65535 (AnalogIn range) to 0-255 (RGB range)"""
    return int(value / 65535 * 255)
idle owl
#

oi oh right. Yeah.

tulip sleet
#

do something like that, since you are mapping a 0-based value

idle owl
#

That I am. That's perfect.

tulip sleet
#

so just change the max values, or parameterize that function

idle owl
#

I think the max analog value is accurate?

#

I'm never sure what the max value is for light sensor. It's an analogin thing so I assume that high.

tulip sleet
#

@stuck elbow re pine64, if/when they switch to '840 from '832, yes

pearl notch
#

@idle owl are there two return statements in a row in that code you pasted about 10 mins ago?

idle owl
#

@pearl notch Yes apparently. I tabbed them wrong.

#

Fixed.

tulip sleet
pearl notch
#

Ah, good

tulip sleet
idle owl
#

Yah that's what I thought.

tulip sleet
#

it will scale to a floating value, but that should be fine

idle owl
#

Yah it was a choppy plot as an integer

#

I thought it was needed for color (since has to be 0-255 as an int)

#

so I removed the int()

tulip sleet
#

yeah, not a color so no prob

idle owl
#

Ok, thank you for taking a look. I'll PR the code to the BLE repo.

stuck elbow
#

@tulip sleet that would be the most pythonic watch out there :)

indigo wedge
#

After seeing the new iPad os works with CP I tried to connect a Serpente to my Nokia (running Pie) Type-C to Type-C and it gets recognized as a keyboard and a USB drive, it claims I need to format it to make it usable, I do that but then it just says the same thing. No file manager or text editor wants to recognize the external drive. So close 😞

pearl notch
idle owl
#

@pearl notch It sounded great on the call! It's in my email and on my list, but I won't be able to get to it until Monday or Tuesday. If Tuesday rolls around and you still haven't heard from me, please ping me again as that's the latest I intend to get to it.

pearl notch
#

No rush at all! I’m amazed at how much work you manage to get done. πŸ™‚

prime flower
#

@solar whale I'm in the process of writing an Upgrading ESP32 Firmware (nina-fw), I've highlighted upgrading from stock to 1.3.0 which incls. @sly falcon 's ENT changes.

solar whale
#

I’ll be happy to try to follow it when it’s ready.

sly falcon
#

@prime flower cool beans! I'm happy to test out, too

#

@prime flower did you see the chatter that @crimson ferry and I had about someplace to keep community and Adafruit maintained NINA fw images/binaries?

solar whale
#

anyone know how to connect a USC-B IPad with IOS 13 to a CP device?

ionic elk
#

@meager fog oof yeah wow the stm32 flash filesystem SUCKS for libraries.

#

I'm trying to just get the baseline on there for an OLED and it's just not having it

#

I think I need to dig deeper on how micropython handles things, it can't be this bad for their MCU-flash only boards.

meager fog
#

yeah i was tryin' to tell ya

#

please use the BMPx80

#

it will be a better / easier experience!

ionic elk
#

Yeah I'll switch to it as soon as it arrives

meager fog
#

for now you can use your scope or logic analyzer to look at SPI data

ionic elk
#

Is there any point in doing flash SPI before regular devices? I have an IS25LQ from another person in A2

meager fog
#

no

#

do plain SPI first

#

you can send incrementing digits and watch CS/SCLK/MOSI

#

then tie MISO to MOSI for echo test

#

once busio is working, you can then add flash SPI

ionic elk
#

How about programming an arduino to be an SPI slave?

manic glacierBOT
meager fog
#

@ionic elk im giving you really good advice from decades of doing this sorta thing, please take it πŸ˜‰

ionic elk
#

@meager fog Ok sorry! I didn't mean to sound like I was blowing you off, I'll definitely take a logic analyzer to it first as you suggested. I was just thinking about more tests I could run, but I can just stick to the data.

meager fog
#

all good! im trying to save you from a lot of frustration πŸ™‚

#

SPI is not very complex, no need to complicate it

ionic elk
#

I appreciate the value of not shotgun programming πŸ‘

meager fog
#

yep!

ionic elk
gilded cradle
#

Ok, thanks

ionic elk
#

running on Feather M4ex

#

(runs just fine with the file included and pretty much fine without it, just that the error is wrong)

gilded cradle
#

Ah, I get it. I think I remember seeing something similar and it might just need a slight tweak such as using the correct Error that is returned.

broken vale
#

Hello there, someone on #help-with-circuitpython pointed me to a conversation here on 9/4 between @idle owl and @tulip sleet in relation to touchio on the SAMD51 based boards. I'm wondering if anyone has any other insight on this as I'm trying to use a Hallowing M4 and touchio but getting an error "No pulldown on pin; 1Mohm recommended". The conversation noted that "On Cortex-M4 chipsets (SAMD51, nRF52840), touchio does not use the built-in touch controller. It uses a 1MOhm resistor as a pulldown to detect capacitive touch" and I think I see the fixes in place in CircuitPython to make that happen but maybe I'm missing something. Trying to get a halloween project in place for my son for this weekend (very early party) and need help getting one of your old M0 projects running on the M4.

meager fog
broken vale
#

Awesome, I was looking all over for any new M4 code that might answer it but you give me exactly what I needed. Mario will live. Thanks @meager fog

meager fog
#

πŸ‘

broken vale
#

@meager fog Sorry for spamming the topic a bit but I just wanted to let you know that my son (8) and daughter (6) were hanging over my shoulder as you were helping us and also just so happened to playing with their Ruby and Gus stuffed toys (we just got them today with some other items we needed). They were really impressed when I told them them that you were the same person in the YouTube videos and thought it was awesome that you were helping us out. Just wanted to share.

meager fog
#

yayy! πŸ™‚

crimson ferry
#

@solar whale May have to wait for a USB-C camera adapter. I always assumed there was some logic in those things, and that seems to pan out: I tried lightning to USB-A male to USB OTG and no dice.

solar whale
#

@crimson ferry thanks! I tried that as well. Just wanted to make sure I was not overlooking something.

crimson ferry
#

@sly falcon I completely forgot I'm gone Sat-Sun. Sorry about that! But I think we can work reasonably independently. I have Discord app on my phone, just that I'll be afk. So this will be 1.3.2 if I read the files right. The 0x50+ range of command codes is unused other than pin mode, digital write and analog write, so I assume we'll tack on digital read and analog read? I'll mirror whatever you do.

prime flower
#

@sly falcon I did not re: somewhere to keep ninafw images/binaries

sly falcon
#

@crimson ferry yeah, I think we can do this asynchronously....and yeah, the 0x50 range sounds like a likely place to put this. I'll take a peek at things Saturday and confirm with you. Hope you have a good time and weekend!

#

@prime flower no worries....I'll bring it up again in the future when I've got more time. Hope you have a good weekend!

solar whale
lone sandalBOT
crimson ferry
#

It would be interesting to compare signals into and out of those camera adapters to see what logic, if any, is happening inside,

solar whale
#

The USB-C-> USB cable works fine on my iPad -- I forgot I had one 😳

crimson ferry
#

Nice! Interesting too... I wonder why (some) other USB data+power cable combinations don't work.

#

@solar whale Is it a single USB-C male to USB micro cable into a CP device?

solar whale
#

no the adaptor has a female USB-A so I haveanothe USB-A to USB micro

#

now -- how do I get to REPL from the iPad??

#

copy / edit / paste worked well

crimson ferry
#

I hope some editors start to support mounted drives natively

meager fog
#

@ionic elk are ya coding today

meager fog
#

@tidal kiln Q when yr around

tidal kiln
#

yep

meager fog
#

i want to archive

#

because its old and krusty

#

can you check the issues/PRs

#

is there anything that is also broken similarly in

tidal kiln
#

ok. basic issue/PR clean up pre-archive? move / create new if needed in CP repo, etc?

meager fog
#

yah

#

i saw you recently did some fixes in the cpy version

#

i just killed off the old python ssd1306

#

so im getting close πŸ™‚

tidal kiln
#

sure. can take a look. want me to ping you for archive? or just go for it after issue/PR clean up?

meager fog
#

@tidal kiln ping me after you check the issue/PR

#

and ask me if you have any Q's

#

like how to handle a wierd case

tidal kiln
#

ok

meager fog
tidal kiln
#

πŸ‘

tulip sleet
#

@slender iron got some q's re refactoring vfs stuff. I could write it up here or could talk.

ionic elk
#

@meager fog hi my computer exploded a bit this morning but I'm over it now. I probably won't have the PR in by tonight but I'll be working over the weekend on it.

meager fog
#

wow fun!

#

np just checkin

ionic elk
#

I got the feather and everything too, and got A2's Saleae up and running

#

So I should be in a good spot

#

@meager fog by the way, I noticed that the SWD header is the SMD kind - would it be possible to pop a cable breakout, box header, and cable into a personal order I made this morning?

meager fog
#

@ionic elk nope only ones with RMA can be added

#

we stock those items in the store

#

place a new order

ionic elk
#

ok

tidal kiln
#

@meager fog i don't think there are any necessary carry overs from either the MAX or LSM repos, all issues/PRs made moot by CP version of libs
the only thing might be to add an issue in MAX repo to add fancier temp calc as an enhancement

meager fog
#

@tidal kiln ok can move the issue over or make a new one

#

wanna close these together

#

πŸ™Œ

tidal kiln
#

sure. no issue to move. it'd be a new one, if you want.

#

returning the register value may be good enough?

meager fog
#

@tidal kiln weird lemme look

#

?

ionic elk
#

@slender iron is there a particular reason why SPI transfer functions in the common hal only return true or false, compared to I2C ones which return an error value?

tidal kiln
#

yep. that.

meager fog
#

@ionic elk spi is a 'nontransactional' protocol

#

you dont know if someone's ont he other side

#

so you can't tel anything other than whether data transmitted or not

#

i2c has ways of knowing if the client was there to get the message

#

@tidal kiln yeah lets port it over, looks nice

ionic elk
#

Ah ok, that makes sense

tidal kiln
#

@meager fog ok - i'll create an issue in the CP lib for it

meager fog
#

fixes some things in it

#

maybe we should add that capability before we close this library

#

cause it seems to be pretty useful

#

@tidal kiln you could use FT232 to help ya write it on your computer πŸ˜„

tidal kiln
#

πŸ™‚

meager fog
#

@tidal kiln ok i owe you the mac/win setup page yeah?

tidal kiln
#

yes please

meager fog
#

@tidal kiln oki i can get those done

#

@tidal kiln anything else wasnt working?

tidal kiln
#

with ft232? or those repos?

slender iron
#

@ionic elk I think it's just to provide better error messages for i2c. feel free to swap spi if errors need better responses

#

@tulip sleet just saw this after getting back from lunch

#

can chat if you still want to

ionic elk
#

I mean, I2C isn't really passing very sophisticated errors either.

#

It's literally success or EIO

slender iron
#

Β―_(ツ)_/Β―

ionic elk
#

Versus true or false on SPI

#

So I mean your call, sounds like either just a style question or maybe a push for more interesting error variety for I2C, which would be a small project

slender iron
#

just leave it as is

ionic elk
#

k

#

also @slender iron what's the module for math?

slender iron
#

what do you mean?

ionic elk
#

I didn't even see it required on the feather

#

Traceback (most recent call last):

  File "code.py", line 7, in <module>
  File "adafruit_bmp280.py", line 30, in <module>
ImportError: no module named 'math'
slender iron
#

ah

#

CIRCUITPY_MATH

ionic elk
#

Oh, it's another sneaky module with no common_hal component

#

I thought it was a library thing, sorry

#

Should we try and sort out all the modules with no common_hal aspect, and not include them in MINIMAL_BUILD?

#

rephrase that - not exclude them via min build, since there's no reason to if they're not chip dependent.

slender iron
#

ya, you can take a quick pass over it if you like

manic glacierBOT
#

When doing dir() on a built-in, the getter is called. This is usually ok but causes issues when the property throws an exception. This was found when diring a _bleio.Characteristic.

Stack trace:

#4  0x0003785c in mp_call_function_n_kw (fun_in=0xa6188 <bleio_characteristic_get_value_obj>, n_args=1, n_kw=0, args=0x2003f8cc)
    at ../../py/runtime.c:624
#5  0x000382b2 in mp_convert_member_lookup (self=0x2001cdb0, type=0xa621c <bleio_characteristic_type>,
    member=0xa6198 <blei...
meager fog
#

@ionic elk hiya st q when you're around

ionic elk
#

@slender iron & @meager fog: I think I'm going to preface the SPI PR with a separate one where I'm going to attempt some flash fixes. Something seems very off about the flash as is.

#

Oh yeah shoot

meager fog
#

is the STM32f413 a close relative of the '412?

#

this person sent us a board with a '413, never heard of it

ionic elk
#

It is decently close as in it's the next level up on the starter line. It has a LOT of UART lines, like 10

meager fog
#

@ionic elk similar enough HAL i hope

#

we'll let them know that its likely supported in a few months

ionic elk
#

It'd be near identical yeah. It just implements basically every single peripheral there is on the starter line

meager fog
#

ok - grab a disco' next time you have an order from DK

ionic elk
#

Will do

meager fog
#

ok next up, whtas with flash

#

i agree its weird

#

very slow πŸ™‚

ionic elk
#

And everything reports itself as 2x as big as it should be

#

I think there may be something that I missed, under the impression that if things failed they would fail completely.

#

Might be as simple as the HAL bit writing

#

But I'll need to dig in a little bit.

#

On the upside I think that SPI is basically working, it's just hard to test because I can't even fit the BMP80 library on the flash

#

But the lines look good

meager fog
#

@ionic elk oki yeah thats odd

#

do you need guideance from dan or scott?

#

@ionic elk of cousre, if SPI works, we can use the SPI flash chip

#

then thats our storage, we dont have to worry about the internal flash as much (altho, long term, it does need to be fixed#

tulip sleet
#

@slender iron now i am back from dinner. vfs refactoring q has evolved a bit but would still like your input

slender iron
#

kk, will head back to my desk. was downstairs while cleaners clean

tulip sleet
#

same thing here sometimes

slender iron
#

k, ready

meager fog
#

@tidal kiln ok will add the windows ft232h instructions now

tidal kiln
#

coolio. thanks!

meager fog
#

@tidal kiln findin buggggz

#

@raven canopy if ya around wanna review my pr

#

im doing hardware tests

raven canopy
#

i can take a peek. i haz no EPDs to test though. 😦

meager fog
#

its a stylistic PR - im testing with the EPDs now

#

or rather, no functional changing of logic

raven canopy
#

almost started saying "shouldn't this use busdevice"; then catches the PR title πŸ˜„

#

merged!

meager fog
#

yeah EPDs are super weirdo and cannot use busdevice

#

wish ya could

crimson ferry
meager fog
#

? huh that is odd but could be

crimson ferry
#

I running latest everything else on there, so... ?

meager fog
#

dunno - im on CPython πŸ™‚

crimson ferry
#

No, you're right, that's not even the right lib. I'm doing displayio. This is going to bug me.

gaunt zinc
#

Was wondering if there are detailed instructions available for everything that needs to be done/installed to get bluetooth working properly on the circuit playground bluefruit? I've been trying everything I find on the forum to get it working but haven't been successful. I'm really new at this so I need step by step instructions if there are any available.

Basically I need to know:

What needs to be installed on Raspbian to support bluefruit and how to install?
What needs to be installed on the circuit playground and how to install?

I completed all of the instructions from the link below but when I try to test I'm getting an error.

Link: https://github.com/adafruit/Adafruit_Python_BluefruitLE

Error:
pi@raspberrypi:~ $ sudo python uart_service.py
python: can't open file 'uart_service.py': [Errno 2] No such file or directory

I'm really stuck and would appreciate any help that can be offered. Thanks

manic glacierBOT
#

Partially addresses item 2 of #2021.

  • Will now properly process modules that are included based on a different module's inclusion (audiocore, audiomixer, ...).

    • It also handles multiple/conditional dependencies. Currently, audiocore is included if either audioio or audiopwmio is included, based on an ifeq. Hopefully this implementation is future-proof enough.
  • Added processing of CIRCUITPY_MINIMAL_BUILD and CIRCUITPY_DEFAULT_BUILD.

solar whale
#

@gaunt zinc for the Circuitplyground bluefruit, you have to use the latest version of Circuitpython and the "alpha" release of the BLE library that is not in the regular "bundle" see the notes here https://learn.adafruit.com/adafruit-circuit-playground-bluefruit/circuitpython -- for the raspian side, I can't help much - I did not even know about that Adafruit_Python_Python Library -I'm trying to check it out now myself. For a first connection to the CircuitPLayground Bluefruit, if you have an iPhone or Android Phone, you can use the Bluefruit_LE_Connect app to communicate with it.

Adafruit Learning System

Circuit Playground Bluefruit: Everything amazing about Circuit Playground, now with the power of Bluetooth!

solar whale
#

@gaunt zinc FYI -- I am not getting very far with the Adafruit_Python_BluefruitE library - I am seeing many of the already report issues. I usually use the IOS or Android app to communicate with my Bluefruit devices. I'm trying to learn more about the Adafruit_Python_BluefruitE Library but just wanted to update you.

meager fog
#

@ionic elk just checkin' are you working today

ionic elk
#

Yep I was actually just going to pose a question here about micropython

meager fog
#

lol ok ya can ask πŸ™‚

ionic elk
#

I notice that many of the peripheral support files have two versions. for instance, there is flash.c, but then also flashbdev.c. They provide essentially the same outcomes, but with a different API. And it appears that flashbdev.c is more recent. A similar spibdev.c exists in contrast to spi.c

#

I understand that this kind of redundancy isn't uncommon in micropython but I'm wondering if one of these modules is outright obsolete, or is otherwise not a good reference in some way

#

All of this is alongside the official ST documentation of course but the MP people often pick up on things that ST skims or actively omits, so I feel it's a good secondary reference

meager fog
#

@ionic elk oof that stuff i dunno - sorry 😦

#

i can help with hardware stuff πŸ™‚

tidal kiln
#

@meager fog hey, i'm here for a little bit. saw the FT232H duplex patch. how'd you run into that?

meager fog
#

@tidal kiln eink displays

#

you need to send and receive data at the same time

#

which is not common for most SPI devices

#

usually you send or receive

#

works now - doing some eink hacking

tidal kiln
#

and it works OK to just set it true for all cases?

meager fog
#

@tidal kiln it...seems to work?

#

its only for exchange, which you only use in that one function

#

without it, it was transmitting 2 bytes not 1 πŸ™‚

timber mango
#

Interesting to read along because was just working on a bit level implementation of spi. I know there's no formal standard but was under the impression that duplex was baked in. E.g. the wikipedia sample code even does it.

meager fog
#

@tidal kiln i did some of the windows setup code but need to try to find/make some clean-room win10 install

tidal kiln
#

ha. yah. took me a bit to do same - getting a clean room linux setup for doing guide screen caps.

ionic elk
#

Quick page to @slender iron and @stuck elbow on the micropython flash topic if you happen to be online this weekend.

#

Since they were helpful on the i2c.c equivalent a few days ago

#

if not I'll probably have it figured out by monday anyhow

raven canopy
#

@ionic elk having spent 99% of my time understanding our structure, micropython diff always trips me up. the original commit message is the best i can point to explain it:

stm32: Factor out flash and SPI block-device code to separate files.

Prior to this patch, storage.c was a combination of code that handled
either internal flash or external SPI flash and exposed one of them as a
block device for the local storage.  It was also exposed to the USB MSC.

This patch splits out the flash and SPI code to separate files, which each
provide a general block-device interface (at the C level).  Then storage.c
just picks one of them to use as the local storage medium.  The aim of this
factoring is to allow to add new block devices in the future and allow for
easier configurability.

https://github.com/micropython/micropython/commit/fa13e0d35bc6326fb87676e33a64864e47407a00#diff-93cf77722cb75e3ef918b724228bf9e0

tidal kiln
#

bleh. i was probably also stuck thinking in terms of I2C's write_then_read. SPI wants it to be simul.

#

@meager fog cool. thanks for finding that. glad it worked too. any other bugs?

ionic elk
#

@raven canopy thank you.

#

Doesn't really explain why flash.c is a thing, though.

raven canopy
#

yeah. the commit message was helpful, to a point. πŸ˜„

ionic elk
#

it sounds like flashbdev is the primary use case though

#

handled by storage

raven canopy
#

i tried to climb through the #include chain. brain decided, "no.".

ionic elk
#

It's included, so presumably it's not just vestigial? Maybe?

raven canopy
#

Β―_(ツ)_/Β―

ionic elk
#

Ok I figured it out. flashbdev is an IRQ/cache handler on top of flash.c.

#

Thanks for the tips @raven canopy

#

They just looked similar because of their defines but flasbdev isn't actually implementing the HAL for writes.

raven canopy
#

np. (though this is another in many situations where i question if i actually helped) πŸ˜„

ionic elk
#

you did! if I hadn't seen the connection to storage.c it would have been much more confusing.

#

also good to know that all the SPI flash storage is in spibdev.

#

@meager fog or @raven canopy do you know what my restrictions are in terms of IRQ use for port level work? I recall there are limits on what's allowed.

#

NEVERMIND another micropython red herring, there's no IRQs. I should give myself more time to avoid asking stupid questions, sorry.

raven canopy
#

@ionic elk no worries. i think its somewhat relative. for instance, i know that the SAMD port forces specific IRQ priorities. trying to find it...

ionic elk
#

A hugely helpful thing for this process, actually, would be if somebody could print me off the first 256 bytes of the filesystem on an NRF or SAMD board.

#

I don't have a debugger that can interface with SAMDs, sadly, and I don't have any NRF boards

raven canopy
#

oh man. i have the tools, but working through the how would take me a while. i've never really spent time at the dump 0x level.

ionic elk
#

Yeah I'm still puzzling through it but I'm wondering if a very high priority IRQ will be needed for flash to be fast enough when dealing with ST's monster 16K sector sizes

#

not as easy as x/256s 0x0000000 in gdb?

raven canopy
#

i could def give it a shot. lunch time, but i can give it a go after if noone comes along with it..

ionic elk
#

No pressure I'm kind of venting stream of consciousness over here, don't want to impose

raven canopy
#

haha. no worries. my plate is mostly clean as I've cleared most of my todo list for this week. been gearing up for a partition expansion on the laptop most of the morning. (why i continue dual boot this laptop makes little sense. dell warranty & support is expired...)

meager fog
#

@tidal kiln none so far - this is really fun πŸ™‚

#

@ionic elk rant all ya want - no dumb questions or comments - this stuff is super hard!

ionic elk
#

I'm probably going to get an old tower into A2 this week and make the beefiest Linux machine I have ever used.

#

And then mostly use it for stuff I could run on a raspberry pi

#

I'm noticing that when reading addresses out of my flash, they seem suspiciously empty for a drive that's complaining about being full...

meager fog
#

@ionic elk :/ could start with a stub function that just writes to a block, then use plain gcc not in cicuitpy to read/write from it

#

see whatcha get

#

i remember on avr8, there was a lot of confusion because a 'word' when writing is 16bits, but when reading, i think it was 8 bits

#

addressing was done by word, so you had to count your 2's πŸ™‚

ionic elk
#

I just dumped the entirety of my flash memory to a file. I'm confident that I don't have data corruption, since it works, and when looking at the file the blocks of file data don't seem to have any weird "spacing", but there are massive empty gaps between each chunk of data.

umbral dagger
#

What's the root cause of "RuntimeError: SDA or SCL needs a pull up"

#

And, yes, the breakout has pullups.

main meteor
#

I'm guessing it does a quick check at initialization to see if those two pins read high.

umbral dagger
#

Refining: why does it think it needs pullups when they are already there? I've seen this happen occasionally for no visible reason.

main meteor
#

I've seen a few people have issues with it, so it might be worth investigating.

ionic elk
#

Ok, I've got more data on the flash, maybe someone can help me recognize what this is. I've got three issues:

  1. the flash is slow. best I can tell, this is just not having a cache and not writing in bigger chunks. Should be fixed but not that big a deal.
  2. the flash is reporting itself as a full sector smaller than it is: 32K out of 48K allocated for it. Weird, proving hard to track down, but also not the biggest deal.
  3. the flash is massively and erratically overestimating the amount of space needed for certain files. Nevermind it's just my mac putting literally 10K+ of cruft into the drive THANKS APPLE GOOD JOB πŸ‘ πŸ‘
raven canopy
ionic elk
#

@raven canopy Thanks!

timber mango
ionic elk
#

I can prevent it by switching to linux πŸ˜‰

raven canopy
#

yep. i can grab an nRF one too (PCA10056 dev board is all i have handy and setup)

#

also. flash on the SAMD51x19 is 512k, if you want a larger look.

ionic elk
#

@raven canopy that shouldn't be necessary. the SAMD one should be sufficient for debugging the drive size issue, and beyond that, my biggest issue was dumbest one - that every time you add a .mpy or .py file, Apple adds a 4K invisible cruft friend.

raven canopy
#

yeah, it does that. there is a trick to avoid it, iirc.

ionic elk
#

That's great, thanks.

#

Feel like a huge idiot, though. At least I made some progress on a new caching system.

raven canopy
#

hehe. i have them feels on the daily.

timber mango
#

@raven canopy yes that's the way to go, but unfortunately you'd have to do it every time when plugging in a new board. On that page I linked they also list a command to prevent .DS_store creation on any external drive, so that's something.

ionic elk
#

hmm can you guys still see my posts? bot just yelled at me - I guess all forms of waste are off the table?

#

even mac generated ones

timber mango
#

Yes

raven canopy
#

@timber mango yeah, that's the downside. but, also why boards ship with the . files on the flash drive. no way around it for getting a new board running though. πŸ˜‘

#

@ionic elk yeah, @digital shore runs a tight ship.

#

though, yours was a rather benign one.

ionic elk
#

I thought so too, figured dog park descriptors would be ok, but I guess not

onyx hinge
tawny creek
#

Cool! It kinda looks like an m4 with an esp but that's the serial chip eh

exotic pumice
#

bit odd to have an esp in a usb port seeing as it has no usb

tawny creek
#

@exotic pumice new ESP32 variant will have usb

exotic pumice
#

yeah I know

onyx hinge
#

@exotic pumice I can't explain that

solar whale
#

Isn't that what the FTDI chip provides (USB - UART bridge)?

solar whale
manic glacierBOT
#

This PR adds SPI support to the STM32 F4 series, starting with the STM32F412 for testing purposes.

Seeking feedback in particular on clock settings. Boards like the F412 are configured by default with a peripheral bus clock of ~100MHz, and the max clock divisor for SPI speeds is 256, capping the minimum speed for SPI at 390kHz. Many libraries assume speeds much, much lower than this, such as the BMP280 sensor, which by default uses 10kHz. While it's easy to simply set the baud higher (the ...