#circuitpython-dev

1 messages Β· Page 244 of 1

timber mango
#

I will πŸ˜ƒ

#

thank you for the message too.. i had the " WHO?? ME??" feeling.. now i will listen quiet again πŸ˜€

idle owl
#

You're welcome! Thank you for joining us!

raven canopy
#

Good luck! So confusing..

fierce girder
#

SPI now working on PocketBeagle and regression fixed on BeagleBone Black

stuck elbow
#

at some point we could use displayio with EPD

slender iron
#

ya, I want to support them in a 4.x release

orchid basinBOT
stuck elbow
#

@gilded cradle for the tutorial

gilded cradle
#

Thanks @timber mango. Guide was going to basically show how to take the TFT featherwings and use displayio with them, so I'll take a look at that.

stuck elbow
#

ah, that is more like "how to animate things" thing

gilded cradle
#

Still good stuff

steel swallow
#

Has anyone found a library that convert C/C++ to python? I found one but it’s not supported by pip

#

So I cloned it and I still had some problems with sublibraries

raven canopy
#

Last Week:

  • adabot
    • Built a script for updating library information on circuitpython.org's future Libraries page. JSONifies a list of new/updated libraries, as well as open issues. The only piece left depends on the answer to how to auto-update (commit vs PR); then deploy.

This Week:

  • PDMIn: continue tweaking the sinc filter
  • adabot: start mocking up some concepts for GitHub API v4 implementation.
slender iron
raven canopy
#

?showtimes

digital shoreBOT
#

3D Hangouts - 11am ET Wednesdays
Show & Tell (YT only) - 7:30pm ET Wednesdays
Ask an Engineer - 8pm ET Wednesdays
Desk of Ladyada - Random hacker times
John Park's Workshop - 4pm EST Thursdays

pastel panther
#

anyone know when the shows are 🀣

raven canopy
#

phone keyboards... 😑 πŸ˜†

#

Thanks everyone! Have a great day! blinka πŸš€

manic glacierBOT
#
[adafruit/circuitpython] New branch created: deshipu\-patch\-1
gilded cradle
#

Thanks everyone

solar whale
#

CP is like herding cats πŸ˜‰

stuck elbow
#

any project with people is herding cats

steel swallow
#

I love mu btw it's really nice software debugging tool

lofty nova
#

@steel swallow

>>> a >>= 2
>>> a
30```
steel swallow
#

here is the code in cpp
crc >>= 1;

#

I am not sure how to express that symbol and I have found python has all the other bitwise operators except these two

lofty nova
#

so is the same in Python minus the ;

steel swallow
#

it doesn't go through the debugger

lofty nova
#

Above is a copy of Python console executing that code

#

debugger ?

steel swallow
#

the program that see's if you have spacing, typos and stuff it is catching it

lofty nova
#

Ahh, pylint. It's not a debugger but a syntax checker

steel swallow
#

yea the syntax checker sorry for using hte wrong vernacular

lofty nova
#

You must have a typo. It works fine in my Mu

steel swallow
#

ok I will try it

#

python syntax checker is catching it

#

elif crc >>= 1:

lofty nova
#

The problem is not on the bitwause

#

It is how you write the else if

modest atlas
#

Is it possible to do HID over bluetooth with in circuitpython with the feather nRF52840

lofty nova
#

1st) there is no elif in Pyhton

steel swallow
#

ok I will check

#

oh is it deprecated in 3.7

#

got it ok

lofty nova
#

Sorry, yes elif was correct but all tutorials I read said not to use it....

steel swallow
#

else:
crc >>= 1
return crc

#

compiles

lofty nova
#

Do you really want to combine a test and a modification on the same line ?

steel swallow
#

I get confused looking at stuff online from 2.76 code examples and 3.7 I make mistakes by using codes from the wrong version

lofty nova
#

I think what is not allowed if to combine the modification and the test on the same line

steel swallow
#

this is compiling now I hope it works I don't really understand what I am doing I am just trying to refactor

#

class crc16(object):
crc = ''
data = ''
i = ''
def testdata(crc, data):
i = ''
for i in range(0, 8):
if crc and 1:
crc = crc >> 1 ^ 0xA001
else:
crc >> 1
return crc

#

all of the class compiles now but I don't know if it will work because I simplified it from C++ so much

lofty nova
#

Looks like you are translating C++ to Python word by word, which is going to fail

#

variable declared at the Class level are automatically class variable (ie static in C++)

#

they are not members

steel swallow
#

here is the cpp
static inline uint16_t _crc16_update(uint16_t crc, uint8_t data) attribute((always_inline, unused));
static inline uint16_t _crc16_update(uint16_t crc, uint8_t data)
{
unsigned int i;

crc ^= data;
for (i = 0; i < 8; ++i) {
    if (crc & 1) {
        crc = (crc >> 1) ^ 0xA001;
    } else {
        crc = (crc >> 1);
    }
}
return crc;

}

#

so I need to call them all classes then

#

python autodetects the number and classifies it if I remember correctly from the class I took

lofty nova
#

So it isn't a class in C++. Why making a class in Python though ?

steel swallow
#

there is a declaration of the file name at the beginning of the cpp

#

#ifndef UTIL_CRC16_H
#define UTIL_CRC16_H

#include <stdint.h>

#

#define is what defines a class (???) I never studied cpp

lofty nova
#

#define defines a preprocessor macro which is often used to define a constant

#

Here is my python translation:

    crc ^= data
    for i in range(0, 8):
        if crc & 1 != 0:
            crc = (crc >> 1) ^ 0xA001
        else:
            crc = (crc >> 1)
    return crc```
#

Not tested, comes with no warranty

steel swallow
#

so I should use that uint16_t ?

#

that is a number type for 16 bit number for radio frequency I am pretty sure

lofty nova
#

uint16_t is typially used in C/C++ to define a unisgned interger of 16 bits length

#

there is no types in Python

steel swallow
#

python will just auto-detect the number right?

lofty nova
#

yes

steel swallow
#

that's why I left it out

#

I will try your other statements though thanks for the tips!

lofty nova
#

just updated the code as I forgot to remove the unit16_t in the parameters

steel swallow
#

ok sounds good I will use

orchid basinBOT
slender iron
#

@modest atlas not yet with circuitpython

modest atlas
#

@slender iron more to look forward to!

slender iron
#

yup!

modest atlas
#

You all are killing it

slender iron
#

πŸ˜„

tidal kiln
#

does Mu have PyPortal support?

slender iron
#

it should I think

orchid basinBOT
manic glacierBOT
slender iron
#

apparently the war requiem is merge music πŸ˜ƒ

manic glacierBOT
fluid helm
#

Working on some edublocks information pages.

Should I have themed headers for each platform (example in top image)
Or have them all the same (example in bottom image)

slender iron
#

@stuck elbow what do you think about splitting gamepadshift into a separate module so we can only enable it on boards that use it?

manic glacierBOT
#

With a TCP server listening, I get a valid connection from the ethernet wing, but when I try to send or receive data I always get an input/output error when entering the commands via REPL.
When using the same sequence in code.py the feather M4 just hangs and doesnΒ΄t react to ctrl-C.
I connected both modules by piggybacking them via headers without additional wires.
itΒ΄s not a problem of USB supply, behaves the same with external power supply.
from REPL other commands like .connected, ....

manic glacierBOT
#

Just to follow up on my earlier post, I think my issue is related to my WiFi access point. I tried to replicate my issues on a second pyportal, and was having difficulty accessing the password protected WiFi. Both pyportals ran fine on a guest (unsecured) WiFi network. My original pyportal, which would crash faithfully within 24 hours of starting, has been running for several days now without issue.

manic glacierBOT
#

Hang on, not sure this is right.
The changes in fdaff00c move the NVM space to the end of the FATFS space:

#define NVM_START_ADDR ((uint32_t)__fatfs_flash_start_addr + \
     (uint32_t)__fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE)

and I think this has undone that and moved it back to where I initially had it, incorrectly, at the end of flash where it overlaps the "Bootloader Settings" segment defined in boards/adafruit_nrf52840_s140_v6.ld
This can brick the board if y...

manic glacierBOT
manic glacierBOT
#
[adafruit/circuitpython] New branch created: revert\-1779\-nrf\-nvm\-2
slender iron
#

@crude fossil sent you a revert PR

raven canopy
#

@fluid helm i'd vote themed. the subtle variation can help with confirmation to the user that they're in the platform they expect. bonus if they match the platform's "official colors".

manic glacierBOT
manic glacierBOT
tulip sleet
#

@crude fossil could I ping you here for discussion?

manic glacierBOT
#

Here's what happened when I built 18908c2, pulling from your repo and checking out that branch:

halbert@salmonx:~/repos/nickzoic/micropython/ports/nrf$ git log -1
commit 18908c21f7998b13493fe75d0020bd9ad1bd1b60 (HEAD, origin/circuitpython-nickzoic-1042-nrf-nvm-bytearray-2)
Author: Nick Moore <nick@zoic.org>
Date:   Tue Apr 9 12:53:11 2019 +1000

    Fixups for adafruit/circuitpython#1042
halbert@salmonx:~/repos/nickzoic/micropython/ports/nrf$ repl
Auto-reload is on. Sim...
#

Oh super weird

Adafruit CircuitPython 4.0.0-beta.6-65-g18908c21f on 2019-04-16; Adafruit Feather nRF52840 Express with nRF52840
>>> from microcontroller import nvm
>>> len(nvm)
4096
>>> nvm[0:5] = b"hello"
>>> nvm[5:10] = b"world"
>>> nvm[0:10]
bytearray(b'helloworld')
>>> nvm[0:4096] = b'abcd' * 1024
>>> nvm[:] == b'abcd' * 1024
True
>>> nvm[3]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: ByteArray index out of range
>>> nvm[3:4]
...
meager fog
#

@gilded cradle heya for the guide on the OLEDs we should update em as well

#

to let people know to go to the Image lib

gilded cradle
#

Ok. Is it just for the 1351 at the moment?

meager fog
#

we should probably update the wiring diagram too

gilded cradle
#

Is there one for the ImageReader that will need to be updated when that PR gets merged?

meager fog
#

its kinda silly as is

#

thats the only page

#

you deleted that example

#

so now it should be "hey go here"

gilded cradle
#

Gotcha

#

I can make a new fritzing diagram

#

Or were you thinking updating the photo?

meager fog
#

i think you can crop the photo

#

or just make it clear the wiring doesn't match it, its just for demo

#

but swap in a fritzing

#

they're clearer than wiring photos anyhow

gilded cradle
#

Ok. I updated the ImageReader PR. Did you want to review it?

#

When I click the Edit This Page link, it just takes me back to a page of my guides. I don't think I have permission to edit it.

manic glacierBOT
meager fog
#

@gilded cradle ok ill give u perms

gilded cradle
#

Thanks!

meager fog
#

added

gilded cradle
#

Ok, that worked

meager fog
#

im a little confused by the PR

#

the examples are already tehre, so why make a new one?

gilded cradle
#

It has the refactored bmp example in it.

#

I can rename it

meager fog
#

i think confusing if we hvae 3 examples

#

maybe combine into one ssd1351 example

#

get rid of the 96x128 and 128x128

#

(they can select size)

gilded cradle
#

Ok, I can do that real quick

#

Ok, pushed. I can just point to the SSD1351 ImageReader Example in the guide

meager fog
#

yep!

gilded cradle
#

Should we update the BMP section to be more about the image reader?

meager fog
#

yeah you can copy the ili9341 page and adapt

gilded cradle
#

Ok, that'll work

meager fog
gilded cradle
#

Ok, perfect. Thanks

sturdy furnace
#

Hi all, my CPX users keep unplugging CPXs running CircuityPython (and not properly unmounting) which often boots it in safe mode.
Anyone have any tips to stop this?

I was thinknig some udev rules, but I can't seem to get them to work. I assume because it is a multi-class device?

Maybe even disabling safemode if that's possible?

Thanks

spark hill
#

@sturdy furnace Im not really qualified by ANY means but what is CPX? (sorry this feels like a dumb question)

meager fog
#

@gilded cradle ok once travis passes go ahead n merge

gilded cradle
#

I don't have merge perms on that library for some reason

meager fog
#

@sturdy furnace it happens if they dont eject properly πŸ˜ƒ

#

(on some OSes)

#

not on mac and linux as much

sturdy furnace
#

@spark hill the CPX is the CiruitPlayground Express πŸ˜ƒ

meager fog
#

@gilded cradle permed!

gilded cradle
#

Thanks

spark hill
#

@sturdy furnace Ah gotcha thank you for the clarification

sturdy furnace
#

@meager fog Yeh, It's a good feature for beginners to not break it. But do you know if udev rules can get it to ejecy nicely on an unexpected unplug?

gilded cradle
#

@meager fog, Should I unpublish that particular guide page while I redo it?

meager fog
#

@gilded cradle nah nobody is lookin

gilded cradle
#

Ok, thanks

meager fog
#

@sturdy furnace oof - not really. but why are they unplugging?

raven canopy
#

@sturdy furnace eject is a host initiated action. the slave can't initiate it, and since the firmware is in a constant loop that is what introduces FS corruption. at least, that's my understanding of it...

sturdy furnace
#

@meager fog honestly, poor mechanical connections, and mistreatment of hardware 😦

meager fog
#

well thats what safe mode is for πŸ˜ƒ

#

they can click the reset button

#

maybe makecode is a better one for your students?

#

its a lot more durable

#

(no filesys)

manic glacierBOT
#

Hey Scott,

I'll have a play around with it and let you know if I have any success. Like you said - it is just easier to say to people: "initialize SERVO3 before SERVO1" for our board.

I'll PR all the board config stuff a bit later - once I know it is very stable (it's looking that way at the moment).

If your interested in checking out the board, the info is on Crowd Supply. We hope to launch this week.

https://www.crowdsupply.com/robotics-masters/robo-hat-mm1

sturdy furnace
#

@raven canopy yeh, I was assuming that it wasn't circuitpython's problem (hence the scary udev rules).
@meager fog oh that's good to know. Unfortunately, it's a python course so ideally I would use CircuitPython.

I'll give some more things a try. But it might just be as simple as better USB connection!

meager fog
#

raiden i think if they have a good microUSB cable, maybe long flexible ones

#

that should solve it

#

but if they get safe mode its no biggie

#

just unplug/replug

#

try to get an editor that writes the files out completely - we like atom or Mu

sturdy furnace
#

Alright, thanks for the advice! I'll see how it goes 😁 I'm hoping to show them that not only is Python super extensible, but hardware is fun and not scary or frustrating! We'll see how that goes πŸ˜ƒ

spark hill
#

@sturdy furnace Good luck!

#

and have fun

#

πŸ‘ŒπŸ½

manic glacierBOT
#

OK so this is yet another crack at #1042, rebased onto master yet again.
With many thanks to @dhalbert for his help finding & fixing problems.

I've tested on Feather nRF52840 and since it touches shared-bindings a bit also on the Metro M4 Express.

Adafruit CircuitPython 4.0.0-beta.7-36-g9c42a7227 on 2019-04-16; Adafruit Feather nRF52840 Express with nRF52840
>>> from microcontroller import nvm
>>> nvm[0:5] = b"hello"
>>> nvm[5:13] = b", world!"
>>> nvm[0:13]
bytearray(b'hello...
manic glacierBOT
manic glacierBOT
manic glacierBOT
stuck elbow
#

@slender iron sounds good

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
meager fog
#

@stuck elbow hihi im going to try loading tripwire

#

any hints?

spark hill
#

@meager fog what's tripwire?

meager fog
#

a game

spark hill
#

Oh wait. SMH I was talking about that with someone else don't know why that didn't ring a bell. lol

manic glacierBOT
manic glacierBOT
stuck elbow
#

@meager fog you mean jumper wire?

manic glacierBOT
stuck elbow
#

and come to think now, I need to change the imports in ugame.py, now that GamePadShift is split to a separate module

#

I guess I will fix it when it gets merged

#

so please wait a bit with this

manic glacierBOT
cerulean pawn
#

hi @slender iron πŸ˜ƒ just found out about this discord. I was trying to run some BLE applications for Papyr, which were built using Zephyr, with the correct offset. Most basic samples which I ran seem to be working fine, but the BLE sample I tried wouldn't work. I haven't investigated much, but could this be because interrupts aren't working correctly / softdevice not forwarding them to app?

slender iron
#

welcome @cerulean pawn !

#

I've never used zephyr so I don't think I can be much help

#

@tulip sleet has been doing more of the BLE in circuitpython support too

spark hill
#

@cerulean pawn nice to meet ya!

cerulean pawn
#

okay, I'll probably spend some time trying to make some BLE app which doesn't use softdevice to work, cause that would be really useful I think

#

hi @spark hill nice to meet you too!

slender iron
#

kk, cool!

spark hill
#

πŸ˜€

manic glacierBOT
slender iron
#

@stuck elbow I swapped data and clock into shift too

#

busio.I2C and busio.SPI take clock first

stuck elbow
#

ok

#

I will update the python code

slender iron
#

I can pull ugame then for you

stuck elbow
#

by the way, a hint for the translations conflicts

#

pick the old date in the first conflict, otherwise you will need to resolve that conflict for every single commit

#

or is there a way I can push a rebased patch now?

#

so it's clock, data, latch now, correct?

slender iron
#

ya

#

you want to push to the branch? I think you should be able to. just make sure to pull down my changes first

stuck elbow
#

there are quite some conflict in the locale dir

#

would save you some work

#

compiling now, as soon as I verify it works, I will push it

slender iron
#

github isn't showing the conflict

stuck elbow
#

maybe I had an old master

#

aaaand it doesn't work :(

slender iron
#

hrm, lemme try

stuck elbow
#

I think you are not calling gamepadshift_tick from the system tick

#

is that a separate repo?

slender iron
#

ah, could be

stuck elbow
#

in any case, circuitpython-stage is updated and should work with the new code

slender iron
#

@stuck elbow ok, checked on my pybadge and works once I called tick

#

pushed the stage update too

stuck elbow
#

awesome, I think we are ready

slender iron
#

waits for travis

stuck elbow
#

it should be renamed to godot

manic glacierBOT
tulip sleet
#

@cerulean pawn we are thinking about zephyr in the long run, but it would require a substantial rework. Its chip peripheral support is not as complete as what we have now for the SAMD and nRF.

cerulean pawn
#

@tulip sleet hi! yeah, it's not as complete. However right now I'm trying to run an app built with it which does BLE, I think it should be a smallish fix somewhere to support interrupt forwarding.

slender iron
#

@stuck elbow I'm off to do errands. I think the PR is set once travis is ok. I had to merge in adafruit/master for some reason but it should be happy now

stuck elbow
#

cheers

tulip sleet
#

@cerulean pawn - I'm confused: are you running CircuitPython apps, or is this a binary zephyr build you're trying to run on some board of ours?

cerulean pawn
#

@tulip sleet a binary built with zephyr, but along with the UF2 bootloader. I guess I'm in the wrong channel, sorry for the confusion

tulip sleet
#

ok, now I understand. Is the app coming up at all, and just the BLE part not working?

cerulean pawn
#

@tulip sleet I was trying it yesterday, it would run up till the app tried to start adertising, it would print on the console and everything.

tulip sleet
#

The bootloader is not enabling the SD or anything, so I'm not sure what you mean about interrupt forwarding. At what offset are you loading the binary?

cerulean pawn
#

0x26000

tulip sleet
#

that should be fine. actually, I wonder if the bootloader is indeed maybe enabling the SD, so it can do OTA, etc.

#

but I would think it's not leaving it enabled

cerulean pawn
#

it is doing sd_softdevice_vector_table_base_set(CODE_REGION_1_START) before jumping to the app at least

#

I'll spend some time on it later, forgot my debugger at work

#

which should mean interrupts go to the right place, maybe it's some other problem

tulip sleet
cerulean pawn
#

will do, thanks @tulip sleet

manic glacierBOT
fluid helm
#

Finished the Circuitpython edublocks page! The theming works really well, thanks @raven canopy for the suggestion of colour themes https://gifyu.com/image/3XOw

Upload GIF & Share Online

Image cpyMode hosted in Upload GIF & Share Online

olive mortar
#

Question: Based on a fairly comprehensive perusal of the source, there does not appear to be any support in the current version for audio in; am I missing something?

orchid basinBOT
tulip sleet
#

@olive mortar there is not bulk AnalogIn; there is PDMIn, for reading data from PDM microphones. Until the M4 boards, reading bulk audio was impractical due to the small size of RAM.

slender iron
tulip sleet
#

@slender iron sure, is @timber mango done with his testing?

simple pulsar
#

@tulip sleet @olive mortar Is there anyway to read a short burst of audio in from signal A0?

slender iron
#

ya, I think so

#

we were just waiting for travis

tulip sleet
olive mortar
#

@tulip sleet , @slender iron - Cool; thanks for the confirmation. I'll likely have whack at adding that, and support for USB audio I/O as well.

slender iron
#

that would be epic! I'd love to see usb audio support in tinyusb (which circuitpython uses)

manic glacierBOT
olive mortar
#

Yeah, I figured on hacking tinyusb; it was a bit unpleasant to find that the blurb for audioio ("provides audio input and output") was, um, optimistic.

slender iron
#

@tulip sleet you ok merging the USER_C_MODULES stuff?

tulip sleet
#

I guess so, like I say, it will ease merging those files from upstream.

slender iron
#

ah ya, sorry @olive mortar . we can only do so much at once

#

kk

olive mortar
#

Not a problem; just a surprise.

slender iron
#

thanks for the help @olive mortar. ping me if you have any questions

manic glacierBOT
#

@deshipu - It looks here that the DigitalInOut objects are made to be inputs with PULL_UP if they are currently outputs. Also if they are already inputs with PULL_NONE, they will be made to be PULL_UP. But if they are inputs with PULL_DOWN, they won't be changed. Is that your goal?

In shared-bindings/gamepad/GamePad.c, the provided doc says they are always pulled up. Could you change the doc to match the impl (unless I am misunderstanding)?

//|     The ``b1``-``b8`` parameters are ...
slender iron
#

@idle owl where did you get the green mit license badge?

idle owl
#

shields.io apparently. At least that's what comes up in my history when I search Firefox for it.

slender iron
#

kk, I need to swap the url to get it from there directly. refering to the github image url breaks when building off github

idle owl
#

I don't remember if I used green or bright green, but I have the URLs

slender iron
#

the filename has brightgreen in it

slender iron
#

πŸ‘

manic glacierBOT
pastel panther
#

hey @slender iron if a do this on the repl:

import board
i2c = board.I2C()
i2c.try_lock()
i2c.scan()

then try CTRL-D to load a code.py that uses board.I2C() is it expected to work? I'm getting a hard fault

spark hill
#

You can use Atom with Python right?

pastel panther
#

the processor or the IDE? Yes to the IDE, probably not for the processor

#

or rather no CP for the processor: πŸ˜‰

#

You might also give Visual Studio Code a try if you're not attached to atom

spark hill
#

I have both

#

Well, Atom is installing now

#

just giving it a whirl

raven canopy
spark hill
#

Honestly probably general. I heard @meager fog mention something about Atom or Mu for tripwire or something else. So I just wanted to make sure I wasn't trippin'

raven canopy
#

yep. its a fine editor. doesn't have a built-in REPL, like PyCharm, that i know of. i just use the terminal...

spark hill
#

Ok cool! Thanks!

raven canopy
#

i have been meaning to try VSCode. everyone seems to love it...

spark hill
#

Yeah, it's great. It's lightweight and easy UI. What's nice is that you can save it as .cpp or C files C# etc. The best part is that you can use it for a ton of different languages.

#

It's like the Roseta Stone of IDEs 😁

raven canopy
#

hehe. Atom is agnostic as well. I also use it with C, when working [fumbling] on core code.

slender iron
#

@pastel panther ya, it should work. please file an issue for it

#

(bonus points for a backtrace if you break on reset_into_safe_mode)

pastel panther
#

kk

spark hill
#

@raven canopy Cool. Hehe

manic glacierBOT
#

I was testing some i2c address code and needed to scan the bus on the REPL, then tried to re-start the code and was sent into safe mode.

code.py:

import time
import board
import busio
import adafruit_veml7700

i2c = board.I2C()
veml7700 = adafruit_veml7700.VEML7700(i2c)

while True:
    print("Ambient light:", veml7700.light)
    time.sleep(0.1)

To reproduce, have the above code.py saved on the device, start a REPL and do the following:

import board
i2c...
meager fog
#

@gilded cradle around now fyi

gilded cradle
#

Hi @meager fog

#

I got the guide updated last night and was working on the small RA8875 display. It's a little trickier than the others, but I got an idea that I think will work well.

#

I can switch over to the SSD1331 though.

meager fog
#

either way

#

i haven't heard any horrified screams over SSD1351 so i think we can move onto SSD1331 πŸ˜ƒ

gilded cradle
#

Lol, yeah

#

This one is a little tricky in the sense that it's all commands and no data.

spark hill
#

@meager fog when I finish the case where should I put the .step?

meager fog
#

thingiverse

gilded cradle
#

Hi @meager fog, the SSD1331 driver is almost converted, but in the setAddrWindow, since the graphics data is counted as data, it needs a startWrite just before that at the end of the function. Otherwise I got all of them removed. Any suggestions on that one?

meager fog
#

lemme look

gilded cradle
#

kk

meager fog
#

ok yeah leave it but you can convert the other items to sendCommands

gilded cradle
#

Yep, that's what I did.

#

Thanks

gilded cradle
#

Ok, looks like it passed travis. I already had an existing PR, but I updated it.

#

However, before merging, I can test on some of the other boards...

#

Looks like it's not working on the ESP8266 and most likely because it doesn't appear to have been updated to use it.

meager fog
#

oof

#

does it not ocmpile or not run?

gilded cradle
#

Doesn't run

#

I think it needs a similar treatment like the 1351 got when it's updated to pass SPI

#

However, I think I'm going to call it an early night tonight and continue on it tomorrow.

#

I don't think it'll take that long for me to get it working

#

Have a good night @meager fog, I'm going to go πŸ’€

meager fog
#

later

#

np

#

im also about to πŸ’€

#

so tired

gilded cradle
#

Yeah, later

meager fog
#

@tidal kiln amazing guide! i didnt know we could plot data πŸ˜„

tidal kiln
#

πŸ˜ƒ thanks. hack-plot (c)

meager fog
#

once gfx is a little faster, we can add more elements (beyond Button)

#

like a plotter

tidal kiln
#

yep. that'll be cool.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Not exhaustive but I've tried and so far failed to reproduce this (on 4.0.0 beta 7):

  • variable length text in a ValueError exception after a few random seconds
  • same exception as in ticket by using a tuple for list index at line 199

One other thing that's struck me is the code I was running was USB MIDI related so could other traffic over USB to the CPX have some triggering effect here?

#

Acutally I just re-ran one of my examples from comments on 4.0.0 beta 7 and it did it on the second raise on REPL:

>>> raise AttributeError("abcdefghij" * 12)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij
>>> raise AttributeError("abcdefghij" * 12)
Traceback (most recent call last):
  File "<stdin>", line 1, in <m...
solar whale
#

@tidal kiln Nice job on the Tide chart for the PyPortal -- works great!

spark hill
manic glacierBOT
spark hill
#

Pushed the PyBadge .brd

#

To Fusion 360

manic glacierBOT
spark hill
stuck elbow
#

that's for the light sensor

#

there is an up-side-down LED soldered on the other side

#

you want to leave that hole exposed

manic glacierBOT
orchid basinBOT
tidal kiln
#

@solar whale thanks! and thanks for trying it out. glad it worked πŸ˜ƒ

shy elm
#

I've been looking for a circuitpython library for the NRF24l01 and had no luck yet. Yet I was wondering if there was a library for it or would I have to use arduino.

unkempt quest
#

Hey all, I'm new to the discord but I wanted to share a project I did with the Pyportal and a raspberry pi! I wanted a tweet display similar to the quote book project but I had no easy way to access the Twitter API from the Pyportal so I setup a raspberry pi with python-twitter to get new tweets every 5 minutes, post them to a web server page, also hosted on the Pi, in order to update the json file with a bunch of tweets. The Pyportal then gets individual tweets on a page that selects a random tweet from the array and puts it up on the page. From that point it's just like the quote book with different text positioning and a different background.

#

I'm working on a full build write up now so I'll share it when I'm done.

scarlet maple
orchid basinBOT
#

@jwcooper Yes, it will need to be there. I was unclear with my expectation so @sommersoft didn't know the entirety of what I wanted for the contributions page. We discussed it last night and he's sorting how he wants to do it since it now resembles the current adabot script more closely. Sommersoft can explain better what his plans are now.

unkempt quest
#

@scarlet maple yeah it does! That's an awesome project!!

scarlet maple
#

Still need to debug why some web requests don't return correctly. But when it's in use, don't have a convenient way to monitor serial on it (just has power and Wifi normally).

unkempt quest
#

Same with mine. Its sitting next to my TV just plugged into a power strip.

#

@scarlet maple I know this is more of a question for the circuit python help channel but it seems like you would know the answer, if I wanted to get data from say 3 different sites, then have the Pyportal scroll throught the sources every minute or so, how would I accomplish this? Basically, how can I have multiple "data_sources"

manic glacierBOT
scarlet maple
#

@unkempt quest I just abuse the wget method for that. Grab data, write to file, parse file. I think there might be options to just return the raw text without a file, too.

unkempt quest
#

Oh! That sounds much easier than I was thinking about

slender iron
#

@stuck elbow you can add to the pull request by pushing to the branch for it. you just have to make sure you pull down the latest commits from github first

stuck elbow
#

@slender iron yeah, but the help on how to pull from a pull request assumes you have merging power, there is no link to that available on the page when you don't

#

so there is no way for me to pull it

spark hill
#

Thanks for the info deshipu!

slender iron
#

@stuck elbow it's just a branch in your repo

stuck elbow
#

ah, so you basically pushed those commits to my fork?

slender iron
#

yup!

stuck elbow
#

makes sense now, thanks

slender iron
#

np, I know it's weird

stuck elbow
#

I would assume you don't have the rights

meager fog
#

@unkempt quest sweet - great build!

slender iron
#

@stuck elbow I think that was the case until the introduction of the "maintainers can edit" check box on PRs

meager fog
#

@tidal kiln heya small fix for your thermocouple code

#

you dont setResolution so you dont actually get a better resolution output - default is always 10, but you can get 12 on M0 and M4

tidal kiln
#

yep. guess i was just going with most basic example.

#

thought about having that in but maybe commented out?

meager fog
#

you should always try to set it

#

no risk

#

and they can bump to 12 if they have an m0

tidal kiln
#

want me to update it? would need to check the volts math.

manic glacierBOT
stuck elbow
#

@meager fog do I need a samd09 for seesaw or will it also work on samd11?

#

I guess I can just use one of the seesaw wings for development

meager fog
#

should work on anything

#

we use samd10 for captouch

stuck elbow
#

roger

manic glacierBOT
pastel panther
tidal kiln
#

@meager fog looks like i already generalized the volts math, so it's just a matter of adding

  analogReadResolution(ADC_RESOLUTION);

to setup().
want me to PR that change real quick?

spark hill
#

When does the py badge realease?

exotic pumice
#

"when it's ready"

#

probably the only answer you'll get

manic glacierBOT
spark hill
#

Logical answer sajattack lol

exotic pumice
#

@spark hill keep an eye on this channel though, limor usually posts here when the first batch of a new board is out

manic glacierBOT
spark hill
#

Ok cool. Thanks!

manic glacierBOT
manic glacierBOT
spark hill
#

I chamfered the edges to give it a slight polygonal look.

orchid basinBOT
#

I think we could leave this unlisted until we build up the content.

The "download instructions" button links to whatever is set in the front matter on the board.

Two new required fields for blinka:

download_instructions: "https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi"
blinka: true

Screenshots:

circuitpython.org/blinka:
![Blinka](https://user-images.githubusercontent.com/311256/56315886-8fbdbb00-611e-11e9-9c6f-13...

tough flax
#

So, I'm regularly needing to do a "moving average" to level input voltage out, debounce & stuff like that. I've come up with this little class: I was wondering if anyone could take a look at tell me if there's already this ability somewhere in Python or if I could do it more efficiently?

class RollingAverage:
    def __init__(self, size):
        self.size=size
        self.buffer = array.array('d')
        for i in range(size):
            self.buffer.append(0.0)
        self.pos = 0
    def addValue(self,val):
        self.buffer[self.pos] = val
        self.pos = (self.pos + 1) % self.size
    def average(self):
        return (sum(self.buffer) / self.size)
ruby lake
#

@tough flax You might try exponentially-weighted sample averaging. I use a line likecvi[mux] += (pot[mux].value - cvi[mux]) >> 2

#

when I read a series of input pots

tough flax
#

So, given real values instead of integers, you're adjusting the average by 1/4 the difference between the new value and the average?

#
avgVal += (newVal - avgVal)/4
#

and the 4 is arbitrary?

#

If you get the same value for 4 readings, you'll stabilize... you can make that 10/20/2?

#

That's certainly faster if you're using the value every reading. The RollingAverage class lets you store the data and only use it when you need it, but has the storage cost (no biggie) and the cost of summing (same division... if you want to use integers, you could use the same trick on the RollingAverage)

manic glacierBOT
manic glacierBOT
upbeat plover
#

@stuck elbow random crash with ball.py
`Traceback (most recent call last):
File "main.py", line 38, in <module>
File "stage.py", line 445, in tick
ReloadException:

Code done running. Waiting for reload.
soft reboot`

#

something to do with game.tick()

stuck elbow
#

that is reload after something wrote something to the disk

manic glacierBOT
#

Ok, i will try to fill a PR before the weekend, i only have a Feather nRF52840 so i will need your help to test it. @tannewt, @dhalbert Do you agree with the symbol names proposed?

// file: mpconfigboard.h

#define CIRCUITPY_RGB_STATUS // Defined in boards with RGB status LED

#define CIRCUITPY_RGB_STATUS_R (&pin_PA17) // Red LED of the status LED
#define CIRCUITPY_RGB_STATUS_G (&pin_PA16) // Gree LED of the status LED
#define CIRCUITPY_RGB_STATUS_B (&pin_PA19) // Blue LED of the...
upbeat plover
#

@stuck elbow duty_cycle =255 turns off the backlight

stuck elbow
#

oops

upbeat plover
#

and del _INIT_SEQUENCE will free up some ram

stuck elbow
#

it won't

upbeat plover
#

128 bytes, tested

stuck elbow
#

it would if I left it as bytearray

#

but its a bytestring now

upbeat plover
#

@stuck elbow maybe should file issue cause del saves 128 bytes

#

tested just now with current repo

stuck elbow
#

interesting

#

I will add it then

upbeat plover
#

I like my RAM freeeeee =}

stuck elbow
#

del shouldn't be doing anything on a bytestring created from a literal :/

#

oh well

bitter dove
#

Is it a good idea to have, in development, code that evals from api call?

slender iron
#

@stuck elbow why not? it's brought into memory with the import

stuck elbow
#

@slender iron it's part of the bytecode, no?

slender iron
#

no, I think it'd be referenced from the module dictionary

#

so del will delete it from the dictionary

stuck elbow
#

maybe strings and bytestrings are handled differently

#

anyways, good to know

ruby lake
#

@tough flax Sorry, afternoon commute delay response. πŸ˜‰ In my case I am reading/using the read values every iteration.

slender iron
#

ya, and where they are defined matters as well

manic glacierBOT
upbeat plover
#

@stuck elbow i think the buttons still need work?

#

jumper.py runs forward while jumping and shooting

orchid basinBOT
slender iron
#

@tidal kiln is that crash you found still happening?

#

try it with the latest, you may have been hitting the shared bus issue

tidal kiln
#

various, yah, but still trying to nail down a repeatable something

#

latest = from s3?

slender iron
#

ya

#

will probably release again at the end of this week too

tidal kiln
#

cool. i'll grab that and see what happens.

slender iron
#

thanks!

tidal kiln
#

thusly?

Adafruit CircuitPython 5b94b77 on 2019-04-17; Adafruit PyPortal with samd51j20
>>> 
slender iron
#

Looks like the latest is 00379dbb7ec779663247f4ff886710594a8e629a

#

but travis is still catching up

manic glacierBOT
tidal kiln
#

oh...latest latest...not just latest

#

will watch for that hash

manic glacierBOT
slender iron
#

thanks @tidal kiln

pastel panther
slender iron
#

we'll need to add it as a subproject to the main circuitpython one

#

what is your rtd name?

pastel panther
#

siddacious

slender iron
#

added you as a maintainer

pastel panther
#

ok, thanks

manic glacierBOT
#

@tannewt the pyportal, pybadge, and the hallowing all start with auto_brightness True. The doc in Display.c says

The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When auto_brightness is True this value will change automatically and setting it will have no effect. To control the brightness, auto_brightness must be false.

The above isn't actually true: there's no check for .auto_brightness when setting .brightness. I like @makermelissa 's suggestio...

pastel panther
#

@slender iron got it working, thanks!

manic glacierBOT
#

Oops. :-)

Ya, they should be auto_brightness = True by default so that you can see what is on the display. Maybe it's worth having it as (yet another) kwarg to Display so it doesn't flash on init. The light sensor isn't actually used yet. (All three do have one.)

auto_brightness is meant to hand off brightness between user code and the VM. We can't use just brightness because we may want to read back the auto value before transitioning to manual control.

manic glacierBOT
manic glacierBOT
#

The readthedocs builds have been failing for some time, and we didn't really notice.
https://readthedocs.org/projects/circuitpython/builds/

The latest failure is:
ModuleNotFoundError: No module named 'sphinxcontrib.rsvgconverter'
but if you go back a bit, there's an error about a png file that's not really PNG (?).

(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) [1{/var/lib/texmf/fo
nts/map/pdftex/updmap/pdftex.map}] [2] [1] [2] [1] [2]libpng error: Not a PNG file

...
tulip sleet
#

@slender iron I did #1813 completely simultaneously with #1811 being merged πŸ˜ƒ Did you already fix the .png issue in your previous PR?

manic glacierBOT
slender iron
#

@tulip sleet yes if it was in a previous build

tulip sleet
#

It worked! I just refreshed the rtd page!

tulip sleet
#

ok, clearly I need to πŸ’€

cerulean pawn
lofty nova
#

@cerulean pawn nice board

cerulean pawn
#

thanks @lofty nova

manic glacierBOT
manic glacierBOT
#

I experience a hard crash when I use stage module with circuitPython 4 beta 7 recompiled with CIRCUITPY_STAGE = 1 option.
I tried the demo example (ball) and the jumper game. Each time, the game launches and crashes after few minutes.
The crash occurs on a itsybitsy M4 and a metro M4 as well. The display used is adafruit 1.8" Color TFT LCD display with MicroSD Card Breakout - ST7735R (product 358).

manic glacierBOT
solar whale
#

Posted first run of CP controlled Deer Deterrent Device to #show-and-tell ... still much to be done, but off to a good start πŸ˜‰

stuck elbow
#

now all the deer that used to watch it will stop

manic glacierBOT
stuck elbow
#

do we have a guide on debugging CP without Atmel Studio?

manic glacierBOT
stuck elbow
manic glacierBOT
stuck elbow
#

@tulip sleet can you lend me a hand with gdb?

#

@tulip sleet so I have the debug build crashed with gdb connected, what should I do now?

#

an by crashed I mean that the LED is pulsing

#

but the program seems to be running still

tulip sleet
#

so it sounds like a hard crash, and you've already lost the stack

#

hmm ??

#

what does the backtrace show?

stuck elbow
#
(gdb) target extended-remote :2331
Remote debugging using :2331
0x0000058c in ?? ()
(gdb) load
Loading section .text, size 0x3b858 lma 0x4000
Loading section .ARM.exidx, size 0x8 lma 0x3f858
Loading section .data, size 0x2e4 lma 0x3f860
Start address 0x4000, load size 244548
Transfer rate: 14048 KB/sec, 13586 bytes/write.
(gdb) monitor reset
Resetting target
(gdb) c
Continuing.
#

this is what gdb is at

#

should I ^C it?

tulip sleet
#

so, set a breakpoint at HardFault_Handler and restart it. That should catch a hard crash. If that doesn't work you can set a breakpoint at nlr_jump, which will catch Python exceptions

#

when you did mon reset and c, you restarted CircuitPython

stuck elbow
#

I interrupted it, and now I got:

#
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
0x0000511a in run_code_py (safe_mode=<optimized out>) at ../../main.c:257
257            if (reload_requested) {
(gdb) tb
Temporary breakpoint 1 at 0x511a: file ../../main.c, line 257.
(gdb)
tulip sleet
#

ok, I spoke too soon above. You did a load, mon reset, and c, and that started it for the first time. so when it crashes or hangs, if it doesn't come back to the gdb prompt, then ^C, and let's look at the stack

#

what is the symptom when it stops working properly?

#

to restart, you don't need to do a load again (maybe that's obvious), just mon reset and c

stuck elbow
#

restarted it with a breakpoint on that handler

#

well, the symptom is that the led is pulsing yellow, the repl is getting disconnected, and when you re-connect it, you get the info about the safe mode

#

and hard fault

tulip sleet
#

the backtrace from the hardfault breakpoint should give you helpful info, unless the stack has been smashed

stuck elbow
#

we'll see

#

I really hope this is that last bug we've been trying to find

#

but it may be something in stage as well

tulip sleet
#

you have the absolute latest master, right? Scott fixed a re-initialization problem last night

stuck elbow
#

yes

#

the i2c stuff? I don't think that's related

#

now it crashed usb on my computer...

tulip sleet
#

aaaahhh 😦

stuck elbow
#
Breakpoint 2, HardFault_Handler () at supervisor/port.c:289
289    {
(gdb) bt
#0  HardFault_Handler () at supervisor/port.c:289
#1  <signal handler called>
Backtrace stopped: Cannot access memory at address 0x2002fbf8
(gdb) 
tulip sleet
#

do you use exceptions extensively in the code? If not, set a breakpoint at nlr_jump, and you can see if it throws a Python exception that you're not expecting.

stuck elbow
#

ok, in a moment, need to reboot

tulip sleet
#

if you stay in gdb too long, then you'll lose the repl connection, but you can reconnect

#

how do you mean it crashed usb?

stuck elbow
#

my keyboard and mouse stopped working

#

but it's a laptop, so the internal keyboard and touchpad still worked

tulip sleet
#

is it ubuntu?

stuck elbow
#

yes

#

and a gnarly KVM

tulip sleet
#

18.04?

#

honestly, I haven't seen that before. I've been hanging up a particular port when trying to the debug the SMART errors on the BOOT drive, but I haven't broken USB completely

stuck elbow
#

yeah, actually mint 19 tara, but same thing

#

I blame the kvm, it's a bit funky

#

it's the only one that lets me use a mech keyboard

tulip sleet
#

is ubuntu the host or the guest

#

i am running ubuntu native

stuck elbow
#

not that kind of kvm

#

a physical monitor/keyboard switch

tulip sleet
#

oh πŸ˜ƒ

stuck elbow
#
(gdb) breakpoint HardFault_Handler
Undefined command: "breakpoint".  Try "help".
(gdb) break HardFault_Handler
Breakpoint 1 at 0x31508: file supervisor/port.c, line 289.
(gdb) break nlr_jump
Breakpoint 2 at 0x1a89c: file ../../py/nlrthumb.c, line 92.
(gdb) c
Continuing.

Breakpoint 2, nlr_jump (val=0x2000133c <mp_state_ctx+40>)
    at ../../py/nlrthumb.c:92
92    NORETURN void nlr_jump(void *val) {
(gdb) c
Continuing.

Breakpoint 2, nlr_jump (val=0x2000133c <mp_state_ctx+40>)
    at ../../py/nlrthumb.c:92
92    NORETURN void nlr_jump(void *val) {
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xdeadbeee in ?? ()
(gdb) bt
#0  0xdeadbeee in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
#

now I can't connect to it

#

gdb is being difficult

#
(gdb) monitor reset
Resetting target
(gdb) break HardFault_Handler
Breakpoint 1 at 0x31508: file supervisor/port.c, line 289.
(gdb) break nlr_jump
Breakpoint 2 at 0x1a89c: file ../../py/nlrthumb.c, line 92.
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x0000058c in ?? ()
(gdb) bt
#0  0x0000058c in ?? ()
#1  0xfffffffe in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
#

ok, I think I finally have something useful

#
Breakpoint 1, HardFault_Handler () at supervisor/port.c:289
289    {
(gdb) bt
#0  HardFault_Handler () at supervisor/port.c:289
#1  <signal handler called>
#2  0x20006f90 in ?? ()
#3  0x0001561a in common_hal_busio_spi_write.part.1 (self=<optimized out>, 
    data=<optimized out>, len=<optimized out>) at common-hal/busio/SPI.c:320
#4  0x2000133c in mp_state_ctx ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
manic glacierBOT
#

After a few tries, I managed to get this traceback:

Breakpoint 1, HardFault_Handler () at supervisor/port.c:289
289	{
(gdb) bt
#0  HardFault_Handler () at supervisor/port.c:289
#1  <signal handler called>
#2  0x20006f90 in ?? ()
#3  0x0001561a in common_hal_busio_spi_write.part.1 (self=<optimized out>, 
    data=<optimized out>, len=<optimized out>) at common-hal/busio/SPI.c:320
#4  0x2000133c in mp_state_ctx ()
Backtrace stopped: previous frame identical to this frame (corrupt...
stuck elbow
#

that line is status = spi_io->write(spi_io, data, len);

#

looking at the code, that only gets called when transferring less than 16 bytes

#

so it must be one of the commands

raven canopy
#

If you remove the flto flag for debug in the makefile, gdb will show the param values in the trace..

stuck elbow
#

ok, trying that

raven canopy
#

And if they're pointers, you can print the dereferenced values with print.

stuck elbow
#
#0  HardFault_Handler () at supervisor/port.c:296
#1  <signal handler called>
#2  0x20006fa0 in ?? ()
#3  0x0002c94e in common_hal_busio_spi_write (self=<optimized out>, 
    data=0x2000181e <displays+94> "*+,", len=1) at common-hal/busio/SPI.c:320
#4  0x200012b8 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
#

looks like sending one of the commands

tulip sleet
#

sorry, I had to go out

orchid basinBOT
stuck elbow
#

could it be that it is crashing because displayio is trying to write to spi while stage is already doing that?

tulip sleet
#

the spi writes are synchronous (or should be)

stuck elbow
#

how would I figure out which member is <displays+94>?

tulip sleet
#

you could print *displays

#

is this compiled with DEBUG=1?

stuck elbow
#

yes

#

and with flto disabled

#

that gives me the whole struct

#
$5 = {{fourwire_bus = {base = {type = 0x47a44 <displayio_fourwire_type>}, 
      bus = 0x20002920, inline_bus = {base = {type = 0x0}, spi_desc = {dev = {
            prvt = 0x0, char_size = 0 '\000', dummy_byte = 0}, io = {
            write = 0x0, read = 0x0}, flags = 0}, has_lock = false, 
        clock_pin = 0 '\000', MOSI_pin = 0 '\000', MISO_pin = 0 '\000'}, 
      command = {base = {type = 0x0}, pin = 0x44e30 <pin_PB09>, output = true, 
        open_drain = false}, chip_select = {base = {type = 0x0}, 
        pin = 0x44e20 <pin_PB08>, output = true, open_drain = false}, reset = {
        base = {type = 0x0}, pin = 0x44c90 <pin_PA04>, output = true, 
        open_drain = false}, frequency = 24000000, polarity = 0 '\000', 
      phase = 0 '\000'}, parallel_bus = {base = {
        type = 0x47a44 <displayio_fourwire_type>}, bus = 0x20002920 "p0", 
      command = {base = {type = 0x0}, pin = 0x0, output = false, 
        open_drain = false}, chip_select = {base = {type = 0x0}, pin = 0x0, 
        output = false, open_drain = false}, reset = {base = {type = 0x0}, 
        pin = 0x0, output = 48, open_drain = 78}, write = {base = {
          type = 0x1}, pin = 0x0, output = 32, open_drain = 78}, read = {
        base = {type = 0x1}, pin = 0x0, output = 144, open_drain = 76}, 
      data0_pin = 1 '\001', write_group = 0x16e3600, write_mask = 0}}, 
  display = {base = {type = 0x479b0 <displayio_display_type>}, 
    bus = 0x200017c0 <displays>, width = 160, height = 128, color_depth = 16, 
    set_column_command = 42 '*', set_row_command = 43 '+', 
    write_ram_command = 44 ',', 
    current_group = 0x2000014c <circuitpython_splash>, refresh = false, 
    last_refresh = 172161, colstart = 0, rowstart = 0, 
...
tulip sleet
#

you can find out the addresses by print &displays[0] [1], etc

stuck elbow
#

it's probably set_column_command anyways, because it's first

tulip sleet
#

then print &displays[0].set_column_command, etc.

#

but let's look at SPI.c:320

#

we got a faul there (not INSIDE the spi_io->write). so maybe the spi_io value is bad

#

print spi_io

#

actually

fr 3
print spi_io
#

to get to that stack frame

stuck elbow
#
(gdb) print &(displays[0].display.set_column_command)
$14 = (uint8_t *) 0x2000181e <displays+94> "*+,"
#
(gdb) fr 3
#3  0x0002c94e in common_hal_busio_spi_write (self=<optimized out>, 
    data=0x2000181e <displays+94> "*+,", len=1) at common-hal/busio/SPI.c:320
320            status = spi_io->write(spi_io, data, len);
(gdb) print spi_io
$15 = (struct io_descriptor *) 0x1
tulip sleet
#

that's a bad address

#

so print *self and print self->spi_desc

#

the spi_m_sync_get_io_descriptor() on line 319 may have failed, and we didn't check the return value

stuck elbow
#
(gdb) print *self
value has been optimized out
(gdb) print self->spi_desc
value has been optimized out
#

get_io_descriptor can't fail

#
int32_t spi_m_sync_get_io_descriptor(struct spi_m_sync_descriptor *const spi, struct io_descriptor **io)
{
    ASSERT(spi && io);
    *io = &spi->io;
    return 0;
}
tulip sleet
#

you may want to rebuild this with -O0, but it will probably not fit then

stuck elbow
#

I can disable AnalagIO

#

it's big

#

and math

tulip sleet
#

also -fno-inline

#

actually -Og is good: it disables optimizations that interfere with debuggin

stuck elbow
#

it fit :)

#

samd51 is a beast

tulip sleet
#

ok, I thought this was on a ugame or something

stuck elbow
#

its itsybitsy m4

tulip sleet
#

are you having fun yet?

#

there are gui front ends to gdb, but I'm not sure how well they work with remote debugging. I've never used them extensively.

upbeat plover
#

@stuck elbow the buttons for feather_m4_minitft_featherwing dont seem right, looks like it is working but returns initegers, not bool list

tulip sleet
#

out for a brief errand

stuck elbow
#

@upbeat plover it's supposed to return integers, I just forgot to negate them

#

I will fix that later

#

of course now it's not crashing :/

river quest
pastel panther
#

oooooooh

stuck elbow
#

that's some serious rounding

old smelt
#

@tidal kiln - I thought I saw a brief blip from lady ada the other day about your displayio guide. Can't find it now. Did you post a link?

tidal kiln
#

still in works

old smelt
#

Ok. Thanks!

tidal kiln
#

got a specific question about displayio though?

slender iron
#

@stuck elbow I'm awake and can help debug now

#

@tidal kiln are you still seeing that crash?

old smelt
#

No, just interested in how it all stacks up.

tidal kiln
#

@slender iron haven't gotten back to it yet. context switch is currently in forums. maybe later today.

old smelt
#

I have everything working how I want it to at this point, but I deeper understanding of how all the pieces interact might generate some ideas on other things to try.

#

Though, I'll be hard pressed beat that nifty bouncing ball demo I saw on Show and Tell last night.

tidal kiln
#

[bitmap + palette] -> [tilegrid] -> [group] -> [display]

slender iron
#

ok, thanks @tidal kiln

tidal kiln
#

tilegrid is probably the most interesting one to figure out

old smelt
#

Right. Also - the naming seems to have ties to old school graphics/gaming terms, and I don't have experience with that stuff. The terminology doesn't necessarily create meaning contextually for me.

slender iron
old smelt
#

@slender iron - thanks for the recommendation. I'll check it out.

raven canopy
#

It's a really good talk... Such a deep dive on the GB

old smelt
#

1 hour?! Whoa... Do I get credit for this? πŸ˜‰

umbral dagger
#

The game-wing is very nice.

tidal kiln
#

it goes by fast - the pace is full on tech

old smelt
#

Sounds good.

umbral dagger
#

@slender iron OK.. I'm sucked into that talk now

old smelt
#

The intro paragraph references the Commodore 64. I remember playing Microsoft Flight Simulator on my buddy's C64 back in the day. We'd type in the load command and then go shoot hoops for about 25 minutes while the game loaded. Good memories.

umbral dagger
#

Soo... game boy emulator on the game-wing?

#

My first handheld was the GBA SP

stuck elbow
#

@slender iron thnaks, but it still didn't crash

#

I will leave it overnight

slender iron
#

when compiled with -O0?

#

or as setup in the repo?

stuck elbow
#

compiled with -Og and -fnoinline

slender iron
#

k, I'll take a look at it and see if I can't find it

#

@tulip sleet how's the backlight fix coming?

stuck elbow
#

I suspect the memory corruption is still there, just falls in a different place

slender iron
#

ya

tulip sleet
#

@slender iron it's done, just needs testing; just eating lunch

manic glacierBOT
manic glacierBOT
stuck elbow
#

@slender iron so, without the optimization flags, it still hangs, but doesn't go into the fault handler. The usb disk still works, but the code and the serial don't.

slender iron
#

where is it hanging? sounds like a mismatched lock/unlock

stuck elbow
#

not really a hang, internals seem to be still churning

#
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
filesystem_background () at ../../supervisor/shared/filesystem.c:44
44        if (filesystem_flush_requested) {
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
run_background_tasks () at background.c:69
69        filesystem_background();
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
0x0002651a in audio_dma_background () at audio_dma.c:320
320            if (dma == NULL) {
#

depending on where I interrupt it

slender iron
#

what is the backtrace for it?

#

bt

#

some wait loops still call the background stuff

stuck elbow
#

you don't actually need the display and buttons connected

slender iron
#

it probably repos on a metro just fine too

stuck elbow
#

probably

#

I have a shield for the metro with the display and buttons, btw

manic glacierBOT
slender iron
#

it's stuck waiting for displayio_display_begin_transaction(display)

stuck elbow
#

hmm, could it be stage conflicting with displayio?

upbeat plover
#

@stuck elbow i tried to make the ball.py more universal, can you review and try it out, i think it can be optimized further by not calling (ugame.display.width), (ugame.display.height) so much

stuck elbow
#

trying to write to display at the same time?

#

@upbeat plover I want to keep that tutorial simple

slender iron
#

that shouldn't be an issue if the locking is correct

stuck elbow
#

displayio_display_begin_transaction does the locking, no?

slender iron
#

it delegates to fourwire to do it

stuck elbow
#

this is where I call displayio

slender iron
#

all the calls appear matched up well

#

on technique I like is to set break points on the lock and unlock calls

#

and then:

#
$ command 1
> bt
> c
> end```
#

that way it'll print the backtrace and then continue

#

you also want $ set pagination off

#
  • that is from memory so it might be slightly wrong
stuck elbow
#

wheee!

#

a new error after I did that

#
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00023f7c in tud_task () at ../../lib/tinyusb/src/device/usbd.c:307
307                TU_ASSERT(drv_id < USBD_CLASS_DRIVER_COUNT,);
#

also, my usb is busted again, rebooting

slender iron
#

I recommend a usb data line switch to save your usb bus

#

you can probably hit the error without having usb connected

tulip sleet
#

@slender iron re the auto_brightness kwd constructor arg. You can always set it immediately. Are you just trying to avoid a flash? Do we have any displays with auto brightness that aren't built in?

#

@timber mango does it help to power-cycle the KVM switch?

slender iron
#

ya, trying to avoid a flash

#

any display with a pwm pin init will have auto brightness

tulip sleet
#

suppose there were an initial brightness value instead?

#

or in addition?

slender iron
#

you can't leave it up to user code because it's not running during the terminal

tulip sleet
#

but the board.c files don't call the constructor; they call the common_hal routine

slender iron
#

initial brightness would be ok. having it set could imply manual brightness

tulip sleet
#

i don't understand about pwm having auto brightness. I thought auto brightness was only with an ambient light sensor. Otherwise, brightness would be full on by default.

#

maybe you mean something else by auto-brightness

#

a display breakout doesn't have a light sensor, e.g. 1.44 TFT, but it does have PWM backlight pin

#

i thought auto-brightness was only for native C displays (since the board knows the light sensor pin, etc.)

manic glacierBOT
slender iron
#

@tulip sleet right now auto means full brightness

umbral dagger
#

Watching that gameboy talk makes be waht to hack some games.

slender iron
#

for cases without a light sensor it'll have to be a binary on/off choice

#

@umbral dagger you should! hopefully circuitpython in the gameboy will become more available over the next few months

#

(you could assemble one now yourself though)

stuck elbow
umbral dagger
#

I watch a video on register maniulation in assembly and you mention makecode ? πŸ˜‰

#

Although that seem compelling

stuck elbow
#

@umbral dagger no, you use the same hardware setup, you use circuitpython in place of makercode

umbral dagger
#

Ah

stuck elbow
#

but you can use pretty much any display and buttons, really

slender iron
#

@stuck elbow corrupting the spi object's memory could explain the infinite wait on the lock

tulip sleet
#

that was what we saw initially: spi_io was 0x1; it should have been a pointer to a block of function pointers

manic glacierBOT
#

TODO list based on the code in rgb_status_led, let me know if there's something else to add or something to remove.

  • [ ] Keep track of current_status_color.
  • [ ] Include code in reset_status_led.
  • [ ] Include code in new_status_color
  • [ ] Include code in temp_status_color
  • [ ] Include code in clear_temp_status
  • [ ] Include code in color_brighness
  • [ ] Include code in set_rgb_status_brightness
  • [ ] Include code in prep_rgb_status_animation
  • [ ] Include code ...
stuck elbow
#

@slender iron true

#

I hate memory corruption bugs, you can't really debug them without time-travelling debugger

tulip sleet
#

You can set a watchpoint!

#

it triggers when a memory location changes. supported in hardware on the SAMD chips

stuck elbow
#

a watch on the lock member wouldn't help much

tulip sleet
#

no, on spi_io

stuck elbow
#

now it corrupts the lock

manic glacierBOT
tulip sleet
#

go back to the previous build maybe, since spi_io should not change much (the value passed in as the arg)

stuck elbow
#

good idea, I will try that tomorrow

#

I've had enough for today :)

manic glacierBOT
slender iron
#

I'll take a look for the corruption later today

#

need to get some lunch soon

stuck elbow
#

thanks

tulip sleet
#

@slender iron I think for all the possible cases we need both brightness and autobrightness kw args. Could encode one as the other, but that's messy.

slender iron
#

works for me

stuck elbow
tulip sleet
#

@timber mango congrats on learning a debugger first written in 1986

#

I'm thinking it might be something that is not long-lived but should be, or there's a missing root pointer

stuck elbow
#

@tulip sleet I've seen worse

slender iron
#

@stuck elbow it can happen when treating a pointer as the wrong type too

stuck elbow
#

I'm casting between uint16_t and uint8_t there, but I'm adjusting the lengths everywhere for it

manic glacierBOT
slender iron
#

@stuck elbow I'm thinking more like the wrong mp_obj

manic glacierBOT
manic glacierBOT
manic glacierBOT
tidal kiln
#

@slender iron ok, scheduler just fired and context switching to CP. looks like there's yet another update on S3? want me to work with 70dd616?

slender iron
#

ya, whatever the latest one is @tidal kiln

tidal kiln
#

ok. thanks.

slender iron
#

thank you!

manic glacierBOT
manic glacierBOT
raven canopy
#

@slender iron i just tested 70dd616 on a Metro M4. works aok for me on win10.

tough flax
#

quick pointer in the code to where boot.py is loaded and managed?

#

run_boot_py in main.c?

raven canopy
#

called at line 422

tough flax
#

etags to the rescue

manic glacierBOT
manic glacierBOT
#

@debrouxl @TheKitty @siddacious
I'm trying to track this down, so I thought I'd ask if you if you could give an inventory of the software installed on your machine. These utilities list installed software, drivers, and security software, respectively. They'll produce a simple HTML report (look under View), or save a list as a text file (select all the items and then choose File->Save.

If you're willing to run these and post the results here, I'd be grateful. If you want to prune the list...

#

Another thing that would be helpful is a USB trace. This requires either some hardware (Beagle, usually), or else setting up Wireshark and USBPCap to capture the USB events. If you are familiar with this or have such a device, let us know.

@siddacious Are you seeing the same errors as above, or is #1749 different? For instance, if you try before and after the commit @debrouxl has noted, do you see success on a build before that commit? I can make some test builds for you if it would save y...

manic glacierBOT
#

@dhalbert I have seen the "things disappear after flashing" behavior previously with a different board but that wasn't what I've been seeing with my feather m0. I believe it was with my metro m4 when I flashed it with beta 7 to get a backtrace for the i2c issue I reported.

I have the above reports but they're too large to inline here. I can give them to you on discord.

I will try before and after the commit mentioned. I don't have a beagle but I suppose I could get one if you thought it...

#

@dhalbert was looking through the reports and found this which you had previously mentioned

==================================================
Driver Name       : HpSAMD
Display Name      : 
Description       : 
Startup Type      : Manual
Driver Type       : Kernel
Error Control     : Normal
Group             : SCSI Miniport
Filename          : C:\WINDOWS\system32\drivers\HpSAMD.sys
Driver File Type  : System Driver
File Created Time : 9/15/2018 12:28:17 AM
File Modified Tim...
manic glacierBOT
manic glacierBOT
#

@critor 's tests used a M0-class TI-Python Adapter platform, which was featured several times on the Adafruit blog, against Windows 10 1803 17134.706. AFAWCT, unsurprisingly, the TI-Python Adapter and various M0-based platforms have excellent compatibility: several Adafruit platforms and the Arduino Zero can run TI's firmware verbatim, and the TI-Python Adapter can run at least my improved build of CircuitPython featuring more math functions.
critor is familiar with USBPcap, he's used it mul...

manic glacierBOT
#

@tannewt In light of other, possibly sporadic USB with boards running CircuitPython (#1749 #1782) issues perhaps this is worth digging into more? Can you ask a few of the usual suspects to cut and paste that raise line into REPL 15 times carefully to see if they can reproduce this ideally on Windows? They need to check each time visually that output has popped out in full before pasting the next one in.

manic glacierBOT
lone sandalBOT
manic glacierBOT
#

@debrouxl I just want to understand clearly what's failing. Tell me if this is correct: You have seen this problem with regular (not just custom) CircuitPython builds at commit 9d43a25 and later. When a board (including several Adafruit boards) is running a CircuitPython build at or later than that commit, then it does not enumerate on your Windows 10 machine.

  1. Is the above correct.
  2. Does it have to be running a particular boot.py and main.py/code.py, or is it just the build itsel...
orchid basinBOT
tidal kiln
#

@slender iron had at least one hardfault with 70dd616 while playing around with displayio stuff last night. i've soldered on a SWD connector so i can try and capture a stack trace for you. currently trying to get all that sw setup and working.

stuck elbow
#

@slender iron got async DMA spi working on Β΅Game, you were right, there is barely any speedup

#

@slender iron but I untangled the shared_dma_transfer into shared_dma_transfer_start and shared_dma_transfer_wait in peripherals, maybe we want to keep that?

granite crow
#

Hi, I'm working to try to get the particle RGB Status LEDs working, I just noticed that particle boards have already defined symbols for those pins, MICROPY_HW_RGB_LED_RED for the red one, etc, I was thinking on defining symbols like CIRCUITPY_RGB_STATUS_R for the same purpose, should I use MICROPY_HW_RGB_LED_RED for all bords as it's already defined?

tulip sleet
#

@granite crow yes, you can use the existing names for those pins. Take a look at some existing boards for guidance

granite crow
#

@tulip sleet hi, from what I found only Particle boards have those symbols defined, so I think I will stick with those symbols, MakerDiary and Nordic Dongle boards don't have any reference to it's RGB LEDs. This is in reference of issue 1382

manic glacierBOT
river quest
tulip sleet
#

@granite crow since the dongle (pca10059) has one plain red LED, we were using that. Feel free to #define new names to help use the RGB led, with names that match other such cases.

manic glacierBOT
manic glacierBOT
slender iron
#

@tidal kiln were you making your own fourwire bus? I fixed a bug around that

tidal kiln
#

@slender iron no pyportal

slender iron
#

@stuck elbow it's definitely worth getting in (maybe once 4.0 is done). It'll matter more when the pixel computation is fast

#

@tidal kiln hrm, k please file an issue on it

#

@granite crow I'm ok if you want to rename. Either name is good

#

@river quest yup! look nice. definitely the right pocket color scheme

stuck elbow
#

@slender iron right now I have a hack in there because I couldn't find a way of making the wait function idempotent -- that is, to do nothing if no transfer is happening

#

I can make a pull request with the hacky code I have, and we can take it from there

manic glacierBOT
slender iron
#

@stuck elbow sounds good. I'm out this weekend so I'll look next week.

stuck elbow
#

happy holidays

exotic pumice
wraith tiger
#

Here I’m analyzing the serial data from my dmm to the serial-to-usb adapter and the usb data from the adapter to the computer.

manic glacierBOT
manic glacierBOT
#

there is no mechanism for accessing the card via the USB port on the device. That is, there's no passthrough from USB to the card filesystem

Hello dhalbert,

What would need to be done to enable this functionality? It seems like the plumbing is already there since it works with spi flash chips already.

I have some projects that need to be enclosed in project boxes, yet the sd card will be full of sounds and config files that need to be edited from time to time. It would be great to ...

manic glacierBOT
#

CIRCUITPY is a single filesystem volume. The SD card is another storage volume, and so isn't visible inside CIRCUITPY.

It is conceivable we could do this, but we'd have to think about it. One issue is whether the SD card volume would be readonly. To use it safely while the program is running, it would need to be mounted readonly to the CircuitPython code, in case you were editing it over USB at the same time.

We can reopen this as a long-term feature. I'll discuss it with the other core...

manic glacierBOT
manic glacierBOT
#

Today's tests show that he can't reproduce the problem with pristine master (sorry, I should have checked earlier). However, he can reproduce at will with small changes in the USB ares on top of current adafruit/circuitpython master HEAD, which I've pushed at https://github.com/debrouxl/circuitpython/tree/trinketm0_usb_comm_broken_after_tinyusb_change .
It's just a matter of disabling and not building USB HID + USB MIDI support, and poof, USB communication capability between @critor 's compu...

lone sandalBOT
manic glacierBOT
#

@debrouxl You have to remove the HID and MIDI devices from the USB descriptor as well. I did that: here's a diff from the branch you linked to above. My changes are the two ####### to comment out those devices.

diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py
index 10bbf5066..ae824b207 100644
--- a/tools/gen_usb_descriptor.py
+++ b/tools/gen_usb_descriptor.py
@@ -276,14 +276,14 @@ descriptor_list.extend(cdc_interfaces)
 descriptor_list.extend(msc_interfaces)...
stuck elbow
#

@tulip sleet I realize it's "when it's ready", but I wonder if you have any tentative release plans?

tulip sleet
#

We’re hoping for RC soon

#

The q is whether there are remaining storage problems.

stuck elbow
#

I think that bug with copying a file while spi is running was just the same gc-related bug that was just fixed

granite crow
#

@tannewt Ok, I will keep the symbols as I have them until now, there are some functions I haven't implemented so far, idk if you can take a look at the PR next week when you have some free time.

manic glacierBOT
manic glacierBOT
nocturne hatch
#

@tulip sleet Happy to hear that there may be a RC soon. πŸ‘Œ Will nrf52840 boards remain "beta" or will they be considered "stable" with an upcoming release? πŸ˜ƒ

manic glacierBOT
#

I've been using multiple boards recently plugged into the same host and I've left a zero byte file on each to mark them so I can ensure from REPL I'm using the correct board when it's important. I noticed on this particular CPX (running 4.0.0 beta 7) that there are loads of bogus 8.3 filenames composed purely of NUL characters. Is this minor file system corruption or a os.listdir bug? Windows file explorer and old skool DOS emulated dir show everything normal.

Press any key to...
manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

That was my first thought but I then wondered if this could be an obscure listdir bug? This probably gets limited used, I've only used it a hand full of times.

Is there an fsck equivalent library call to independently check the health of the file system? Actually
there's the crappy old DOS remant, chkdsk and that does show problems:

C:\Users>chkdsk e:
The type of the file system is FAT.
Volume Serial Number is xxxx-xxxx
Windows is verifying files and folders...
Wind...
tulip sleet
#

@nocturne hatch The nRF boards will also be not beta. There are more BLE features to add, but the the current build is stable.

nocturne hatch
#

Great! 😁 Does that mean there will be more features added to the BLE library, once the 4.0.0 release is finished? 😍