#circuitpython-dev

1 messages ยท Page 281 of 1

past herald
#

It may depend on your JTAG connection... going through OpenOCD seems to allow access to the additional registers.

trim elm
#

@idle owl An issue on the Adabot repo mentioned adding the count of good first issues to the weekly stats generated by adabot. Do you think that would be a worthwhile thing to do?

manic glacierBOT
#

Delays are shorter than expected, due to rounding down, and coarse millisecond precision.

This code gives a 125 Hz waveform, but should be approx 100 Hz.

import board
import digitalio
import time

led = digitalio.DigitalInOut(board.D13)
led.switch_to_output()

while True:
        led.value = True
        time.sleep(0.005)
        led.value = False
        time.sleep(0.005)

Details here:
https://forum.pjrc.com/threads/59040-CircuitPython-on-Teensy-4!?p=226231&v...

raven canopy
#

@onyx hinge I'm interested to see how you approach it. I did take the "never distort" approach. And that 16bit unsigned...no CMSIS and my lack of assembly kept me from getting it done "fast". ๐Ÿ˜

onyx hinge
#

@raven canopy some number of steps forward, some number of steps back, and it's not clear what the net direction overall is

manic glacierBOT
#

I'm getting a "Can't remount '/' when USB is active" error, when calling storage.remount("/", False) , despite the fact USB is not connected while the command is running.

Steps to reproduce

The board has to be battery powered, so that it keeps running the code even when USB is disconnected.

  1. Get into CircuitPython REPL (over USB-CDC)
  2. Type the following code:
import storage
import time
try:
  time.sleep(15)
  success = False
  storage.remount("/", True)
  ...
onyx hinge
#

oops I think I just hosed my IS31FL3731. I had read the docs which said the panel was symmetric so I didn't think twice when attaching it to the driver board. the driver board is upside down. #lfmf

#

if only I'd actually followed the online guide I couldn't have made this mistake, since they soldered the "control port" connector first

#

time to eat something rq before the meeting

idle owl
#

<@&356864093652516868> Here's the notes doc for the meeting in ~12 minutes. Please add notes even if you're attending, it's super helpful! Talk to you all soon! https://docs.google.com/document/d/1IA9bA0Inf2JrTk_CbDvENPPGOuqmmtdmfv5Nj2sbKmg/edit

old smelt
#

Lurking

turbid radish
#

I think I'll be lurking to incase JP needs a hand

indigo wedge
#

lurking

cunning crypt
#

Lurking!

crimson ferry
#

sometimes mobile internet is all one can get (like my area)

ivory yew
#

Likely offline / lurking, but I left some notes in the doc.

cunning crypt
#

@onyx hinge You've got a truly note-worthy job

sterile bronze
#

lurking

errant grail
#

text only today

swift arrow
#

lurking only

manic glacierBOT
river quest
#

HUG REPORT FOR @indigo wedge

#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

Testing CircuitPython on Teensy 4.0 โ€“ IoT made easy IoTeensy (video)! Scott and Artur have done an amazing job bringing CircuitPython to the NXP iMX RT1062, this chip holds a lot of promise! โ€ฆ

indigo wedge
river quest
fierce girder
#

@indigo wedge amazing

river quest
#

Today's second project: @CircuitPython support for the #OpenBook! It's not 100% there yet โ€” I have yet to get the screen working as board.DISPLAY โ€” but I can create it in main and it "just works" with @tannewt's IL0398 driver. This feels like a big step. https://t.co/U...

Likes

117

fierce girder
#

photorealism of those renders ๐Ÿ™‚

river quest
#

PyCascades 2020 in Portland is just a month away, Scott is speaking and Nina made a PyPortal countdown!
https://twitter.com/nnja/status/1215414459964878848

Did you know that #PyCascades2020 in Portland is just a month away? ๐ŸŽ‰

To keep track, I built a countdown timer using my @adafruit PyPortal.

๐ŸŽŸtickets: https://t.co/CWbr7pDvBL
๐Ÿ—ฃtalks: https://t.co/5zT0HSxOcA
๐Ÿ‘ฉโ€๐Ÿ’ป code: https://t.co/l2K6LTlgyr
๐Ÿฆ follow: @...

โ–ถ Play video
slender iron
#

I am the last of the conference. ๐Ÿ™‚

river quest
onyx hinge
#

the net issues increase is mostly exciting iMX ideas I think

indigo wedge
#

Yes I created 34 iMX issues ๐Ÿ˜…

slender iron
#

@cunning verge please mute in the meeting

#

the audio is echoing back

cunning verge
#

@slender iron Many apolofgies to all affected. i am still very new & finding my way around discord. My PC has no microphone connected so did not think it would affect the stream

slender iron
#

@cunning verge no problem! thanks for sorting it out

#

are you just listening in?

turbid radish
#

@idle owl - any time

cunning verge
#

@slender iron at the moment. still getting my head around all the features that Discord offers, also no where near being in a position to offer any input to such a great & talented group . Is there any protocol here that I should be aware of for people who are just listening?

slender iron
#

yup, just let us know you are lurking and we'll skip you when we do the round robins

#

let us know if you have any discord questions, we're happy to help answer

cunning verge
#

Hi folks just lurking so please skip past me !

errant grail
#

@pastel panther there is a font folder in the repo with the OpenSans-9 font.

indigo wedge
manic glacierBOT
prime flower
manic glacierBOT
turbid radish
#

Guide coming for that @prime flower

errant grail
#

Thanks @prime flower! I'd better get busy on that guide.

pastel panther
#

@errant grail whoopsie doodle, I must have missed that

errant grail
#

@pastel panther ... another reason to get busy on the guide!

onyx hinge
#

I hope I have more time going forward

solar whale
#

๐Ÿ“ฌ

half sedge
#

Text only. Sorry I was lost in timezone computation. I wrote my notes.

indigo wedge
#

Hope they don't get discouraged by the Alpha-ness of it ๐Ÿ™‚

pastel panther
#

@slender iron dylan and I can PyPi-ify it but it should be close to ready, just needing a release

slender iron
#

@pastel panther that would be amazing

#

it shouldn't be too difficult

pastel panther
#

we may have disabled it by renaming the setup.py but I think otherwise it should be good to go

tidal kiln
#

yep

slender iron
#

๐ŸŽ‰

pastel panther
#

wew ๐ŸŽ‰

turbid radish
#

@tulip sleet - are you sure???? ๐Ÿคฃ

half sedge
#

yes

#

PyPortal arrived today!

pastel panther
#
slender iron
#

the others will use it

pastel panther
#

ok

slender iron
#

thank you, thank you

pastel panther
#

sure thing

uneven yarrow
#

I'm reading through a circuit python tutorial and I see this function definition:

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

I get that the 3.3 is our total logic level voltage, but what is 65536

#

?

pastel panther
#

@ionic elk just think of it as a chance to get rid of all the cruft and tune your installation procedures ๐Ÿ™‚

slender iron
#

@uneven yarrow analog values are normalized to 16 bits

#

so 65536 is the analog value at 3.3

#

@ionic elk mute please

ionic elk
#

sorry

slender iron
#

np

uneven yarrow
#

ah ok. thanks!

slender iron
#

np ๐Ÿ™‚

ivory yew
indigo wedge
#

MMh, that would be neat ๐Ÿ˜„

slender iron
manic glacierBOT
raven canopy
#

You could utilize Discord custom status to highlight when you're available... (Cause we need more options in this convo. lol)

raven canopy
#

It's really spotty.

#

If you edit the URL directly, it works.

onyx hinge
#

tuesday works for me

prime flower
#

Tues!

half sedge
#

I want to test my microphone...

errant grail
raven canopy
#

crickit :+1:

turbid radish
#

Violent Crickets is a great band name

ionic elk
#

A metal band for empty venues

slender iron
#

@half sedge I'll stick around after the meeting so you can test

half sedge
#

@slender iron Assuming I can have the same setup next week.

indigo wedge
#

๐Ÿค˜

turbid radish
#

Thanks all

errant grail
#

Thanks!

raven canopy
#

Thanks everyone!

slender iron
#

yay!

turbid radish
#

Congratulations @idle owl

indigo wedge
#

that issue number didnt sound right, you said 20 but i myself created 34 ๐Ÿ˜„

raven canopy
#

It happens a lot. The last couple will often not show it. Def a GutHub issue.

#

AttoCurroct, ftw. ๐Ÿ˜

indigo wedge
#

is Gut Hub for sharing recipes ?

errant grail
#

Some of those domain names will increase in value. Stock up now!

indigo wedge
#

nrf does

slender iron
half sedge
#

Not yet

indigo wedge
#

I'm 100% sure I screwed up the pins or peripherals in the imx port somewhere

#

there were just so many

half sedge
#

Next time.

indigo wedge
#

you can use nmigen to make a soc

#

(n)migen is so much nicer than Verilog ๐Ÿ˜„

tulip sleet
#

e.g. in my .gdbinit:

define sload840
python
import os.path
import sys
sys.path.insert(0, os.path.expanduser("~/repos/bnahill/PyCortexMDebug"))
end
source ~/repos/bnahill/PyCortexMDebug/cmdebug/svd_gdb.py
svd_load ~/repos/circuitpython/ports/nrf/nrfx/mdk/nrf52840.svd
end
#

I have this for several chips

indigo wedge
#

well...

#

it's very experimental

idle owl
#

Heading out. Cheers everyone!

indigo wedge
#

it does work on my feather, i did test it also on the evk

onyx hinge
#

@tulip sleet ooh more gdb stuff for me to copy from you. I "jloadc" multiple times per hour

tulip sleet
#

svd NVMCTRL, etc.

indigo wedge
#

the evk comes with a cmsis-dap debugger

half sedge
#

Should I re-shuffle the doc to have chronological order?

manic glacierBOT
idle owl
#

@half sedge I will not turn down that offer ๐Ÿ™‚ Please do!

#

I reshuffled the one I had to go out of order for, so at least it's mostly in looping order.

half sedge
#

Take a backup !

idle owl
#

Downloaded a copy of it

tulip sleet
half sedge
#

@idle owl I belive it is done now.

idle owl
#

Thank you!

manic glacierBOT
#

My more general frequency generator has a jitter problem, but good frequency:

import board
import digitalio
import time
import math 

led = digitalio.DigitalInOut(board.A0)
led.switch_to_output()

print(0.005, math.floor(1000*0.005))
print("{0:20.18f}".format(0.005))

f = 100.0
duty_cycle = 0.5

period_ns = (1/f) * 1_000_000_000
on_ns = period_ns * duty_cycle

while True:
    led.value = math.fmod(time.monotonic_ns(),period_ns) < on_ns
pastel panther
#

@trim elm ^

slender iron
#

@pastel panther yup!

pastel panther
#

@slender iron would that be a major version since the other libs were removed?

slender iron
#

sure

trim elm
#

@pastel panther @slender iron Should I go ahead and release it?

pastel panther
#

sounds good to me

slender iron
#

is it all set up for pypi?

pastel panther
#

I'll double check but it should be

slender iron
#

kk

pastel panther
#

taking a sec to do a double plus check

#

@trim elm good thing I checked; it's missing a setup.py; use the cookiecutter to make a temporary new Adafruit_CircuirPython_BLE directory and then commit the setup.py into the BLE repo

slender iron
#

thanks @pastel panther !

pastel panther
trim elm
#

Ok

pastel panther
#

thanks!

trim elm
#

@pastel panther It seems like there's a way to get the stuff in curly brackets to autofill. How do I do that?

pastel panther
#

@trim elm what? I need a bit more context

#

you mean the cookiecutter?

trim elm
pastel panther
#

did you use cookiectutter?

trim elm
#

What?

pastel panther
#

lol, one sec ๐Ÿ˜‰

trim elm
#

Ok

pastel panther
trim elm
#

Oh yeah, I used the setup.py from that, but in the setup.py there's a bunch of lines inside curly brackets, with what appears to be some python, like this keywords='{{ kw_list.kw_list|join(" '\n'")|indent(width=13) }}',

#

@pastel panther And it seems like the purpose of that is to automatically generate part of the setup.py. Is that the case, and if so, how do I do that?

#

Oh, wait, you said to read the readme

pastel panther
#

indeed I did ๐Ÿ˜‰

trim elm
#

lol. Back in 1 sec

pastel panther
#

kk

trim elm
#

It's crazy, it's almost like the README had all the answers to the questions I had.

pastel panther
#

๐Ÿ˜†

#

been there, done that

ionic elk
#

@slender iron I hath returnethed

slender iron
#

@ionic elk kk, I need to find my swd breakout

ionic elk
#

are you using stlink?

slender iron
#

no, jlink

ionic elk
#

does that still use openocd? I forget

slender iron
#

no

#

jlink has its own gdb server

ionic elk
#

hmmm maybe I should get my BMP back up and running

ionic elk
#

The gdb system I used to use, st-util, isn't maintained anymore and openocd gives me lots of issues

pastel panther
#

@trim elm kk, ๐Ÿ‘€

slender iron
#

@ionic elk why not get a jlink from the store?

ionic elk
#

I could do that, which one do you use?

#

I mean is it way better than a BMP? Because that was fine too

slender iron
ionic elk
#

though this lack of correct registers might be a build / GDB problem

slender iron
#

I haven't used BMP. I don't think they've added SAMD51 support

ionic elk
#

something something makefile didn't properly specify etc

slender iron
ionic elk
#

yeah they haven't, but it's not as though I'm able to use a SAMD51 with an stlink either

slender iron
#

what is the meowbit pinout?

ionic elk
#

Oh right that isn't documented anywhere hang ong

slender iron
#

only 3v is labeled

ionic elk
#

yeah I had to do it with a multimeter hang on taking a photo

slender iron
#

k, thanks. is your PR up to date too?

#

or is there another branch?

#

we could switch to audio if you like too

#

and I can share my screen

ionic elk
#

I will update it now

slender iron
#

k thanks

ionic elk
#

I'm in ameila

slender iron
#

still there?

#

can't hear you

pastel panther
#

@trim elm ok, I think we're good to go on the release. should be 4.0.0 with ------BREAKING CHANGES--- or whatever in the title and description since the other libraries moved out into their own repos

trim elm
#

Ok. I'll add BREAKING CHANGES to the title and do the release

#

@pastel panther Alright, made the release

pastel panther
trim elm
#

@pastel panther @slender iron Should I also draft a release for ANCS?

pastel panther
#

@trim elm it's green, so sure!

trim elm
#

Also, as far as Apple_Media goes, should I be working on trying to fix the docs/linting errors?

pastel panther
#

hmm

#

re ANCS, test the setup py with my prior instructions. lmk if you need them again

slender iron
trim elm
#

@pastel panther the only commit since the last release (initial release which had already been migrated to Actions) was just updating the build badge, and it's already on pypi. Do you still want me to do a release?

pastel panther
#

ANCS?

trim elm
#

Yeah

pastel panther
#

no, that's ok

trim elm
#

Ok

#

@pastel panther I'll finish up a forum response and then take a look at the Apple_Media issues to see if I think I've got a shot at fixing them

pastel panther
#

sounds good!

trim elm
#

@pastel panther I think I'll let @slender iron or someone else fix the pylint issues on that repo

pastel panther
#

@trim elm he asked for help getting it sorted out so I'll take a look when I can

#

he mentioned it would be a bit tricky so no worries

trim elm
#

@pastel panther Ok. Actually, I think I'll grab something to eat (just remembered I forgot to eat lunch) and maybe see if I understand it any better then.

ionic elk
pastel panther
#

@trim elm good call, bloodsugar helps brains chooch

ionic elk
#

reminds me I gotta get that sweet free chipotle delivery today

pastel panther
#

say waaaaaaaaat?

ionic elk
#

get the app mang

#

they do it every so often

pastel panther
#

then I would eat more chipootle and I'd start looking even more like a burrito

ionic elk
#

If that was an outcome I would already be one, chipotle is literally my favorite food

trim elm
#

@ionic elk Thanks for reminding me about that. I almost missed it

ionic elk
#

in the times where I have lived near one I have had weeks where I ate it literally every day

graceful heart
#

เฒ _เฒ 

pastel panther
#

It's high up there for me. Burritos are my comfort food. Sad for chippapoodle, I live in CA and have a more-amazing-er taqueria literally around the corner

manic glacierBOT
indigo wedge
#

@slender iron would we have any other starting targets for tinyuf2 in addition to imx or would it be imx for now? i guess the stm32 uf2 bootloader seems to be in some stable state? if we found another target then we could bring more people in on the project ๐Ÿ˜„

pastel panther
#

@tulip sleet I though I recalled talk of adding touchio support to the M4 boards using the resistor based approach used on other boards; Am I remembering correctly?

tulip sleet
#

@pastel panther, yes, it is in the build now.

#

there is now "generic" touchio support, which is turned on for SAMD51 and nRF boards

#

and the code checks for the large-value (like 1Meg) pulldown resistor being present

#

and will throw an error if it's not

pastel panther
#

ah, excellent.

manic glacierBOT
#

BLE pairing now will store appropriate bonding information after pairing. A region of internal flash is allocated for this. It's a growing consecutive log of "bonding blocks", which store either keys or CCCD values (sys_attr values).

CCCD values must be restored to their values after pairing when a bonded connection is made; this is required by the BLE spec. So whenever a CCCD is written for a paired connection, we remember its value using the sys_attr mechanism in the nRF SoftDevice.
...

slender iron
manic glacierBOT
manic glacierBOT
#

Ok, we sorted out the interrupt issue! The functions called by an interrupt are dictated by the vector table. The location of it can be moved so that one set of code can swap to another (such as a bootloader). In this case, the STM uf2 is correctly setting it but our start up code is setting it back to the original location! For reference it is the VTOR register in the system control block (SCB) that controls it.

@hierophect is now unblocked and will continue with this. It's great to sort ...

half sedge
#

Does anybody knows why the "Feedback? Corrections?" button ask for anonymous contribution with no personal data? When I find something I don't like in the documentation, I like to point it out, but I would also love to know if this is taken into account, and if ever the guide improve, know about it. Why it can not be like an issue on GitHub?

#

As a result of not having that, I have no tracking on things I might have suggested in the learn side.

manic glacierBOT
trim elm
#

@slender iron I made a pr on your fork of BLE Apple Media. If you've got a sec, it'd be great if you could take a look at it, since that's the last pylint error we were getting

#

Never mind. I'll just make a pr from my fork of your fork

manic glacierBOT
manic glacierBOT
#

@PaulStoffregen Would rounding to the closest ms (or the current sleep resolution) be the fix you are imagining? Since folks can be easily surprised by 0.005 s rounding down to 4 ms, I think that is better than explaining it in documentation.

And if I might add to that fix an enhancement request: Increase sleep and monotonic_() resolution (as I mentioned above). Should that go into a separate issue?

#

@mcosti hmm, some kind of pairing issue mentioned here: https://social.technet.microsoft.com/Forums/en-US/31e39461-0b8b-4daa-86d0-010f0bd2feed/microsoft-surface-and-ble-issue?forum=win10itprohardware. The OP said it works with a dongle, but not with the builtin Bluetooth hardware. I assume you're up to date on drivers and the latest version of Windows 10, but if not, that might be worth trying.

I did not find many similar reports, but very few people are trying to use BLE HID with Windows....

pastel panther
ivory yew
#

yes

onyx hinge
#

ooh it would be awesome if someone could help that PR forward, it's one of the longest standing ones at this point, I think

manic glacierBOT
#

Thanks! A simple formatting request: could you group pin aliases together, and put a blank line between aliases? This makes it easy to see and check.

    { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
    { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA02) },

    { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) },
    { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA05) },

    { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) },
    { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_P...
trim elm
#

@pastel panther @slender iron To the best of my knowledge, all major issues, both pylint and Sphinx, have been solved on BLE_Apple_Media

slender iron
#

nice! thanks @trim elm !

#

anything you need me to look at? I'm working a bit now

trim elm
#

If you could take a look at my PR to make sure I didn't do anything that will break something else, that'd be awesome. The PR is still failing, but I did some local testing by just removing the things that were failing one at a time, and they were all todos, or Sphinx wanting some more documentation in one or two docstrings.

#

@slender iron ^

slender iron
#

link please

slender iron
#

did you have it as a PR to me originally?

#

we shouldn't need the adafruit_ble mocks

#

we should be able to use adafruit-circuitpython-ble from pypi

trim elm
#

Ah, ok. Just doing a simple mock import wasn't working so I mocked it kinda like adafruit_circuitpython_ble does with _bleio, but if there's an easy way to get it to do it from pypi instead, then that'd probably be a lot cleaner

#

And that would also have the added benefit of the mock not needing to be updated if ble were to get a new feature that would require a mock update

manic glacierBOT
#

The issue mentioned here sounds very similiar to the one I'm experiencing. https://answers.microsoft.com/en-us/windows/forum/all/problem-with-bluetooth-low-energy-gatt-compliant/ec845657-d885-47e8-a796-cd3ff83a7698

Unfortunately, the suggested solution that others confirmed working for them (uninstalling Microsoft Bluetooth LE Enumerator and restarting) did not seem to work for me. @urish , I am curious if this works for you, though.

I'm not sure if its relevant/true/meaningful, but w...

#

According to the error code, the cause of the issue: the device's hardware key contains a "FailReasonString" value, and the value string is displays an error message defined by the hardware manufacturer. If the hardware key does not contain a โ€œFailReasonStringโ€ value the message above is displayed.

I think that is just saying that it's failing and we didn't supply a reason string ??

As far as I can tell i'm up to date on my drivers. I have 2 other Bluetooth HID devices (Pen digit...

slender iron
#

@trim elm I'll take a look tomorrow. thanks for getting it this far!

manic glacierBOT
#

hmm. Not sure about the PS4 game pad, I think that's older, but the Surface Pen is listed as using Bluetooth 4.0, and in device manager shows up in HID section as Bluetooth Low Energy GATT compliant HID. So, still not 100% sure, but most likely?

Is there perhaps some arduino BLE HID code I could try on the CPB instead to see if I get the same issue?

orchid basinBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@hierophect I made a quick test over VTOR reg in SystemInit:

  /* Configure the Vector Table location add offset address ------------------*/
#ifdef VECT_TAB_SRAM
  SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#else
#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
#define VAR_NAME_VALUE(var) #var "="  VALUE(var)
  #pragma message(VAR_NAME_VALUE(FLASH_BASE))
  #pragma message(VAR_NAME_VALUE(VECT_TAB_OFFSET))
  SCB->...
manic glacierBOT
ruby atlas
#

Digging around circuitpython's testing framework... Are we still running Rosie CI? https://github.com/adafruit/rosie-ci I also saw some remnant mentions of qemu but we seem to have removed that in October.

manic glacierBOT
#

The unix port should have it's Makefile updated so that hardware-independent modules are included, so that tests can be added for them.

Please add modules you know can be added to the circuitpython unix port to this checklist.
We might also want to have a HAL that provides dummy hardware for testing code functionality too, but that will probably want a bunch of different issues.

  • [ ] _pixelbuf
trim elm
#

@slender iron @pastel panther Just to update you guys on the BLE AMS PR, everything is currently passing Actions, both Sphinx and PyLint.

manic glacierBOT
onyx hinge
#

@slender iron I'm coming up blank on how to detect dma underrun on samd51. Is there another keyword I might try searching on or do you have any tips?

#

Seems like it just cycles the descriptors freely but I can't see how to tell if you missed a message about it

#

Hopefully I'm overlooking something simple

manic glacierBOT
#

With "Adafruit CircuitPython 5.0.0-beta.3-6-g926375d99-dirty on 2020-01-10; Teensy 4.0 with IMXRT1062DVJ6A", ampy utility doesn't work with Teensy 4.0 :

$ ampy -p /dev/ttyACM0 ls
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/serial/serialposix.py", line 537, in write
    n = os.write(self.fd, d)
OSError: [Errno 5] Input/output error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/hom...
obsidian compass
#

Just curious, Is there any plan to have a CLI based package manager for circuitpython? Something which can fetch and put a library to /lib folder

stuck elbow
#

most circuitpython boards don't have network

#

and by default the filesystem is read-only

manic glacierBOT
onyx hinge
#

@obsidian compass I have homebrewed my own thing while working on JEplayer. It uses makefiles and will mpy-cross the libraries you symlink into a src/ directory, and finally uses rsync to ensure what you have on the device is up to date. I don't know if this is anything like what you are asking for, but I welcome feedback! https://github.com/jepler/JEplayer/

obsidian compass
#

@onyx hinge thanks for sharing, I'll give it a try ๐Ÿ™‚

raven canopy
#

@ruby atlas no, Rosie hasn't been running for quite some time. I have been slowly working through a replacement. My #circuitpython-dev2020 posts have some details.

obsidian compass
#

@stuck elbow that's right but during dev we can use host machine cli to fetch and put the .mpy library to /lib

raven canopy
#

I liked @ivory yew's point of going GUI over CLI for handling the package management. Using Kivy came to mind, so that it could be cross-platform. Not the only option, certainly.

stuck elbow
#

@obsidian compass oh, you mean on the computer's CLI?

#

there is a number of such tools you can choose from, the two most popular are called wget and curl

obsidian compass
#

@raven canopy yes that's right ๐Ÿ™‚

#

@raven canopy anything but electron based app ๐Ÿ˜‰

ivory yew
#

I would do a multilayered thing. I'd make the core of the package manager a shared library and build CLI and GUI interfaces on top.

obsidian compass
#

@ivory yew that sounds like the best way to do it, IMO

#

I think conda works same way too

manic glacierBOT
raven canopy
obsidian compass
#

pip also has a frontend IIRC

ivory yew
#

pip is ... no.

stuck elbow
#

language-specific package managers are generally rather harmful to that language's community in my opinion

manic glacierBOT
ivory yew
#

I wrote up a very rough doc about this last september.

#

very rough, so if y'all wanna peek at it go for it, but please keep in mind I brain dumped this for an hour before I got distracted and I haven't cleaned it up or come back to it at all: https://docs.google.com/document/d/1DyImgx0fs_TFMTLfUh9d62b5z8wtwgtuxOZMEN5fbP4/edit?usp=sharing

raven canopy
#

bookmarked!

obsidian compass
#

+1

#

Thanks for sharing @ivory yew ๐Ÿ™‚

manic glacierBOT
ivory yew
#

gotta run, have fun reading my brain soup!

drowsy geyser
#

@ivory yew On a quick browse through your doc, as long as you're detecting dependency issues between the lib and the CP version, why not include firmware build and install?

ivory yew
#

Not sure what you mean?

drowsy geyser
#

Latest library .mpy + latest firmware, therefore, no dependency colliosions.

ivory yew
#

Like updating the firmware?

drowsy geyser
#

Yes

ivory yew
#

I meant to put that in there

#

I may have forgotten

drowsy geyser
#

Ahhh, ok. I didn't notice it. But it was, admittedly, a very fast scan.

ivory yew
#

but yeah I would want it to detect fw version and give you the option of upgrading

#

but never force you.

obsidian compass
#

@drowsy geyser I remember during initial days of micropython it has a web interface where you select which lib you want to include in your default image/.bin it builds new binary including them and mail it to you

ivory yew
#

it's also an incomplete brain dump, as mentioned.

drowsy geyser
#

Totally understand. Just trying to offer some feedback.

ivory yew
#

๐Ÿ‘ feel free to leave comments on the doc

drowsy geyser
#

Oh, cool. I'll do that.

ivory yew
#

when I come back to it someday I'll have a record.

#

kk really gotta go! โ˜ฎ๏ธ

manic glacierBOT
#

@dhalbert:

I have been working on BLE bonding over the past couple of weeks (see #2510), and just tested on Windows 10 with a BLE-capable dongle, and did not have this problem. But it also worked before without bonding. So it may be particular to the Bluetooth hardware on your Windows machine(s).@mscosti and @urish, what is your hardware?

@mscosti:

@dhalbert I'm using a MS Surfacebook 2, which has Bluetooth built in (no dongle)

@dhalbert:

@mscosti hmm, some kind of pairing issue m...

#

@mscosti:

The issue mentioned here sounds very similiar to the one I'm experiencing. https://answers.microsoft.com/en-us/windows/forum/all/problem-with-bluetooth-low-energy-gatt-compliant/ec845657-d885-47e8-a796-cd3ff83a7698

Unfortunately, the suggested solution that others confirmed working for them (uninstalling Microsoft Bluetooth LE Enumerator and restarting) did not seem to work for me. @urish , I am curious if this works for you, though.

I'm not sure if its relevant/t...

#

@mscosti:

hmm. Not sure about the PS4 game pad, I think that's older, but the Surface Pen is listed as using Bluetooth 4.0, and in device manager shows up in HID section as Bluetooth Low Energy GATT compliant HID. So, still not 100% sure, but most likely?

Is there perhaps some arduino BLE HID code I could try on the CPB instead to see if I get the same issue?

@dhalbert:

How about https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/master/libraries/Bluefruit52Lib/examples/...

manic glacierBOT
orchid basinBOT
ionic elk
#

@slender iron do you remember what it was that lead you to realize that VTOR might be the problem? I'm trying to make a note of how we ended up there. We were looking at the control registers, and then we realized something wasn't loading as it should have been...

#

After that I remember it was VTOR isn't right, it's being properly set by bootloader, watchpoint to determine it was changed in Reset Handler, then I guessed it was in system_stm32.

#

Was it just that it happened to be up on your screen as we were looking at SCB registers, and we noticed it was wrong?

slender iron
#

@ionic elk I think it was because we were looking at what the bootloader did before jumping to the app

#

and I have svd on the STK already so when I saw SCP I tried it

ionic elk
#

@slender iron I feel like there was something that tipped us off that the vector table wasn't being loaded properly. I'm trying to remember what that was

#

cuz I want to remember it for next time

slender iron
#

ยฏ_(ใƒ„)_/ยฏ

#

should have streamed it ๐Ÿ™‚

ionic elk
#

some value wasn't set, or something

#

oh well

slender iron
#

well, we saw that the SCB->VTOR value was back to 0x8000000

#

and therefore it must have been unset

ionic elk
#

right, that was after, everything was pretty clear from that point on

indigo wedge
#

I pushed some basic code structure to https://github.com/arturo182/tinyuf2, it builds and "works" (blinks a led and usb interfaces show up) on the rt1011 evk, note that there is no uf2 code in there yet

ionic elk
#

We were looking at the control registers, then we checked out the memory to make sure everything was in the right place...

#

It's not super important though so nbd

indigo wedge
#

I'm thinking if we should reuse board definitions from tinyusb or make our own structure for that

slender iron
#

@indigo wedge my plan was to have a supplemental board structure in tiny-logic-friend

#

it won't be shared at all because it will include logic analyzer specific data

#

my plan today is to split out flash info from board info today in circuitpython

indigo wedge
#

i'm just thinking that right now if someone wants to add their own board they would have to make copy an existing tinyusb board folder and modify that and there would be a lot of copied code

#

like, look how easy it is to add a new board in the samd bootloader

slender iron
#

ya, I think we can factor things out as we go

indigo wedge
#

just 2 files

slender iron
#

ya, we can get there. imx rt is trickier because of the flash info

#

@onyx hinge what do you mean by underrun? running out of buffer to playback?

onyx hinge
#

@slender iron right, it alternately DMA's buffer A and buffer B to the DAC, so an "underrun" would be if it starts to dma buffer A (or B) but software hasn't filled it..

manic glacierBOT
onyx hinge
#

and in this case the hardware is going to just DMA out old data and the software doesn't know it. Except your audio will sound .. wrong and jumbled

manic glacierBOT
#

@kevinjwalters Yeah, utime is interesting. The functions returning wrap-around time can give new programmers headaches. The unspecified period can give everybody problems. If my code asks the question, "Has some length of time passed since this event of interest happened?", I want to feel comfortable that the counter has not wrapped around some number of times, but that the wrap-around time is much longer than the interest in the question. I'd rather not have to count wraps.

I understand...

slender iron
#

@onyx hinge do we keep a counter based on dma block completion? wouldn't a gap of >2 mean an underrun?

#

does the dma mark the descriptor as invalid on completion too?

onyx hinge
#

to the second question, I think no -- the B dma descriptor always points back to A and vice versa

#

to the first question, I don't know where we do that

slender iron
#

lemme look. somehow we have to know what buffer is being used atm

#

we use the event system to track when a block is done

#

and it can tell you when an overrun (?) occurs

onyx hinge
#

OK! I will look into what they term an overrun. I was looking at DMA in the datasheet, not thinking about event system though that makes sense in retrospect.

tidal kiln
slender iron
#

@onyx hinge is the best person for DAC issues I think

orchid basinBOT
onyx hinge
#

yeah @tidal kiln @slender iron it seems to be my thing. I'm not in the right headspace to respond right this second, and I'm not even sure what I would suggest. If adding a small sleep is an effective workaround, that is great and they should go for it.

orchid basinBOT
manic glacierBOT
bright aspen
#

@onyx hinge @slender iron @tidal kiln Also hidden in that discussion on the DAC is a pop with the mixer. Is the using responsible for attack?

slender iron
#

not sure what you mean by "Is the using responsible for attack?"

bright aspen
#

Uh, user.

onyx hinge
#

so say your sample is +4000 and you change the volume from .1 to 1.0, the DAC will change from 400 to 4000 in one step. Yes, that will sound like a pop.

bright aspen
#

Right.

onyx hinge
#

having the mixer spread a volume change over a short period of time is not an unreasonable request, I suppose, but the code is not written

bright aspen
#

Coding that might be easier than writing up how to do it in CP. (I have no opinion either way.)

bright aspen
#

@onyx hinge @slender iron @tidal kiln One person's workaround was to use the mixer. Perhaps that effectively increases the buffer size? Arg. I'm kibitzing.

orchid basinBOT
onyx hinge
#

@bright aspen kibitzing is fine, I love knowing other minds are thinking about the same problem as me. I don't think that the mixer adds a bigger buffer, I think it's 1024 bytes (divided into 2 512-byte buffers) by default just like for a WaveFile. ICBW of course.

raven canopy
bright aspen
#

@raven canopy @onyx hinge I'm just guessing at how the mixer works. I'm assuming everything is done on half buffers. I'm also guessing that a mixing change is done on the edge of that. So maybe a volume change can take place over a half buffer. That means a faster change with faster sample rates, though. If I wandered down a bunny trail...

#

My CircuitPython 5 poster arrived today. You can release it now.

onyx hinge
#

someone recently told me that she doesn't like the metaphor of a bunny trail or rabbit hole, so she prefers to say that she emerged from a wormhole about a topic. I thought that was great!

#

afk, it's well past local lunch hour here

pastel panther
ruby atlas
#

@raven canopy i need to find time to look at those and/or write my own!

manic glacierBOT
manic glacierBOT
#

@urish I think this issue just needs usb_enabled to be changed. Basing it on a variable set in mount/umount lower in that file would be better. The terms there mean plugged and unplugged and are not mass storage specific.

That being said, I want to add a circuitpython service for uploading and downloading files. The beginnings of it are here: https://github.com/adafruit/circuitpython/blob/master/supe...

#

When sending keystrokes to an iOS device using the new BLE HID support, any modifiers are completely discarded. For example, using the following code after a connection has been established (where kbd is an instance of adafruit_hid.keyboard.Keyboard):

kbd.send(Keycode.CONTROL, Keycode.OPTION, Keycode.H)

With iOS VoiceOver turned on, Ctrl+Option+H should activate the Home button, showi...

manic glacierBOT
#

Not to hijack (too much) the initial concern of rounding down to next ms instead of to nearest ms in time.sleep()...

Yes, I like microseconds. In addition to giving a false impression of precision is that what works on one board might not work as well on another. Those might be a documentation task. Even so, I favor a move to microseconds, if not for both sleep() and monotonic_ns(), then just for the latter.

Is there a guideline as to how long a background task can keep sleep() from ret...

slender iron
#

@indigo wedge what flash chips are you using on your boards?

manic glacierBOT
indigo wedge
#

@slender iron w25q64jv

slender iron
#

for both? thanks!

indigo wedge
#

yeah

slender iron
#

kk

manic glacierBOT
manic glacierBOT
#

Initial commit of board definitions for the Seeeduino XIAO. Very similar to the Sparkfun SAMD-21 Mini board. https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html Note that changes are necessary to the Mu editor to use the serial terminal with this board (specifically, adding the USB VID/PID).

The USB VID/PID are just copied from what the Seeeduino XIAO provides as supplied (VID=0x2886 (SEEED), PID=0x002f). Digital and analog pin defs are as p...

manic glacierBOT
#

I think this is safe, because the sd_ble_sys_attr_get() calls in write_sys_attr_block() will fail if the connection handle is invalid, and then write_sys_attr_block() will just give up in that case.

Interestingly the documentation talks about (ideally) fetching the values after the connection is closed to avoid churn. But someone may press reset, etc. So that's why I put in the one-second delay, which seems to cover the typical case.

uint32_t sd_ble_gatts_sys_attr_get | ( | u...

idle owl
#

@tulip sleet So this is weird: if you load the Circuit Playground library alone onto a CPB, and in the REPL from foo import cp it fails on a lack of lis3dh as expected. Drag lis3dh onto the board, go back to the REPL, from foo import cp it says

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'adafruit_circuitplayground.cp'```
I have to reload the REPL entirely by exiting the REPL and going back into it. Import again, fails on a lack of `thermistor`, again, as expected. `import cp` and it says the same `no module named 'adafruit_circuitplayground.cp'`. I have to exit and reenter the REPL again. Repeat until all the dependencies are installed, and it finally imports `cp` properly. ๐Ÿคท
raven canopy
#

@idle owl i'd investigate the sys.path.

idle owl
#

@raven canopy Ok... what am I looking for here. It's ['', '/', '.frozen', '/lib'] because of the frozen CPX stuff.

raven canopy
#

well, that looks correct. ๐Ÿค”

#

getting a CPX running...

idle owl
#

CPB. Didn't try this on CPX. Can't, because dependencies are built in.

raven canopy
#

haz no CPB ๐Ÿ˜ฆ hehe

idle owl
#

@raven canopy Need to fix that. ๐Ÿ™‚

tulip sleet
#

@idle owl in general once you import something, even if there's a failure, you can't reimport without a restart. That's just Python semantics; it's not peculiar to us.

idle owl
#

@tulip sleet Hmm ok.

onyx hinge
#

@prime flower I've been meaning to ask, can we have a quick chat about progress bar maybe in the morning? I had rolled my own in JEplayer and it's a little different. Would like to converge

raven canopy
#

adabot patch about to be applied to 195 repos... ๐Ÿคž

#

Actions is going to hate me. though i hope they enjoy the free stress-test. ๐Ÿคฃ

idle owl
#

@raven canopy Actions doesn't feel.

#

@onyx hinge Oh, @prime flower is AFK until next week I believe.

raven canopy
#

@pastel panther @trim elm pylint examples patches completed. there are 3 repos that i apparently don't have access to (librarians not added yet, i assume).

... Beginning Patch Updates ....
.... Working directory: /home/sommersoft/Dev/adabot/adabot
.... Library directory: /home/sommersoft/Dev/adabot/adabot/.libraries/
.... Patches directory: /home/sommersoft/Dev/adabot/adabot/patches/
.... Deleting any previously cloned libraries
.... Running Patch Checks On 214 Repos ....
.... Patch Updates Completed ....
.... Patches Applied: 192
.... Patches Skipped: 19
.... Patches Failed: 3 

.... Patch Check Failure Report ....
No Failures


.... Patch Apply Failure Report ....
>> Repo: Adafruit_CircuitPython_LSM6DSOX        Patch: 0001-update-pylint-examples-directive.patch
   Error: b"remote: Permission to adafruit/Adafruit_CircuitPython_LSM6DSOX.git denied to sommersoft.\nfatal: unable to access 'https://github.com/adafruit/Adafruit_CircuitPython_LSM6DSOX.git/': The requested URL returned error: 403\n"
>> Repo: Adafruit_CircuitPython_BLE_Apple_Media Patch: 0001-update-pylint-examples-directive.patch
   Error: b"remote: Permission to adafruit/Adafruit_CircuitPython_BLE_Apple_Media.git denied to sommersoft.\nfatal: unable to access 'https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Media.git/': The requested URL returned error: 403\n"
>> Repo: Adafruit_CircuitPython_MCP4728 Patch: 0001-update-pylint-examples-directive.patch
   Error: b"remote: Permission to adafruit/Adafruit_CircuitPython_MCP4728.git denied to sommersoft.\nfatal: unable to access 'https://github.com/adafruit/Adafruit_CircuitPython_MCP4728.git/': The requested URL returned error: 403\n"
#

oh dear. that looks like a jumbled mess. repos are: LSM6DS0X, BLE_Apple_Media, and MCP4728.

onyx hinge
#

@idle owl oh I knew that even

#

Thanks

pastel panther
#

whoopsie dodle

#

@raven canopy you called it. Fixed

raven canopy
#

@pastel panther k. i'll hand jam 'em with git am.

pastel panther
#

hey @trim elm , @raven canopy put a pile of stuff on yer desk

#

๐Ÿ˜‰

#

thanks @raven canopy

raven canopy
#

from one inbox to another... ๐Ÿคฃ

pastel panther
#

gives @trim elm aspestos potato mitts

trim elm
#

@raven canopy Thanks!

#

lol

pastel panther
#

just don't huff 'em

trim elm
#

I'll try not to

#

I've got to take care of some other stuff, so I'll get started on this later tonight or tomorrow

pastel panther
#

ok, sounds good

raven canopy
#

@trim elm i was worried you had already started pushing releases. didn't want to double stuff for you. my attention was on that amazing LSU Tigers football clinic last night. ๐Ÿ˜„

#

also, the 3 libs above are now patched.

trim elm
#

Awesome

idle wadi
#

Tried to look through the discord so hopefully I am not asking an old question. Looking to develop a project based on Circuit Playground Bluefruit - BLE as a beacon. If this is possible, any help with sample code would be greatly appreciated.

bright aspen
#

I got my CircuitPython V poster up. I'm all ready to be inspired.

trim elm
#

@pastel panther Would you like me to draft releases for all the libraries?

pastel panther
#

sure!

#

maybe start with a few?

trim elm
#

Ok

pastel panther
#

it's up to you. If you're confidant in your automation, the go ahead however you want

trim elm
#

Ok, I'm going to try it on a few more of my personal repositories then do it for everything

trim elm
#

@pastel panther Any idea why this wouldn't work?
os.system('curl --data "{"tag_name": "v2.0.0", "target_commitish": "master", "name": "Migrated repository to GitHub Actions", "body": "This repository now uses GitHub Actions as a CI instead of Travis. This has no effect on the code itself.", "draft": true, "prerelease": false}" https://api.github.com/repos/dherrada/{}/releases?access_token=MY_TOKEN'.format(repo))

#

It's giving me this:
KeyError: '"tag_name"'

pastel panther
#

๐Ÿ‘€

wind trellis
#

Are you sure those double quotes are going to work? It looks like you've got a double-quoted argument to --data that contains double quotes.

pastel panther
#

ya, what @wind trellis said

wind trellis
#

Maybe backslash something inside there?

pastel panther
#

yes, probably the outer quotes I think would work

#

like:

wind trellis
#

That stuff will make your head hurt bad. ๐Ÿคฏ

trim elm
#

I tried that already, but with single quotes surrouding the {}s but that didn't work, I'll give it a go with double quotes

#

Yeah, same issue

wind trellis
#

@trim elm Not sayin' you're gonna like this, but...

#

If I have test.py as: ```python import sys

print(sys.argv)```

#

then I can do python os.system('python test.py "{\\\"one fish\\\": \\\"two fish\\\"}"')

#

and get: ['test.py', '{"one fish": "two fish"}']

#

So that second argument is correct. It's a dictionary definition with quoted key and value intact, passed through the os.system command and read from the argument list.

trim elm
#

@wind trellis hmm... That might just work. Too tired to try it right now, but I'll give it a go tomorrow morning

wind trellis
#

Definitely not something to tackle when you're sleepy. Good luck with it!

onyx hinge
#

@trim elm You can use the subprocess module to give arguments as lists instead of a whole command as a long string. subprocess.run(["curl", "--data", "{...}", "https://...."])

#

and yeah avoid starting subprocesses while sleepy

trim elm
#

@onyx hinge Yeah, I think that might be a better option than what I'm currently doing.

onyx hinge
#

or you could almost certainly use python3 requests package to send the request instead of curl

#

requests.post('https://httpbin.org/post', data={'key':'value'})

trim elm
#

That actually sounds like a great option. I've tried using subprocess for other stuff, and while it does have a lot of functionality, doing complicated stuff with it is very not fun

onyx hinge
raven canopy
#

i was going to mention... JSON is particular on single & double quotes.

tulip sleet
#

@idle wadi We had iBeacon and EddystoneURLBeacon working in a previous version of Adafruit_CircuitPython_BLE, but we need to re-create them, after redoing a lot of the internals of that library. It would be based off the current advertising code. See https://github.com/adafruit/Adafruit_CircuitPython_BLE/releases/tag/2.0.1-alpha.2 (which does not work with the latest betas). What kind of beacon did you have in mind?

raven canopy
#

@trim elm also...be careful when automating releases. you may not have a great granularity on everything that is being updated, and leave things out of the release notes.

#

apologies if steps have been already been taken to release everything, so that its a clean slate.

pastel panther
#

@raven canopy he's only making drafts but yes, a missing key could bork that

manic glacierBOT
#

Following the discussion on https://github.com/adafruit/Adafruit_CircuitPython_IL0373/pull/7

Circuitpython currently supports raw string / byte literals with the 'r' prefix but doesn't support the 'R' prefix.

This should be changed to support compatibility with CPython.

"Both string and bytes literals may optionally be prefixed with a letter 'r' or 'R'; such strings are called raw strings and treat backslashes as literal characters." (excerpt from https://docs.python.org/3.7/refere...

manic glacierBOT
subtle sun
#

@indigo wedge thanks for fixing this issue.

A bit off topic but I am curious about is why micropython chose to implement the is_char functions receiving a mp_lexer_t pointer and not just pass the actual byte. Do you think this is because it is optimized away?

indigo wedge
#

Not sure tbh

ionic elk
#

I don't have a lot of luck using the displayio.release_displays() command. I still constantly get stuff like ValueError: SCK in use, etc. Does anyone know what's up with that?

stuck elbow
#

is that a fourwire display?

ionic elk
#

yes

stuck elbow
#

maybe the fourwire bus object is still lingering around somehow?

ionic elk
#

I'll look into that

stuck elbow
#

I remember it worked for me in 4.x, but I didn't test it in 5.x

ionic elk
#

specifically it seems that the display works fine up until you fail the syntax in some way, and then the first pin of the SPI bus will be perpetually in use.

#

So as long as my code works, everything is fine, but as soon as I make any form of error, it'll lock the display bus until a hard reset.

stuck elbow
#

that's on the stm32 or generally?

ionic elk
#

I will test generally now

stuck elbow
#

we had some reset bugs with exception handling before

main meteor
#

Correctly unwinding everything in an exception is annoyingly meticulous and subtle.

ionic elk
#

Appears to be stm32 only. And it's quite specific - if the error is between release_displays() and displayio.FourWire, it locks the bus. Other than that it all works ok.

onyx hinge
#

hmmm I have been investigating how RawSample+AudioMixer gives pretty poor results. I discovered that even back when AudioMixer was first merged there were small glitches, but when the "only run background tasks once per ms" code went in it got substantially worse. This is from "before" the background tick optimization, a glitch about 2 samples long

#

specifying a bigger buffer for AudioMixer tends to hide it, at least from the scope, but there's still a little buzz.

slender iron
#

@gentle bronze does tinyusb work ok with dcache enabled?

raven canopy
#

Does it traverse bit-depths/rates? Off hand, I'd likely say it's IRQ priority related, but it could be the execution cycles of each encoding type. @onyx hinge

slender iron
#

@indigo wedge I've got things starting up ok but usb is unhappy

onyx hinge
#

@raven canopy I have been concentrating on 44.1kHz / 16 bit because that's typical for mp3. My test program:

ionic elk
#

@slender iron does DisplayIO currently support screens that need a backlight LED pulled up? Sorry for off topic

indigo wedge
#

@slender iron in tinyuf2?

#

i'm working on that one right now

#

should have a more working version later today

slender iron
#

@indigo wedge no, in circuitpython

indigo wedge
#

ah

#

is that with your flash changes?

slender iron
#

@ionic elk not sure, I don't think so

ionic elk
#

I don't think so either. Worth an issue?

slender iron
#

@indigo wedge yup, also moved stack to dtcm and trying to enable both cpu caches

#

@ionic elk need it for meow:bit? could you just fix it?

ionic elk
#

Maybe, will need a never-reset for digitalIO I guess?

indigo wedge
#

@slender iron yeah i couldn't get that one ram bank working maybe it's related, is this on the evk?

onyx hinge
#

@raven canopy this is on pygamer fwiw but I think any samd51 will behave similar

slender iron
#

@ionic elk there should be one on the backlight pin already

#

@indigo wedge I think I got the flexram setup ok

#

lemme push my changes

gentle bronze
#

@slender iron I have no idea, which issue you are encoutering, I could try to help it out.

onyx hinge
#

default buffer size is 1024, so each half should be 512 bytes, which is 256 samples, or 5.8ms. So there should be plenty of time margin available even if background tasks are only once per ms

slender iron
#

@gentle bronze I broke my latest teensy 4 code and am wondering if the dtcm isn't flushing usb packets before queueing them up

onyx hinge
#

I need to get some better tools to visualize background tasks and dma buffers somehow. I could scope plenty of signals but I don't know how to get them TO my scope

#

(this is monophonic audio, stereo would be 2.9 ms per half buffer)

slender iron
#

@onyx hinge you can twiddle a pin in the background task

#

and you can connect the dma event to a pin as well

ionic elk
#

@slender iron not sure what you mean - there's no backlight definition in DisplayIO, and you can't mark pins as never reset manually, so I'm expecting I'd need to add a new parameter to Fourwire that allows a backlight pin, right?

onyx hinge
#

@slender iron have time to tutor me about that second thing? I have the first in there

slender iron
#

@ionic elk Display manages the backlight, not FourWire

#

@onyx hinge I can later. Now I'm in 3 concurrent conversations. The gist is you add the PORT peripheral as another user to the event generator for the dma signal and then you tell PORT what to do based on event input

onyx hinge
#

@slender iron that's fine, I'll try reading a bit first ๐Ÿ™‚

slender iron
gentle bronze
#

@slender iron to be honest, I am sure either, is there any code I can try

indigo wedge
#

@slender iron i think it might be cause you removed "USB_DEVICES = "CDC,MSC,HID""

#

and like i mentioned, i think we dont have enough EPs to have all 4 classes

#

so i turned off MIDI

slender iron
#

I moved it @indigo wedge because it was the same for all boards

indigo wedge
#

oh, maybe i shouldve looked at the whole thing ๐Ÿ˜…

onyx hinge
slender iron
gentle bronze
#

@slender iron if you defined CFG_TUSB_DEBUG = 2 and implement tu_printf to output via UART or SWO, it can be print out useful debugging log

slender iron
#

ah, ok

indigo wedge
#

yes i see

onyx hinge
#

glitch1 to glitch2 is 2.2ms which doesn't mean anything to me right off the bat

gentle bronze
#

for example USBDUSBD init CDC init MSC init USBD: event BUS_RESET USBD: event BUS_RESET USBD: event SETUP_RECEIVED 000: 80 06 00 01 00 00 40 00 | ......@. Get Descriptor XFER Endpoint: 0x80, Bytes: 18 USBD: event XFER_COMPLETE Endpoint: 0x80, Bytes: 18 USBD: event XFER_COMPLETE Endpoint: 0x00, Bytes: 0 USBD: event BUS_RESET USBD: event SETUP_RECEIVED 000: 00 05 1C 00 00 00 00 00 | ........ Set Address USBD: event XFER_COMPLETE

onyx hinge
slender iron
#

kk, cool @gentle bronze. right now I'm getting the USB IRQ even though nothing is plugged in ๐Ÿ˜•

onyx hinge
ionic elk
#

@slender iron ah I missed backlight_pin. but it doesn't appear to get reset when release_displays is called

gentle bronze
#

@slender iron hmm weird, do you know what cause the IRQ

onyx hinge
#

going to step away and think about this.

slender iron
#

@gentle bronze looking now. there are six enabled

#

@onyx hinge sorry, my brain is in usb teensy land atm

onyx hinge
#

(traces look much less spiky when my GND leads haven't popped off)

slender iron
#

@gentle bronze looks like SOF received is active

#

its possible the USB hasn't been reset correctly

gentle bronze
#

I will also give it a try as well

obsidian valley
#

I just saw that there is now some support for circuitpython on imx.rt10xx. I have a NXP imx.rt1010 evk. How do I install circuitpython on that devkit?

slender iron
#

@gentle bronze ya, that branch on the 1060 evk

#

@obsidian valley sit tight, we're getting there

gentle bronze
#

one minute ๐Ÿ™‚

slender iron
#

could totally be an unrelated issue

#

seems weird to have SOF interrupt when disconnected

gentle bronze
#

yeah, it is weird, it shouldn't happen though

obsidian valley
#

No worries I'm sure I'll have a easier time using that kit with cpy than the original ide. I guess there is some mad coding going on to get those boards working

gentle bronze
#

@slender iron do I need to flash a bootloader first

slender iron
#

@obsidian valley ya, I'm currently reworking the flash definitions

#

@gentle bronze no

gentle bronze
#

ok, just copy bin file over evk link ๐Ÿ™‚

slender iron
#

I'm using a jlink to load

obsidian valley
#

Cool I'll keep discord running and scroll through the messages here every now and then to monitor progress

gentle bronze
#

one more sec, pulling out my jlink as well ๐Ÿ™‚

slender iron
#

@obsidian valley the checked in version should actually work on the 1010-evk

indigo wedge
#

@slender iron so you removed the bootloader?

slender iron
#

@indigo wedge no, I'm just placing the non-bootloader things where it is

#

@gentle bronze do you have the swo printf handy?

obsidian valley
#

I'm just not certain what the procedure is to install it and verify if it works. I have tried dragging the .uf2 file into the flashdrive of the board in windows but could not connect to it in mu. And tbh it's been a long time since I used that board and I dont remember what button does what.

slender iron
#

@obsidian valley what is the name of the drive? you could try dragging the bin

gentle bronze
slender iron
#

can't remember which file extension the built in debugger takes

#

@gentle bronze thanks!

indigo wedge
#

it takes bin

#

but if your bin depends on the uf2 bootloader then it wont work

#

cause it will go to like 0xC000 offset and theres no boot code

gentle bronze
#

yeah, it doens't seem to work with copying bin file to MSD of evk-link

slender iron
#

@indigo wedge it doesn't

#

well, shouldn't

gentle bronze
#

couldn't connect with both evk link, and jlink, maybe I miss a jumper setting or soemthin

indigo wedge
#

i'm working on the uf2 as much as i can ๐Ÿ˜…

slender iron
#

np ๐Ÿ™‚

#

I think I'm being clever, the bin will work with and without

indigo wedge
#

that's like the 1st rule of coding, don't be clever ๐Ÿ˜„

slender iron
#

true, seems to be working for me though

#

I put the ivt where the bootloader would have it but it points to the isr table where the bootloader would look

pastel panther
#

you should always be clever, except for when you shouldn't

gentle bronze
#

@slender iron I need some help to load hex with jlink, do I need change any jumper setting

gentle bronze
#

a specific loading command would help as well ๐Ÿ™‚

slender iron
#

@gentle bronze the SW7 needs to be 0010

#

for spi flash

#

and make sure to mon halt before load and mon reset after

#

I think the jlink is actually loading a program of its own to do the flash

manic glacierBOT
#

Perhaps stating the obvious... I am new to ARM, CP implementation, and even github... I am today seeing this same behavior.
I looked at the systick handler. (I think it does some unneeded things; see below.) I don't see a problem. I didn't dive down into some functions such as one related to the file system. Perhaps those can be moved to software triggered exceptions (maybe using the STIR, if available, for an atomic trigger). Those can then run at a lower priority. From my limited glance, ...

obsidian valley
#

Ok the EVK's dirve comes up as RT1010-EVK containing a html file that links to it's product page and details.txt

slender iron
#

@gentle bronze I can't figure out how to get SWO going

#

I need to step away from my jlink to feed cats and eat breakfast. will have my laptop

main meteor
#

The cats approve of your plan.

slender iron
#

she definitely does

gentle bronze
#

@slender iron I still haven't figure out how to run the code, is there anyway I could use use non-bootloader linker to copy bin file to MSC evk link ?

indigo wedge
#

ah, fork

gentle bronze
#

I give up for tonight, still haven't know which command load firmware with jlink

slender iron
#

@gentle bronze I'm not using a bootloader with it

indigo wedge
#

RIP my USB

slender iron
#

thanks @gentle bronze will keep you posted

#

@indigo wedge ripped off the board? you could solder it back ๐Ÿ™‚

indigo wedge
#

yeah, don't have any tools here, all at our hackerspace

gentle bronze
#

@slender iron which command you use to load firmware ? Normally I used this for jlink flash target # Flash using jlink JLINK_DEVICE = MIMXRT1062xxx6A JLINK_IF = jtag flash-jlink: $(BUILD)/firmware.hex @echo halt > $(BUILD)/$(BOARD).jlink @echo loadfile $^ >> $(BUILD)/$(BOARD).jlink @echo r >> $(BUILD)/$(BOARD).jlink @echo go >> $(BUILD)/$(BOARD).jlink @echo exit >> $(BUILD)/$(BOARD).jlink JLinkExe -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $(BUILD)/$(BOARD).jlink

slender iron
#

@gentle bronze I always do it from within gdb

#

which loads the elf file not the hex

gentle bronze
#

do you power it via the evklink usb or the dc jack ?

slender iron
#

dc

#

(oh ya, switched that jumper too)

gentle bronze
#

ah right, could be that,I will try that tomorrow ๐Ÿ™‚

slender iron
#

@indigo wedge midi should be fine, the datasheet says its 8 bidirectional endpoints

stuck elbow
#

@indigo wedge solder the pins and glue the socket :P

slender iron
#

I did see a crash in usb_midi_init when my interrupt handlers were in the wrong spot

obsidian valley
#

I have my evk1010 connected, copied the file onto the board, what next?

indigo wedge
slender iron
#

@obsidian valley the other usb should show up as a CIRCUITPY drive

indigo wedge
#

but you have to move a jumper and connect to the 2nd usb @obsidian valley

obsidian valley
#

ok thanks gonna try that

#

ok which jumper to where?

indigo wedge
#

J1 which selects power source should be moved from 1-2 to 3-4 if you want to power from the device USB

#

otherwise you can have both USBs connected and then i think it's fine to leave it at 1-2

obsidian valley
#

ok I'll try this gotta search for another usb cable thanks @indigo wedge @slender iron

gentle bronze
#

@indigo wedge ah that could be my mistake, that limit apply to lpc18xx, iMX have 8 endpoints for both USBs. I will double check dcd vs datasheet tomorrow.

#

thanks for pointing it out

slender iron
#

ok, its definitely the dcache

manic glacierBOT
#

fwiw, this looks like a classic HAL trade-off. I'm sure Adafruit's main goal is minimizing engineering time to support as much hardware as possible. But like most hardware abstraction layers, the result is often constraining the most powerful hardware to a set of assumptions based on experience with the last powerful hardware.

As someone who focuses on powerful hardware, but also has only limited hours to do far more that people want than can ever be accomplished... I have mixed feelings...

manic glacierBOT
ionic elk
#

has anyone ever had a watchpoint literally crash gdb before?

manic glacierBOT
#

The imprecision here is an intentional decision, as I said when this first came up. The Python code will never have reliable timing. We provide other modules for timing sensitive functions. Sure, it'd be nice if this had sub-millisecond precision but it isn't a priority. We have more reliable alternatives.

So, we'll happily take a PR for this but please don't read too much into this.

ionic elk
#

@slender iron if you get a second today, do you think you could check out this issue? https://github.com/adafruit/circuitpython/issues/2524 it's proving to be a bit tricky for me since watching the relevant variables is crashing my debugger. Switching over to installing everything on my new PC so if you're busy I'll keep hacking at it tomorrow.

GitHub

STM32 chips currently lose critical information held in the displays[] array of shared-module/displayio/init.c under certain circumstances. I've found two specific ones I am able to rep...

manic glacierBOT
slender iron
#

@ionic elk sorry, I'm heads down trying to improve the imx rt performance for show and tell

meager fog
indigo wedge
#

hehe, yeah ๐Ÿ˜„

old smelt
#

Hi all - any recommended projects or learn guides I could check out to learn more about sending/receiving AT commands in CP?

meager fog
#

@old smelt check out the ESP AT library. it...isnt great because ESP kinda sux but i did do AT parsing, also check Hologram's cellular examples

old smelt
#

Thanks @meager fog !

#

Though, the idea of warm sun on Tatooine does sound nice.

#

Oops! I meant, suns.

#

Oh wait - I see what I did wiht the URLs.

#

Never mind.

#

Got it

#

This trip through Jason's Stream of Consciousness brought to you by...Shack Happiness!

indigo wedge
#

tinyuf2 is now close to the same level as my uf2 branch of tinyusb but I can't quite test it cause of the hw usb issue (see above) https://github.com/arturo182/tinyuf2

manic glacierBOT
onyx hinge
idle owl
#

Late to the party, but here it is: My CircuitPython 2020 post. Thank you everyone who shared their thoughts. I look forward to another amazing year! https://blog.adafruit.com/2020/01/15/2019-highlights-and-a-pledge-for-2020-from-kattni-circuitpython2020-adafruit-circuitpython-kattni/

Adafruit Industries - Makers, hackers, artists, designers and engineers!

Another year has flown by, and itโ€™s once again time to reflect on the past and look to the future. CircuitPython hit the ground running in 2019 with 4.0.0-beta.0 being released in January, anโ€ฆ

manic glacierBOT
#

Upper or lower case may be used for f, u, r, or b prefixes, so if we support one, maybe we should support all. https://docs.python.org/3.8/reference/lexical_analysis.html#string-and-bytes-literals

stringliteral   ::=  [stringprefix](shortstring | longstring)
stringprefix    ::=  "r" | "u" | "R" | "U" | "f" | "F"
                     | "fr" | "Fr" | "fR" | "FR" | "rf" | "rF" | "Rf" | "RF"
shortstring     ::=  "'" shortstringitem* "'" | '"' shortstringitem* '"'
longstring   ...
onyx hinge
#

@slender iron so what I am seeing is that in audio_dma_background, this new condition + if(event_interrupt_overflow(dma->event_channel)) { is firing pretty much constantly in my test with RawSample + AudioMixer. Additionally, the "glitched" samples occur right when background tasks are being handled, and the glitch data is what SHOULD HAVE been in the stream two glitches before

onyx hinge
#

this is rewinding to BEFORE I reworked the tick handling to fire at most once per ms; this becomes much less clear AFTER ticks were reworked, because up to 1ms or so of data is glitched instead of just a tiny bit

slender iron
#

@onyx hinge does overflow happen when you do mp3? its possible we don't clear the interrupt

onyx hinge
#
             continue;
         }
 
+        if(event_interrupt_overflow(dma->event_channel)) {
+            event_overflow_count ++;
+            last_overflow_event_channel = dma->event_channel;
+            last_overflow_dma_channel = dma->dma_channel;
+        }
         bool block_done = event_interrupt_active(dma->event_channel);
         if (!block_done) {
             continue;
``` note that you have to check overflow before interrupt-active because the latter clears the OVF flag
#

I know that it doesn't increment while looping a RawSample without mixer, but I think that's because "single buffer" audio gets a different path. Will test with wav and mp3, jas

onyx hinge
#

no mp3 yet at this old ref

#

wave does eventually get an overflow but not right away

slender iron
#

ยฏ_(ใƒ„)_/ยฏ

manic glacierBOT
onyx hinge
#

event system is only turned on in the case of !single_buffer, so that's why no overflows are possible there...

lone sandalBOT
fierce girder
onyx hinge
#

it keeps tripping me up that if my program is in an input(), it will not auto-reload

meager fog
#

@fierce girder yep!

fierce girder
#

thanks

manic glacierBOT
#

Managed to get another couple datapoints today.

  • Tried the same circuit python BLE keyboard code on a co workers windows machine (different manufacturer, different Bluetooth chipset even) with built in bluetooth and got the same error (driver error)
  • Loaded up the Arduino BLE keyboard demo and was able to successfully connect and have windows recognize and treat it as a keyboard.

![image](https://user-images.githubusercontent.com/3848505/72486014-9c6b5e80-37d7-11ea-9c59-6e170148f3a...

marble hornet
#

@rare perch thanks!

onyx hinge
#

I don't think this is how the start of playing a sine wave should look. Specifically, the part in about horizontal div 5 where it goes "Z-Z-Z-Z-Z-Z" while stuck in background tasks. (D0: high = in background tasks. D1: high = dma interrupt request, according to audio_dma_background. D2: high = dma interrupt overflow, according to audio_dma_background.)

#

oookkaaaaaay. the difference between my working and non-working code was a print(), the long background task block is displayio scrolling the text display.

#

some of my programs weren't affected because they did not have print()s

#

that was the real pattern, and it was obscured by other things

lone axle
#

I've just added the new debug build v08 apk to the Android Bluefruit Playground Repo. This version changes how the neopixel animations work a bit to solve an issue where the animations failed to stop properly sometimes. I think it could also lead to the animations running smoother on some devices. There are also some improvements to the disconnection process from last night included in this build. https://github.com/FoamyGuy/Android_Bluefruit_Playground

lone axle
#

Once I get the package namespace switched over, the signal strength icons, and a proper loading indicator on the accelerometer module, that will be everything from all of the feedback I've received and my own list of things todo. Getting pretty close to ready to launch. Anyone with an Android device and CPB interested and willing to test it out please let me know how it goes and what device you tested on if possible.

#

Goal is to finish up those things by the end of this weekend.

manic glacierBOT
manic glacierBOT
#

This is really odd because I did the same thing as you, and am seeing the flags field (0x01 with value 0x06) in the advertisement. Below is my screenshot. I am using the code below as a test: it's a slightly modified version of examples/ble_hid_periph.py. I'm using https://github.com/adafruit/Adafruit_CircuitPython_BLE/releases/tag/3.1.2 (not 4.0.0). I'm using a very recent build off master of CircuitPython. Do these versions differ from what you are using?

[ble_hid_periph.py.txt](h...

manic glacierBOT
marble hornet
#

@gilded cradle I know you asked this question literally months ago but I got the responsive buttons by using a procedural display library instead of displayio. I did some practical testing and I found this was was much more responsive heuristically. Not to mention itโ€™s only blitting what it needs to

#

That being said, displayio is still great for most applications

marble hornet
#

@slender iron can I ask you some questions about glyphs? i'm trying to extract their bitmap but i;m not finding much docs

slender iron
#

tomorrow, I'm headed to bed now

marble hornet
#

kk, sleep well ๐Ÿ˜Š

indigo wedge
indigo wedge
#

They agreed to remove that item from the order now, send me everything else and send me this one with the backorder items once the confusion is resolved

stuck elbow
#

@indigo wedge so it's Adafruit's fault after all!

manic glacierBOT
solar whale
#

@indigo wedge what else could you possibly use it for ๐Ÿ˜‰

ivory yew
#

We have 99 boards!

stuck elbow
#

...standing on the wall, 99 boards standing on the wall...

#

which reminds me that I need to update the photo

ivory yew
#

Heh. You gave me the tiniest amount of power! I shall abuse it. ๐Ÿ™‚

stuck elbow
#

the black piece of cardboard that I use for background is getting really worn out

ivory yew
#

Gives a good vintage look

stuck elbow
#

I photoshopped it with gimp to make it look black ;-)

ivory yew
#

Haha

orchid basinBOT
manic glacierBOT
gilded cradle
#

Thanks @marble hornet. I think I was trying to figure out how to get the calculator buttons to be more responsive, but the CircuitPython displayio speed update fixed it.

manic glacierBOT
half sedge
#

Please someone give a new micro USB cable to @meager fog ... The red one I see in YouTube video is damaged with the shielding is visible. Thanks.

marble hornet
#

has anyone else noticed a builtin font error on the nrf52840 feather in 5.0 beta 3 for the letter C ?

manic glacierBOT
stuck elbow
#

@marble hornet wat do you mean?

onyx hinge
#

but manitou we believe in you and think you can submit a PR!

stuck elbow
#

(sadly, I don't have any NRF board that runs CircuitPython, since non-express boards were dropped)

#

I was thinking about making a haxpress board, though

solar whale
#

@stuck elbow I just did a build of the current master and it built the non-express nrf52840 boaeds -- which one(s) do you have?

stuck elbow
#

the Feather nrf52840

solar whale
#

that is an express

stuck elbow
#

is it?

#

it's doesn't have 'express' written on it anywhere, but the firmware does

solar whale
#

yes -- has 2Mbyte Flash chip

stuck elbow
#

ok, I will try it then, thanks

onyx hinge
#

now that you mention it, that's confusing!

#

I hope this patch I'm working on .. works out. Decreases AudioMixer CPU utilization 50% and switches to saturating arithmetic so voices don't get fainter as you mix more. Just waiting on some build testing before I PR it.

solar whale
#

the build is BOARD=feather_nrf52840_express

stuck elbow
#

yeah, but the silkscreen just says feather nrf52840

#

maybe I have an early hardware version

onyx hinge
stuck elbow
#

I wasn't trying the nrf port all this time because I thought it wouldn't work

#

silly me

onyx hinge
#

the flash must be integrated in the RF shielded package?

stuck elbow
#

no, I think there is a tiny flash chip just next to the module

#

@onyx hinge that sounds awesome

onyx hinge
#

2 MB of QSPI Flash for storing CircuitPython files

stuck elbow
#

re the patch

onyx hinge
#

it does take +200 bytes or so of flash so I'm worried it might not fit everywhere

marble hornet
#

@stuck elbow i mean the c is shifter up and cut off on the bitmap ?

#

nm, it's my code! hmmmm

uneven yarrow
#

what's the best approach to stepping through a mpy file while debugging via stack trace? I hit an error while trying to get my esp32 to connect to a node server and the runtime error is popping up from within one of the mpy files.

I know that I can go to github and pull down the original py file and walk through them that way, but is there an easier way of looking through the mpy files themselves?

stuck elbow
#

not that I know of

uneven yarrow
#

hmm, gotcha

stuck elbow
#

00 usually means that there is a problem with the connection, or the esp32 doesn't respond for some other reason

uneven yarrow
#

oh good to know

stuck elbow
#

spi doesn't have any crc or ack, so if there is no connection, you simply just read all 0s

manic glacierBOT
uneven yarrow
#

interesting. so I'm using the following url to test:

SERVER_URL = "http://10.10.10.137/"

When I removed the http I got a different error stack

#
Traceback (most recent call last):
  File "code.py", line 180, in <module>
  File "adafruit_requests.py", line 270, in get
  File "adafruit_requests.py", line 167, in req
ValueError: need more than 1 values to unpack
#

and this is making a request to a simple node/express server I'm running locally

#
const express = require("express");
const app = express();
const port = 3000;

app.get("/", (req, res) => res.send("Hello World!"));
app.get("/json-test", (req, res) => res.json({ message: "Hello World!" }));

app.listen(port, () => console.log(`Example app listening on port ${port}!`));

#

nothing fancy, nothing special

stuck elbow
#

you need the http, I think

uneven yarrow
#

gotcha

#

hmm, let me try pinging the node server from the controller (haven't tried that yet)

stuck elbow
#

make sure the esp32 has the correct firmware flashed, is correctly connected and is powered

#

(unless it's built-in)

lone axle
#

I'm sure you've probably got it done already, but just because I caught myself with this the other day: Make sure your sever is visible to other devices on the network

uneven yarrow
#

aaaaah