#circuitpython-dev

1 messages ยท Page 262 of 1

manic glacierBOT
manic glacierBOT
#

OK, this is actually a manifestation of a bug in atmel-samd/tick.c, plus the bug in clear_temp_status(). It's supposed to do a filesystem flush once a second, but it's failing to do that. So the nrf port is actually doing the right thing, but in the process of checking whether to flush the filesystem, it's changing the status neopixel color without checking whether someone else is using neopixel.

The filesystem flushing should probably not fiddle with the status color unless it actuall...

manic glacierBOT
#

Fixes #2114.

  • clear_temp_status() now checks whether status NeoPixel or DotStar is in use.
  • in atmel_samd/tick.c, SysTickHandler() ws not calling filesystem_tick()

There is very similar code in the different versions of ports/*/tick.c which should be factored out eventually into common code. That's part of why the second bug above existed. Since we should rewrite the timing code anyway for #696 (sleep and wakeup), I don't think it's worth refactoring right now.

manic glacierBOT
#

Environment:
Adafruit Feather M4 Express with samd51j19
5.0.0-alpha.2 on 2019-09-04
CP Lib Bundle 20190907

The code below attempts to update the text of a displayio Label on a 2-color EPD FeatherWing, but only the first iteration is displayed. Text does not update after the first iteration on the 2-color EPD. It goes through its flashing motions, but the same text appears again in every loop. print() output shows the code is progressing through its loops with the 2-color EPD.

Similar...

manic glacierBOT
#

Environment:
Adafruit Feather M4 Express with samd51j19
5.0.0-alpha.2 on 2019-09-04
CP Lib Bundle 20190907

The code below attempts to implement the Sprite Sheet example from:
https://learn.adafruit.com/circuitpython-display-support-using-displayio/sprite-sheet
...by adapting it to the timing requirements of EPD displays (e.g., time.sleep(display.time_to_refresh))

The first iteration through t...

indigo wedge
plucky flint
#

๐Ÿ‘‹

timber mango
#

@onyx hinge you have written that sometimes your computer (linux) locks up?!
i have a eventually similar / related problem sometimes here:

  • ItsyBitsy M4 Express (about newest UF2 bootloader)
  • Kubuntu 19.04 64bit
  • Laptop: Dell Latitude E6510 (~9Years Old..)
    i currently mostly upload Arduino firmwares - this with the Bootloader and the UF2 drive thing.
    sometimes my computer locks up - in a way i only can do a hard shutdown...
    i think it has to do with the usb hardware/software and the multiple & fast enumerations....
    and till now i did not had patience to investigate more time into this...
manic glacierBOT
#

When I build the current master on my Mac , I see these "find: illegal option -- t" errors.
The errors do not appear to impact the build, but I don't see where they are coming from.
I don't see them for any other board.



Build stm32f411ve_discovery for en_US took 33.03s and succeeded
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
find: illegal option -- t
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]...
manic glacierBOT
#

I suspect it's due to this line in Makefile

FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py')

plus the fact that FROZEN_MPY_DIR is probably empty or unset.

Linux "find" treats find -type f as find . -type f (i.e., it searches starting at the current directory) while bsd-derived find seems to require at least one path to be specified.

I suggest to protect the use if FROZEN_MPY_DIR with ifneq ($(FROZEN_MPY_DIR),) as in stm32/Makefile as a pos...

onyx hinge
onyx hinge
#

hm, the schematic says it has "4Mb flash" (SPI connected). I wonder if that's 4Mb = 512kB, or 4MB.

main meteor
#

I'm guessing 4Mb (512kB), but since the part number isn't given and I can't read it on the board pictures, I suppose the next step would be to download the EAGLE files and see if the part is defined there. There is a zip file in the github, but I don't know if it contains a BOM or not.

onyx hinge
#

yeah no part number is visible on the schematic. I didn't bother trying to download the eagle file

#

"You have an order status of Exception. Don't worry! This order just requires a quick review by our Customer Service team before it can ship" blah! (sparkfun -- I decided to pick up one of those thing plus boards, plus another $180 of stuff I probably don't need ๐Ÿ’ฐ )

main meteor
#

I just had my shipping switched to FedEx on a Digikey order because something (I'm guessing flux remover) required special handling.

old smelt
#

@main meteor and @onyx hinge - I just happen to have a Thing Plus on my desk and a microscope within walking distance. The part number on the memory is 25SF041, and it's an Adesto part.

main meteor
#

That's a definitive answer, thanks! Sure enough, it's 4Mb = 512kB.

#

I love it when people "just happen" to have a microscope (and the object of interest) at hand.

onyx hinge
#

thanks @old smelt !

old smelt
#

You know... There's really no good "You're welcome" emoticon, is there?

manic glacierBOT
lone sandalBOT
stuck elbow
#

@old smelt probably because it's not an emotion

tulip sleet
#

@indigo wedge There is no movement toward replacing SAMD. STM Arduino support is not great, and there are still plenty of Arduino users of our boards. Some STM chips have quirks, such as not enough USB endpoints, etc. The more chips we can support, the larger the ecosystem.

indigo wedge
#

Great to hear ๐Ÿ˜Š

#

Just wanted to make sure cause I have boards in the pipeline that use CP and they are samd

manic glacierBOT
idle owl
#

@tulip sleet Question about cap touch on Bluefruit when/if you're around.

tulip sleet
#

@idle owl ok back

idle owl
#

@tulip sleet Ok. Does the same CircuitPython "calibration" concept apply to the Bluefruit as the Express, as in on board start-up, it calibrates based on what's connected to the touch pads?

tulip sleet
#

yes, but Nick picked a different threshold calculation method:

    self->threshold = raw_reading * 1.05 + 100;
#

if that seems like its not consistent, then we can change it

idle owl
#

For the purposes of this, that isn't relevant. I wanted to make sure the bit in the guide that said to reboot the board if you're getting weird readings was still accurate or if I needed to add a note about the Bluefruit

#

Good to know, I'll keep that in mind

tulip sleet
#

the old one is just "not touched value" + 100

idle owl
#

Huh ok

tulip sleet
#

ok, sounds good

idle owl
#

What's the 1.05 do then?

#

5% added to it for a better buffer?

#

Or a more "relative" buffer anyway..?

slender iron
#

@onyx hinge @old smelt would love to support thing plus! just haven't gotten a pr from anyone to add it

tulip sleet
#

yeah, maybe, I'm not sure how he arrived it, and how much experimentation he did

slender iron
idle owl
#

It kind of makes sense because +100 could be minute at higher readings.

#

Anyway, good to know, I'll keep that in mind in the event we get feedback on it.

tulip sleet
#

I did a lot experimentation to get 100. It used to be a much higher multiplicative threshold. But i saw that the touched/not-touched values were not scaling when the wire got longer

idle owl
#

Interesting

#

I do remember it being terrible for a while.

#

The backflips I had to do to get the key limes to work on that first project were ridiculous.

tulip sleet
#

yes, it was way too insensitive

idle owl
#

They interfered with each other so badly.

#

I obviously assumed it was something I was doing. Until JP ran into the same thing and we fixed it. ๐Ÿ˜„

sterile bronze
#

@idle owl , @tulip sleet what I've done in my programming for cap touch and ldr connections is a run a calibration at boot up that reads the pin for 100 to 200ms and save the highest raw value read and then add 100 to the value. This usually works well for calibrating the input threshold.

tulip sleet
#

@sterile bronze do you mean in CircuitPython or using something else? We read the value when the TouchIn object is created, but just once, and then add 100 (for QTouch/FreeTouch on SAMD21)

sterile bronze
#

In CP I usually add it to my program but I have done this for other boards when the pin is assigned. I haven't written any bootloader files for CP.

idle owl
#

Is microcontroller.cpu.temp supposed to be in 0.25 degrees C increments?

tulip sleet
#

@idle owl not deliberately, but it might come out that way. I wouldn't write that down

idle owl
#

@tulip sleet Hmm ok. Thanks.

tulip sleet
#

it might be due to the granularity of the reading. There was just a formula to apply to the raw values

sterile bronze
#

The boot up time for the CP boards is very fast, which is very nice, so it may not be practical to add it when the pin assignment is done. Most of my previous work has been at the industrial end on dedicated machines.

idle owl
#

@tulip sleet Because it's definitely coming out that way on the Bluefruit.

tulip sleet
#

@sterile bronze since we assign pins dynamically, we wouldn't check until the pin is claimed for touchio

idle owl
#

My screenshots in the guide imply that it wasn't the case on whatever board I used for the screenshots.

tulip sleet
#

hmm, ok, you could just say the precision is 0.25 deg C. I'll look at the code.

manic glacierBOT
idle owl
#

The guide page is meant to be general to apply to all of the boards. Except it refers to the ATSAMD21. So I'm assuming we wrote it before we had M4s.

manic glacierBOT
idle owl
#

I guess I should test it on an M4.

tulip sleet
#

@idle owl hmm ok, data sheet says:
6.28 TEMP โ€” Temperature sensor
The temperature sensor measures die temperature over the temperature range of the device. Linearity
compensation can be implemented if required by the application.
Listed here are the main features for TEMP:
โ€ข Temperature range is greater than or equal to operating temperature of the device
โ€ข Resolution is 0.25 degrees

manic glacierBOT
idle owl
#

Hmm

manic glacierBOT
tulip sleet
#

so you can say that in the CPB guide. On the SAMD chips, there's a much more complicated formula to compute the value, involving multiple readings and calibration values

idle owl
#

We're not really doing separate pages for the CPB, so it'll have to be a note on the general page. And it's the same part on CPX, which I'm testing now.

#

oh wait

tulip sleet
#

are you using microcontroller.cpu.temperature? That's what I'm talking about

idle owl
#

I was thinking thermistor.

#

Yes that is what I'm talking about.

#

I conflated the two in my head just now.

#

So the nRF has 0.25 resolution.

#

is the important piece of information here. And the ATSAMD do not.

tulip sleet
#

yup. It actually returns an integer which we divide by 4

idle owl
#

Hmm ok

manic glacierBOT
idle owl
#

Same for M4?

tulip sleet
#

but no reason to say that

idle owl
#

Right

tulip sleet
#

M0 and M4 are similarly complicated but not the same

idle owl
#

But the resolution on the M4 is like the M0?

#

Trying to figure out what I need to add to this page as notes.

tulip sleet
#

one thing about terminology: we casually say M0 and M4, but those are really ARM architecture designations. The SAMD21 is an M0, the SAMD51 is an M4, and the nRF chips are also M4.

idle owl
#

Good call.

tulip sleet
#

so I'd avoid using M0 and M4 to designate classes of boards, use SAMD21 and SAMD51 and nRF52840 instead

#

looking in SAMD51 datasheet

idle owl
#

Right, I'm fixing that now on this page.

#

I'll go check the others.

tulip sleet
#

there's no defined accuracy or precision for the temperature sensors on-chip on SAMD21 and SAMD51

idle owl
#

Ok

#

I'll dig out a SAMD51 and test it simply to see

tulip sleet
#

the raw values are taken from ADC readings, and then there's a formula using multiple calibration values to calculate the final value. The SAMD51 datasheet is actually incomplete about how to use the ADC to get the temp: I had to do trial and error to see what worked

idle owl
#

Fair enough

#

Complicated like you said.

onyx hinge
#

Should I chuck in an issue for samd51 thing plus in the u2f bootloader repo too?

#

er u2f must not be what I mean

#

uf2

#

or maybe it already has one

idle owl
#

@tulip sleet SAMD51 looks like 21 in terms of 4 decimal places returned for temp. Thanks!

onyx hinge
#

"In addition, this board comes flashed with the same convenient, UF2 bootloader as the RedBoard Turbo." yay

tulip sleet
#

@idle owl do you mean you see slight variations in the 4th digit? printing 4 digits is just the size of the floats.

#

and the accuracy is much worse than that

idle owl
#

No, I guess I didn't compare the two, I simply checked the resolution.

#

We explain in the guide it's not accurate or precise.

#

But that it's close

manic glacierBOT
manic glacierBOT
#

Opening new issue to narrow focus of #1933. See that issue for original details.

run_background_tasks() calls a number of routines that need to run in the background. Some of these do extensive checking to see if there's anything to do. The overhead of these routines could be reduced to save a substantial amount of time (like another factor of 2).

run_background_tasks() is called in after the completion of every jump opcode and every return in vm.c. So an improvement here would sp...

tulip sleet
#

@onyx hinge we thought you might be a good choice for working on #2142 above; added to Basecamp

manic glacierBOT
onyx hinge
#

I saw some signs that j-link can do detailed instruction level coverage reporting, which would be useful in answering just how many cycles background tasks slurp up when they are called. I will have to see whether I can get that to work.

tulip sleet
#

@onyx hinge I think you can just set the USB background on a 1ms intervl and comment out most or all of the other background tasks, and then put them back one at a time. I think that will still lead to a functioning CPy, and you'll be able to measure each one, and how improvement to each task's overhead contribute

#

as I mentioned in #1933, I was able to get CPy 3.x to run with no background tasks for a little while, and so got an upper bound on improvements

old smelt
#

Is STEMMA QT intended only for sensor boards/small devices? The documentation kind of leans that direction. The QT connector is nice and compact + QWIIC compatible which is dandy.

#

It looks like the new Feather STM32F405 uses the QT connector. So, apparently that's cool? Just verifying...

meager fog
#

yep will have a stemma QT

#

its back compatible with qwiic - only diff is it will work with 5V or 3V

#

QT is for..cutie ๐Ÿ™‚ smaller connector! great for lil breakouts

old smelt
#

Great, thanks!

meager fog
#

sensors are 0.7x1.0" whenever possible

#

bigger when they have to be

old smelt
#

We have something of a requirement for QWIIC, but like the STEMMA a lot. QT solves the problem.

meager fog
#

yep works just fine with 3V logic

#

more sensors coming soon

#

lemme know if you have any requests

old smelt
#

Will do!

idle owl
#

@pastel panther Is MSA301 not in the bundle for a reason?

pastel panther
#

Likely I forgot?

idle owl
#

That's fair. Wasn't sure if it was WIP or something.

#

Looks like the only important one missing from the bundle.

pastel panther
#

ah poop, gimmie a minute

idle owl
#

No rush, simply ran the check to verify.

pastel panther
#

ya, It'll just take a sec and then I won't have t remember again

idle owl
#

Right on

indigo wedge
#

๐Ÿ˜„

idle owl
#

@pastel panther I requested changes, in case it didn't notify you.

pastel panther
#

@idle owl Didn't check my email yet. I responded

idle owl
#

Ah ok, no worries

#

@pastel panther Thanks!

pastel panther
#

@idle owl Bitte

idle owl
#

And since I'm refactoring a lot of the CPX code right now, now's the time to do it if we want to.

tulip sleet
#

@idle owl, no I think it's fine

idle owl
#

Right on, thanks

onyx hinge
#

obsessively removes vias from a board design in eagle

pastel panther
#

๐Ÿ‘€

#

@idle owl or other mac users: Do you have any idea how to keep OSX from pooping ._adfruit_foo.mpy files into my lib when I try copying over the bundle?

#

Or am I strange?

manic glacierBOT
ionic elk
#

@slender iron let me know if you could take a quick look at my comments regarding the bit packing, as they'll impact the wrap-up of analogio as well.

slender iron
#

@ionic elk I'll look tomorrow. In the ble weeds at the moment

idle owl
#

For circuitpython.org are the names of the boards on the downloads page pulled from the circuitpython-org GitHub or are they pulled from CircuitPython itself?

#

@gilded cradle Do you know? ^^

slender iron
#

@idle owl the human readable names are from the -org repo

idle owl
#

@slender iron Ok thanks. One of them is wrong. Wasn't sure where to fix it.

orchid basinBOT
gilded cradle
#

@idle owl sounds like scott answered your question already

idle owl
#

Yep, sorry to bug you! Scott seemed busy so I figured I'd ask you since you dealt with it a bunch.

#

Thanks for the merge!

gilded cradle
#

yw

idle owl
#

@gilded cradle Yeah I wasn't sure whether it applied to that name, and if it didn't, figured it wouldn't be in the guide. So I asked instead.

gilded cradle
#

Makes sense ๐Ÿ™‚

idle owl
#

Ok off to assemble a bunk bed. Later!

gilded cradle
#

Have fun

manic glacierBOT
slender iron
#

@tulip sleet you around?

tulip sleet
#

yep

#

@slender iron yep

meager fog
#

@ionic elk hiya if ya give me a bin for '412 ill test it now!

ionic elk
#

It's a draft! Let's start the testing process in full after Scott gets a chance to review the bit packing stuff tomorrow and I integrate it in there.

meager fog
#

oooh ok

#

np

onyx hinge
#

hmmm what to do tonight

#

๐Ÿ‘ผ . o O ( Work on something assigned ) ๐Ÿ‘น . o O ( Work on something fun )

#

๐Ÿ‘ผ . o O ( Tidy your working area )

onyx hinge
#

hmmmm

#

so this can be made to "work", except it wouldn't survive from boot.py, contrary to micropython: ```>>> import busio, board

u = busio.UART(board.TX, board.RX)
u.mirror_console = True

meager fog
#

@onyx hinge lol

#

what did you decide?

onyx hinge
#

@meager fog to work on something fun of course

meager fog
#

yayyy!

#

fun is FUN

onyx hinge
#

๐Ÿ™‚

meager fog
#

still count it towards your hours if its circuitpython

#

since your idea of fun is still, umm, work

onyx hinge
#

I have a project to hook some kind of python-on-hardware board to a Commodore 64 like a good old fashioned serial modem

#

I will keep that in mind, thanks.

meager fog
#

hmm over the uart? you should be able to, we talk to cell modules over AT

#

did you end up grabbing any nrf feathers?

onyx hinge
#

Yeah, I can talk to it via UART, but what I would LIKE is for the code.py print() to talk to it, for the repl >>> to talk to it, etc.

#

Yeah, danh alerted me and I think I got an order in on the last one in stock

#

so as far as concrete learning goes, I now know what the heck it means when it is written: MP_STATE_VM(serial_mirror_obj) = (mp_obj_t)self; -- I still couldn't explain it though.

meager fog
#

oof

#

yeah i dont knwo we have repl redirection

onyx hinge
#

micropython has a form of repl redirection, but I couldn't get it to work 100%, and it is not at all configured to work with how circuitpython works

#

the way they do it in uP depends on how the hand-off from boot.py to code.py works, and that's different in CP totally

#

I hear scott is motivated to work on this too, because he wants to do a bluetooth keyboard + displayio screen as standalone

#

@meager fog btw thanks for taking good care of me. I look forward to having fully half my time to spend on CP stuff in November. I know you're busy, but it would be nice to have an actual conversation with you sometime as well.

meager fog
#

sure ๐Ÿ™‚

#

i been around for 14 yrs and will be around for at least another 10

onyx hinge
#

That is a good plan to have

old smelt
#

About a month ago, I opened a bug for displayio that has been added to 5.x.x-Bug Fixes. I presume that if I wanted to hack away at a fix for this, I would need to create an environment where I could do full build of CP, right? I'm not a C programmer, so this could be an interesting exercise.

onyx hinge
#

@old smelt Yeah that would be a first step. What environment are you usually in -- mac, linux, windows?

meager fog
#

@onyx hinge yah repl redirection is cool - i think...poke at it for a bit. but if it looks like more than a day's effort lets keep cuttin' out those audio bugs so we have super awesome audio. another thing to check btw is that you can do displayio without audio cutting out (display will be slower of course). as is, audio irq starves

old smelt
#

Mac

meager fog
#

check the guide we have

#

its pretty good!

old smelt
#

...generally, though I flexed some old Linux muscles last weekend and put Ubuntu on an old Windows laptop

meager fog
onyx hinge
#

@old smelt you can totally do it on mac

meager fog
#

im on win10 but most others are on macos

old smelt
#

A-ha! Thanks for the link.

onyx hinge
#

@meager fog yeah I will check out what I can see on my pyportal with display.

old smelt
#

I recall seeing that before, but I couldn't recall where I had seen it.

meager fog
#

jep, i am psyched about all the bugs you're finding & closing - epic work there!

onyx hinge
#

@meager fog so far on nRF I approached it by putting in more BACKGROUND calls, which is .. not ideal. Do you see a different route? (and yeah ful repl redirection/duplication looks like much more than one night of a half-handful of hours)

meager fog
#

i dont know - it may not be totally solvable without preemptive handling

onyx hinge
#

I will also try to ask scott what he says and check back over what he has written on previous issues I can find.

meager fog
#

which is like "man why did i build an rtos in python"

#

like right now 3 things happen in the bg

#

usb, audio and display

onyx hinge
#

yeah, only "audio" might now be 3 or 4 different kinds of audio, etc.

meager fog
#

audio should get priority because its interrupt-based

#

oof its not one buffer?

onyx hinge
#

I sure have imagined setting up some kind of deadline system

#

on nRF, unfortunately not. Their "easydma" means that each individual peripheral manages its DMA through unique registers within the periph

#

they even do double buffering at least two different ways

#

(PWM is one way, PDM and I2S are similar)

meager fog
#

hmm i see what you're saying

#

you cannot know when the current task completes

onyx hinge
#

there are interrupts that could be enabled of course, and the EVENT registers are quick to check

meager fog
#

yah its not a big big deal

#

audio is v hard

onyx hinge
#

also with audio you don't really know how many ms of audio one "chunk" is, it depends on lots of details. I think WaveFile is tuned to try to read about 1 block from flash per call but I'm not 100% sure of that assessment. But 512 bytes can be anywhere from 64ms (8kHz, 8bit mono) to 3ms (44.1kHz, 16bit, stereo)

meager fog
#

right

onyx hinge
#

so .. interrupts to set flags, quick checking of event-done registers, having some kind of deadline scheduler in the background stuff, ... I dunno what all to do. but it still all depends on anything long-running cooperating, too

meager fog
#

ok well, dont need to do it - just think on it as you do other stuff

#

if it comes to you in a flash, gr8

#

if not, it works as is

onyx hinge
#

haha okay

#

I will also be thinking awful hard while I'm on vacation. Anything I should pick up for my work while I'm in japan for 3 weeks? ๐Ÿ˜‰

meager fog
#

enjoy your break!

onyx hinge
#

I am sure I will. It's a new destination for me.

meager fog
#

if you have a hankerin' you can always take a pygamer/pybadge or circuit playground bluefruit with ya

#

they're small

onyx hinge
#

haha haven't been able to find them in stock yet

#

well I have a cpb

#

I should take that, and finally learn anything about bluetooth

#

it's bedtime here! ttyl and thanks again

#

this is a blast

manic glacierBOT
plucky flint
#

๐Ÿ‘‹

fluid moss
#

Nicholas!

old smelt
#

I'm trying to get a CP build going on my Mac, and I'm getting the following error out of Make:

GEN build-pyportal/genhdr/mpversion.h
python ../../py/makeversionhdr.py build-pyportal/genhdr/mpversion.h
make: *** No rule to make target `freetouch/adafruit_ptc.c', needed by `build-pyportal/genhdr/qstr.i.last'.  Stop.```
#

?

onyx hinge
#

@old smelt looks like you did not get the "submodules".

#

checking for a doc link for you...

#
git submodule update --init --recursive
``` these steps should have done it, but maybe they encountered errors -- documented near the top of https://learn.adafruit.com/building-circuitpython/build-circuitpython under "Fetch the code"
Adafruit Learning System

How to build CircuitPython yourself on different platforms

#

.. run those submodule commands from the top directory of circuitpython, which is different than what that gif included above shows

old smelt
#

Darn... I did forget to do that.

#

Thanks!@

#

BTW - the guide suggests creating a case-sensitive image for the builds. Any recommendations for size? How big will this thing grow when doing the builds?

main meteor
#

It's not huge. I set up a 10GB disk image for building CP, and only 1.2GB are used.

old smelt
#

Thanks @main meteor. Still bigger than I was expecting, but gives me some guidance.

solar whale
#

IIRC the only reason for the case-sensitive FS was for ESP8266 which is no longer needed. I don't think it is necessary.

old smelt
#

oh really?

#

Ok - that's good news. I'll try without the separate image.

#

I just didn't want to chase unnecessary issues.

main meteor
#

There's some other stuff in there, principally the library bundle, and some bitmap and display code I'm working on. OTOH, it's not up to date, so if CP 5 is larger, it might take up more room.

solar whale
#

I just built the curremt master on my Mac in a standard FS

old smelt
#

Speaking of CP5... How do I know what I am building, anyway?

solar whale
#

the master branch is latest code -- bleeding edge -- you have to select a branch or tag for something else -- then make sure you reload the appropriate submodules!

old smelt
#

Got it.

#

That works for me

#

And, we're off! All cooling fans are on high alert!

old smelt
#

Success! Thanks @solar whale, @main meteor, and @onyx hinge .

solar whale
#

I recommned checking with @tulip sleet regarding the need for the case-sensitive FS in case something has changed.

#

I don't use my Mac much for building CP -- normally on a Linux box, but I like to keep my options open!

#

It certainly seems to build OK with out it.

old smelt
#

Will do.

old smelt
#

Directory grew to ~820MB with this initial build.

manic glacierBOT
#

Iโ€™m having similar issues with the PCA10059 connected to a Raspberry Pi 3. I copied adafruit_ble and adafruit_bluefruit_connect libs to the PCA10059. They use 75.1K of storage. I then loaded a simple BlueTooth test:

from adafruit_ble.uart_server import UARTServer
from adafruit_bluefruit_connect.packet import Packet
from adafruit_bluefruit_connect.button_packet import ButtonPacket

uart_server = UARTServer()

while True:
    # Advertise when not connected.
    uart_server.st...
manic glacierBOT
#

Environment:
Adafruit Feather M4 Express with samd51j19
5.0.0-alpha.2 on 2019-09-04
CP Lib Bundle 20190907

The code below attempts to implement the Sprite Sheet example from:
https://learn.adafruit.com/circuitpython-display-support-using-displayio/sprite-sheet
...by adapting it to the timing requirements of EPD displays (e.g., time.sleep(display.time_to_refresh))

This code works on the 2-color EPD FeatherWing (switch the True/False on the board flags below).

Can't completely cha...

ionic elk
#

@tulip sleet is there a reason why the microcontroller pin interface is inconsistent about whether it takes pin information directly, or a pin object? For instance, the claim_pin function takes a pin object, but most others take a packed pin number. Is there a good reason against making them consistent one way or the other? Just kind of a stylistic choice.

#

I guess I just don't understand why "claim pin" should use an object, but "reset pin" should not.

onyx hinge
#

@ionic elk this impression is halfway baked, so take it with a grain of salt. Some of these I/O objects (like I2C and SPI right now) need to be able to survive reboots of the Python interpreter. That means that their members shouldn't be Python objects, and leads to storing the integer pin identifiers instead. I became aware of this only last night while working on UART console but even if this is not the REASON it sure is important for facilitating this.

ionic elk
#

If it is, I think there should be a note of that in the file itself.

onyx hinge
#

sure, I can agree with that statement

#

and I may be way off base with my assessment too

ionic elk
#

What uses the I2C and SPI raw right after a reset like that?

onyx hinge
#

displayio

#

it maintains the connection to the display over python reloads

#

I think this may all stem from scott's displayio work in 5.0

ionic elk
#

does it also go in and claim those pins pre-emptively?

onyx hinge
#

yeah there is a function called something like never_reset_pin which it passes those pin numbers to

#

@slender iron can you weigh in on any of this? I'm going 80% on guesses here

ionic elk
#

That makes sense, generally. I guess my issue is that since this is a port-level interface, not a common_hal one, the interfaces between ports are starting to get very inconsistent.

#

Scott's currently recommending that we use bitpacked fields, which means all my functions are going to have two parameters, specific to stm32, instead of a single packed int.

#

claim_pin won't have that problem

#

I don't know if any of this matters really though.

onyx hinge
#

I did see some of this discussion go by, but I can't say I followed it all. It's entirely possible that scott is wrong (for instance, if his design means you can't really implement reset_pin, it is probably not a design to continue with!) and until you are confident he understands your concern, you should continue to work to help him understand.

#

(but at the same time, if it becomes clear to you that either choice is going to work out technically, then I would personally accept his preference after making my best case about whatever the topic is..)

#

afk for some lunch!

ionic elk
#

Yes either will easily work technically, this is really just a style choice. Thanks for the power cycle info, @onyx hinge

slender iron
#

claim pin could take the number as well. reset takes it already so that python objects only need to store the number (1 byte) instead of the pin object pointer (4 bytes). It has nothing to do with the displayio lifetime stuff. pin objects are static and live forever too

#

@onyx hinge I think the audio playback smoothness might just be a matter of having larger buffers to allow for larger gaps between background calls

manic glacierBOT
#

A power cycle + a with open... OnDiskBitmap construct also seems to kick refresh back on after it's frozen:

with open("/display-ruler.bmp", "rb") as bitmap_file:
    g = displayio.Group(max_size=1)
    odb = displayio.OnDiskBitmap(bitmap_file)
    tg = displayio.TileGrid(odb, pixel_shader=displayio.ColorConverter())
    g.append(tg)
    try:
        time.sleep(display.time_to_refresh + 1)
        display.show(g)
        display.refresh()
        print("Ruler   ", display.ti...
idle owl
#

Ok, I hit the audioio/audiocore issue.

#

@onyx hinge Are you around? I'm guessing not.

#

@slender iron Is there no audioio in CircuitPython 5.x for CPB?

slender iron
#

correct

idle owl
#

Related: is there a way from the REPL to list all the available CP modules?

slender iron
#

help("modules") iirc

idle owl
#

Ok. How do you do AudioOut then?

slender iron
#

with the audiopwmio

#

something like that

idle owl
#

Ok

#

Found it. Thanks.

#

@slender iron Is the audiopwmio specific to the CPB or is it a 5.x change? As in, are all boards switching to that or is it an nRF situation?

slender iron
#

it's an nRF thing

#

because it doesn't have a DAC built in

idle owl
#

Ok

#

Thanks

slender iron
#

np

onyx hinge
#

@idle owl did Scott get you the info you needed?

idle owl
#

@onyx hinge Yeah, but I'll want to discuss some more details with you later if you're around.

onyx hinge
#

@idle owl how's 7 or 730 us Central work for you?

manic glacierBOT
#

In general, I dislike the "fill out a large struct and pass it in style" that HALs typically have because a lot of code is unneeded. However, if the HAL will make it easier to use code across stm families then it might be worth it.

I'm not sure if the low level code is best because it can cause consecutive writes to the same register rather than setting things all at once. Is it possible to write to a register directly via a struct? Does the LL API abstract us across families still?

idle owl
#

@onyx hinge 7CT should work.

onyx hinge
#

Feel free to ping me but I think I'll be home

idle owl
#

Right on, will do.

idle owl
#

@onyx hinge 7:30CT might work better or possibly 7:45. I'll ping you later to confirm.

onyx hinge
#

Okay

meager fog
#

@tidal kiln p0ng

tidal kiln
#

p1ng

meager fog
#

@tidal kiln whatcha hackin on

tidal kiln
#

misc. doing a general house cleaning sweep.

#

basecamp / gh / forums / etc.

#

got something specific?

manic glacierBOT
#

@tannewt The LL libraries do abstract us completely across families, as does the HAL. I'd personally recommend we use one or the other, since writing to the registers directly will almost certainly cost portability, some of which could be pretty deep magic.

In terms of comparison, if you don't like the extra "chaffe" of the HAL I'd say the LLs are about as efficient as we're going to get - I don't think I've even reduced that section down as much as I can yet, I'm still reading through th...

meager fog
#

@tidal kiln lemme think - well, dya wanna try that recorder project with the cplay ble?

#

its faster, maybe works now?

tidal kiln
#

sure. can at least try it and see what happens.

manic glacierBOT
manic glacierBOT
solar whale
#

Are there any actual differences between the 4.x and 5.x bundles at this time?

manic glacierBOT
solar whale
#

there is no difference between the VERSIONS.TXT files so I guess not.

idle owl
#

@solar whale No, it's to continue the way we have been to alleviate confusion as to which bundle to use.

solar whale
#

@idle owl OK -- thanks -- I get confused easily ๐Ÿ˜‰

crimson ferry
#

diff reported that the .mpy files may differ, but I assume that's just build differences?

solar whale
#

I saw that too, I suspect is is just some stuff in the binary that contains build details.

#

I tried doing some binary compares of .mpy files and just get more confused ....

#

I'll look into it more another time -- I'd like understand the differences, but it's not critical now .

manic glacierBOT
onyx hinge
#

hm looks like I'll need to read that guide about running the linter locally ๐Ÿ˜€

#

yay local pylint

ruby atlas
#

yeah. as long as you remember before giving travis a workout ๐Ÿ™‚

idle owl
#

@onyx hinge In a meeting, so I can't test sound until we're done. I'll take a look at your PR in a bit here.

old smelt
#

Hi All - I did a local build of CP this morning, and I got a successful working UF2 which was pretty encouraging. It looks like it's CP 4, though:

#

Adafruit CircuitPython 4.0.1-5-g63b253c33 on 2019-09-11; Adafruit PyPortal with samd51j20

#

What do I need to do to build CP5?

#

Was I missing a switch?

onyx hinge
#

@old smelt any chance you simply transferred the wrong .uf2 file?

old smelt
#

Donโ€™t think so. Iโ€™ll double check though.

onyx hinge
#

what does git describe --tags from anywhere inside your circuitpython source say?

old smelt
#

It matches the rev nun I pasted above

#

4.0.1-5....

onyx hinge
#

okay, well, that at least makes sense then!

#

are you at all experienced with git at this point?

old smelt
#

Some yes.

slender iron
#

@old smelt what does your git log show?

onyx hinge
#

It seems like you have run a command to switch to the "4.x branch". This is the "git checkout" command, for example. Perhaps the guide suggested to do it without explaining what the purpose was.

#

since getting the source, did make any changes? If not, you can easily move to the branch for 5.x, which is called "master": git checkout master

old smelt
#

git log kicks a bunch of output. Anything specific you want to see?

#

But a lot of commit dates in May

#

@onyx hinge , no changes yet. Just running a pipe cleaner right now.

#

Mac terminal does mysterious things with command history, so I can't reconstruct my build commands very easily. Kind of annoying...

onyx hinge
#

OK, well, recommend doing git checkout master and then git describe --tags. Then, it should say something more like 5.0.0-alpha.2-55-g89fed709a

old smelt
#

Hmm:

#
Already on 'master'
Your branch is up to date with 'origin/master'.```
onyx hinge
#

git remote -v | grep origin says ?

exotic pumice
#

git pull

#

oh it says up to date

#

that's weird

#

git fetch?

old smelt
#

Ah -ha! I think I may have figured it out. I orginally fetched my fork on GitHub which would have been CP4

onyx hinge
#

@old smelt okay, that could def. explain it

old smelt
#

Ugh... Sigh.

onyx hinge
#

(though eventually, to create a pull request, you do need git to know about both adafruit's circuitpython and yours as different "remotes")

old smelt
#

Sounds good. I'll start with cloning the adafruit repo. Learning...

slender iron
#

I always name remotes after the github user

#

and then git checkout adafruit/master

idle owl
#

@old smelt You can add a remote that is the adafruit repo, and then fetch/merge that, and then push it to your repo to update.

old smelt
#

Ok

#

Thanks @idle owl

onyx hinge
#

yes, git gives you a lot of choices of how to manage things. you could sure git remote add adafruit https://github.com/adafruit/circuitpython, git fetch adafruit, git checkout -b my-new-branch adafruit/master^{} for instance

idle owl
#

@old smelt Let me know if it doesn't work for some reason and I can try to walk you through it in more detail. Or Jeff can beat me to it! ๐Ÿ˜„

onyx hinge
#

which would let you start on a branch called my-new-branch, beginning where adafruit's master branch is

#

(please please please don't ask what ^{} means, just roll with it ๐Ÿ˜ฌ )

old smelt
#

Ha! Okay...

#

Thanks for all the help.

#

Gotta go drive some cameras for a while. I'll try this out later tonight.

onyx hinge
#

see you later!

#

since you're interested in contributing a bug fix we are interested in helping you with the boring steps of getting git to work for you

idle owl
#

@onyx hinge What did you test the simpleio update with?

#

With the simple demo code I'm getting ValueError: A2 in use

#

Resetting the board didn't fix it.

onyx hinge
#

@idle owl I tested on Metro M4 and CPB. I used board.SPEAKER on CPB and board.A0 on M4

idle owl
#

Hmm.

onyx hinge
#

give me two minutes and I'll be back at my desk to check again. Are you on 4.1? I was on 5/master.

idle owl
#

I'm on a CPB running 5.x

#

Tried it with board.SPEAKER and it says AUDIO in use.

#

Was attempting to use a piezo on A2 first

#
code.py output:
Traceback (most recent call last):
  File "code.py", line 8, in <module>
  File "/lib/simpleio.py", line 97, in tone
  File "/lib/simpleio.py", line 49, in _AudioOut
ValueError: A2 in use```
onyx hinge
#

No other code imported?

idle owl
#
import time
import board
import simpleio

while True:
    for f in (262, 294, 330, 349, 392, 440, 494, 523):
        # For the M0 boards:
        simpleio.tone(board.A2, f, 0.25)  # on for 1/4 second
        # For the M4 boards:
        # simpleio.tone(board.A1, f, 0.25)  # on for 1/4 second
        time.sleep(0.05)  # pause between notes
    time.sleep(0.5)
#

PIezo worked on A2 using PWM only.

onyx hinge
#
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "kattni.py", line 8, in <module>
  File "simpleio.py", line 96, in tone
  File "simpleio.py", line 49, in _AudioOut
ValueError: A2 in use
``` OK me too
#

oh it plays one sound and then breaks. ๐Ÿ˜ฆ ๐Ÿ˜ฆ I am a bad programmer, it must be a problem in the core PWMAudioOut...?

idle owl
#

You're hardly a bad programmer. I'm not sure. Limor requested changes anyway.

#

Yeah one sound, then fails.

#

so something isn't deiniting I assume.

onyx hinge
#

yeah I bet I did not test that in core

#

I will file an issue in core for this. It would be useful if you verify it works on M0/M4 and 4.x right now, though

#

I will also look for Limor's requested fixes

idle owl
#

I'll test it on CPX running 4.x

onyx hinge
#

and yeah I shouldn't say things like "I am a bad programmer", it isn't helping anybody. It's just expressing how I feel in a moment, but it's a habit better off broken.

idle owl
#

@onyx hinge Works on CPX running 4.x.

onyx hinge
#

.. I'm going to evaluate a little more before declaring it a bug in core, I didn't reproduce it without using my modified simpleio yet.

#

but I'll follow up this evening after some more investigation

idle owl
#

Ok

onyx hinge
#

thanks for the quick testing! Please don't let me keep you from other stuff you need to do tonight.

idle owl
#

@onyx hinge Ok, so Limor wants me to do this try/except thing with importing audiocore as audioio to make the code the same, but in a piece of code that uses AudioOut and WaveFile how do you do that? Because it's two different things, audiopwmio and audiocore.

onyx hinge
#

quick and actually thorough

idle owl
#

You're welcome. I'm dealing with similar code at the moment it turns out.

onyx hinge
#

so you need to deal with the move of WaveFile to audiocore? Are you also trying to deal with AudioOut and PWMAudioOut at the same time?

idle owl
#

Yes.

#

So I can't simply import audiocore as audioio and audiopwmio as audioio it doesn't work that way

onyx hinge
#

first before I start giving a lot of advice, let me check on what the review notes on that simpleio PR say

idle owl
#

Ok.

#

I think she wants you to do exactly what I'm trying to do.

onyx hinge
#

Yeah, let me sketch that. I think it's a valid request/criticism.

#

this is nice, it gives me a break from locking up my whole computer trying to do clever things with UARTs

#
    from audioio import AudioOut
except ImportError:
    try:
        from audiopwmio import PWMAudioOut as AudioOut
    except ImportError:
        pass # not always supported by every board!

try:
    import audiocore
except ImportError:
    import audioio as audiocore
``` is what I have now.  Would that code potentially help with what you are doing?
#

it is probably better than what I had, I was trying to be too fancy

idle owl
#

That was close enough to get me what I needed. Thank you!

onyx hinge
#

oh hmmmm!

idle owl
#

This look rightish? ```python
try:
from audioio import AudioOut
except ImportError:
try:
from audiopwmio import PWMAudioOut as AudioOut
except ImportError:
pass # not always supported by every board!

try:
from audiocore import WaveFile
except ImportError:
from audioio import WaveFile```

onyx hinge
#

Yes I think that looks good

#

you want to just write WaveFile, not audiocore.WaveFile, when you use it

idle owl
#

Right, and AudioOut right?

#

The code works now

onyx hinge
#

right, no dots on either one

#

okay! It is actually a bug in nRF PWMOut that you found

idle owl
#

I'm finding all the bugs it seems. ๐Ÿ›

onyx hinge
#
>>> 
>>> import pulseio
>>> import board
>>> with pulseio.PWMOut(board.A0): pass
... 
>>> with pulseio.PWMOut(board.A0): pass
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: A0 in use
#

finding bugs is so valuable, thank you! I will file an issue on core

idle owl
#

Why did you import audioio first on the first try/except and audiocore first on the second one?

onyx hinge
#

that's a good question!

#

I wanted to put the "most 5.xish, most mainstream" choice first. So that means audiocore for where to find RawSample/WaveFile pretty clearly

#

for where to get AudioOut, I think that boards with real DACs (all the M0 and M4 pretty much, right?) are more prevalent, so that's audioio first

idle owl
#

Ah

#

Fair enough ๐Ÿ™‚

onyx hinge
#

I think you could make different arguments, but that is my thought process as I can reconstruct it

idle owl
#

Makes sense

manic glacierBOT
onyx hinge
#

now what is embarassing is that .. I am almost sure I ran into this and noted it as an issue to file the very first evening I set out to work on nrf52 "officially"

#

and did I file it? No. The dog ate my google doc

idle owl
#

I've had that happen!

onyx hinge
#

yay, fix in core is pretty simple. It's so easy to overlook things

manic glacierBOT
onyx hinge
#

oh pylint, why did I not run you myself

#

oh sphinx why did I not run you myself

old smelt
#

Progress:

Adafruit CircuitPython 5.0.0-alpha.2-55-g89fed709a on 2019-09-11; Adafruit PyPortal with samd51j20

manic glacierBOT
#

This is certainly in a "hacky-hack" stage. It

  • seems to work on nRF52840
  • almost certainly fails to build on every other platform
  • takes some liberties with existing HAL APIs and memory allocations
    but it does achieve the goal of letting you write in boot.py
import busio, board
busio.UART.make_console(board.TX, board.RX)

to get the regular REPL and program output mirrored both on USB (if attached) and via UART.

The platform build problem is of course surmountable; b...

onyx hinge
#

hum, I wonder if some of my problems with locking up are due to using the "-rt" kernel set. I booted into a "vanilla" debian kernel this last time, and haven't had a crash yet. ugh, I am used to the "-rt" kernel being pretty stable these days.

manic glacierBOT
plucky flint
#

๐Ÿ‘‹

cerulean sparrow
#

@onyx hinge What are you using that needs a hard realtime kernel? Seems like a large pain point when -lowlatency / -preemptive should handle a lot of cases.

onyx hinge
#

@cerulean sparrow I am a sometimes developer on LinuxCNC (http://linuxcnc.org) and expect to be doing more of that this fall/winter. It requires either the "-rt" kernel or even an RTAI-patched kernel, though the second option is becoming a more and more distant second choice. Usually being on debian's "-rt" kernel is just fine actually, but I'm hunting for any reason to explain how flaky my development experience has been lately.

main meteor
#

Might be time to do some forensics on your lockups/crashes.

manic glacierBOT
onyx hinge
#

They're always preceded with kernel GPFs like this one ```Sep 8 12:40:58 soba kernel: [80072.030736] general protection fault: 0000 [#1] PREEMPT SMP NOPTI
Sep 8 12:40:58 soba kernel: [80072.030745] CPU: 1 PID: 16427 Comm: kworker/1:3 Not tainted 4.19.0-5-rt-amd64 #1 Debian 4.19.37-5
Sep 8 12:40:58 soba kernel: [80072.030748] Hardware name: BIOSTAR Group TA970XE/TA970XE, BIOS 4.6.4 02/02/2012
Sep 8 12:40:58 soba kernel: [80072.030762] Workqueue: events acm_softint [cdc_acm]
Sep 8 12:40:58 soba kernel: [80072.030802] RIP: 0010:usb_clear_halt+0x16/0xc0 [usbcore]

topaz schooner
#

Is there a CircuitPython install guide for the Feather M0 Bluefruit? From everything I've read, it should install, but I don't want to brick my Feather.

main meteor
#

I wonder if the kernel doesn't like the board re-enumerating its USB port.

topaz schooner
#

Thanks.. I got my Feather M0 Bluefruit a while ago when BT wasn't supported in Circuit Python yet. Now that it is, I really want to try it out. The Express doesn't seem to have any real differences from the Bluefruit, aside from some pin assignments and, of course, the BTLE module. Still a little scary. If anyone else has tried this, I'd really like to hear how it went.

#

One thing does stand out.. The Express is described as having a ATSAMD21G18 ARM Cortex M0+, where the Bluefruit just says "M0", no plus.

#

But I can't find any info that says what differences there are, or aren't.

main meteor
#

I think the main other difference is the Express has an additional flash memory chip (that additional storage is quite useful when running CircuitPython).

topaz schooner
#

Wondering if I should just bite the bullet and upgrade to the Huzzah32 (ESP32 Feather)

main meteor
#

Depends on what you want to do with it. The Huzzah offers WiFi but I don't think it supports Bluetooth. I think the M0 offers more in the way of I/O.

topaz schooner
#

The Huzzah32 might not, the Huzzah32 Feather does. Didn't know they were different until I just looked. But it still doesn't have official CircuitPython support.

solar whale
#

@topaz schooner Circuitpython will not support the BLE on the Feather M0 Bluefruit -- It is essentailly a Feather M0 Basic.

#

CP BLE support is only for the nrf52840 chipset at this time

#

as to express -- as noted, that implies there an external flash for the CP filesystem. The Feather M0 Bluefruit does not have one. It has a very small File system. on the internal Flash.

topaz schooner
#

That clears it up.. Thanks. Guess I'm sticking with C

solar whale
#

Sorry to bear bad news -- the feather nfrf2840 express is a nice way to go!

ionic elk
#

I'm having a lot of trouble getting the CI to work on my PRs - it's encountering mostly git issues with tarballs and authentication. I see one of @onyx hinge's builds has failed for the same reasons. Is this just a Github thing we can wait out?

manic glacierBOT
cerulean sparrow
#

Does the Monster M4sk run circuit python? Is there any documentation on how to edit the eyes?

ionic elk
#

@tulip sleet how did you protect the USB pins, and other vital stuff, from the chipwide reset_all_pins() function? I don't see anything that adds them to the never reset array.

#

When I searched for never_reset_pin_number, all that comes up is some busio and PWM dynamic additions. I was expecting some table in peripherals or port init to protect critical system pins, but I don't see anything. Are there just no GPIO pins shared with oscillator or system purposes in nrf?

manic glacierBOT
umbral dagger
slender iron
#

note that only one eye is supported from circuitpython

#

I haven't spent time to verify multiple displays work together ok

ionic elk
#

@slender iron is there a way for a user to check what pins certain functionality is on? Say if they want I2C, they ask what pins have it, or something like that?

idle owl
#

@ionic elk I wrote scripts that attempt to create the object on each pin or pin combination and returns the valid options.

#

If that's what you're asking.

ionic elk
#

@idle owl interesting. On the STM32, we won't have peripheral information per pin, since STM32 peripherals are extremely specific. But I wonder if I could tie into this somehow

manic glacierBOT
idle owl
#

Also interesting. Did not know that about the STM, though I know nothing about them, so it's all new info for me.

ionic elk
#

sure it's good to know how it's done now

#

Ideally I'd like to have some option available to the user to either declare where every peripheral is mapped, or search for the pins of a specific one

idle owl
#

Right on, so sort of the opposite of the script.

ionic elk
#

Yes, and it'll have to be built that way all the way down to the port level

idle owl
#

This is stretching beyond my knowledge, but something like dir() for peripheral pins from the REPL?

ionic elk
#

I'll check that out, the python stuff is kind of out of my depth

#

so I'm not sure how this is exposed higher up

idle owl
#

That's what makes having a team so great ๐Ÿ™‚ Someone else can know the things you don't.

#

Right

#

I'm definitely referring to higher up.

#

dir() gives you everything something can do.... so it works on modules to show what you can call, but also works on, for example, board to tell you all available pins. Which is what made me think about the potential to have dir(i2c) or something and have it show you the available options... not exactly what it's meant to do, but something like it might be what you're getting at.

manic glacierBOT
#

Hi folks! I was working my way through the Welcome to CircuitPython tutorial and was told to go to GitHub and look for an issue with the "good first issue" tag. I saw this one, and as it happens I'd added a couple of mcp23s08s to a parts order a while back as a "might be useful some day, since I'm paying for shipping anyway" thing.

So it's working now, blinkies blinking even as I type. I need to work through another tutorial to learn how to post/submit/request/etc my contribution and I sti...

ionic elk
#

Yeah kinda. So, for instance, on the stm32 F411, I2C3 has exactly 2 pins: SDA on PC9, and SCL on PC8. So I'd like the user to either be able to punch in some "Peripherals" command and see a list that includes "I2C3: SCL-PC8, SDA-PC9" as a row, or punch in "I2C3" and see "Pins: SCL-PC8, SDA-PC9"

idle owl
#

I see

#

That would be handy

ionic elk
#

would that fit with the dir() command or would it be better suited elsewhere?

idle owl
#

That one I'm not sure on. I feel like you could create a peripherals thing and call dir() on it, but I'm not sure that's what it's really meant to do. Scott would know better.

slender iron
#

@ionic elk the goal is for user's not to know anything about I2C3 and just know i2c can be done on PC9 and PC8

#

which is what @idle owl 's scripts can tell you

ionic elk
#

The I2C3 label can certainly be left out, but the issue is that if they try to use I2C1's SDA and I2C3's SCL, it will fail

slender iron
#

how would they try to use it?

ionic elk
#

I'm not sure I understand

slender iron
#

want to voice or video chat?

ionic elk
#

Sure

#

We could hop in the chat channel

slender iron
#

๐Ÿ‘

manic glacierBOT
#

I'm not convinced this is a good idea. I assume you are not intending for it to have a "while True" loop in it. That would be even worse. But my concern is that now it gets executed everything the board reboots unless it is deleted. Just bothered me ;-) I guess I think the users should have some understanding of what is going on. this seems like a bit too much handholding to me. Just my opinion.

manic glacierBOT
ionic elk
#

@slender iron is there a way to receive notifications on github whenever an issue has a certain tag? It'd be convenient for tracking stm32 issues

slender iron
#

not sure, I get emails for all of them and filter them into a folder

manic glacierBOT
manic glacierBOT
meager fog
#

@ionic elk hiya

#

i have some halting stm32 questions

silver tapir
manic glacierBOT
#

This PR introduces a structure for handling stm32 peripherals, which are more inflexible than the other ports. Peripherals are created as separate objects based on chip family in the peripherals directory. Common-hal modules then check to see if pins match any of the existing peripherals.

Looking for feedback on structure. Current model uses direct pin references as a double-checking measure when implementing peripherals, but an alternative numerical storage system is commented.

manic glacierBOT
old smelt
#

@slender iron - have a minute to talk about the make_opaque()/make_transparent() issue?

slender iron
#

@old smelt may have some time tonight

old smelt
#

Ok. Just a quick question...

#

Your comment in the issue thread said that make_transparent()/opaque() needs to include a self-refresh.

#

Is that as simple as adding self->needs_refresh = true;

slender iron
#

ya, I believe so

old smelt
#

Ok. Tried that, and I'm seeing the same results

#

That answers my question. Thanks. I'll poke around a bit. Trying to understand how all of this stitches together.

slender iron
#

k, thanks!

manic glacierBOT
plucky flint
#

๐Ÿ‘‹

timber mango
#

sorry if this is not the right place to ask this but how can i get into using circuitpython on the game boy ?

stuck elbow
#

@timber mango you would need a special cartridge that @slender iron has developed

timber mango
#

is it possible to purchase these preassembled ? i do not have much hardware or electronics experience

stuck elbow
#

I don't know, you might need to wait for him to wake up

timber mango
#

okay i will do that , thank you so very much ๐Ÿ˜Š

#

i am very excited for this

stuck elbow
#

this is very much work in progress still

#

by the way, I'm on a quantum computing sprint now, and now we are using CricuitPython to write a quantum game

timber mango
#

thats amazing !

lone sandalBOT
manic glacierBOT
timber mango
#

Got hands on a uBlox NINA B3 evalkit, and tried to install CircuitPython on it. So I followed the tutorial on how to install it on the nRF devboard. Worked like a charm to get the UF bootloader up and running. (nrfjprog link is dead BTW).

Only thing, I just had only a 128MB quad SPI flash at hand. Is this a problem? Since I only once for a short time a REPL, and it never showed up as a CircuitPython USB drive.

ionic elk
#

@meager fog sorry I missed your question yesterday.

#

Let me know if you still need anything answered

#

let me get you a new binary too.

manic glacierBOT
manic glacierBOT
slender iron
#

@timber mango The SAMD51 only supports 16MB QSPI. the nina is an nRF52840 right?

#

@timber mango The GameBoy cart isn't currently available. I'm not sure when it will be. I've been tweaking the software still because it has some major bugs still (like hangs and improper writes)

manic glacierBOT
timber mango
#

@slender iron jep it is... Note to self, next time order a bunch of different parts ๐Ÿ˜‰

I tested it again, and now i got a stable REPL. Just no flash drive, seems i need to get me less flash.

manic glacierBOT
#

Itโ€™s exactly the same as the ones in the fix (Samsung EVO 32Gb). I solved
the error by downloading the โ€œadafruit_sdcard.pyโ€ from
https://github.com/adafruit/Adafruit_CircuitPython_SD
and placing adafruit_sdcard.py next to code.py and importing it, instead of
adafruit_sdcard.mpy from the lib folder. Wouldnโ€™t this mean the fixed code
is not in the latest library release? If that doesnโ€™t make sense let me
know and Iโ€™ll send you a picture of the sd card.

Thanks!

On Fri, Sep 13, 2019 at 9:29 AM ...

ionic elk
#

I'm having an issue with mu where if I write a second time after a program has finished executing, it freezes, and the disk image for circuitpython stops being available until the board is reset.

#

Is this more likely to be an issue with my code, or with mu?

manic glacierBOT
#

I'd prefer it if there were two additional functions on supervisor .add_serial_in() and .add_serial_out() that way we can separate the two things. A keyboard for example would only be serial_in. We probably also want a forever kwarg that keeps the object alive past the vm. Folks may want to redirect temporarily too.

Instead of needing a separate hook, you can probably reuse the stream api stuff.

Also, we may want to formalize a way to "save" certain heap state at the end of a vm t...

#
[adafruit/circuitpython] New tag created: 5\.0\.0\-alpha\.3
orchid basinBOT
slender iron
#

@ionic elk is that with an stm board? try with a known good build of circuitpython to verify mu is working. that sounds like what happens when the board crashes

ionic elk
#

I think it's a write crash, yeah

#

It's more destructive with Mu than other editors, so I've switched over to sublime

#

hmmmmmmmm actually what appears to be the case is the board soft reboots after 30 seconds of runtime, and then can't be written to again without crashing...

manic glacierBOT
slender iron
#

@ionic elk sounds like it's time for a debugger

ionic elk
#

I've been in there but I can't get a trace on what's causing the reset

slender iron
#

is it a full reset or just a reload?

#

what is the backtrace once it's broken?

#

good places to break are reset_into_safe_mode and HardFault_Handler

manic glacierBOT
manic glacierBOT
ionic elk
#

@slender iron "soft reboot". Might be host computer related, though. I'm having some trouble replicating it consistently.

slender iron
#

ah, so reload

#

are you resetting pins yet? resetting the usb pins would be bad

ionic elk
#

Analogio adds USB pin protection

#

But I should look into whether it might be messing up some other system essential feature through a pin.

#

I remembered an important reason to stick to all LL, by the way. The HAL relies on a file called hal_msp which contains a bunch of pin definitions which we'd much rather have flexible control over. LL avoids it completely.

#

I'm looking into how micropython handles it at the moment.

slender iron
#

๐Ÿ‘

onyx hinge
#

@slender iron bringing up this "samd51 thing plus", what do I do about usb pid/vid ?

slender iron
#

use the same as arduino or uf2 and we can bug sparkfun about it

onyx hinge
#

okay, will do that for now.

#

I want to talk about the UART console stuff but that's a longer conversation than I want to get into now.

#

but that's "long term if ever stuff" to me, I'm not worried

manic glacierBOT
onyx hinge
#

suddenly everyone is interested in this board I guess

#

I'm not sure which part limor is suggesting santaimpersonator work on -- and whether they are on discord? -- but I think I have a good start locally, but not tested/built yet. I started on the pin definitions last night but didn't get through before it was time to hit the sack.

old smelt
#

@onyx hinge - out of curiosity, does it require a J-Link to port to a new board initially? I have this vague memory of something like that from when I was looking at putting CP on a Particle Argon.

meager fog
#

@slender iron @ionic elk QUESTION!

#

@onyx hinge id like to prod sparkfun into submitting PRs for their boards

#

its going to be hard for us to test/verify their BSP's without said hardware - and they're shipping with circuitpython so they def made the BSP at some point ๐Ÿ™‚

onyx hinge
#

@old smelt if it doesn't ship with UF2 bootloader then yes it seems so

#

@meager fog OK, better if I deassign that issue from myself then and let santaimpersonator take the lead?

meager fog
#

@onyx hinge yah sure, i dont think we can assign them cause they're not in the libraries group but thats ok

onyx hinge
#

๐Ÿ‘ I'll go do that

manic glacierBOT
onyx hinge
#

ooh looks like I can assign it

old smelt
#

@onyx hinge - got it. Thanks.

manic glacierBOT
timber mango
#

@slender iron okay thanks for the update ! keep up the great work ๐Ÿ’–

#

cant wait to get my hands on one, i have so many cool ideas that weren't possible with assembly

manic glacierBOT
old smelt
#

Well, it's Beer:30 here in WI, and I have a bit before Friday Football. Anyone around who has some deep displayio core knowledge that could help me out?

meager fog
#

i know a little

old smelt
#

Cool!

#

I'm trying to chase down this make_transparent/opaque issue, but I don't really understand when/where a display refresh is executed.

#

I've tried adding the code that I thought would trigger a refresh for the display, but it doesn't seem to do it.

#

So, essentially, the calls to _pallet.make_transparent() in roundrect.py aren't really doing anything.

#

The original configuration of a shape (transparent/opaque) seems to be "sticky". And can't be changed after initialization.

meager fog
#

i dont know that kind of detail

#

if you have an issue, please hold until someone can answer it

#

i dont know the core displayio stuff ๐Ÿ™‚

old smelt
#

No worries. Thanks for taking a minute to check it out.

#

I don't know it either.

manic glacierBOT
onyx hinge
#

@slender iron I see how to use version checks for audioio vs audiocore. Do you have a preference as to how audioio vs audiopwmio is handled? Doing it by os.uname().sysname == 'nrf52' doesn't really appeal to me. What would you like me to do?

#

board.AudioOut did occur to me...

#

but that's a bigger change and would require touching all boards

slender iron
#

@onyx hinge maybe try/except is ok for audio vs audiopwmio

#

it'll be cleaner with the version check for core/audioio

onyx hinge
#

OK, I tried to do that in my latest update on that PR.

manic glacierBOT
slender iron
#

@onyx hinge k, great!

onyx hinge
#

I also realized, I don't know any case where nRF would go through the audiopwmio path successfully

manic glacierBOT
onyx hinge
#

OH I see how they fit the qwik connector on the thing plus -- it's actually bigger than the standard feather form factor

#

๐ŸŽถ standards are great ๐ŸŽต

manic glacierBOT
#

@tannewt - I don't have it committed anywhere yet. I confess that I'm in a bit over my head with remote repos and how to create a branch remotely. So, I'm a bit hesitant there.

I just set needs_refresh = true in both make_opaque() and make_transparent():

void common_hal_displayio_palette_make_opaque(displayio_palette_t* self, uint32_t palette_index) {
    self->colors[palette_index].transparent = false;
    self->needs_refresh = true;
}

void common_hal_displayio_palet...
manic glacierBOT
manic glacierBOT
#
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.

-236 bytes free in flash out of 253440 bytes ( 247.5 kb ).
24916 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).

Too little flash!!!```

I don't get it, I use the same `SAMD21E18A` like gemma_m0, trinket_m0 and many other, why is ...
raven canopy
#

returns to the living. the flu sucks...especially when you have to keep adulting... ๐ŸŒ„

onyx hinge
#

argh I thought I was going to debug some stuff on pyportal this weekend, but to my horror the swd header is not fitted

onyx hinge
#

do I need to connect 3.3v to the j-link for it to function?

solar whale
#

yes -- at least in my experience...

#

I connect SWDIO, SWDCLK, GND, 3.3V and RST

#

3.3V goes to Vref on the JLink

onyx hinge
#

right

#

that confirms what I thought/read, thanks

#

too bad there aren't labeled test points for 3.3v and gnd

solar whale
#

on which board?

#

Ah --- I see -- on pyportal -- they are on the pads for the SWD connector -- you could access them there

onyx hinge
#
Connecting to target...Connected to target
Waiting for GDB connection...
``` looks like we may be on the road
#

huh not the problem I expected to start out debugging -- with my master-ish-branch firmware loaded, pyportal hardfaults at startup in common_hal_pulseio_pwmout_construct setting up the display early early on

solar whale
#

I just put alpha-3 on a Pyportal -- so far its OK

onyx hinge
#

hmm that's exactly where I am as well ```jepler@soba:~/src/circuitpython$ git describe --tags
5.0.0-alpha.3

#

hm, when I load the firmware from inside gdb with danh's jload it messes up. when I do it via PORTALBOOT, the same binary is fine

#

smh

#

fine in that it gets started to circuitpython; I have an incompatibility in my python files or something, ``` File "adafruit_pyportal.py", line 438, in set_background
AttributeError: 'Display' object has no attribute 'refresh_soon'

solar whale
#

do you have latest adafruit_pyportal.py -- I am not seeing that

#
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.3 on 2019-09-14; Adafruit PyPortal with samd51j20
>>> 
onyx hinge
#
origin    https://github.com/adafruit/Adafruit_CircuitPython_PyPortal (fetch)
origin    https://github.com/adafruit/Adafruit_CircuitPython_PyPortal (push)
origin/master:adafruit_pyportal.py:        board.DISPLAY.refresh_soon()
origin/master:adafruit_pyportal.py:            board.DISPLAY.refresh_soon()
``` huh despite pulling I still see the use of those functions in adafruit_pyportal.py
#

refresh_soon and wait_for_frame

solar whale
#

I think there are may places that need update -- I fixed Slideshow a few weeks ago, but more to be done

onyx hinge
#

what a surprise, I think this todo is why audio stutters while updating the display on pyportal ... ``` // TODO(tannewt): Make refresh displays faster so we don't starve other
// background tasks.

    usb_background();
solar whale
#

pyportal_simpletest.py fails due to wait_for_frame as well....

onyx hinge
#

this does fix the audio stuttering right up in my reproducer, but clearly it'll never fly: ``` // TODO(tannewt): Make refresh displays faster so we don't starve other
// background tasks.
+

  • #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO
  • audio_dma_background();
  • #endif
    usb_background();
#

(reproducer loops a wave file while continuously printing to the console)

slender iron
#

Hi all, the weekly community meeting is Monday at 11am Pacific / 2pm Eastern here on Discord in the CircuitPython voice channel. All are encouraged to attend. The notes doc for the meeting is here: https://docs.google.com/document/d/1rWT7iyx39KK_qpDKbT_SnyGplmTR-gaNi_zGQCvT43E/edit?usp=sharing <@&356864093652516868>

manic glacierBOT
idle owl
#

@ionic elk Could be either, but I would personally suspect code first. Or you found a lovely bug ๐Ÿ™‚

#

I've managed things like that with code before is the reason for considering that first.

timber mango
#

@slender iron you said you're tweaking the software a lot for the game boy cart. does that mean the hardware is mostly final? could i manage to put the board together myself and then flash any updates to the software?

slender iron
#

@timber mango I believe the hardware is final but since there are bugs I'm not 100% sure I won't need to rev hardware.

#

Ya, if you assemble one yourself then you could help with the software. ๐Ÿ™‚

timber mango
#

time to teach myself electronics ๐Ÿ˜‚

manic glacierBOT
slender iron
#

are you near seattle? I could loan you one

timber mango
#

australia ๐Ÿ˜…

#

id hapilly cover costs if you were able to do that though

onyx hinge
#

I have been doodling a C64 "cartridge port" <-> fpga <-> feather setup. tinyfpga bx has enough signals, so it could read/write any memory via DMA, or drive instructions onto the bus like a ROM. feather could send it instruction lists via SPI or something. I haven't quite figured out how much stuff @slender iron 's board does without needing an FPGA in the mix.

#

also I'm not sure whether DMA can drive I/O devices. Sure might be some interesting demo effects you could accomplish if you could update VIC registers every cycle.

slender iron
#

@timber mango I'm hesitant to send them permanently because I only have three to show people

#

@onyx hinge my board acts like memory and simply returns instructions when the host fetches them

#

it never controls the memory bus directly

#

it tells the cpu what to do

timber mango
#

understandable @slender iron

onyx hinge
#

@slender iron that's what I thought I understood.

timber mango
#

what are the two ports on the left of the board ?

slender iron
#

midi in and out

timber mango
#

oh very cool

#

goodbye LSDJ here comes... PYDJ

onyx hinge
#

@slender iron so I'm also making some doodles about background/idle tasks. Basically, an "earliest deadline first" scheduler, still cooperative, will now let you re-enter other tasks, but never re-enter the same task. It also requires coming up with (largely imaginary or at best hand-wavy) deadlines for all background tasks, and turns them from a block of code into a structure..

#

@slender iron thoughts before I get too far into implementing it?

slender iron
#

@split zodiac totally ๐Ÿ™‚

timber mango
#

could you technically encode artbitrary data and send it over the midi port?

slender iron
#

yup, it's just uart with an optoisolator on the input

#

@onyx hinge sounds like it might be something switching to an rtos could give us. I've never used one myself though

timber mango
#

i did some PS/2 keyboard to serial stuff with assembly but that sounds more fun

onyx hinge
#

@slender iron I have some experience in that area with LinuxCNC, though we NIH'd everything.

#

in the name of having our own portability layer of course

slender iron
#

of course ๐Ÿ™‚

timber mango
#

i really want to make a little operating system for the game boy using this

#

do you think it would be possible @slender iron ?

onyx hinge
#

@slender iron are there rtos-like parts of micropython we can integrate instead?

exotic pumice
#

what speed do y'all run the qspi flash at?

slender iron
#

@timber mango it depends on what you mean by operating system. the cart basically makes the gameboy buttons, sound and a screen for circuitpython

#

@onyx hinge not that I know of. I know some folks use micropython from within freertos though (the imx rt PR upstream does)

exotic pumice
#

I can't figure out where the storage module is actually implemented for samd

#

arduino defaults the qspi to 4MHz but that seems slooooooow

timber mango
#

@slender iron just a software operating system with little applications and stuff

slender iron
#

@timber mango ya, that should be doable!

timber mango
#

put wifi on the board so it can have an internet browser ๐Ÿ˜ˆ

slender iron
#

@exotic pumice for external flash it's done outside the port in supervisor

#

(not actually real)

timber mango
#

yea haha but still cool

#

there are companies that do the full board print and assembly, right?

slender iron
#

yup! they won't be able to test it though so you may need to fix it anyway

timber mango
#

yea i can probably give that a go though !

slender iron
#

definitely

#

it can be pretty costly to have only one assembled though

timber mango
#

that's okay i think it's worth it

#

do you think it would be possible to have a 32-bit framebuffer that is quantized and blitted onto the game boys vram each frame?

slender iron
#

you'd have to do the math

timber mango
#

probably getting ahead of myself but its just so exciting ๐Ÿ˜Š

slender iron
#

I doubt you can push that much data each frame

timber mango
#

mm you're probably right and only CGB has VRAM DMA ๐Ÿ˜ญ

onyx hinge
#

if it's "just" running instructions, then that gives you a quick check on how many pixels you can push...

#

a long enough sequence of STA instructions, f.e.

#

but I also don't know what the limits are on the samd side

manic glacierBOT
timber mango
#

ye i havent touched gbz80 in a while so ill have to work out the cycles

#

it still has to copy everything from the ROM into VRAM right @slender iron ?

#

@slender iron since you have control over all the cartridge i/o, where does the cartridge rom point to ?

onyx hinge
#

oh right it's not a 6502 in gameboy

#

LD A, IMM and LD [HL+],A are each 2 cycles, so you can do about 1MHz / 4 of them per second or 8kB per 30fps frame ?

timber mango
#

sorry was waking up

#

25920 cycles which is more than a whole v-blank

#

@onyx hinge yea that gave me a good idea

#

just to double buffer and run at 30fps

manic glacierBOT
#

Thanks @siddacious! The tutorial is very good so far for the Git side of it, and for coping with Travis as well. I'm feeling more overwhelmed by docs and examples for the new code to be honest, Sphinx, Readthedocs, .rst, .yml, etc. I'm sure the process is itself all documented somewhere but it feels like a big lift for a first-timer. One step at a time I suppose...

slender iron
#

@timber mango there isn't a ROM to speak of because the samd dynamically returns data (ignoring the address almost all of the time)

timber mango
#

it's technically through the ROM addresses still though?

#

or how does that work

manic glacierBOT
#

Pins for D2, D3 connectors and cap touch pad nose were incorrect. According to the schematic they are PB08 and PB09 for D2 and D3, and PB08 for the nose. Updated pins.c to reflect accurate pins. Also removed the line disabling touchio in mpconfigboard.mk.

Tested with altered firmware build, thanks to @jepler for the quick test build. Tested capacitive touch using touchio with the nose pad. Tested NeoPixel strips on both D2 and D3. All work successfully.

manic glacierBOT
#

I have a grand central, and have successfully set up importing singular .py scripts from the sd card and am trying to get numpy working, but it is not working. The current error is:
AttributeError: 'module' object has no attribute 'array'
Which basically means it has not imported numpy properly XD.
Numpy is a series of folders instead of a single .py which I suspect is the issue. I was wondering if there is a way to make this work.
Thanks!

onyx hinge
#

well, returning to the M4 dac stuff for an hour, I can reproduce the "stairstep DAC when increasing" behavior under Arduino by setting CCTRL above 0. This is the "current control" and is supposed to control the rise and fall rate of the DAC output, I think.

#

What arduino configures and what CP configures, neither quite match the datasheet .. argh!

#

CCTRL = 0 is to be used with clock <= 1.2MHz, but Arduino uses 12MHz.

slender iron
#

@timber mango technically the cpu thinks it's reading and address but we ignore it. We've issued the code itself so we already know what to return and can ignore the address except to detect the vsync interrupt

onyx hinge
#

and yes, if I copy those settings -- including the GCLK settings -- the rise/fall match Arduino

#

I wonder what uses GCLK 4? I can't find it via grep.

timber mango
#

@slender iron thats so neat ๐Ÿ˜

onyx hinge
#

I'm quitting for the night, but somebody's got to explain me why ports/atmel-samd/peripherals is a submodule and I'll read back tomorrow. (one element of the current best DAC fix I've got is in that submodule, which tricked me)

slender iron
#

@onyx hinge it's a submodule so that it can be revved/used separately from CircuitPython

manic glacierBOT
onyx hinge
#

this is playing the looping sample [0, 57600]

#

both peaks should be the same

#

solution: when playing audio out, scale everything to (56000/65536) of full scale ๐Ÿ’ข

#

takes a break

raven canopy
#

@onyx hinge that seems maddening. thinking back a couple weeks, i wanted to blame the open-mode DFLL as the source. but iirc, Arduino uses it too. at this point, i'd only be throwing darts at the WSJ stock listing...

orchid basinBOT
onyx hinge
#

@raven canopy Does Arduino actually use the DACs for Audio? I looked around for a library and didn't find it.

raven canopy
#

proceeds to throw a dart
@onyx hinge have you played around with the DACx.REFRESH register at all?

#

hehe. concurrent thoughts.

#

๐Ÿค” hmm...well, I assumed it did. i can take a gander.

onyx hinge
#

I got to the point where directly setting the DATA register in CP gives results that look like Arduino doing AnalogWrite, full scale 0 to 65535

#

but AnalogOut and AudioOut on CP are pretty different, and AudioOut is still giving weirdness

#

I actually DID get AudioOut to give the same waveform as Arduino doing AnalogWrite, except that it did it without respecting the actual sample rate

main meteor
#

Ouch.

raven canopy
#

haha. "Excuse me silicon-collective, but that doesn't seem correct."

onyx hinge
#

checks whether samd51 might be violating the code of conduct

raven canopy
#

@onyx hinge are you using Tone or analogWrite on arduino?

onyx hinge
#

@radiant wind AnalogWrite

#
  pinMode(A0, OUTPUT);
  analogWriteResolution(16);
}

void loop() {
  analogWrite(A0, 0);
  analogWrite(A0, 65535);
}
raven canopy
onyx hinge
#

I agree, but it is not using DMA to send a sample, it's just sending one value after another

raven canopy
#

true. it has that "luxury".

#

why must the SAMD sheets contradict itself.. ๐Ÿ˜–

DACx.REFRESH Feature Description:
tREFRESH = REFRESH ร— tOSCULP32K

DACx.REFRESH Register Description:
tREFRESH = REFRESH ร— 30ฮผs
#

and, it looks like we're already using the lowest REFRESH anyway.

0 = no refresh
1 = reserved

asf4_config is set to 2.

onyx hinge
#

32768Hz is about 30.5us so I'll forgive that much

raven canopy
#

here is the characteristics at 85C chart. does the drift, plus the RuntimeCal using DFLL (which also drifts), cause any concern? serious question; i have little experience outside the ~2 years i've been here.

onyx hinge
#

I don't think I've heated anything to 85C while running my tests

onyx hinge
#

so on top of all my other fixes, rescaling the samples so they are in the range 1000 .. 65000 instead of 0 .. 65535 would fix the last waveform problem

#

taking some away at the high end and some at the low end gives more total range for some reason

#

.. I need somebody to look at this and say "yeah that's crazy but let's go ahead and do the workaround" (or "not do the workaround", I don't care...)

manic glacierBOT
#

Make changes in asf4_conf even though I think in these cases the "peripherals" submodule is running the show.

Arduino clocks the DAC at 12MHz but uses the CCTRL setting for clocking < 1.2MHz (100kSPS).

A fresh clock (6) is allocated for the new 12MHz clock. This matches the Arduino value, though not the GCLK index.

Modify other settings to more closely resemble Arduino.

In AudioOut, actually clock the waveform data from the timer we set up for this purpose.

This gives good wav...

#

The waveforms you can get when using DMA are really bizarre. Here, the sample data alternates between 0 and some critical number around 57000. Every even "high" sample is flawless, but then the odd "high" samples are just all over the place. Go lower, and all the "high" samples are equal. Go higher, and the odd "high" samples are all wrong, but they tend to settle at about the same wrong value. This is real hard to explain!

![MSO1104Z_2019-09-15_09 23 00](https://user-images.githubuse...

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 5\.0\.0\-alpha\.4
orchid basinBOT
waxen loom
#

I found an interesting observation on the Bluefruit specifically 'touch_A5' and 'touch_A1' are mapped the same on the A5 pin. The A1 pin has no effect. I am using the 'adafruit_circuitplayground.express' library which obviously does not map the same to the Bluefruit. Is there a similar 'express.py' library available for the Bluefruit to date? Thank you all in advance.

manic glacierBOT
onyx hinge
waxen loom
#

@onyx hinge thank you very much.

waxen loom
#

@onyx hinge updated firmware however now getting:

#

File "/lib/adafruit_ble/uart_server.py", line 31, in <module>
ImportError: no module named 'bleio'

#

from bleio import Attribute, Characteristic, CharacteristicBuffer, Peripheral, Service

onyx hinge
#

looks like adafruit_ble will also need to be updated

#

however it looks like the latest release does not have that fix, https://github.com/adafruit/Adafruit_CircuitPython_BLE/releases 24 days ago while the related pull was just merged 16 days ago https://github.com/adafruit/Adafruit_CircuitPython_BLE/pull/18

waxen loom
#

@onyx hinge thanks will revert back to older firmware in the meantime.

onyx hinge
#

@tulip sleet consider a release of Adafruit_CircuitPython_BLE in the near future?

onyx hinge
#

note to self: don't brush the jumper wires that constitute the soldered-on debug interface. Only seems to have rebooted the board, but it was a surprise!

tulip sleet
#

@onyx hinge did you find the BLE pre-release? Look at all releases.

onyx hinge
#

@tulip sleet 2.0.1-alpha1 is the top pre-release and I think it's too old based on dates to have the _bleio change. I didn't actually dl and check though.

tulip sleet
#

I think youโ€™re right. Iโ€™ll make another pre-release. I thought I did that but I see not.

manic glacierBOT
#

@dhalbert just so I'm clear and not needlessly bashing my head against the wall, I'm getting the sense that the following is true:

  • Circuitpython only supports atmel-samd, esp8266, and nrf, ergo there should be no expectation that any other board or port in this repo builds successfully
  • By virtue of being a fork of MicroPython, a bunch of other, unsupported ports and boards exist in this repo
  • No undue effort is taken to make sure unsupported boards or ports are purged
  • In sum tota...
tulip sleet
manic glacierBOT
manic glacierBOT
manic glacierBOT
#
import time
import board
from analogio import AnalogIn
 
analogs = []
for pin in (board.A0, board.A1, board.A2, board.A3, board.A4, board.A5):
    analogs.append(AnalogIn(pin))
 
def get_voltage(pin):
    return (pin.value * 3.3) / 65536
 
while True:
    print("(", end='')
    for a in analogs:
        print("%0.1f,\t" % get_voltage(a), end='')
    print(")")
    time.sleep(0.1)```

trying the firmware.bin you posted, only board.A1 works, a...
manic glacierBOT
#

Iโ€™ll check that out tomorrow morning, thanks for the heads up. I was using
the direct PIN numbers for the Analog channels so maybe something is messed
up in the aliases.

On Sun, Sep 15, 2019 at 7:36 PM ladyada notifications@github.com wrote:

import time
import board
from analogio import AnalogIn

analogs = []
for pin in (board.A0, board.A1, board.A2, board.A3, board.A4, board.A5):
analogs.append(AnalogIn(pin))

def get_voltage(pin):
return (pin.value * 3.3) / 655...

manic glacierBOT
slender iron
#

@onyx hinge you should be able to merge now

onyx hinge
#

๐Ÿฐ thanks!

#

shall I go try it out on that pinout PR then?

manic glacierBOT
slender iron
manic glacierBOT
#

Yes the sys.path included the SD card. I have given up on using numpy. Thanks for the help though~

Adin Ackerman

From: Scott Shawcroft
Sent: Sunday, September 15, 2019 8:51 PM
To: adafruit/circuitpython
Cc: AdinAck; Mention
Subject: Re: [adafruit/circuitpython] How to import large complicated pythonscripts from sd card? (#2157)

@AdinAck Did you modify sys.path to include the folder on the sd card?
As @ladyada says it's highly likely that numpy will take too much memory and/or require nativ...

timber mango
#

@slender iron how much memory is there on the circuitpython cart for program, gfx, etc?

marble hornet
#

@meager fog the stm32 port is so cool! f4 and f7 in the works or just f4? (very excited)

ionic elk
#

@marble hornet Just the F4 for now, there's a lot to do even within the STM32 families! Scott's mentioned interest in the F7 and NXP's new chips after that.

manic glacierBOT
slender iron
#

@timber mango I think it's 256k ram total because it's the SAMD51x20 iirc

manic glacierBOT
modern wing
#

Good afternoon all you wonderful folks โ€” Iโ€™ll be lurking on the call today :)

onyx hinge
#

oh shewt I forgot it's monday. will be listening only

crimson ferry
#

Lurking today

errant grail
#

Text only today. Wrapping up the final two tracks on the album today.

modern wing
#

Yes

river quest
#

nice name

errant grail
#

Great album, @river quest . I play it often.

river quest
#

๐Ÿ™‚