#circuitpython-dev

1 messages ยท Page 302 of 1

manic glacierBOT
slender iron
#

@tulip sleet at my comp now

manic glacierBOT
slender iron
#

@prime flower so you are going?

tulip sleet
#

@slender iron if you have time, now's good to chat

slender iron
#

yup, good for me

prime flower
#

@slender iron I registered using the link and intend to attend

manic glacierBOT
spice crypt
#

Is there still a way to turn on verbose logging to the REPL? It seems like notro was able to in this issue, but I don't see the command. Is it a special build flag? Only results I'm finding online are for SWD debugging

manic glacierBOT
#

I built locally, a couple times. Verified that the ifeq ($(MCU_SERIES),F4) patterns in the STM port's mpconfigport.mk work, should they start to drift. Its all 5x5 that I can see.

I kind of liked the ALWAYS/DEFAULT/MINIMAL approach, but I spend no time adding ports. I'll agree with any approach of those that do. ๐Ÿ˜„

There are a few cleanup things, but they're mostly my doing from the initial effort. I have no issues handling them myself, as I prepare to loop shared_bindings_matrix.py...

obsidian compass
#

Quick question, is there support for USB HID gamepad in CP?

manic glacierBOT
slender iron
#

@spice crypt I don't know what you mean by verbose logging

#

@obsidian compass yes but the gamepad descriptors that work with a host can vary

obsidian compass
#

I am looking for Linux

slender iron
#

@tulip sleet do we have a learn guide for usb gamepad?

spice crypt
#

@spice crypt I don't know what you mean by verbose logging
@slender iron output like this assign byte code: code=20002a40 len=27 flags=0
assign byte code: code=20002b20 len=44 flags=0
assign byte code: code=20002b60 len=17 flags=0
make_function_from_raw_code 20002990
mp_obj_new_fun_bc: 20002960
make_function_from_raw_code 2002d970
mp_obj_new_fun_bc: 200028f0
make_function_from_raw_code 20002a90
mp_obj_new_fun_bc: 20002990

idle owl
#

@tulip sleet Here is the board check I wrote for the Circuit Playground Library. python @staticmethod def circuit_playground_type(is_type=None): if is_type is not None and is_type not in ("Bluefruit", "Express"): raise ValueError("Valid Circuit Playground boards are Bluefruit and Express.") cp_type = None if "Bluefruit" in os.uname().machine: cp_type = "Bluefruit" if "Express" in os.uname().machine: cp_type = "Express" if is_type is not None: return is_type == cp_type return cp_type

#

Code looks like this: ```python
from adafruit_circuitplayground import cp

if cp.circuit_playground_type("Bluefruit"):
print(cp.circuit_playground_type())

#

Easily expandable to add new boards as they come.

#

might rename is_type but otherwise I'm happy with it.

tulip sleet
#

@slender iron @obsidian compass There's no HID gamepad Learn Guide; sorry; I don't think it worked well or at all on Linux; it MIGHT have worked with the browser support on Linxu

#

@idle owl I think it would be better not to have it do the comparison itself if the arg is not None. That makes the function do two pretty different things depending on the argument. How about:

from adafruit_circuitplayground import cp

if cp.circuit_playground_type() == "Bluefruit":
    # whatever
idle owl
#

I did that

#

except you can put anything in there

#

and it will validate against it

tulip sleet
#

having it return either a string or a boolean is highly unusual

idle owl
#

I wanted to force it to require "Express" or "Bluefruit"

#

So I made it more complicated to require one of those.

#

So you could put in if cp.circuit_playground_type() == "foo" and it will allow whatever you want. So if you typo'd Express or Bluefruit in your code, you might never know that you're not validating properly because the code will run.

#

And attempt to work on both boards.

obsidian compass
#

@slender iron @obsidian compass There's no HID gamepad Learn Guide; sorry; I don't think it worked well or at all on Linux; it MIGHT have worked with the browser support on Linxu
@tulip sleet thanks for info, is there anything I can do to bring it to functioning state?

tulip sleet
#

ok, so how about having two routines: circuit_playground_is_type(something) and .circuit_playground_type as a proprty (or a no-arg function). What I'm saying is that the API style you have now is highly unusual and potentially confusing

#

@obsidian compass there was no gamepad description that worked across all of MacOS, Linux, and Windows, so I had to do two out of three. In addition the Linux support seemed flaky in general

#

or you could have circuit_playground.EXPRESS and circuit_playground.BLUEFRUIT as predefined string constants (or integers!) that the user would compare against.

idle owl
#

Splitting it is fine.

#

I don't like the idea of using constants for this.

tulip sleet
#

sounds ok

#

@obsidian compass issues were range of joysticks (8 vs 16 bit) and maybe signed vs unsigned

#

it was kind of a mess; support is poor and there were few hardware examples of non-proprietary game controllers that would work without installing drivers

#

@ionic elk in general for re patterns, you should always use raw strings, because you might edit an existing one and forget to put the r prefix on when it becomes necessary

#

a raw string is just a string that's parsed on input differently; it is not a different data type

idle owl
#

@tulip sleet ```python
@staticmethod
def circuit_playground_type():
if "Bluefruit" in os.uname().machine:
return "Bluefruit"
if "Express" in os.uname().machine:
return "Express"
raise ValueError("Board unsupported by this library.")

def circuit_playground_is_type(self, is_type):
    if is_type not in ("Bluefruit", "Express"):
        raise ValueError("Valid Circuit Playground boards are Bluefruit and Express.")
    return self.circuit_playground_type() == is_type```
#
from adafruit_circuitplayground import cp

if cp.circuit_playground_is_type("Bluefruit"):
    print(cp.circuit_playground_type())
tulip sleet
#

you could make circuit_playground_type a property; that would be consistent with what we make properties.

idle owl
#

ok

tulip sleet
#

you could save a tiny amount of code space by calling os.uname().machine only once and assigning it.

#

i'm just thinking about the frozen size

idle owl
#

I don't know how to do that and have it return properly.

slender iron
#

@spice crypt Ah. I'd just look in the source for those messages and turn the define on. I don't know it off the top of my head. (I never use it.)

tulip sleet
#
@staticmethod
    def circuit_playground_type():
        m = os.uname().machine
        if "Bluefruit" in m:
            return "Bluefruit"
        if "Express" in m:
            return "Express"
        raise ValueError("Board unsupported by this library.")
idle owl
#

oh

#

I see what you mean. Thanks.

spice crypt
#

I'm partway through your uheap memory video, hope to do it that way eventually.

tulip sleet
#
_CP_TYPES = ("Bluefruit", "Express")
@property
def circuit_playground_type():  
    m = os.uname().machine 
    for t in self._CP_TYPES:
        if t in m:
            return t  
    raise ValueError("Board unsupported by this library.")

    def circuit_playground_is_type(self, is_type):
        if is_type not in self._CP_TYPES:
            raise ValueError("Valid Circuit Playground boards are Bluefruit and Express.")
        return self.circuit_playground_type() == is_type
#

that assumes the type names are actually in .machine, which is true currently

idle owl
#

Something will be in .machine I would think. And we can return whatever we want, so if it's not necessarily the name, we can still return the colloquial board name.

#

hmm ok

tulip sleet
#

again, just saving bytes

idle owl
#

right. Does _CP_TYPES go in init or outside

tulip sleet
#

raise ValueError("Valid Circuit Playground boards are", self._CP_TYPES)

#

it's a class constant

idle owl
#

ok

tulip sleet
#
class ...:
    _CP_TYPES = ...
idle owl
#

yah ok that's where I was putting it.

#

@tulip sleet So this look ok for the error? Auto-reload is on. Simply save files over USB to run them or enter REPL to disable. code.py output: Traceback (most recent call last): File "code.py", line 3, in <module> File "/lib/adafruit_circuitplayground/circuit_playground_base.py", line 155, in circuit_playground_is_type ValueError: Valid Circuit Playground boards are ('Bluefruit', 'Express')

tulip sleet
#

I think so, do you think so?

idle owl
#

Good enough I guess. I used .format otherwise it does weird things with quotes separating each section.

#

We'll have to update the frozen lib. bleh.

#

At least we're not still dealing with 4.x I guess. Should probably figure out a way to make it fail gracefully if it's on 4.x still?

#

"figure out" I mean we already know how to do that. I suppose I simply mean do it.

#

Actually there's probably no point. Because Bluefruit was never supported on 4.x. We already put a hard stop on that.

idle owl
gilded cradle
#

@tidal kiln, want to take a look since you're more familiar with the FT232H?

tidal kiln
#

@gilded cradle yep

gilded cradle
#

Thanks

tulip sleet
#

@slender iron you are right, notifications are only single BLE packet events, so the size is limited to that. And the discovery process does not include a way to determine a characteristic's max length.

I think it would actually be useful to have a Connection.max_data_length property so you could retrieve the negotiated max data length (mtu - 3) for a particular connection. That makes it easier to do length checking in various places.

manic glacierBOT
simple pulsar
pseudo pebble
#

Does anyone know if the CircuitPython port for the Xenon / Argon supports the bluetooth functionality?

idle owl
#

@pseudo pebble Last I knew, no. It utilises the microcontroller successfully but does not include support for the radio. It's been a while since I looked into it though.

pseudo pebble
#

@idle owl I knwo the Argon supports wifi, wasnt sure about the bluetooth

idle owl
#

Ah hmm ok. @solar whale might know better than me.

pseudo pebble
#

With Adafruit not yet supporting a feathewr of their own with onboard wifi that works with CP, my stack of Argons is still relevant

idle owl
#

I feel like he messed with them a bit at some point.

#

Fair enough, understandable.

solar whale
#

@pseudo pebble the Argon is an nrf52840 and the Circuitpython bleio functions should be supported.

idle owl
#

Like I said, been a while since I looked into it. I'm guessing it was pre-nRF52840 CircuitPython support.

#

Thanks for chiming in!

solar whale
#

The Wifi via the ESP32 is only minimally supported

pseudo pebble
#

:: nods :: YEah, it works fine for basic stuff... but I gues particle is dead long term

#

Still, i have like 11 xenons and 8 argons and 3 borons... so if I can at least use the xenons ? Boonus

solar whale
#

the xenon and argon should be functionally the same.

#

I even the Boron should work the same -- just no support for the celluar part.

pseudo pebble
#

I flashed up an argon, I'll try some BLE code on it, see what happens

solar whale
#

you can use the wifi on the argon if you reflash the esp32 with the AT command firmware but it is not as well supported as the ESP32SPI capable boards.

pseudo pebble
#

:: nods :: Yeah, I am using it that way for some basic data logging. Qorks fine but the connection isnt super stable

solar whale
#

In my opinion,you are better off adding an airlift featherwing....

pseudo pebble
#

Well, a xenon + airlift woudl not be a horrible option. I hate having to go to a two board solution, evne with stacking, but it is what it is

solar whale
#

Good luck with BLE -- it should behave much like the fearther nrf52840 express

#

with a few pin name differences

pseudo pebble
#

:: nods :: I am lookign at some sample code now.

#

Big win foer me if it works. I cant go to production with them ofg course, but for dev? Perfect

#

Ok. It works

idle owl
#

Good to know!

pseudo pebble
#

Yeah. No real muss

manic glacierBOT
#

Do you still need an answer from me? I'm not sure what the question was.

@tannewt since you've been working with the clock files recently I was hoping for your input on including ifndef-mediated default values for the clock divisors (PLLM, PLLQ, etc) in each MCU line's clocks.c. These could then be overridden at the board level in the case that a board needs to suppress clock speed for a certain purpose (like external SRAM). Would this break anything for your low-power code or vision...

#

Do you still need an answer from me? I'm not sure what the question was.

@tannewt since you've been working with the clock files recently I was hoping for your input on including ifndef-mediated default values for the clock divisors (PLLM, PLLQ, etc) in each MCU line's clocks.c. These could then be overridden at the board level in the case that a board needs to suppress clock speed for a certain purpose (like external SRAM). Would this break anything for your low-power code or ...

ionic elk
#

@slender iron are RGBMatrix and FramebufferIO SAMD specific?

slender iron
#

no

#

that is the protomatter work @onyx hinge was working on

#

it is on nrf as well

onyx hinge
#

@ionic elk ladyada has asked me to look into porting it to stm, starting with the feather.

#

but right now, it isn't on that port, just the ones tannewt mentioned

ionic elk
#

That's what I thought. I wasn't sure about FrameBufferIO though which is why I asked. That's part of RGBMatrix?

onyx hinge
#

right now framebufferio only works with rgbmatrix. in the future, we imagine that for microcontrollers with built-in LCD driving might implement something else that would work with framebufferio.

ionic elk
#

Ok, sounds good. Thanks!

onyx hinge
#

happy to answer any more questions you have.

manic glacierBOT
#

Chatted with @jepler about this on Discord to verify that FrameBufferIO is only used with RGBMatrix on the SAMD for now. Both RGBMatrix or FrameBufferIO default to 0 right now (unlike ulab, which defaults on) so they should be defined port by port - I imagine we'll make them default to 1 sometime later once they have more coverage (doesn't seem like we have a specific line for that but I'd figure it's when all the "big" ports atmel-samd, nrf, mimxrt, and stm are supported).

slender iron
#

@ionic elk rgbmatrix and framebufferio are on nRF too

ionic elk
#

@slender iron cool! it's not a super big deal just mentioning it in my conversation with @tulip sleet in the docs PR. There's minor ambiguity for some modules about whether they should be "default" or not but I'd hardly describe it as urgent.

slender iron
#

just making sure you know after seeing "Chatted with @narrow dirge about this on Discord to verify that FrameBufferIO is only used with RGBMatrix on the SAMD for now." above

ionic elk
#

yeah I'll edit that to remove any confusion

#

Shouldn't impact the code, it's basically just whether the modules are set to 1, 0, or FULL_BUILD in circuitpy_mpconfig.mk. I figured in this case they should be 0 and turned on per-port.

manic glacierBOT
slender iron
#

@sour lynx you around?

#

(I realize it's late.)

slender iron
#

@vale spire @atomic summit got the build setup enough to crash the linker

atomic summit
#

oooer, progress!!! Awesome!

slender iron
#

you can make BOARD=saola menuconfig and the sdkconfig file ends up in the board folder

#

had to make minor changes to the idf to get it happy with -Wundef and -Wsigned-compare

manic glacierBOT
manic glacierBOT
#

This patch does two things:

  1. Add s140 v7.0.1 as an option to build, and
  2. Switch nrf52833 to use v7.0.1

Since this is the minimum supported version for that chip, and while 6.1.1 works (but is not supported by the vendor), are there any blockers for integrating this into circuitpython?

There's a lot of discussion here about how to update nrf52840 boards, but I suspect that should be a separate topic, since nrf52833 shouldn't ever really be running v6.1.1.

vale spire
#

@slender iron neat! just reading throught he Makefile now. so you call the idf cmake with your sdkconfig and get a bunch of .a files for the relevant components and then you do the rest in the Makefile?

slender iron
#

@vale spire that's the theory

manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
lucid solar
#

@slender iron Github check mpy-cross-mac is failing, I think it's because msgpack isn't installed now for some reason.

onyx hinge
#

@lucid solar noted, I'll look into it

#

we'll just drop that macos job if necessary, it's only a curiosity

lucid solar
#

@onyx hinge we could just brew install msgpack

onyx hinge
#

are you familiar with macos and brew? I'm not, though I did write that section of the actions file. I would be happy to see a PR from someone who is, to make it work right.

lucid solar
#

and yes...that's my PR ๐Ÿ™‚ k0d = me

#

@onyx hinge PR on it's way....

onyx hinge
#

isn't the missing program 'msgfmt', which is from gettext?

#

great!

lucid solar
#

msgfmt is part of msgpack I think...I could be wrong will check anyway

onyx hinge
#

on linux msgfmt comes from gettext, and we were running 'brew link --force gettext'. Until some recent change, that made the msgfmt program available. but now brew just criticizes you and doesn't do what was requested, even with --force

lucid solar
#

gettext was updated 2 days ago on brew, must have been that

onyx hinge
#

could be? yesterday a run said this: ``` brew link --force gettext
shell: /bin/bash -e {0}
Linking /usr/local/Cellar/gettext/0.20.1... 181 symlinks created

If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile```

#

today a run said this: brew link --force gettext shell: /bin/bash -e {0} Warning: Refusing to link macOS provided/shadowed software: gettext If you need to have gettext first in your PATH run: echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile

lucid solar
#

maybe we don't even need gettext installed if macOS provides it...but I guess it doesn't provide msgfmt...which I guess we use?

tulip sleet
#

do either of you have a Mac to update and check this on? If not I do (not used on a daily basis)?

lucid solar
#

I'm updating now ๐Ÿ˜‰

onyx hinge
#

fwiw this seems to work today on github actions, so I can also PR it if @lucid solar's tack doesn't pan out. ```- brew link --force gettext

  •    echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH"
    
#

weird way to set an environment variable, but what are you gonna do

lucid solar
#

msgfmt is in /usr/local/opt/gettext/bin on my mac, so I think that's a good fix. can you do the PR @onyx hinge please?

onyx hinge
#

sure thing

manic glacierBOT
#

'brew' apparently introduced an incompatible change, where even "--force" does not actually make the commands available in the default path.

Also switch to a numbered macos release instead of "latest", though this did not save us from breaking changes in brew or other preinstalled sw.

This was reported upstream and they may be fixing it, but for now this puts the wheels back on the bus. https://github.com/Homebrew/homebrew-core/issues/53485

onyx hinge
#

@lucid solar are you familiar with how to merge or rebase your PR to get this change once it's merged?

tulip sleet
#

@lucid solar @onyx hinge I have a very vanilla Mac with only XCode installed, and there is no gettext available in /usr/local/

#

so I think you have it from a previous instsall

lucid solar
#

I was just going to say that...it's installed by brew

#

I didn't mean it was preinstalled

#

so we need the other command also

onyx hinge
tulip sleet
#

right but now doing brew install gettext is necessary?

#

crossed msgs

onyx hinge
#

it's installed on the runner but is not placed on the PATH.

lucid solar
#

lets see if the test fails

tulip sleet
#

ok, got it

lucid solar
#

@onyx hinge yes, I can rebase my PRs when this is confirmed working.

onyx hinge
#

@lucid solar excellent. I wanted to make sure in case you were unfamiliar.

manic glacierBOT
onyx hinge
#

I can change the PR to ``` run: |

  •    brew install gettext
       echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH"
    

``` though that prints a warning: Warning: gettext 0.20.2 is already installed and up-to-date which seems a bit silly

#

it might be better, instead of assuming gettext is installed when I can't point at documentation that says it is

tulip sleet
#

this is odd: I did brew install gettext and now I have both gettext and msgfmt on my path under /usr/local/bin

onyx hinge
#

we aren't doing brew update/upgrade so we wouldn't get it until the base runner image was updated.

#

(look at me pretending I know much about brew :-/)

lucid solar
#

I'm assuming, the actions macos image installs some of the "Utilities" via homebrew, so it probably installs gettext as a dep. of one of them.

onyx hinge
#

@lucid solar my theory too

tulip sleet
#

yes, my brew updated itself before trying to fetch, so it may be fetching the older one?

lucid solar
#

"Where is the macOS source? We are in the process of preparing our macOS source to live in this repo so we can take contributions from the community. Until then, we appreciate your patience and ask you continue to make tool requests by filing issues."

tulip sleet
#

anyway, your pr is working, that job passed

#

i'll approve and merge once the test job works, unless you want to do it a different way

lucid solar
#

I think it's fine

onyx hinge
#

I don't need to fiddle with it further, thanks

manic glacierBOT
onyx hinge
lucid solar
#

@ionic elk whats your plans for the STM32F7 ports? I'm starting to enable the missing modules, done pulseio, doing os now...

manic glacierBOT
#

I think packet_size needs to be asymmetric because WRITES can be as long as the attribute length while NOTIFY is limited by the MTU. Based on the doc here it needs to be the larger of the two: https://github.com/adafruit/circuitpython/blob/master/shared-bindings/_bleio/PacketBuffer.c#L100

We'll want to validate that outgoing data fits into the mtu if NOTIFY is being used.

@tannewt I am adding Connection.max_packet_length, which returns the maximum number of bytes that will fit ...

lucid solar
onyx hinge
#

@lucid solar right now enabling displayio probably expects that spi and i2c are available. You're right, it could be separated out, but I suspect there's work to do first

ionic elk
#

@lucid solar Yeah I saw your quick PR to add PulseIO in, looks good. There are probably a number of modules that can very easily be added - OS and thus Random and Storage are among them. ADC support is probably among the more difficult.

They didn't make my original todo list because I like to double check the Micropython and STM32Duino implementations to make sure there aren't any initialization gotchas or other major hidden differences from the F4 that could mess users up unwittingly. Making sure of that takes testing and reading and it isn't at the top of my priority list right now, but I'm happy to review anything you feel is low hanging fruit.

lucid solar
#

@ionic elk yeah, I'm just enabling simple things just now. Ones that I know won't break other ports. I'll get some F4 boards so I can test more complicated things in the future.

ionic elk
#

As for DisplayIO, that comment could probably be a little cleaner, yeah. Right now it fails because PulseIO isn't in and there's some backlight brightness thing somewhere that needs it factored out...

#

If you want, you could just breeze through the initialization settings between the CubeMX exports for the F4 and F7 for the basic/PWM timers and see if anything stands out to you. Micropython doesn't have an great equivalent to our PulseIO so it's less ideal for gotcha checking compared to, say, flash, where we're basically identical

#

Just FYI I'm working on a PCB project I promised a friend I'd do by the end of the week so I'm going to have sporadic availability today, but I'll be doing some reviews tomorrow and I'll be fully back in gear on Monday as well.

lucid solar
#

Ok, take your time. None of this is really priority, it's just I'm wanting to understand how CPY works so trying to 'touch' as much of the codebase as I can.

ionic elk
#

No it's great! It's awesome to have someone else exploring the STM32 port in detail. And I'd also admit that I didn't spend as much time on the F7 implementations as the H7 ones so it's good to have you pointing out issues like these

lucid solar
#

I don't understand the shared-bindings/shared-module system yet.

#

I'd like to look at the L4P5 port at some point....seems @meager fog is interested in that mcu and it's very similar to f7 in terms of features.

ionic elk
#

I think they like it for the similarity in stats to the SAMD51. But that said the Micropython is littered with structural differences for the L series, so I definitely wouldn't underestimate the difficulty of adding it. I think it'd likely be as much if not more work than the H7 port.

#

They have different flash memory structure, different bus settings, all kinds of stuff.

#

But I'm excited to explore the L series now that we have more low power focus and support. I've got friends who use Circuitpython for environmental sensors so this kind of stuff is definitely intriguing to me

lucid solar
#

I'm more into graphics, that's why I want to get LTDC working on the discof7 board...the screen is nice!

#

I think I'll leave it for a few days though, I've got another CPY issue I want to tackle first.

#

Actually, I want to get openocd into the Makefile first, as it's very useful for debugging...plus the USART/VCP thing we talked about.

tulip sleet
#

@lucid solar shared-bindings/ provides the Python visible API layer for native modules. A native module is implemented per port in port/<port-name>/common-hal/<module-name>. If part or all of the module can be implemented in a port-independent way, then that port-independent code is in shared-module/

onyx hinge
#

so any knowledge of the underlying datastructures should be kept out of shared-bindings. I keep falling afoul of this, and tannewt gently corrects me

slender iron
#

@spice crypt lets debug here

#

ram.bin should be dumped by gdb

spice crypt
#

It's not in the same directory as mylog.txt resides

slender iron
#

hrm, what did you run in gdb?

spice crypt
#

your script

#

output_gc_until_repl

slender iron
#

looks like the ram.bin bit is commented out

spice crypt
#

haha, what do you know

#

let me try it

slender iron
#

line 13 may need to be updated too

#

that's how this stuff goes. it always needs a little updating because it's not fully auto

spice crypt
#

It's not happy after uncommenting the ram dump
`Breakpoint 1 at 0x310e6: file ../../py/gc.c, line 106.
Breakpoint 2 at 0x62d88: file ../../main.c, line 251.

Breakpoint 1, gc_log_change (start_block=start_block@entry=0, length=length@entry=2) at ../../py/gc.c:106
106 change_me += length; // Break on this line.
$1 = 0x0
$2 = 0x2
$3 = 0x6b0
#1 0x00037a20 in gc_alloc (n_bytes=<optimized out>, has_finaliser=<optimized out>, long_lived=<optimized out>) at ../../py/gc.c:597
597 gc_log_change(start_block, end_block - start_block + 1);
#2 0x0004441e in m_malloc (num_bytes=<optimized out>, long_lived=<optimized out>, num_bytes=<optimized out>) at ../../py/malloc.c:81
81 void *ptr = malloc_ll(num_bytes, long_lived);
#3 0x00053d88 in m_malloc0 (long_lived=false, num_bytes=24) at ../../py/malloc.c:122
122 void *ptr = m_malloc(num_bytes, long_lived);
#4 mp_map_init (n=3, map=0x20014f5c <mp_state_ctx+76>) at ../../py/map.c:87
87 map->table = m_new0(mp_map_elem_t, map->alloc);
../../tools/output_gc_until_repl.txt:32: Error in sourced command file:
No symbol "_srelocate" in current context.`

#

Also, I had to compile with -ggdb or else gdb would never break on gc.c:106

slender iron
#

ah ya. we changed that

#

are you on nrf?

spice crypt
#

yes

slender iron
#

need to look in the .ld file for the new name

#

looks like it's _ram_start now

spice crypt
#

so far so good

#

gdb server is active

slender iron
#

I don't think I've done it with nrf before

#

you should be able to watch ram.bin grow

spice crypt
#

it is indeed

slender iron
#

it dumps all of ram every gc action ๐Ÿ™‚

#

does your code finish? you may need to ctrl-c it at some point

#

the break in main.c is meant to stop gdb after the user code finishes

spice crypt
#

I had originally tried to run this on my full code and Jlink just segfaulted after a few minutes. I did change the code to something very minimal

slender iron
#

kk

#

it's not fast ๐Ÿ™‚

spice crypt
#

Yep, I see that. I'll give it a few minutes

#

do yo have analyze_heap_dump.py command in your history so I can avoid transcribing from youtube

slender iron
#

let me see

spice crypt
#

BBL, will report back

slender iron
#

@spice crypt I don't have it in my history. It's been a while since I did it

spice crypt
#

np. Thanks for looking

slender iron
#

np, happy to

#

it's usually what I rely on ๐Ÿ˜„

sour lynx
#

(I realize it's late.)
@slender iron I'm here, sorry, didn't get the notification yesterday

slender iron
#

no problem ๐Ÿ™‚

#

I finally got some focused time to work on things

#

one thing I ran into is a few compiler errors due to use using -Wundef and -Wsigned-compare

sour lynx
#

due to IDF header files?

#

or in IDF source files?

slender iron
#

headers

#

we don't compile the source with our flags

sour lynx
#

sure, can pull these changes in

slender iron
#

the other question I had for you was how I could disable overwriting the given sdkconfig

#

my ideal would be to have a full sdkconfig.defaults for the port and then individual sdkconfigs for each board

#

where the sdkconfig only has the differences

sour lynx
#

you can pass multiple sdkconfig defaults file via SDKCONFIG_DEFAULTS variable, like so:

#

cmake -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.myboard"

#

(one sec, will double check the syntax...)

slender iron
#

and then no sdkconfig? or one in the build folder?

sour lynx
#

it will create sdkconfig file from the contents of both specified sdkconfig.defaults files

#

usually it is recommended to add sdkconfig to .gitignore

slender iron
#

kk, then it can be in the build folder

sour lynx
#

i think you should be able to customize sdkconfig file name, which makes it possible to move it to the build folder

slender iron
#

yup. I sorted that out yesterday

#

just hadn't thought about the board one being a default as well

sour lynx
#

cmake -DSDKCONFIG=build/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.a;sdkconfig.b"

slender iron
#

my current state is that the compiler is segfaulting when I try to use it for linking

#

so I've gotta mimic the link command the idf is doing

#

I'm happy with the structure

sour lynx
#

oh. that's interesting. if you find what change in the command line makes it segfault/not segfault, let me know

slender iron
#

kk

sour lynx
#

to derive it from the build system, instead of hardcoding

slender iron
#

yup! That was just expedient

sour lynx
#

We tend to reorganize the files/directories once in a while. We do this in a way that doesn't break apps compiled with IDF build system, but if you are hardcoding directories then it may break unexpectedly.

slender iron
#

had to do that first since tinyusb pulls in the headers

#

ya, we can always update it too

sour lynx
#

i've logged a task in our issue tracker this week about finding a way to generate list of compiler/linker flags for external build systems.

slender iron
#

I was debating pulling them from the build.ninja file

sour lynx
#

that might actually be not a bad approach!

slender iron
#

I think I need to union them though

#

or find the component I'm actually using and snag it from there

sour lynx
#

if you declare requirements of the main component on other components you use, then the include paths for the main.c will be correct

slender iron
#

kk, so I can grab them from there

#

may still be easier to manually do it

sour lynx
#

regarding tools/.gitignore โ€” was it needed because you set IDF_TOOLS_PATH=$IDF_PATH/tools?

slender iron
#

yes, should I not have? seemed like what it was going for

sour lynx
#

usually if you don't set it, it defaults to $HOME/.espressif, or %USERPROFILE%\.espressif

manic glacierBOT
slender iron
#

ah ok

manic glacierBOT
sour lynx
#

in docker containers, sometimes we put it elsewhere, like /opt/esp

slender iron
#

heh. I'm on fish so the install needed me to add it

sour lynx
#

oh, i see. fish versions of install and export were contributed, i don't think we have fish users on my team, so this part might have been untested.

#

with bash and zsh it works without setting IDF_TOOLS_PATH

slender iron
#

ok, I'll remove the .gitignore changes and look into updating the fish script too

#

@sour lynx will you want a rebase with it or is a separate commit ok?

sour lynx
#

separate commit is fine. I think we may have to amend your commit which fixes -Wundef after some bikeshedding, which ifdef/if defined(/if defined pattern we want to standardize on in our header files. And also will need to add a CI job to prevent it regressing in the future.

#

So likely the PR will be rebased and some commits might be squashed after we accept it.

slender iron
#

๐Ÿ‘ I tried to match the file's use

sour lynx
#

yeah, i understand. Maybe it will pass as is. Will see.

slender iron
#

they should probably be #if defined(FOO) && FOO to be extra correct

#

in general I want us to move away from checking defined

sour lynx
#

for things which come from sdkconfig, if defined(CONFIG_FOO) should be sufficient, as Kconfig never defines to 0.

slender iron
#

ya, that was my first approach (to have Kconfig define 0)

sour lynx
#

it might have been nicer if it instead always defined CONFIG_FOO to either 0 or 1, but alas

slender iron
#

there was a lot of other issues to run down due to that

#

I like always defining because then you can verify the referencing code actually included the appropriate header

sour lynx
#

that's right, agree that defining 0s would have been a better option.

#

nowadays we have a CI script which checks whether we may have forgotten to include "sdkconfig.h" or misspelled the option name.

slender iron
#

I think I have the start of that work in a stash if you are interested

sour lynx
#

i'm afraid if we change Kconfig behavior to define 0 values now, we have a good chance of breaking a lot of our users' apps

slender iron
#

ya, it's a pretty big change

sour lynx
#

pretty sure we had a PR internally with the same change a while back (around the time of IDF 2.1) and even then when we had much less users it was decided that the change was too big.

slender iron
#

kk

sour lynx
#

maybe in IDF 5.0...

slender iron
#

luckily I realized the simpler way to fix the warnings ๐Ÿ™‚

#

thanks @sour lynx I appreciate the help. will poke the linker on my stream in a 2.5 hours

spice crypt
#

will poke the linker on my stream in a 2.5 hours
@slender iron Where do you stream at?

slender iron
#

on Adafruit

spice crypt
#

youtube I'm assuming

slender iron
#

and linkedin and twitter

#

๐Ÿ™‚

spice crypt
#

aha

manic glacierBOT
#

@tannewt I am adding Connection.max_packet_length, which returns the maximum number of bytes that will fit in a single transmitted packet (MTU size - 3). It will throw an exception if you call it before the connection is established, since we don't know the MTU size.

I don't think you will be able to raise an exception because a Connection object doesn't exist prior to it being established.

How will you know the maximum amount of bytes you can read out? If you are a server with a wr...

spice crypt
#

@slender iron Re: heap analyzer. I got as getting the analyzer dependencies setup for analyze_heap_dump.py, but now running into the issue of different named symbols in the linker. I'll continue poking to find the appropriate translations. rom_start has me scratching my head right now.

nRF: https://github.com/adafruit/circuitpython/blob/master/ports/nrf/boards/common.template.ld#L97
SAMD51: https://github.com/adafruit/asf4/blob/039b5f3bbc3f4ba4421e581db290560d59fef625/samd51/gcc/gcc/samd51g19a_sram.ld

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython

#

I'll continue later on today

slender iron
#

what symbol are you looking for now?

#

I'll be around off and on. just exercising now

spice crypt
#

Looking for mapping of this:

rom_start = symbols["_sfixed"][0] KeyError: '_sfixed'

#

'rodata' in nrf seems similar

slender iron
#

ya, worth a shot. I'd have to look at the context

spice crypt
#

Tried, but that's not really a symbol

slender iron
#

you may need to add it into the linker script

#

or hard code it

#

I think it should be FLASH_FIRMWARE

#

er, whatever CIRCUITPY_FIRMWARE_START_ADDR is

#

k, bbl. exercise time

spice crypt
#

๐Ÿ‘

#

Linker: _rom_start = ${CIRCUITPY_FIRMWARE_START_ADDR};
mkdir heapviz
analyze_heap_dump.py: rom_start = symbols["_rom_start"][0]
Getting somewhere!

manic glacierBOT
#

I don't think you will be able to raise an exception because a Connection object doesn't exist prior to it being established.

Right, sorry, I was calling bleio_connection_ensure_connected(), which will throw an exception if the connection is no longer connected. So PacketBuffer.max_packet_length will throw an exception if it's not connected, because it doesn't know the MTU and so can't answer reliably.

How will you know the maximum amount of bytes you can read out? If you are a ...

slender iron
#

nice @spice crypt !

lucid solar
#

@slender iron I want to output the console on both uart and usb-cdc...thing is the serial.c file that does it over uart isn't included if usb.c is. So I'm wondering where is best to put the code. Any thoughts?

#

in some ways I feel serial.c should really be console.c etc, but that's something that needs bigger discussion I guess

slender iron
#

@lucid solar for now I'd just #if it into the usb one.

lucid solar
#

ok...that's what I just started to do ๐Ÿ˜„

slender iron
#

we can always reorganize it later

#

ideally it'd be any stream object

#

though the ctrl-c checking requires an interrupt

#

goes to lunch

solar whale
#

@tulip sleet upgraded to ubuntu 20.04 -- part of a a complete rebuild of my system due to a disk drive failure. Just finished a complete build of CP (en_US only) but no issues (other than fomu - I have not installed the risc-v tools yet) . I managed to get away with just replacing my disk drive with a new solid state drive ... so far so good.

raven canopy
#

i got the motd on my RPi last night (running 19.10). not real sure i'm ready to test the waters there. ๐Ÿ˜„

sour lynx
#

@slender iron i've narrowed it down to the presence of --gc-sections on the command line. Which, again, is odd, because we use this flag in IDF build system.

#

but once i remove --gc-sections, the linker starts actually complaining about missing symbols instead of crashing

#

oh, and you seem to be missing -mlongcalls from CFLAGS

slender iron
#

k, awesome!

remote dawn
#

Brand new Adafruit Metro M0 arrived today. The first time I plugged it in to my Windows 10 desktop, it seemed to connect OK, but several minutes later Windows said it was malfunctioning. Now Windows doesn't even recognize it. Nothing shows up in the Devices USB listing; there's no "beep" or any indication in Windows that anything got connected at all! But the Metro does receive power thru the USB cable. I can also plug in the 9V supply before connecting the USB; just nothing at all! What should I try?

slender iron
#

@remote dawn did it have circuitpython on it?

remote dawn
#

It was ordered as CircutPython. The Adafruit Metro M0 instructions are confusing because they told me to start by installing the Arduino IDE, which I did. I downloaded the proper set of board files, and selected the Metro M0 but it said it couldn't connect.

slender iron
#

what happens if you double click the reset button? that should get you into the bootloader

remote dawn
#

The light beside the reset button stops varying across the spectrum and turns solid green. Also the tiny LED labeled "L" turns on. But nothing shows up in Windows.

slender iron
#

ah, so the varying sounds like the arduino rainbow pattern.

remote dawn
#

In fact, now the LED turns red, not green

slender iron
#

red means that usb isn't detected by the bootloader

#

you may want to try a different cable and remove any intermediate hubs

remote dawn
#

Aha. I moved the cable to a different plug, without any intermediate hub. Now I have a green light AND Windows is giving me a METROBOOT hub. So now what do I do? Ignore the Arduino IDE completely and start up Mu?

#

Windows just informed me that the device is set up.

#

I've downloaded the latest version of CircuitPython (a UF2 file) - should I try to install that?

#

Welp, I tried to open the INFO_UF2.txt file on the METROBOOT drive and now it's hung up. Window USB manager is not responding. I'm going to try resetting. Hmm... a simple single press of the Reset button closed out the METROBOOT and brought up a window called CIRCUITPY. So I guess I'm in business. Thanks, tannewt!

lucid solar
#

@slender iron I've kind of fixed some of the esp32s2 stuff

slender iron
#

@remote dawn no problem! glad you made progress

lucid solar
#

FileNotFoundError: [Errno 2] No such file or directory: 'boards/saola/saola-spi.ld' is my issue now

slender iron
#

@lucid solar igrr saw that you can remove gc-sections and it doesn't crash

#

weird! that might be an old version of my branch

lucid solar
#

ok...did you have that file then?

slender iron
#

ya, I think that is a litex remnant

#

but you wouldn't get that far without the newer makefile

lucid solar
#

@slender iron basically it seemed like xtensa-gcc was outputting the file, just not exiting correctly, so I tricked it into always reporting it exited ok. That seemed to fix some things, but not everything...so I think it's not a valid hack for now. I'll go to sleep now. Have a good weekend if we don't talk before Monday.

slender iron
#

Thanks you too! Happy birthday!

lucid solar
#

Thanks ๐Ÿฐ

idle owl
#

Here is the notes document for Mondayโ€™s CircuitPython Weekly meeting. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโ€™ll be attending the meeting - itโ€™s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโ€™ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1hcf6M5Xfg-LgcnLCO06eExrDE44b1aTNV_eSqdDRjRE/edit

manic glacierBOT
#

How will you know the maximum amount of bytes you can read out? If you are a server with a write and notify characteristic, then a client could write more than the MTU to you even though you can only write an MTU back.

That's a bit pathological (WRITE/NOTIFY vs the typical READ/NOTIFY), but I"m thinking the point of .max_packet_length is how big a notify packet the server can send, and the point of PacketBuffer is to queue notify packets. Maybe we should just call it `max_notif...

manic glacierBOT
tulip sleet
manic glacierBOT
#

It's not pathological. That's how USB MIDI works.

All right, I stand corrected. So I'm thinking that what one wants .packet_size to reflect varies based on which direction you're interested in and what the flags are. Perhaps the best thing is to drop it, and have the user code figure out the packet length required based on the situation, the new Connection.max_packet_length, and on the Characteristic's max_length. Or do you think calling it .max_notify_length makes more sense?

manic glacierBOT
clever wren
#

I'm wondering if a library for micro:Bit micropython will work on circuitPython.

simple pulsar
#

@clever wren Which one?

clever wren
#

cube.bit accessary

#

4tronix Cube:Bit

#

Un a little unsure if it is the Python library to run the cube:bit from a raspberry Pi with Python or micropython for Micro:bit

lone axle
#

is the setup.py file included in the library repos "only" for installing the library via pip? Or does that serve a different purpose as well?

raven canopy
#

@lone axle only for PyPI/pip.

lone axle
#

Thank you ๐Ÿ‘

manic glacierBOT
#

So, FYI, this "bug" is present in every SoC that we support, including heavily tested ones like the F405. It doesn't impact the functionality of the timers in any of them as far as I'm aware.

The use of the extern keyword here was carried as a convention over from the pins.c and pins.h file, but I'll admit I don't need to make much use of the keyword in my own projects. Is it strictly necessary to even have it at all for array declarations like this?

simple pulsar
#

@clever wren From the 4tronix page on this, With Raspberry Pi, use any of the WS2812 code already available to drive your Cube:Bit eg. Pimoroni, Adafruit or 4tronix FireLed products. - The Adafruit NeoPixels are WS2812. The cube looks like it performs just like any other strip (or circle) of addressable LEDs. There are native Adafruit libraries to talk to these. https://circuitpython.readthedocs.io/projects/neopixel/en/latest/

spice crypt
#

This is after initiation of all my code and then in "idle" state

#

I wish the GC just nullified all the "out of scope" blocks

ebon raptor
#

You could try using weakref more

ebon raptor
#

oh hm, does circuitpython even support weakref?

lone sandalBOT
stuck elbow
#

@ebon raptor that could be hard to do, due to the way GC looks for pointers

ebon raptor
#

I'm more familiar with CPython than micro/circuit but weakref is more about triggering the refcount collector than the mark-and-sweep phase.

manic glacierBOT
onyx hinge
#

@tulip sleet @slender iron Looking at the changes on master since 5.3.0-rc.0, is the nRF firmware size calculation an important bugfix? I am pretty sure I don't want to go beyond that, where the SD version was changed. Just trying to decide whether to go to 5.3.0 final, bump slightly to the merge of #2800 (and get #2802, a nice little safe ulab update that might help PhilB), or what. I just happened to be checking now, will bring this to In The Weeds if chat doesn't produce a conclusion.

#

oh hmmm, #2802 is no good, it added docs but didn't actually pull in the ulab changes egg on face

manic glacierBOT
manic glacierBOT
tulip sleet
lucid solar
#

@slender iron when CPY is running a script...and it waits for CTRL+C...it seems to be running inside mp_builtin_input is that correct?

manic glacierBOT
manic glacierBOT
tulip sleet
#

@lucid solar ctrl-C is detected in usb.c (mp_interrupt_char). It is not running inside mp_builtin_input. There's a check for ctrl-c there, but that's not the interrupting charater check

lucid solar
#

ok, thanks

tulip sleet
#

pyexec.c parse_compile_execute() is where code.py gets run (that is well down the call chain; it starts in main.c)

lucid solar
#

I think I found what I needed...I need to do mp_interrupt_char for serial also...nearly done...just having interrupt issues ๐Ÿ™‚

manic glacierBOT
manic glacierBOT
lapis hemlock
#

@onyx hinge Jeff, do you want to add the equal and not_equal functions to the compare sub-module? As far as I remember, the == and != binary operators won't work properly in circuitpython, if the operands are ndarrays. The two functions would offer a workaround.

onyx hinge
#

I wouldn't mind seeing it added. ๐Ÿ™‚ I have continuing work on the RGBMatrix stuff that takes precedence right now.

lapis hemlock
#

I have continuing work on the RGBMatrix stuff that takes precedence right now.
@onyx hinge My question was not an invitation to tango๐Ÿ˜‰ I will see to adding the implementations.

manic glacierBOT
manic glacierBOT
#

I just experienced a variant of this or perhaps a different issue. I tried to copy over code.py as I normally would and it paused and didn't appear to copy any bytes. After maybe 20 second Windows popped up a very unique looking error. I've never seen an Adafruit board elicit one of these before, Error 0x80070079: The semaphore timeout period has expired:

![20200426-cp-5 2 0-windows-error-after-some-timeout-explorer-copying-over-circuitpy-code py](https://user-images.githubusercontent....

ionic elk
#

do we still have ure support or was that dropped?

tulip sleet
#

@ionic elk it's now re

ionic elk
#

how do I import it?

#

or is it something I might have missed on the stm32 port?

#

I can't get access to it with import re it seems

tulip sleet
#

check for MICROPY_URE or something like that; it hasn't been moved into the CIRCUITPY flags, I think

#

it's turned on for SAMD51 and nrf definitely

#

also same for json (was ujson)

ionic elk
#

Yep looks like it's something I just fixed with the docs change but wasn't on the specific feather I was using.

#

Thanks!

#

does it have any extension in capability from what's on the docs, along with the rename?

tulip sleet
#

you mean for our version? Our version is the same as MicroPython.

ionic elk
#

ok

low sentinel
#

I'm working on a UI for a 3d printer using displayio and an m4 express feather:

MemoryError: memory allocation failed, allocating 1096 bytes

> in uart_port.readline()

I have to poll JSON from a UART to get the status of the printer. The JSON generates quite a bit of garbage (gc every couple of seconds), maybe fragments the memory.

I'd love to use a fixed buffer, and I'd just adore some kind of memory dump via USB. Any tips, dear friends?

tulip sleet
#

@low sentinel if you can get away without parsing the JSON, but just reading characters until you hit the status field, that should help a lot. I'm not sure what you mean by memory dump via USB.

#

There is regular expression support: import re

#

maybe do readline() from the UART, though it will return an incomplete line if it times out

low sentinel
#

I'm not sure what you mean by memory dump via USB
I mean I have a lot going on here between displayio, json parsing, instrumentation, displayio font glyph cache, icons... It is tough to understand exactly where my memory is and some kind of visualization would be wonderful.

#

maybe do readline() from the UART, though it will return an incomplete line if it times out

That's the line that is OOMing.

Regexes - I'm not really sure I'll be able to use them. There are indices and identifiers and stuff. It's not straightforward anyway - would need to dynamically generate the regexes.
(I am in the wrong channel, this is more appropriate for help-with, I'm sorry!)

tulip sleet
#

there isn't a detailed dump available in an ordinary way. We have some tools for doing this, but they are meant for development.

#

and it doesn't necessarily classify the memory as you wish

slender iron
#

@low sentinel here is a stream I did about memory analysis: https://www.youtube.com/watch?v=baa5ILZTRkQ&list=PLjF7R1fz_OOXBHlu9msoXq2jQN4JpCk8A&index=7&t=12s @spice crypt has been doing more recent digging and is using displayio as well

Live stream of @tannewt debugging memory issues in CircuitPython.

Visit the Adafruit shop online - http://www.adafruit.com


LIVE CHAT IS HERE! http://adafru.it/discord

Adafruit on Instagram: https://www.instagram.com/adafruit

Subscr...

โ–ถ Play video
low sentinel
#

Yeah, these SVGs look right about perfect

spice crypt
#

I had to make a few tweaks for use on nrf (will make a PR) but otherwise the instructions are clear. You will need to uncomment the append line in the gdb script.

manic glacierBOT
#

Hi all,
I'm a huge fan of this project. I was looking for some advice before I submit a PR.
I have a project that uses Optical Switches for determining wheel speed (and distance). I have put together a module that handles the counting via interrupts, very similar to rotaryio, however where rotaryio looks for a quadrature encoder, this module purely looks for single pulses.
My question is, how should I prepare my code for the PR. Given this linear encoder is similar to rotaryio, should I pa...

ionic elk
#

@slender iron how do you tell what driver one of these waveshare epapers has onboard? I've been poring over their datasheets and they don't seem to list it anywhere

onyx hinge
#

this is weird. My ulab PR overflows espruino-pico, going from >60kB free to over-full. but .. the added code in ulab itself is negligible. and it only happens after being merged with origin/master, not on its own. (happens to be based at 5.2.0-rc.0)

#

hmmm

#

the linker script has

FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 320K /* sector 4 is 64K, sectors 5,6,7 are 128K */

but the successful build prints

68356 bytes free in flash firmware space out of 393216 bytes (384.0kB).

#

FLASH_FIRMWARE is the name that is supposed to be used for this region, the script gets it wrong and uses FLASH instead but that refers to the whole flash

#

so this port was really full before, but the script reported wrong and made it look like there was about 60kB free...

#

will note it on the PR

bright aspen
#

I'm back to see what's going on over here. I'm helping out with the Covid Watch project. Covid Watch is an anonymous exposure notification app to help contain Covid-19. I'm doing some BLE testing and measurements. I'm using CLUE this instant, but have some other boards. I wan't to squeeze out what I can from BLE in CircuitPython. I'm currently using _bleio. However, there seems to be a warning that it could change. How much of a risk is that?

manic glacierBOT
#

While diagnosing the build failure of #2811, I discovered that for espruino pico, there is actually 320kiB for flash, but the build (when successful) reports space free against 384kiB. This appears to be due to using FLASH_TEXT as a section name, while the script (build_memory_info.py) uses FLASH_FIRMWARE (indicating it's the current best practice) if available, or FLASH otherwise; but FLASH includes e.g., bootloader and internal filesystem data.

tulip sleet
#

@onyx hinge It is possible that the double-precision float routines have been included due to something in the code. Try arm-none-eabi-nm --print-size --size-sort --reverse-sort --radix=d and look for large routines, and look for dadd, dsub, dmul, ddiv etc.

#

ah, I read your later message.

#

@bright aspen It probably won't change that much; if there's something that you need in adafruit_ble in Python that we don't supply, feel free to open an issue.

#

we just don't guarantee that it won't change

#

hence the underscore

onyx hinge
#

@tulip sleet still a helpful recipe, I'll file it away in my memory

#

so happy to see this added on github pull requests, even if it's a little hard to spot.

slender iron
#

@ionic elk I know how to do it when looking at good displays website. what screen do you have?

#

@bright aspen nice! I've got my eye on a couple contact tracing projects. I mean to make sure we can be compatible with the Google/Apple system with a dedicated device.

manic glacierBOT
bright aspen
#

@tulip sleet @slender iron Thanks! Covid Watch will probably switch over to Google/Apple and I'm also in the non-phone discussions, so this sounds great. I'm currently working in improving distance estimations.

manic glacierBOT
thorny jay
#

I'm using CLUE this instant, but have some other boards.
@bright aspen I suggested the use of CLUE for anonymous Covid-19 tracing. If one tracing protocol/app is 100% open, then it could be implemented on an anonymous device such as a CLUE. https://twitter.com/DavidGlaude/status/1254016084719607809?s=20

@eschnou @roald @DamienERNST1 Voici CLUE de @adafruit avec un microprocesseur nRF82540 (Bluetooth BLE), un รฉcran, deux boutons (et plein d'autres chose). On peut l'alimenter par une batterie LiPo et stocker les contacts sur la flash. Programmable en Arduino et en @CircuitPyth...

simple pulsar
#

@thorny jay I think getting decent distance estimates from BLE is going to be really tricky, I've been thinking about this. In a "normal" city environment I'm sure a basic system would be near useless. Apple might have some big data ML-magic from their "find my" service to improve this. There's also some basic techniqes with smartphones to try and work out if it's inside a pocket/bag or in-hand.

#

@thorny jay But it could certainly be an interesting educational tool for showing the protocol or allowing people to work out the limitations of the tx power/rssi approach. I'd like to persuade my godson to do some R&D here!

thorny jay
#

Yes, finding distance might be difficult... but maybe this is not what you really want. You need to build a risk estimation based on the signal strenght and duration. If you pass by someone, the risk is low. If the signal strenght is low, the risk is low. But once you have a long duration and a strong signal, then the risk increase.

#

I say that, but some friends in the city tell me they can see the Bluetooth signal from a lot of their neighborg, up/down/left/right. But since it's another appartment, the risk is pretty low. So false alarm might trigger if your neighborg is affected.

#

In preparation for the PyCon(?) or what was that conference where 3000 CLUE needed to be distributed as badge for participant, I worked (with @lone axle ?) on an application that show he colour of the badge from nearby users. That was just using the BLE colour advertisement from Adafruit. It would be super simple to show a spreading by having all the participant "green" and one with a "red" badge. Then see how long it take before everyone turn "red". And that would be very educational.

manic glacierBOT
#
[adafruit/circuitpython] New branch created: jepler/2\.8\-cflags
#
[adafruit/circuitpython] New branch created: stm\-linker\-scripts
onyx hinge
#

oops, sorry about that ^^^ (branches deleted now, I guess that doesn't warrant a notification)

simple pulsar
#

@thorny jay I think I remember discussions about that app, where is it? I just stuck what I was reading in https://forums.adafruit.com/viewtopic.php?f=53&t=164851 And on the subject of city vs less crowded space, when I first got an Amazon Firestick (WiFi only) I plugged it in and it told me I didn't have enough bandwidth to use it. What is was actually telling me was the 2.4GHz wireless was way too busy where I live!! I run it now on 5GHz which happens to be less crowded.

ionic elk
#

@slender iron the 2.9 inch epaper from Waveshare

tulip sleet
simple pulsar
#

@tulip sleet Agreed, but there might me some very clever stuff to refine the estimates if you have a smartwatch and a smartphone.

#

Or even for the simpler case it could provide a small amount of extra information of correcting for attenuation from different angles. This is all guesswork, of course.

timber mango
ionic elk
#

I will add

#

it is an H7

#

STM32H743VIT6

#

already supported, stupid easy

#

I do need the flash chip tho

bright aspen
#

@simple pulsar @tulip sleet @thorny jay @slender iron Wow, lots of great ideas here. I should have come here much sooner. At Covid Watch we are talking about a Tile-like device for childret that depends on the parent's phone for memory and Internet. I too was thinking that CLUE or Circuit Playground Bluefruit could do that and mentors could help people get their devices started. That is very cool. I think that DP3T has a limited version in Python and that might be a place to start tinkering (I have not looked at it). A/G seems to be based on the DP3T work. I am on the Covid Watch team, and I lurk in the CoEpi, SafePaths and TCN Coalition Slack workspaces. (Covid Watch is part of TCN Coaliton). Besides the channel for making such gadgets, I'm also on the channel for distance measurements which is generalizing to exposure discernment. There we will be using CircuitPython for measurements. Well, two of us are getting up to speed on that. If anybody's workstyle allows, I'd encourage contacting a team that fits and jumping in. In the mean time, I'll be around.

manic glacierBOT
onyx hinge
#

@ionic elk @timber mango the 2MB flash is just the figure for internal flash on STM32H743VI isn't it?

ionic elk
#

@onyx hinge on the Toasty? I wasn't actually going by the stats, I was going by the physical IC I see on the board that looks like a Nor flash chip

onyx hinge
#

I do see that 8-pin package near the USB connector too

ionic elk
#

I don't know what it could be, other than flash

#

the stm32duino port doesn't seem to have any information about it either

onyx hinge
#

agree

timber mango
#

I will add
@ionic elk Wow, cool! ๐Ÿ™‚ I will see if I can find out what the flash chip is.

lucid solar
#

I designed a board recently, there is some ESD protection for the USB that was in an 8pin package...

#

I don't see why they would add flash to that board, 2mb on-chip and an SD card.

slender iron
timber mango
#

I am hoping to order at least one Toasty when I get paid. I am hoping I can order two. I will just have to see how much money I have left after getting necessities.

manic glacierBOT
#

While we're here... is there a particular reason why we show only the remaining free bytes, rather than simply the amount of flash used? I use this metric the most often to gauge the results of optimization or to see whether it will fit in a low-flash board or a certain sector on a board, but I have always had to reverse this operation to get that info - I have never needed to know the remaining amount of flash as a raw number. Maybe that's more interesting to others, though?

tulip sleet
#

@timber mango don't forget to get a cheap multimeter re our convo weeks ago; will be useful for testing

slender iron
#

@ionic elk does the ribbon cable have a number on it? you can compare with the 2.9s on here: http://www.e-paper-display.com/products_list/pmcId=29&pageNo_FrontProducts_list01-004=2&pageSize_FrontProducts_list01-004=15.html

manic glacierBOT
timber mango
#

don't forget to get a cheap multimeter re our convo weeks ago; will be useful for testing
@tulip sleet A decent DMM is very high on my aquisition list. I can not get by without one any longer. I had one of these before and it was excellent. https://www.digikey.com/product-detail/en/flir-extech/EX330/EX330-ND/6149613?utm_adgroup=Test %26 Measurement&utm_source=google&utm_medium=cpc&utm_campaign=Dynamic Search&utm_term=&utm_content=Test %26 Measurement&gclid=Cj0KCQjwhZr1BRCLARIsALjRVQOohqBI9gKi7cy2OuRuvg0m6cE3kV__00_JvHrk2xq-0_zin9e62bUaAr_lEALw_wcB

tulip sleet
#

@timber mango sounds good but if you are pinched a $20 one would be fine too. I managed to get a Triplett 1401 locally for a very good price. It has probe holders which I like a lot. I have the Extech also

timber mango
#

sounds good but if you are pinched a $20 one would be fine too. I managed to get a Triplett 1401 locally for a very good price. It has probe holders which I like a lot. I have the Extech also
@tulip sleet I will keep that in mind. If I can only get one thing, it will be a multimeter.

tulip sleet
#

Digi-Key has lots of 'em, including $20 (not autoranging, but that is usually OK with me): https://www.digikey.com/product-detail/en/flir-extech/MN35/MN35-ND/7322804

timber mango
#

@tulip sleet That does look like a decent little meter. If I can not get the Extech 330, I will go for the MN35. ๐Ÿ™‚

manic glacierBOT
timber mango
#

@ionic elk the 2MB flash is just the figure for internal flash on STM32H743VI isn't it?
@onyx hinge This chip has 1MB of on chip flash with the possibility of adding up to 1MB of external flash.

ionic elk
#

@timber mango ah yeah I missed that it's a VI, rather than a ZI

#

so does the Toasty come with the extra 1MB included? I don't know why it would be restricted to "up to 1MB" when could plop any old flash chip on there.

timber mango
#

Toasty has 2MB Flash, so has the 1MB external flash also, and 1MB SRAM which gives 864KB SRAM for users.

ionic elk
#

@slender iron wowzer that is a lot of almost completely identical 2.9" boards

#

I don't see any particular matches in the FPCB, seems like the silkscreen on it varies a lot even in the product photos. mine only has TP0-TP6 markings, no serial number.

marble hornet
#

How does the build script know what files to freeze into a firmware for some given directory? Does it do all py files except for setup.py?

manic glacierBOT
idle wharf
#

@thorny jay the nRF52833 and some other newer nRF chips have Bluetooth Direction Finding support, which is not present in nRF52840: https://www.nordicsemi.com/Products/Low-power-short-range-wireless/Direction-finding. I'm not sure how applicable it is to contact tracing, but we did just have an nRF52833 port added to CircuitPython. That chip has less RAM and flash so it's a bit of a squeeze for CircuitPython.
@tulip sleet Just a heads up, the Angle of Arrival (AoA) and Angle of Departure (AoD) that you can do in BLE 5.0 is not possible in phones or phone to phone. It requires a much larger antenna. Last I looked into it the antennas which could do it were more like ceiling tiles.

I was super excited about this approach until I learned that. ๐Ÿ˜•

tulip sleet
#

@marble hornet there's a list of what to freeze in the mpconfigboard.mk for each board (see CircuitPlayground Express for an example)

#

oh, sorry, the answer to your q is in tools/preprocess_frozen_modules.py

manic glacierBOT
marble hornet
#

Thanks! I will take a look and see where I can go from there.

marble hornet
#

And I had some trouble figuring out: do you have to make clean every time you add or change what modules are frozen in?

#

Or can you just re-build?

idle wharf
#

@thorny jay and @simple pulsar Do you know if the circuitpython ble library can control the output power of the BLE radio? Since you want to track shorter distance interactions you can turn this down. I worked on a project where we had hundreds of BLE Beacons in a building and one issue was the beacons were transmitting at a power that you could see beacons from so far away, and it was too noisy\ hard to determine location.

slender iron
#

@idle wharf I don't think we can now but it could be added

tulip sleet
#

@marble hornet better to clean

#

(in a mtg now)

thorny jay
#

@idle wharf sorry, I am not an expert... that would be for @tulip sleet but he is in a meeting now.

idle owl
#

CircuitPython Weekly in ~45 minutes. Everyone is encouraged to attend - you can always attend and listen in if you don't want to participate. Hope to see you there! Here is the notes doc. Please add your hug reports and status updates even if you'll be attending - it's super helpful! Thanks! https://docs.google.com/document/d/1hcf6M5Xfg-LgcnLCO06eExrDE44b1aTNV_eSqdDRjRE/edit <@&356864093652516868>

lone axle
#

Do we have any existing library (or builtin?) for parsing XML?

tulip sleet
#

no, sorry

#

@idle wharf there is skeletal power support but it's not really implemented. It would not be hard

idle wharf
#

Thanks @tulip sleet if I get far enough down this road, I can bring a C dev to the table to help.

tulip sleet
#

it's only a few lines of code

idle wharf
#

ha! You're not supposed to admit that. ๐Ÿ˜‰

#

I'm pretty deep into looking in this (contract tracing with BLE) for a client and specifically the suitable Adafruit boards.
I'm choosing circuitpython for the proof of concept because the MicroPython boards I've used have incomplete libraries, lack of inventory or the development seems to have died off. So huge kudos to this community for the awesome momentum around CircuitPython!

lone axle
#

I wonder if there is any interest in having one created? I got to thinking about some way to define interface layouts within their own file more like how mobile development handles them. I thought about possibly using JSON for it for a bit over the weekend but I think XML may be able to express them in a more clean and easier to understand way.

tulip sleet
#

i would say that json and xml are equivalently functional.

#

for both it's harder to write an incremental parser

#

which would save memory

lone axle
#

Definitely both functional but the hierarchical / tree like nature of UI Layouts lend itself to XML a bit better I think. Maybe I'll go ahead and try mocking up some ideas for possible layout code with JSON. Perhaps it will work out nicer than I am thinking.

simple pulsar
#

There's also YAML ...

lucid solar
#

and TOML ๐Ÿ˜‰

lone axle
bright aspen
#

@idle wharf What is the nRF52833 board? Concerning power, I think that is possible, thre is a soft device interface. Unless you beat me to it, I'll add an issue for that.

lone axle
#

YAML I am less familiar with. I should read up on that one some.

idle wharf
#

@bright aspen the different Nordic chips just have different specs. Some add NFC as well the Floating Point Module
https://www.nordicsemi.com/Products/Low-power-short-range-wireless
https://developer.arm.com/docs/ddi0439/latest/floating-point-unit/about-the-fpu

simple pulsar
#

I've used it for fairly simple configuration files in the past.

onyx hinge
#

both xml and json can be processed incrementally, it's the SAX model vs the DOM model. However, when writing to the SAX model you often end up with assumptions about the order of data encoded in the reader and writer (when the data formats may even specify that e.g., mappings in json can be arbitrarily re-ordered without changing meaning) that hinder interoperation with other generators/consumers

bright aspen
#

@idle wharf That is a cool table! Thanks! But, I asked my question poorly. You mentioned "but we did just have an nRF52833 port added to CircuitPython". Is that something available?

idle wharf
#

Ah.. gotcha. Sorry. I was quoting someone else who mentioned the nRF52833. But no, on Adafruit there no boards with the nRF52833. I do see the 832 come up though. https://www.adafruit.com/?q=nRF52833

#

The original post was about BLE AoA and AoD for precise distance measurement and as long as the chip\library support BLE5 you could use that part of the BLE Protocol, but again, I think the antennas are pretty big.

tulip sleet
#

@half geyser added support for nrf52833. We don't have a board right now, but he does (that is, he is working on a project with one)

bright aspen
#

I see nRF52832 and nRF52840. Ah, @half geyser . I'll look.

tulip sleet
#

we no longer support the '832 on CircuitPython, because it doesn't have native USB

#

is what xobs is working on. https://simmel.betrusted.io/

#

so you might want to get in touch with him ๐Ÿ™‚

idle wharf
bright aspen
#

Do any of the non Nordic boards support BLE?

modern wing
#

Happily lurking today ๐Ÿ™‚
...or is it lurking happily? Same difference.

onyx hinge
#

hello, I'll be taking notes today. Slow getting set up.

tulip sleet
#

@bright aspen no

modern wing
#

Loud and clear

serene warren
#

Lurking. Noted in the doc

#

Dnt dnt da...

onyx hinge
#

thanks @serene warren it's a big help

serene warren
#

Went fishing yesterday, got beat up pretty bad by wind and waves. Sore as can be today.

tulip sleet
#

@idle wharf we are starting our weekly audio meeting if you want to join. See the top pinned message for a link to the notes

#

@bright aspen too

serene warren
#

I find shaking the crumbs out occasionally helps with my keyboard

idle wharf
#

@tulip sleet Thanks for the invite, I can't today... just about to head away from my keyboard.

tidal kiln
#

lurking

sterile bronze
#

Hugs only today

slender iron
timber mango
#

Text only

onyx hinge
#

@slender iron I'll get the links during community news

#

though I guess the links aren't in the doc, so it's anybody's guess:)

uncut nexus
#

lurking today

onyx hinge
ionic elk
#

google breaking out all this embedded stuff recently...

#

wonder what's up with that

idle owl
#

Stanford course expected 1k people - ended up with 80k people applying.

onyx hinge
#

ooh Dresden. One of my favorite cities in Germany (family lives there:)

marble hornet
#

And flexible e-paper displays

onyx hinge
#

there's lots more in the newsletter that Scott isn't covering right this second

slender iron
lucid solar
#

k0d is swedish for code....but spelt differently...maybe I should try to change my github username ๐Ÿ˜‰

onyx hinge
lucid solar
#

I'll probably be lurking most of these meetings, as it's a time when my wife is home watching TV so I can't talk.

idle owl
#

@lucid solar You can also be text-only.

#

Where you type your notes into the chat channel, or better yet, add them to the notes, and we'll read them off.

lucid solar
#

@idle owl yeah, I've added them to the notes.

idle owl
#

@lucid solar Excellent, thanks!

onyx hinge
#

@timber mango will you be participating or are you lurking?

manic glacierBOT
#

This would help in developing anonymous exposure notification apps to contain Covid-19 (privacy-preserving contact tracing apps) in testing and measurementsโ€“and perhaps even in devices.

In characterizing RSSI for different phones, control over BLE transmit power in a nRF52 CircuitPython board would be handy. There has also been talk of doing that to help with distance estimation.

Perhaps this could be a property of _bleio.Adapter. (And perhaps eventually added to the appropriate class ...

marble hornet
#

Need a minute before talking

manic glacierBOT
raven canopy
#

i still maintain that Git is a strange, and magical realm we've only recently discovered. ๐Ÿฆ„ ๐Ÿ˜„

marble hornet
#

Back and can talk

slender iron
#

k, will do you last

manic glacierBOT
onyx hinge
#

@sterile bronze drop us the link again in case anybody missed it ๐Ÿ™‚

timber mango
#

@raven canopy Certainly strange. Unsure about magical.

sterile bronze
onyx hinge
turbid radish
#

lurking

onyx hinge
#

thanks @idle owl I got distracted

idle owl
#

@onyx hinge No worries. ๐Ÿ˜„ I understand entirely.

turbid radish
#

Folks, please if you have any last minute news, projects, events, etc. in the Python/CircuitPython/MicroPython community, please email them to me at anneb@adafruit.com as soon as possible, in the next two hours if possible, for tomorrow's newsletter.

#

Thanks and sorry for the hit and run post, something personal came up in the last 45 mins and I'm sorting that out also.

slender iron
tidal kiln
#

yes

onyx hinge
#

@slender iron sorry, cater got out of order in the document

slender iron
#

np

marble hornet
onyx hinge
#

@timber mango any notes for status updates?

thorny jay
#

Yes that one.

slender iron
#

@lone axle have you looked at the 32blit at all? I was starting to think about games for it

onyx hinge
#

the circuitpython FAT filesystem is case-insensitive, which is why 'import label' and 'import Label' both wored

lone axle
#

Whoa neat, nope I hadn't seen that yet. I'll look into it. Definitely looks like a cool device.

thorny jay
#

I would love to know/have the electronic to control a clock from GPIO. It mean driving a solenoid with 1.5V, so to get from 3.3V and some protection for return current(?). It would make it possible to control the second hand from any microprocessor.

lone axle
#

Ah, Thank you Jeff. That makes sense.

slender iron
#

@lone axle they are doing some cool game asset stuff too

modern wing
#

@onyx hinge That's a pretty nifty novelty clock

timber mango
#

@onyx hinge I have nothing. I do not know where my brain is going to take me this week.

onyx hinge
#

QLab is sound, video, and lighting control for macOS. Itโ€™s used by everyone, big and small.

slender iron
#

@ionic elk mute please

ionic elk
#

sorry!

slender iron
#

np, just heard you mousing. not disruptive

onyx hinge
#

@old smelt before next time, you may want to take a look in your discord "user settings", you can tweak the input sensitivity or use "push to talk" to prevent your audio from cutting out. When you are talking, watch for a green circle around your avatar -- if it's not steady while you're talking, then you are cutting in and out for us.

idle owl
#

@old smelt You still cut out a little, but it was a lot better this time.

old smelt
#

Oh sure. Okay. Using my studio setup, so that's odd.... I'll check it out.

#

Thanks!

#

Sorry... ๐Ÿ˜ฆ

idle owl
#

No worries!

#

Simply wanted to make sure you knew.

old smelt
#

I appreciate it.

idle owl
#

It's likely a Discord issue, not your hardware.

modern wing
#

+1 for Jeff's suggestion, I've had that issue with each new mic I've attached to my system. And sometimes it randomly resets back to "auto-adjust" for no good reason ๐Ÿ™‚

old smelt
onyx hinge
#

@old smelt I think discord is pretty aggressive at its "voice activity" sensing, which is why you might want to experiment with the options

old smelt
#

Will do.

solar whale
modern wing
#

And there's the new voice compression (on MacOS it's next to share screen and hangup), indicated by a vertical bars of various lengths. That might be causing an issue too.

onyx hinge
#

@idle owl we can look at that together in the weeds or some other time soon, if you like

raven canopy
#

@solar whale that's a good looking frame!

old smelt
#

@modern wing - I've had seemingly unending audio trouble when I run the mac app. I usually end up on Chrome, like today. But, I'm game to try again.

slender iron
#

@idle owl it'd be good to use the same board names in the CP library as you'd get from os

idle owl
#

@slender iron That's what it uses.

slender iron
#

perfect!

onyx hinge
old smelt
#

I have a hard stop (meeting) at 2:00. Gotta go. Have a great week! Thanks all...

idle owl
#

@onyx hinge Thanks, we can deal with it offline.

old smelt
#

My pleasure! Always fun.

modern wing
#

Thanks for joining us Jason!

onyx hinge
#

Isn't this what setup.py.disabled is for?

idle owl
#

@onyx hinge Yes.

onyx hinge
#

๐Ÿ‘‹

serene warren
#

A Good time was had by ...me... Thanks everybody.

modern wing
#

Thanks!

ionic elk
#

๐Ÿ‘‹

modern wing
#

@onyx hinge Quick question -- what brought up that crazy clock link? A possible CircuitPython project?

onyx hinge
#

@idle owl OK, we can pick up the topic of audio in here or in DM. Don't stay stuck for long.

#

@modern wing @thorny jay mentioned in his "other stuff" section that he was re-flashing the clock to turn it into a "week clock"

modern wing
#

Ahh, nice -- thanks ๐Ÿ™‚

thorny jay
#

@modern wing It's my non CP project of the week.

onyx hinge
#

I had just heard about it long ago due to the Discworld "Vetinari clock" tie-in

thorny jay
#

But I would like to be able to control the second hand of an analog clock from a GPIO.

idle owl
#

@onyx hinge Let me at least get the rest of the code functioning on CPB and see if I manage to fix it in the process.

onyx hinge
#

@idle owl sure thing

thorny jay
#

Right now I try to flash an attiny45 from my Raspberry Pi. I did that years ago, so I know I can do it... but I forgotto document it.

onyx hinge
#

avrdude and the (equivalent of) 6-pin header?

thorny jay
#

Yes, I just want to make sure I connect the right pin to avoid burning it.

onyx hinge
#

yeah no kidding

marble hornet
#

Can you hear me?

tulip sleet
#

nope

#

you could make sd first, and then make flash to load the bootloader after the softdevice is loaded

slender iron
#

@pastel panther would be interested in it too

lucid solar
#

Nice!

slender iron
#

they chose yaml

lucid solar
#

Not sure why you shared that

tulip sleet
#
          - hpa:
            - sum:
              - hpa
              - division:
                - sum:
                  - rawComp1
                  - rawComp2
                  - valueDP7
                - 16.0
          - hpa:
            - division:
              - hpa
              - 100.0
        return: hpa
#

i think a grimace emoji is appropriate here

#

i.e.

hpa = hpa + (rawComp1 + rawComp2 + valueDP7) / 16
hpa = hpa / 100.0
return hpa
lucid solar
#

When I detect CTRL+C inside of python on the serial, I call mp_keyboard_interrupt() as that's what happens on the USB-CDC also. But it seems to trigger a hard fault...any ideas why that might happen?

tulip sleet
#

hmm, noo. Set breakpoints at reset_into_safe_mode() and HardFault_Handler() to catch this and see what the backtrace is

manic glacierBOT
marble hornet
#

@slender iron Yes! I did for the pine time Looks neat

slender iron
#

Here is the notes document for Mondayโ€™s CircuitPython Weekly meeting. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโ€™ll be attending the meeting - itโ€™s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโ€™ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1RFV1kKlyBJfJkLivY_r_a28FFKXT83av-Wr1b4RMtu8/edit?usp=sharing

raven canopy
#

that cyanobyte spec schema is going to have to be immense...

#

i figure I2C is the "easy" one...

lucid solar
#

Yeah, I just wonder if any manufacturer will actually write schema themselves.

manic glacierBOT
lucid solar
#

@tulip sleet thanks for the pointers...I know why it's not working now.

manic glacierBOT
#

@tannewt yes, we are able to selectively disable parts of ulab. I originally investigated that as a solution, but with the new ulab.comparison module deactivated it left only about 2kB (I forget exactly) of flash free. My gut said, better to fully disable ulab on this board than return within days or weeks to revisit the issue. If we get lto and it reclaims 20+kB as I suspect it would, that would be a great time to re-revisit it. However, I can change this PR to disable as little as possi...

lucid solar
#

@ionic elk thanks...now I need to code faster as I have no outstanding PRs ๐Ÿ™‚

lapis hemlock
#

@onyx hinge Jeff, would it be OK, if we moved spectrogram to either the fft module, or something else? It was a bit silly of me to put it into the user module.

#

Actually, something like scipy could make sense, and then we could dump all functions that come from scipy into that module.

marble hornet
#

@tulip sleet can i pick your brain again?

#

later tonight?

marble hornet
#

or sometime that works for you? about uploading the softdevice via uf2

tulip sleet
#

@marble hornet you can't upload the softdevice via uf2. You can only upload it via DFU using the bootloader (if the bootloader is there), or using a J-Link.

#

(@gentle bronze will be working on a self-updater, but we don't have it yet)

marble hornet
#

@tulip sleet i tried make BOARD=<watch_name> SERIAL=<device location> dfu-flash and dfu-sd (just incase) and other variations/commands.
the dfu-flash seemed to work, ie update, but circuipython still crashed when trying to use the bluetooth. is there a command

#

how does one upload a new sd via DFU w/out wiping out the bootloader?

tulip sleet
#

i'm not sure you can. So there may be some other reason why bluetooth is not working. I am about to go afk for a few hours

#

dinner and a movie

marble hornet
#

thank you, i'll keep on trying / researching. have a great evening!

tulip sleet
#

good luck!

marble hornet
#

thanks

onyx hinge
#

@lapis hemlock it's unfortunate to move it, since users are already using the current name.

lapis hemlock
#

Well, they have to bite the bullet, then. It is partly my fault, I admit, but it is still a mistake.

#

Another option could be to add an empty user module. That wouldn't upset the current scheme.

#

The problem is, if user functions and core functions are in the same module, then updating code from git is difficult.

onyx hinge
#

If you want to revisit it, let's talk to @slender iron about it. Maybe you can lay out what you see as the trade-offs in an issue or PR and mention us ? we can make a decision there

lapis hemlock
#

The last observation is the sticking point, I think.

onyx hinge
#

that's what "extra" was supposed to be, a place for your users to add their own functions and not get conflicts with changes in ulab?

lapis hemlock
#

That was my idea, and then I added the spectrogram. .

tidal kiln
#

just checking - there's no I2S in support in CP yet? only out?

lapis hemlock
#

If you want to revisit it, let's talk to @slender iron about it. Maybe you can lay out what you see as the trade-offs in an issue or PR and mention us ? we can make a decision there
@onyx hinge Done: https://github.com/v923z/micropython-ulab/issues/111

slender iron
#

fyi @idle owl we can't release pypixelbuf in its current state because it'll break neopixel spi

#

I downgraded librarians from write to triage to reduce the number of folks who can release but you still have admin permissions that could do it.

idle owl
#

@slender iron I haven't been releasing it. I told Dylan not to as well. Did it get released?

slender iron
#

nope! this is preemptive

#

๐Ÿ™‚

idle owl
#

Ok. Was already on my radar.

slender iron
#

epic! you are always ahead of me. thanks!

marble hornet
#

how could one check to see if there is a softdevice on the nrf52840 ?

#

if they aren't sure it is on there

timber mango
#

Hi, there. I'm using TSL2591 and it's been working but today I started getting "RuntimeError: Overflow reading light channels!" and that section of code is not all that clear. Anyone have knowledge of that sensor and can help me understand what the overflow condition is?

#

Looks like the constant is set to 100ms but not sure why that is and if there's any problem making it longer?

lucid solar
timber mango
#

Hi, there. I'm using TSL2591 and it's been working but today I started getting "RuntimeError: Overflow reading light channels!" and that section of code is not all that clear. Anyone have knowledge of that sensor and can help me understand what the overflow condition is?
@timber mango Answered in #help-with-circuitpython channel.

slender iron
#

@half geyser do you plan on improving circuitpython so it can work with the google/apple ble exposure notification stuff?

#

@tulip sleet when you have a chance can you test m0 master for flakiness? I think I'm able to reproduce it with master

ionic elk
#

@lucid solar Nice! Note we've already got the F412 and F411 discovery boards implemented. There are definitely some other no-brainers to implement on there, anything that's already got a supported SoC is a shoe-in. I'm not 100% on stuff like the F429 yet, just since they sometimes have breaking gotchas that can take time to resolve.

lucid solar
#

It's nice to have some idea of the scale of things, how many boards exist etc, and to see if any are interesting to port to...

ionic elk
#

We're also not prioritizing anything with less than 128K of ram, so there aren't any immediate plans to add support for the F3 series and below

#

Oh yeah it's a fantastic list, I was thinking I needed to put one together the other day so this is great

lucid solar
#

The reason my name is grey on some boards, is because they're in my basket ready for the next order ๐Ÿ˜‰

#

I will add the Adafruit boards on tomorrow.

crimson ferry
#

@lucid solar I'd suggest a "user RAM" column if other boards are like the STM32F405, which has 256, but only 128 is accessible to user code

lucid solar
#

@crimson ferry maybe...but this is more from a porting view....and that's maybe not interesting?

crimson ferry
#

fair enough

#

could affect priorities maybe

lucid solar
slender iron
#

@lucid solar it isn't autogenerated

lucid solar
#

Thanks...now I sleep, have a great rest of the day everyone.

manic glacierBOT
#

@dhalbert I can't reproduce this flakiness with a Metro M0. Most of the time it works. Occasionally, I do see the boot hang very early but I think I can get the same behavior on master. I was testing it with an Arch Linux system and a Beagle sniffing the USB traffic.

I've merged in latest master which is what I tested with. Please try again and let me know if it's consistently bad for you still. I may need your help debugging it.

half geyser
#

@spice crypt those graphs look cool! Do you have any information on how you generated them?

#

@slender iron The goal with simmel is to provide a platform to develop on. The choice of what protocol to use seems very divisive, so the goal is to support them all. It's partly why I have the AES256 module for circuitpython.

#

Having said that, the Google/Apple protocol assumes you have an always-online device, which is incompatible with Simmel, which is designed to run up to 6 months disconnected on a pair of AAA batteries.

#

As a workaround, you could set up a server to do the polling and notification, which /is/ compatible.

slender iron
#

how does simmel check to see if it's been exposed to someone who reports having covid?

tulip sleet
#

@slender iron I'm going to stop working now for the evening, but in the morning I'd like to test MIDI with the new packet length changes. Are you talking MIDI to/from an iOS device, or are you using something else? THanks.

slender iron
#

@tulip sleet ya, using an iPad. can you test master with usb as well?

tulip sleet
#

sure, you made the interrupt change?

slender iron
#

my branch should have current master merged in

tulip sleet
#

I am just testing on my very vanilla Dell desktop, USB2, but I think it was bad on USB3 also. Were you using Garageband or something else?

slender iron
#

I think it was a mix of synth one and xynthesizer iirc. check with @split ocean. he has better apps to test with I think

tulip sleet
#

i got the Moog synth app for free when they were offering it. Are the examples in the repo a sufficient test, you think?

split ocean
#

Moog synth app is great for testing.

slender iron
split ocean
#

I'd recommend the free MIDI Wrench to see realtime messages as well as to set up virtual MIDI ports if needed. Some apps won't connect directly to BLE MIDI devices so MIDI Wrench allows virtual wiring of all that.

#

I've also connected BLE MIDI to mac os machine using the Audio MIDI setup settings in the OS. I gather that it may be painful to do this in Windows.

tulip sleet
#

thanks, that's very helpful. I have a 25-key controller and an older digital piano but they're all DIN MIDI or USB

#

i could see about Linux too. I have a Bluetooth dongle

split ocean
#

With MIDI I feel like the age of the connector standard is proportional to the ease of use and robustness.

#

DIN5 MIDI, bulletproof. USB, hrm. BLE MIDI, yikes.

#

WiFi MIDI, RUN!

tulip sleet
#

i have a simple cheap USB MIDI interface. I had an older more expensive one but it had proprietary Windows drivers (circa Win98) and I think it eventually stopped being usable all together.

split ocean
#

I've had good luck with a cheap USB MIDI interface cable as well.

tulip sleet
#

I'll certainly ask if I run into difficulties. tx much

split ocean
#

Happy to help.

half geyser
#

@slender iron thanks, I didn't know what the current preferred cryptography library was.

manic glacierBOT
#

I'm seeing a lot of assert errors in tinyusb with this patch. For example:

(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
process_set_config (cfg_num=1 '\001', rhport=0 '\000') at ../../lib/tinyusb/src/device/usbd.c:731
731         TU_ASSERT( drv_id < USBD_CLASS_DRIVER_COUNT && drv_len >= sizeof(tusb_desc_interface_t) );
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
process_control_request (p_request=0x2001ff20, r...
manic glacierBOT
spice crypt
#

@spice crypt those graphs look cool! Do you have any information on how you generated them?
@half geyser These are using @slender iron 's gc activity monitor code.
Video: https://www.youtube.com/watch?v=baa5ILZTRkQ
Git readme: https://github.com/adafruit/circuitpython/blob/master/tools/gc_activity.md

Live stream of @tannewt debugging memory issues in CircuitPython.

Visit the Adafruit shop online - http://www.adafruit.com


LIVE CHAT IS HERE! http://adafru.it/discord

Adafruit on Instagram: https://www.instagram.com/adafruit

Subscr...

โ–ถ Play video
GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython

#

There are other files related to that in the tools folder

#

It's setup in the repo for SAMD, needs some tweaks to make work for NRF

half geyser
#

Ah, I see. gc_activity.html in tools reads allocation_history.json and parses it into a pretty graph. That's super fancy.

slender iron
#

The visualization in the video isn't using gc_activity.html. It uses graphviz

spice crypt
manic glacierBOT
marble hornet
#

@slender iron does MICROPY_ENABLE_GC turn in all gc or just long lived?

slender iron
#

everything

#

and again. long lived is helping you, not hurting you

marble hornet
#

okay, i'll leave it be then.

slender iron
#

the bugs we've found with it usually cause crashes

manic glacierBOT
manic glacierBOT
marble hornet
#

@slender iron, i am running your low_power branch on the watch after implementing a screen sleep, i'll report on the battery life within the next few days

half geyser
#

Is there a way to do something like MP_ROM_LIST()? I'm working on the crypto module, and I'd like a static list of the available sizes.

#

Most instances of mp_obj_list_t seem constructed at runtime.

slender iron
#

You could do a static tuple since they are immutable

#

No fancy macro for it though that I know of

half geyser
#

I think that's probably what pycrypto uses.

#

Are there any examples of statically allocating static tuples?

#

I guess it's just a len, a base, and a list of items...

#

Ah, MP_DEFINE_ATTRTUPLE looks like exactly what I need.

marble hornet
#

@slender iron scratch that, whenever it soft reloads the watch hangs on trying to init hardware

#

double checking

#

yeah, the non - low_power verson of the nrf52840 master hangs after a soft-reload and needs to be reset before it can re-init hardware (spi lock )

#

soft reload via ctrl-c, ctrl-d . do you want me to register and issue on your fork tomorrow?

half geyser
#

@marble hornet brownout?

manic glacierBOT
#
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
process_set_config (cfg_num=1 '\001', rhport=0 '\000') at ../../lib/tinyusb/src/device/usbd.c:731
731         TU_ASSERT( drv_id < USBD_CLASS_DRIVER_COUNT && drv_len >= sizeof(tusb_desc_interface_t) );
(gdb)

Also, the ASSERT that gets hit is probably due to the tinyusb process not being called often enough, causing the host to send a USB RESET, which hits this bug: https://github.c...

manic glacierBOT
#

I chose to disable ulab altogether on the espruino pico.

This brings up another issue, which, perhaps, deserves its own thread: it would be really great, if users could customise their own ulab (or any other external module, for that matter). I have come to realise that in circuitpython the main tripping point is that the makefile, py.mk, has to be modified. Would it be possible to accept arbitrary make fragments from external modules, exactly as is done in micropython? With th...

full epoch
#

Hi, this might be a dumb question but: I plan on buying a Featherwing prop maker. But is it compatible with WS2812 and WS2812B led strip as they both use RGBW?

marble hornet
#

@half geyser it only happens with low power, and it is pugged into 5v

half geyser
#

Ah, okay. I ran into a problem with Simmel, but that just has to do with how I'm measuring current. Also, it's not a good idea to power it off of a pair of 1.5V Li-Ion AA batteries. The power briefly dips below 2.7V.

#

(Also, I discovered that the ARM debug core doesn't step into interrupts when you do stepi)

manic glacierBOT
manic glacierBOT
#

This adds initial support for the PyCrypto AESCipher module. This
implementation supports only a subset of AESCipher modes, namely
ECB, CBC, and CTR modes.

Example usage adapted from the PyCrypto README for AES:

>>> from Crypto.Cipher import AES
>>>
>>> key = b'Sixteen byte key'
>>> cipher = AES.new(key, AES.MODE_ECB)
>>> cipher.encrypt(b'Circuit Python!!')
bytearray(b'E\x14\x85\x18\x9a\x9c\r\x95>\xa7kV\xa2`\x8b\n')
>>>

This key is 16-bytes, so it uses AES128. If...

lucid solar
#

Hi, this might be a dumb question but: I plan on buying a Featherwing prop maker. But is it compatible with WS2812 and WS2812B led strip as they both use RGBW?
@full epoch

@idle owl Maybe you know?

manic glacierBOT
tulip sleet
#

@lucid solar WS2812 or WS2812B should be fine. The difference is internal and it doesn't appear the timings differ. WS2813B currently doesn't work but I have a sample and will try to make it work.

#

But I thought WS2812(B) were straight RGB, not RGBW. A lot of our RGBW strips are SK6812RGBW. So maybe your RGBW are not really WS2812x? There is a lot of casual use of "WS2812" when the underlying pixels are not really that type.

lucid solar
#

@tulip sleet that wasn't really for me, it was @full epoch

full epoch
#

@tulip sleet thanks for your answer. Keep me I formed please

manic glacierBOT
#

CPython has int.bit_length(), which returns the length of the number in bits.

I wanted this because it was required by a Fibonacci number calculator I wrote. However, as evidenced by the fact that upstream micropython hasn't implemented it either, I doubt it has wide applicability, so I won't be too sad if it's not incorporated.

On a CLUE I can calculate (and even print in decimal!) fib(65000) which is 13585 decimal digits long. The calculation takes about 9 seconds. Much larger ...

bright aspen
#

BLE: Does the softdevice API allow obtaining the channel that an advertisment was received on? Folks over at Covid Watch have expressed an interest in this datum.

tulip sleet
#

You could add an issue if you want this reported up.

manic glacierBOT
idle wharf
#

BLE: Does the softdevice API allow obtaining the channel that an advertisment was received on? Folks over at Covid Watch have expressed an interest in this datum.
@bright aspen I'm curious how this information would be helpful in the solution. Is that something you can share?

slender iron
#

@tidal kiln you around today?

tidal kiln
#

yep

slender iron
#

we can roll out pixelbuf once it's updated

#

@lucid solar I haven't had time for esp yet this week. lower_power is getting in my way

tidal kiln
#

sure. looks mildy urgent? things are blocking on that?

lucid solar
#

@slender iron I'm trying another approach to how you did it...adding CPY(makefiles) to CMake instead of the other way round.

slender iron
#

@tidal kiln if we release pypixelbuf then we'll break neopixel_spi

manic glacierBOT