#circuitpython-dev

1 messages Β· Page 324 of 1

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 6\.0\.0\-alpha\.3
slender iron
#

@tulip sleet want to call it beta.0?

#

we can call the next one that

tulip sleet
#

yah, the next one: I said: This is the third alpha release of CircuitPython 6.0.0. It is relatively stable. The release is still alpha because some API changes and additions are not yet included. Upcoming in a future release but not yet included are ESP32-S2 Wifi support, and bleio HCI support for ESP32 co-processors.

slender iron
#

are there any actual changes or just additions?

tulip sleet
#

i don't think there are changes, but who knows πŸ™‚

slender iron
#

kk, lets do the next one as beta

tulip sleet
#

i agree, it will be close to feature-complete

slender iron
#

we can always add features with minor versions

manic glacierBOT
#

There were a number of problems. First, when allocation failed during _PM_begin, a crash would occur if you tried to _PM_free the object. Second, there were problems with how allocation errors were signaled that presented additional problems for recovery. (it was doing longjmps out of the protomatter code, and it erroneously disabled interrupts, both of which made post- or mid-crash behavior extremely hard to fathom until noticing those things)

This does not fix 'the other' problem, whic...

idle owl
#

@slender iron Another yaml file would work.

slender iron
#

kk, will have you review the change shortly

idle owl
#

@slender iron Merged.

slender iron
#

Thanks! I'll add that yaml to the few repos that have tests too

#

midi and imageload I think

manic glacierBOT
indigo wedge
#

I just saw the release notes for Alpha 3 mention BLE with esp32 co-cpu, is nina getting new functionality or is this with a separate fw? Very exciting πŸ™‚

tulip sleet
#

we are just turning on the BLE functionality and routing the UART to the right pins

#

it's just a minor rebuild of NINA. It's already in our fork

indigo wedge
#

ah so wifi over spi and ble over hci uart?

tulip sleet
#

yes, they can't be used simultaneously, as far as I know. But there's a complete new imple of _bleio that talks HCI, compatible with the old one

indigo wedge
#

nice! is it the same uart that's used for programming?

#

cause if yes then my imx feather will have ble working πŸ˜„

tulip sleet
#

it's peripheral ONLY right now. it has been tested with Nordic UART, etc.

indigo wedge
#

that's awesome, great work!

#

then i must carve out some time to test this πŸ™‚

tulip sleet
#

we wanted to get something working for projects. Then I'll work on central.

indigo wedge
#

even just peripheral is amazing

tulip sleet
#

tnx! also no bonding. The code started as the ArduinoBLE library, but I reworked it a lot. I got some useful include files for struct definitions from zephyr

indigo wedge
#

right, their hci driver is quite mature

tulip sleet
#

i was distressed to find out that HCI leaves ATT implementation to the host; I expected it to be part of the command set (as in the nrf SD)

#

i am really tired of searching the 3000-page BLE spec. Also, there seems to be no community of HCI developers that I could find to ask questions: it's maybe too small a cohort

solar whale
#

I have a branch of the CP repo in my fork -- I pulled and merged the lates main - after 6.0.0-alpha3 release -- How do I get the branch build to reflect the new alpha.3 tag? it still shows alpha.2 -- If I just clone the main repo it builds as alpha.3.

tulip sleet
#

git pull --tags, maybe

silver tapir
#

@thorny jay I talked to AndrΓ©s Sabas, the Electronic Cats owner, and he says that maybe some alternative shipping option can be arranged. If still interested, please email store@electroniccats.com

manic glacierBOT
#

SPI SD card won't mount.
I tried SD card with:
adafruit-circuitpython-espressif_saola_1_wrover-en_US-20200827-fe73cfb.bin
adafruit-circuitpython-espressif_saola_1_wrover-en_US-6.0.0-alpha.3.bin
the code that is trying to mount the card:
https://github.com/emard/esp32ecp5/blob/master/circuitpython/sdmount.py#L1
output:
import sdmount
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sdmount.py", line 30, in <module>
File "adafruit_sdcard.py", line 11...

thorny jay
#

I have enough gadget to keep me busy.

solar whale
#

looks like git fetch upstream --tags did the trick

tulip sleet
manic glacierBOT
#

I made a CircuitPython release and one aspect of the the build failed:

Website1
##[error]Process completed with exit code 1.
Run python3 build_board_info.py
Logged in as adafruit-blinka
Traceback (most recent call last):
  File "build_board_info.py", line 310, in 
    generate_download_info()
  File "build_board_info.py", line 243, in generate_download_info
    support_matrix = shared_bindings_matrix.support_matrix_by_board(
  File "../docs/shared_bindings_matrix.py", line 14...
tulip sleet
#

@slender iron @ionic elk ugh all the ESP32-S2 builds failed in the alpha.3 release:

Run source $IDF_PATH/export.sh
Adding ESP-IDF tools to PATH...
Not using an unsupported version of tool cmake found in PATH: 3.17.0.
Using Python interpreter in /home/runner/work/circuitpython/circuitpython/.idf_tools/python_env/idf4.2_py3.8_env/bin/python
Checking if Python packages are up to date...
The following Python requirements are not satisfied:
gdbgui>=0.13.2.0
To install the missing packages, please run "/home/runner/work/circuitpython/circuitpython/ports/esp32s2/esp-idf/install.sh"
Diagnostic information:
    IDF_PYTHON_ENV_PATH: /home/runner/work/circuitpython/circuitpython/.idf_tools/python_env/idf4.2_py3.8_env
    Python interpreter used: /home/runner/work/circuitpython/circuitpython/.idf_tools/python_env/idf4.2_py3.8_env/bin/python
#

this is just a silly problem

slender iron
#

oh ya, I just fixed that in mine

#

gdbgui just did a release

onyx hinge
#

@slender iron just a note that I think that I narrowed down Phil B's problem to rotation= with rgbmatrix and that I probably failed to deal with it for Framebuffer displays in general -- I may need to pick your brain monday or tuesday about what handling that looks like, in case a little more code inspection doesn't help

manic glacierBOT
#

The change in https://github.com/adafruit/circuitpython/commit/7f744a2369a5036cadfa05575da1704f709c98bb#diff-eabdb5188465dac61c841030638d5cca puts a call to supervisor_ticks_ms64() inside scan_on_ble_evt(). My limited understand is that is called from a soft device related interrupt handler. supervisor_ticks_ms64() is disabling and re-enabling interrupts using non soft device functions. Is that ok within the interrupt handler? (I have no idea here, btw!)

onyx hinge
#

@slender iron groups don't have the rotate/transpose/scale options, tilegrids do. is there a big ugly reason why groups can't?

lone axle
#

Groups can scale I think

slender iron
#

@onyx hinge my brain couldn't handle it

onyx hinge
#

@slender iron I know the feeling tbh.

manic glacierBOT
manic glacierBOT
crimson ferry
#

On the esp32-s2, what is envisioned for using both ota_0 and ota_1 ...actually doing a future OTA implementation for updating circuitpython?

slender iron
#

@crimson ferry yes, I don't want to rule out OTA

manic glacierBOT
manic glacierBOT
thorny jay
#

Is it OK to download alpha3 directly from Amazon S3? Or there is a problem and it should be avoided?

manic glacierBOT
#

On Adafruit CLUE board and CircuitPython 5.3.1

I tried the following code on my CLUE board and works fine.
When Button A 'not' pressed, it returns True and when Button A is pressed, it returns False. This is okay.

`
import time
import board
from digitalio import DigitalInOut, Direction, Pull

button_a = DigitalInOut(board.BUTTON_A)
button_a.direction = Direction.INPUT
button_a.pull = Pull.UP

while True:
print (button_a.value)
time.sleep(0.1)
`

When I changed the...

#

This is to be expected. If you look at the schematic https://cdn-learn.adafruit.com/assets/assets/000/087/877/original/adafruit_products__CLUE_sch.png?1580423083 the buttons are connected on one side to Ground and the other side to the GPIO Pin. Pressing the button connects the Pin to Ground so it will read False.
When you us the Pull-Up/Down setting , you are setting the "default" state of the GPIO Pin when nothing is connected to it (when the Button is not pressed)
When you use a Pull-UP...

tulip sleet
#

@thorny jay Yes, go ahead and download from S3. There were errors in the release process and circuitpython.org did not get updated

manic glacierBOT
manic glacierBOT
#

That 42241 (0xa501) number is peculiar. It doesn't have many factors, 53 * 797. The last time I had a peculiar number it's highly likely it was related to dict additions for symbol table but I don't see how such a large quantity of whatever could suddently be needed.

I've left a small version of the essence of my game code running to see if it trips up on background BLE (someone owns a very promiscuouys Cycliq Fly12 bike light near me) and some occasional 5 player game testing.

manic glacierBOT
onyx hinge
#

I don't understand why the adafruit_sdcard one has the long pause between images, the three are running the same code. sdioio is plainly the fastest. sdioio is using stm32f405 feather, the other two are nrf52840 feathers.

manic glacierBOT
#

@dhalbert In practical terms, I think I need either the new stack trace functionality you mentioned further up in the comments to help pinpoint what's doing the memory allocation or crash dump functionality to catch this. It's been very infrequent recently on 5 devices, but perhaps more frequency when I use 6 together but I can't predict which of the 6 it will occur on.

Have crash dumps been discussed for hard faults and optionally for MemoryError? Those could be enabled with something in ...

thorny jay
#

Because I don't have a Metro M4 Express AirLift... I wanted to replicate adafruit_matrixportal demo from John Park and @gilded cradle but on "Feather M4 Express" + "Adafruit RGB Matrix Featherwing Kit - For M0 and M4 Feathers" + "Feather Wing AirLift". After tweeking the code to use the RGB Matrix, then tweeking it to use the AirLift, I got the final error: "ValueError: D11 in use". It is not possible to do that... because some pin you need for the AirLift are also required for the RGB Matrix. I guess I need to wait for the ESP32S2 with build-in WiFi. 😦

crimson ferry
#

You could rig it I think, but not with featherwings stacked or doubled pin-for-pin

#

This may seem like a silly question, but should the following expression: led.value = not led.value toggle the output true-to-false or false-to-true, no matter what?

#

I've used this before and never thought much about it, it just works, as I think it should, unless I'm missing something.

#

But, here's something curious. This code:import board from digitalio import DigitalInOut, Direction led = DigitalInOut(board.L) led.direction = Direction.OUTPUT led.value = True led.value led.value = False led.value led.value = not led.value led.value led.value = not led.value led.valueworks fine on PyPortal. But on ESP32S2 (alpha.3), it does not work as expected.

#

On PyPortal, setting to True or False always changes the LED correctly, and prints the boolean value correctly

#

but on ESP32S2, negating the value doesn't behave the same

crimson ferry
#
>>> print(led.value)
False
>>> led.value
False
#

I realize reading an output is iffy, but to behave differently on different platforms is... unintuitive

onyx hinge
#

It doesn't seem very kind to the user to have "led.value" of an output pin not reflect the current state of the pin.

#

you might also say:: should led.value = led.value ever be able to change the state of the pin

#

likely it has to do with the esp port being young, and if you don't care to dive in and simply fix it, you should file an issue.

crimson ferry
#

I don't have the C chops to find and fix, so I'll file an issue. But I needed a sense check, this had me questioning the nature of my reality

onyx hinge
#
 *
 * @warning If the pad is not configured for input (or input and output) the returned value is always 0.
 *
 * @param  hw Peripheral GPIO hardware instance address.
 * @param  gpio_num GPIO number. If you want to get the logic level of e.g. pin GPIO16, gpio_num should be GPIO_NUM_16 (16);
 *
 * @return
 *     - 0 the GPIO input level is 0
 *     - 1 the GPIO input level is 1
``` the esp idf has defined the low level routine in an interesting way.
#

this makes the otherwise relatively sensible implementation in CircuitPython not work: return gpio_get_level(self->pin->number) == 1;

#

(I say relatively sensible because I'd have written ... != 0 or just return gpio_get_level() because I've been burned by code which returned an integral type and (inadvertently) returned values like 2, 4, 8, etc for "true". However the esp-idf docs seem to state that they promise to only return 0 or 1)

manic glacierBOT
crimson ferry
#

Thanks, Jeff

onyx hinge
#

or it might be possible to set the pin to mode GPIO_MODE_INPUT_OUTPUT / GPIO_MODE_INPUT_OUTPUT_OD and not GPIO_MODE_OUTPUT

crimson ferry
#

"configured for input and output" is a new concept I think for CircuitPython

onyx hinge
#

Sure, happy to be a check

manic glacierBOT
#

If it's not intended to be able to read back the value previously set on an output pin, accessing the value property to read it should give an exception.

I think the problem arises because the esp-idf defines the return value of this routine in a surprising way, rather than returning the value currently driven onto the pin:

 * @brief  GPIO get input level
 *
 * @warning If the pad is not configured for input (or input and output) the returned value is always 0.
 *
 * @param  hw P...
orchid basinBOT
manic glacierBOT
#

FWIW, input behaves the same on both. It's conceptually an easier case to make that it's an error since the value is controlled by an external source:

>>> pin = DigitalInOut(any_gpio)
>>> pin.direction = Direction.INPUT
>>> pin.value
False
>>> pin.value = True
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: Cannot set value when direction is input.
gilded cradle
#

@thorny jay, there's not enough free pins to use the RGB Feather and airlift feather at the same time. I considered adding support, but it just wasn't possible.

crimson ferry
#

@gilded cradle You could do it, but not stacked or doubled, as long as you can sacrifice I2C? A0, A1, SCK, MOSI, MISO, SDA, SCL are available, and Airlift uses the (3) SPI pins + (3) other pins, CS BUSY and RST, for routine use.

gilded cradle
#

Ah, that's true. I meant in a tripler.

manic glacierBOT
#

@kevinjwalters and @tannewt, I’m willing to pitch in on this issue. I read through the related issue and here’s what I gather:

Need a way to call for an immediate (blocking?) screen refresh. I assume this would be an empty call display.refresh() or with target_frames_per_second=None.

I would suggest that this include an option to treat the whole screen as dirty and do a full redraw of all items. This could be an interim solution for structures that do not have dirty rectangle tr...

thorny jay
#

@thorny jay, there's not enough free pins to use the RGB Feather and airlift feather at the same time. I considered adding support, but it just wasn't possible.
@gilded cradle Yeah, I figured that out after making chirurgical change to your library for 30 minutes. I was confused as to why you made a library for only one combo of hardware where the "portal for matrix" concept would work for other... well, I figured the "hard" way that I was hitting a pin limit. However, I believe some modularity where you can give your rgbmatrix and your AirLift pin would be usefull to this library. As soon as an ESP32S2 is there, you could have wifi internally and drive an rgbmatrix (no support for that yet I guess, and likely another Feather Wing will be required as it is each time different.

#

@gilded cradle You could do it, but not stacked or doubled, as long as you can sacrifice I2C? A0, A1, SCK, MOSI, MISO, SDA, SCL are available, and Airlift uses the (3) SPI pins + (3) other pins, CS BUSY and RST, for routine use.
@crimson ferry Maybe with a Bring Your Own Matrix Feather Wing... it is already more or less my case since I drive a 64x64 matrix added the "E" address line. So this mean I need one more pin. And then maybe I will hit the contrain of having the pin in the same "register" so that it goes faster to toggle them simultaneously. As the end of the day, I will have a unique hardware setup and unique problem.

manic glacierBOT
#

If the heap memory is not touched when the VM shuts down, then I think the following would work. It relies on being to able to use the stale data in the old heap.

  1. Copy the location of the string object that is the filename into a pointer variable at a fixed location
  2. Reload exception throws us back to somewhere in main.
  3. VM gets shut down. Loop back to restart VM
  4. Before heap is re-initialized (is it zeroed?), examine the string object pointed to. Allocate an array on the stack...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I have been doing some timing tests of SPI transactions

This is on a feather_m0_rfm69 (SAMD21) but there are similar delays on SAMD51 and STM32F504. The delays are shorter on the faster boards, but still seem long.

There seem to be very long delays between the SPI transactions.
This figure shows a write operation
The interesting thing is how long it takes before the writes actually happen
top 4 traces are MOSI/MISO/SCK/CS
trace 5 is D13 -- self.led in the code
trace 6 is D12 -- se...

manic glacierBOT
#

A crash like the following occurs in the unix port:

Program received signal SIGSEGV, Segmentation fault.
0x00005555555a2d7a in mp_obj_module_set_globals (self_in=0x55555562c860 , globals=0x55555562c840 ) at ../../py/objmodule.c:145
145	    self->globals = globals;
(gdb) up
#1  0x00005555555b2781 in mp_builtin___import__ (n_args=5, args=0x7fffffffdbb0) at ../../py/builtinimport.c:496
496	                mp_obj_module_set_globals(outer_module_obj,
(gdb)
#2  0x00005555555940c9 in mp...
manic glacierBOT
#

I upgraded from 5.3.0 to 5.3.1. I ran 11 games with 3 rounds per game on 6 devices, so that's 198 executions of the code in main loop where this has previously occurred and curiously it's always on the third and final transmission. All fault free but I'm not reading too much into that as this is such a rarely triggered bug.

orchid basinBOT
manic glacierBOT
#

Changes: I made Adapter have a constructor that takes the uart, rts, and cts args. You can actually only call it once, before it complains "Too many adapters". To set _bleio.adapter, you call _bleio.set_adapter(). It can't be used as a settable property due to limitations in how module attributes are treated.

In an HCI build, the attribute is set back to None on each soft restart. In a non-HCI build (e.g. nRF), the attribute is always set and is read-only.

manic glacierBOT
manic glacierBOT
crimson ferry
#

We can find with CircuitPython code whether a pin is capable of PWM, I2C, UART, SPI, touchio. But is there some mechanism deeper than pins.c to designate whether pins can be analog? digital? input? output?

stuck elbow
#

@crimson ferry same as with sercoms/timers β€” just try and catch the error

crimson ferry
#

@stuck elbow My question is whether it's possible for code to detect? For example, a processor pin that is input-only... CP code lets me output to it to my heart's content, but nothing ever changes on the pin.

#

(don't get me started on MOSI-only SPI devices, and breakouts/libraries that don't return init status πŸ˜‰

stuck elbow
#

It should throw an error when you try to switch it to output

crimson ferry
#

what's the mechanism?

stuck elbow
#

if it doesn't, I would say it's a bug

crimson ferry
#

it doesn't detect or throw exception in my current case

#

where in circuitpython core code is the encoding of pins being input-capable, output-capable, analog-capable, digital-capable?

stuck elbow
#

I suppose it would need custom check for that on platforms that have such pins

crimson ferry
#

it would have to be in port/board I would think

stuck elbow
#

same for pullups/pulldowns

#

for analog there must be a place where it looks up the analog channel for the given pin, and throws an error when there is none

crimson ferry
#

that sounds right for analog, but digital may just rely on info in a datasheet

#

it it's input-only, for example

stuck elbow
#

generally I would think this is something defined in HAL

crimson ferry
#

OK, I'll dig around there, thanks

orchid basinBOT
manic glacierBOT
ornate breach
#

The sam4s has circuit python support, right? I’m thinking about making my own feather with the sam4s since it has native USB and whatnot, I just wanted to make sure it was CP supported.

manic glacierBOT
#

Builds of the esp32s2 targets frequently fail:

-- Found Git: /usr/bin/git (found version "2.28.0")
-- Initialising new submodule components/asio/asio...
warning: could not look up configuration 'remote.origin.url'. Assuming this repository is its own authoritative upstream.
Submodule 'components/asio/asio' (/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git) registered for path 'components/asio/asio'
fatal: repository '/home/runner/work/circuitpython/circuitpytho...
tulip sleet
#

This is basically some of the info in the datasheet, transcribed for programmatic use

#

@ornate breach we have not supported the SAM4S. The SAMD51 is an M4 processor with more RAM

#

SAMD51 has more RAM

#

I believe the SAM4S is older

ornate breach
#

Probably so

crimson ferry
#

Thanks, Dan, looks like it covers: interrupt, touch, ADC, sercom, timers. The thing that prompted this line of thinking was that on ESP32-S2, there are pins that are input-only, but I'm not sure if there's a way to programmatically enforce that.

ornate breach
#

I was just cruising through Digi-Key for M4 MCUs

#

Cooking up new ideas for feathers

tulip sleet
#

SAM4S was introduced in 2011; SAMD51 introduced in 2017

#

@crimson ferry the format of that pin table varies between ports; it's somewhat different on STM, for example, so it would certainly be possible to add an "input only" flag

tulip sleet
#

@onyx hinge I think there's a leftover debugging print statement from the endpoint checking:

Endpoint 0 - vs max_ep 8
Endpoint 0 - vs max_ep 8
Endpoint 0 - vs max_ep 8
...
orchid basinBOT
solar whale
#

@tulip sleet I was going to try the esp32spi with BLE -- I have the updated nina firmware installed on a metro_m4_airlift, but I am having trouble getting _bleio into my build. What do I have to do to enable it?

#

or should I try first on some other board?

#

oh -- nevermind -- I forgot to install PR 3310!

solar whale
#

@tulip sleet FYI -- I tried running the ble_simpletest but get ```ress any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.3-48-gf5a5fc4c8 on 2020-08-31; Adafruit Metro M4 Airlift Lite with samd51j19

import ble_simpletest
scanning
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ble_simpletest.py", line 12, in <module>
File "adafruit_ble/init.py", line 267, in start_scan
NotImplementedError:

#

the first few steps go ok ```Adafruit CircuitPython 6.0.0-alpha.3-48-gf5a5fc4c8 on 2020-08-31; Adafruit Metro M4 Airlift Lite with samd51j19

from adafruit_ble import BLERadio

ble = BLERadio()```

tulip sleet
#

@solar whale this PR only implements peripheral mode, so scanning is not working. You can try ble_uart_echo_test.py: that's peripheral mode

#

the idea was to get Bluefruit Connect up and running first

solar whale
#

OK -- sorry -- will try that

tulip sleet
#

I will make that clearer in the PR

solar whale
#

also of interest, I tried building my own copy of the nina_FW and it did not work ( got a time out lookin for the HCI ) I used the one from your PR and it works OK

#

I'll look into that

manic glacierBOT
#

After reading about the ability to turn off QSPI during sleep for the nRF52840 in 6.0.0 alpha 3 I tried emulating what @xiongyihui did in issue #3244 on my itsybitsy BLE (also nRF52840). However after building CircuitPython with the CIRCUITPY_ENABLE_MPY_NATIVE=1 flag to be able to use the @micropython.asm_thumb decorator and adding a few lines to xiongyihui's code to disable the DotStar LED the current drawn from battery (no USB connected) is still identical to what it was when using 6.0.0 al...

solar whale
#

@tulip sleet Echo test worked great!

tulip sleet
solar whale
#

hmm -- it looks like that has been merged, but maybe I misread something --

tulip sleet
#

hmm, you're right, that's odd. I'll bring it up with Limor.

solar whale
#

thanks -- I'll try it again -- then I can open an issue on it.

tulip sleet
#

that would be great; she built the version I posted in the Cpy PR long before the NINA pr

#

The adafruit_ble_adafruit library should work also, on the peripheral sdie, though it has been somewhat less tested.

solar whale
#

OK -- I'll try to do some testing later today. Off to a good start! Thanks!

tulip sleet
#

thanks for testing!

solar whale
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Yes, the dotstar library uses SPI if it can. Below is from https://github.com/adafruit/Adafruit_CircuitPython_DotStar/blob/master/adafruit_dotstar.py. The way around this would be to modify the code to force it to use bit-bang method it does when SPI is not avialable on the requested pins.

        self._spi = None
        try:
            self._spi = busio.SPI(clock, MOSI=data)
            while not self._spi.try_lock():
                pass
            self._spi.configure(...
turbid radish
#

?serverinfo

#

? serverinfo

#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

24718

Roles

34

orchid basinBOT
manic glacierBOT
#

It didn't even occur to me to test current with the LED still on but I did and got this:
Doing nothing but importing time and going to sleep (LED still on) results in about 1.95 mA. Lower than before even though the LED is now on.
When using the code below setting the brightness for the first time using the DotStar object causes the current to jump from 1.95 to 2.85 mA even though the brightness of the LED doesn't change. I assume that increase is caused by the HFCLK turning on again (and...

onyx hinge
#

<@&356864093652516868> Discord meeting in about 1 hour in the text and audio channels. If you have a chance to add your updates and your "lurking" status to the notes document, please do -- it's super helpful. https://docs.google.com/document/d/1fzARe32tu1diEPjFla3ipsz6jJehwYHlF7LYdjLaMYw/edit?usp=sharing
Reminder that if you plan to speak in the audio channel, you have to be a member of circuitpythonistas. We're happy to add you, let us know.

manic glacierBOT
#

Try without the "bin"

 make BOARD=makerdiary_nrf52840_mdk_usb_dongle SD=s140 V=1 -j4

worked for me

Create build-makerdiary_nrf52840_mdk_usb_dongle-s140/firmware.bin
Create build-makerdiary_nrf52840_mdk_usb_dongle-s140/firmware.hex
Create build-makerdiary_nrf52840_mdk_usb_dongle-s140/firmware.uf2
python3 ../../tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "build-makerdiary_nrf52840_mdk_usb_dongle-s140/firmware.uf2" build-makerdiary_nrf52840_mdk_usb_dongle-s140/firmware.he...
#

GEN build-makerdiary_nrf52840_mdk_usb_dongle-s140/genhdr/mpversion.h PreProcess ld_defines.c make: arm-none-eabi-gcc: No such file or directory make: *** [../../py/mkrules.mk:63: build-makerdiary_nrf52840_mdk_usb_dongle-s140/ld_defines.pp] Error 127 make: *** Waiting for unfinished jobs....
for me not,
and its

make BOARD=makerdiary_nrf52840_mdk_usb_dongle SD=s140 V=1 -j4 hex

i have tried it with bin but both dosen't work.

I use manjaro and gcc 10.1.0

modern wing
#

Good afternoon all you wonderful folks! Happily (if a bit groggily) lurking today πŸ™‚ β˜•

The notes doc has been updated to reflect as such.

manic glacierBOT
stuck elbow
#

lurking

#

that sounded like Abe's Odyssey

manic glacierBOT
tidal kiln
#

lurking

uncut nexus
#

lurking today

lone axle
#

Lurking today (noted in the document already), I will have to cut away early for another meeting.

onyx hinge
#

thanks @lone axle I'll be happy to get back in my role of URL paster

modern wing
#

The Duke of URL.

onyx hinge
#

OK make me a vanity role, I'll take it

stuck elbow
#

The Earl of Url

onyx hinge
#

@thorny jay please mute

#

thank you

thorny jay
#

Sorry, I am also going to make it text-only.

onyx hinge
#

got it, thanks

manic glacierBOT
onyx hinge
#

You could say 2020 is The Year That Didn’t Happen, or perhaps even The Year That Everything Happened Online. All the international cons and camps have been cancelled, and we’ve spent ou…

In this presentation, we will take a look at this years badge and a bit about the decisions and troubles leading up to this point.

β–Ά Play video
#

Learn how to install and use the hardware centric CircuitPython language on a compatible microcontroller board.

Interested in getting @CircuitPython up and running on your compatible microcontroller board? Check out @WoolseyWorkshop's latest tutorial.
@adafruit #CircuitPython #electronics
Getting Started With CircuitPython On Compatible Microcontroller Boards https://t.co/SIZrCvsNmq

turbid radish
#

Send your info to Anne on Twitter at @anne_engineer

#

Or Do a PR

#

Lurking

onyx hinge
#

Michael Lass is not a familiar name to me

#

yup

slender iron
#

I wonder if we should split the overview into the three sections

onyx hinge
#

with 52 boards, you can do the adafruit blinka board of the week .. all year

modern wing
#

No problem πŸ‘

onyx hinge
#

@slender iron want me to drop that screenshot in the chat or is it full of secrets?

#

MAKE := #problematic

modern wing
#

Awww.

slender iron
#

@solar whale does your cat have hug reports?

#

or would they be purr reports?

solar whale
#

as long as you scratch her head

onyx hinge
#

🐱 . o O ( hug report to the big ones with thumbs who serve me food. it should be more often though. )

#

@slender iron only the top side connections are actually needed in that pinout?

slender iron
#

no, you need both sides

onyx hinge
#

if you want it pogo-able, do those need to be duplicated on the top with a little pad or something?

slender iron
modern wing
#

question about CircuitPython day -- do we/will we have a schedule of the adafruit broadcasts for the day?

slender iron
modern wing
#

Thanks Scott

slender iron
#

np

dire spruce
#

I am learning circuit playground. I noticed that some example codes just do import board while others do board and call out circuit playground. Which is right?

onyx hinge
#

belated hug report to scott for taking the next step in improving his development style

gilded cradle
#

another belated hug report to @onyx hinge for taking a look at the RGB Matrix issues in circuitpython.

onyx hinge
#

@dire spruce both are fine -- if you want to go beyond what is in the circuitplayground module, then you can do it by directly using board, etc.

#

if you're just starting you'll probably find the circuitplayground way easier

thorny jay
#

I wanted to use the neopixel library on a code that was already using neopixel_write... is there an easy way?

dire spruce
#

How do I know which boards are included in board library

onyx hinge
dire spruce
#

That’s where I am right?

onyx hinge
#

@dire spruce no, go up in the channel list, under "help with"

dire spruce
#

Oh there’s a circuit python and a help with?

slender iron
#

(this channel is usually for circuitpython developmen)

onyx hinge
#

+t

dire spruce
#

Oh ok

onyx hinge
#

Thanks!

slender iron
#

I answered your question in the other channel

thorny jay
#

I played a lot with 64x64 RGB matrix this week, and it is only after a few days that I figured that my matrix has Blue and Green inverted (or maybe I made a mistake). Suddenly the image were much nicer. πŸ˜‰

crimson ferry
#

@solar whale I've been getting hangs with SPI lately (esp32s2), though it was working in the past (had ESP32SPI connected to an Airlift working fine in July) Need to re-test with alpha.3

tulip sleet
#

limor said she will check out the firmware issue

onyx hinge
tidal kiln
#

wow. that's already coming up again.

onyx hinge
#

You generally need permissions to add labels

#

Sometimes you can restructure the code so that the lock is held for a longer length of time. If you are polling, then make sure you do it outside of that loop.

#
    if (hri_sercomspi_get_CTRLA_CPHA_bit(hw) == phase &&
        hri_sercomspi_get_CTRLA_CPOL_bit(hw) == polarity &&
        hri_sercomspi_read_CTRLB_CHSIZE_bf(hw) == ((uint32_t)bits - 8) &&
        hri_sercomspi_read_BAUD_BAUD_bf(hw) == baud_reg_value) {
        return true;
    }
``` @slender iron is reading these registers back going to be "fast" or is it slower than RAM?
#

other thing of note is that samd_peripherals_spi_baudrate_to_baud_reg_value is called to get baud_reg_value and it uses floating point math

#

If it's less than 16 bytes it shouldn't look at background tasks

tulip sleet
#
// Avoid using C stack when making Python function calls. C stack still
// may be used if there's no free heap.
#ifndef MICROPY_STACKLESS
#define MICROPY_STACKLESS (0)
#endif

// Never use C stack when making Python function calls. This may break
// testsuite as will subtly change which exception is thrown in case
// of too deep recursion and other similar cases.
#ifndef MICROPY_STACKLESS_STRICT
#define MICROPY_STACKLESS_STRICT (0)
#endif
onyx hinge
#

Thanks for running the meeting, @idle owl !

modern wing
#

Thanks!

gilded cradle
#

Thanks

mental nexus
#

Thanks everyone!

solar whale
#

πŸ‘‹

manic glacierBOT
#

Now that we are using PYSTACK, investigate whether turning on MICROPY_STACKLESS is a significant performance improvement.

From py/mpconfig.h:

// Avoid using C stack when making Python function calls. C stack still
// may be used if there's no free heap.
#ifndef MICROPY_STACKLESS
#define MICROPY_STACKLESS (0)
#endif

Suggested by Damien to Scott.

modern wing
#

@idle owl If this is with a macbook pro, could it be the usb-c adapters themselves? I've had a few USB-C adapters not play nicely with external devices....

#

If you're a host of a zoom meeting, or the host gives you permission, you can record zoom meetings --- super handy feature. πŸ™‚

idle owl
#

MacBook Pro, yes. One of the monitors here is USBC directly. The other one is DisplayPort to USBC. In my other location, both USB C directly.

gilded cradle
#

Which one crashes it?

idle owl
#

Both setups crash.

gilded cradle
#

I mean which monitor? Either?

idle owl
#

Oh, I can't unplug the USBC one here because my network and peripherals are plugged into a hub plugged into it.

gilded cradle
#

Ah

idle owl
#

But it doesn't crash if I remove the DP-USBC one

modern wing
#

Hmm. I was thinking it could be the USB-C cable itself, first party vs third party? Or it could be the hub not playing nicely

idle owl
#

This is the USBC cable that came with the monitor. Huge gauge. Powers the laptop as well as providing a hub through the monitor

modern wing
#

The reason I'm diving down this rabbit hole is because I have some Microsoft-branded USB-C to USB-A adapters, and they simply do not play nicely -- but worse, they're inconsistent in how they fail.

idle owl
#

This is USBC to USBC cable.

gilded cradle
#

Ok, I usually use a displayport-usbc cable and had played with OBS a bit, but hadn't crashed. I just switched back to a DisplayPort to Mini DisplayPort since I could use a single hub.

#

Currently traveling, so using my laptop with an iPad as a sidecar.

modern wing
#

Sidecar is such a nice feature.

idle owl
#

I had forgotten about that. I also forget sometimes that I have an iPad.

gilded cradle
#

Yes, I just updated my ipad since my old one was too old for that.

#

It's a great travel monitor

modern wing
#

I run a 2nd gen ipad pro 12.9, and that's "new" enough for sidecar. It beats any USB monitor I've had hands-down -- and it beats Duet Display too.

gilded cradle
#

Mine is just a lower-end 10.2" iPad.

modern wing
#

Isn't it so nice though, older and lower-end hardware plays nicely

gilded cradle
#

Yes

#

I used a luna display with my old ipad and old macbook, but it was a little harder to set up.

modern wing
#

Anywho, I haven't tried OBS yet on my new laptop -- I'll give it a go with a few external monitors, see how it handles recording to disk with everything going at once.

manic glacierBOT
slender iron
lone axle
#

yep. They are looking for almost exactly what I have created if I understand their last message correctly. I'll post a link to it in that forum post.

ornate breach
#

What was the required minimum RAM and flash for CP?

#

32KB RAM?

tulip sleet
#

yes

#

256kB flash (or 192kB with external flash, but we don't have any boards like that)

slender iron
#

(you really want more than 32k though)

tulip sleet
#

256kB on non-flash-chip boards is 192kB firmware + 64kB CIRCUITPY

slender iron
#

thanks @lone axle

ornate breach
#

if I used SPI Flash

tulip sleet
#

no, it's only 128kB internal flash. Also, we have never done PIC32

slender iron
#

the different architecture will impact the code size of circuitpython stored in flash

tulip sleet
#

we've spent a while looking for chips that meet the requirements

#

I'm not sure there are any "hidden" chips that look great

ornate breach
#

gotcha

slender iron
#

(the imx rts are underutilized imo)

tulip sleet
#

i.MX RT M4M7 chips are interesting

#

what he said

slender iron
#
  • M7
ornate breach
#

has USB OTG support too

#

Might be tough without the ARM core though...

#

hmm

slender iron
#

non-arm is doable

#

main thing is having gcc support

#

there is a little assembly needed for the nlr mechanics too

#

what is the appeal with pic32?

ornate breach
#

mostly just trying to do something that's not been done quite yet

#

I like challenges. though to be fair, I have a number already haha

slender iron
#

most challenges are software challenges

#

one challenge would be getting running on cortex-a

ornate breach
#

like an A7?

#

or A9 even

slender iron
#

ya, any of them πŸ™‚

#

maybe start with the rpi

#

or giantboard

ornate breach
#

hmmm

#

I do see that there already is quite a big undertaking for RPi and other similar boards

slender iron
#

you mean blinka?

ornate breach
#

yeah

slender iron
#

it uses CPython on top of Linux

#

I'd love to see bare-metal circuitpython on it

ornate breach
#

oh I see

slender iron
#

so you can plug in and edit away like any other board

ornate breach
#

that is a bit of a challenge huh

slender iron
#

again, a software challenge though

#

(and I have lots of those)

ornate breach
#

lots of low level software challenges when thinking about running right on the bare metal

slender iron
#

yup

#

(I have fpga ideas if that's more interesting to you)

ornate breach
#

I am working on some FPGA projects

#

like the ICE40 feather wing I talked about last week on show and tell πŸ™‚

#

it's a small step towards getting the biggest FPGA I can on a feather wing hehe πŸ™‚

slender iron
#

πŸ™‚ what are you doing on the software side?

ornate breach
#

right now mostly just trying to load a simple blink verilog file to it

#

after that, reworking one of the binary to header libraries for C to work with CP

#

basically need to turn a binary into an array to be spit out over SPI

slender iron
#

have you looked at my systemonachip library?

ornate breach
#

I have not

slender iron
#

I've done a bit of that for the machxo2. I have loading over i2c from cp working

#

I'm trying to create python classes that are both the driver and hardware def

solar whale
#

@slender iron SPI works OK on esp32s2- saola-wroom -- with rfm9x featherwing.. Same code failed on wrover

#

sorry for double tag -- posted to wrong channel

slender iron
#

kk, so it is a ram thing

#

πŸ‘

ornate breach
#

very interesting, that might work for the ICE40 chips

manic glacierBOT
slender iron
#

ya, my hope is that we can distribute bitstreams with the python lib so it's easy to load and then use

ornate breach
#

I'm not aware of i2c on the ICE5LP*K but I'm sure there are a few of the ICE40 Ultras that do have i2c programming

slender iron
#

the same approach should work over spi

#

you may want to try and do an 8 bit bus over the featherwing

ornate breach
#

yeah, just a few minor tweaks

#

I'll play around with it in the coming weeks. I just got the new regulators to replace the ones I got which didn't provide the right voltage so that will be happening over this week

slender iron
#

πŸ‘

#

the next thing I'm hoping to do is create an i2c to wishbone harness for the xo2 to test peripherals on it

ornate breach
#

That would be interesting

slender iron
#

ya, I think so. basically start with individual peripherals and then work up to self-contained socs

onyx hinge
#

@slender iron where does displayio take care of the transposition and X/Y mirrors when actually sending pixels out to the device?

slender iron
#

its done on a tilegrid basis. the buffer it fills is in native display orientation and the bitmap is read by row as well

manic glacierBOT
onyx hinge
#

what about when the whole display is transposed, not a TileGrid?

slender iron
#

it get propagated down into the tilegrids via the transform

manic glacierBOT
#

@kevinjwalters and @tannewt, I’m willing to pitch in on this issue. I read through the related issue and here’s what I gather:

Thank you! I'm happy to give pointers on this.

Need a way to call for an immediate (blocking?) screen refresh. I assume this would be an empty call display.refresh() or with target_frames_per_second=None.

Yup, blocking is good. I think we could change the API so that the default means now. It'll be good to have the target fps explicit otherwise.

...

onyx hinge
#

@slender iron if my display is native 32x16, and the rotation is 90, should its core.area = {x1 = 0, y1 = 0, x2 = 16, y2 = 32 } transposing x and y?

slender iron
#

yes, I thiiiiiink so

idle owl
#

Here is the notes document for Wednesday 9 September 2020's CircuitPython Weekly meeting. It is being held on a DIFFERENT day, at the typical time of 11am Pacific / 2pm Eastern here on Discord. 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/1Zeeb_ZJltPcESMhRtofP4_QGoLWagNtAPfoAeA2q8Ms/edit?usp=sharing

manic glacierBOT
#

Also, you probably don't want to restart if there was an error, only if it was a normal end of the program. I might be overthinking this.

I don't think you are overcomplicating it. I think it is complicated.

Another aspect is what file should be run on reload. We don't know what file has been changed when the FS is written. My guess is that we want the currently running file reloaded (and therefore we need to preserve the filename past start up into the new heap.)

A related use to ...

manic glacierBOT
manic glacierBOT
#

One question here plus one on the library. Should this take native pins only? Is it prepared for a DigitalInOut-like class?

I am taking DigitalInOuts because the calling library already needs to use them to do the initial hard reset of the adapter. It's not prepared for a duck-type DigitalInOut class, but I think we can code for that internally when we need to. I could imagine that there's an internal software HCI adapter that has rts and cts signals that are not actual pins, so ...

manic glacierBOT
manic glacierBOT
dire spruce
#

Anyone know why help with circuit python is gone?

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I wont to convert a unixtimestamp to localtime in circuit python.
This is the simple code:

unix_correction = 946684800 # correct to 01-01-2000
timezone = 7200
t=1598887049

def convertUnixTime(t,timezone):
dummy=time.localtime(t-unix_correction+timezone)
return "%4d-%02d-%02d %02d:%02d" % (dummy[0],dummy[1],dummy[2],dummy[3],dummy[4])

Running it I get the error message:

"timestamp out of range for platform time_t"

could not found a solution for this problem (it is wor...

manic glacierBOT
#

Thanks for everyone's explanations and tips!
I removed the DotStar in the board definition (I think) by removing the following lines from mpconfigboard.h

#define MICROPY_HW_APA102_MOSI   (&pin_P0_08)
#define MICROPY_HW_APA102_SCK    (&pin_P1_09)

That dropped the current during sleep to 0.95 mA which is obviously way better than what I got when turning off the LED using adafruit_dotstar.Dotstar. Just out of curiosity I did also try physically removing the LED from one of my i...

manic glacierBOT
manic glacierBOT
#

I want to add usb_hid for a braille display.
In the hid_report_descriptors I have added my own report descriptor and I noticed that for the output reports I can't have a report count larger than 8 (0x08).
Is there a limitation for the report count?
Here is the output report I am talking about, there are also other output reports but this is the only one that exceeds 0x08.

        # SET DOTS
        0x09, 0x41,		    # 08|1   , Usage      (vendor defined)
        0x85, 0x...
manic glacierBOT
ionic elk
#

Am I the only one who finds openocd super frustrating to set up/use? It seems like there's so little documentation on how to find the right configuration files/settings for your application

onyx hinge
#

I have not grown used to it either

#

but once I figure it out I put the settings in a script and forget about it

#

for my sam e54 which has to use openocd .. ```$ cat start-stub-same
#!/bin/sh
exec /home/jepler/.local/openocd/bin/openocd -f /home/jepler/.local/openocd/share/openocd/scripts/board/microchip_same54_xplained_pro.cfg -c "gdb_port 2331"

#

so if you figure out how to launch it for esp32s2 let me know

#

probably involves $HOME/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/share/openocd/scripts/target/esp32s2.cfg

manic glacierBOT
ionic elk
#

@onyx hinge yeah my biggest problem is simply that it loves to rely on these super specific files and whoever wrote their documentation just assumed that you would know what you need and where it is, magically?

onyx hinge
#

yup. If you had the time and energy you could try contributing to their documentation but you never know how that will be received when you're starting as an outsider

manic glacierBOT
tulip sleet
#

@ionic elk I used openocd once long ago to fix some fuses on Atmel boards, and found it quite frustrating. I was greatly relieved to be able to switch to the J-Link, which "just works".

ionic elk
#

@onyx hinge they aren't even on github, which gives me bad feelings about how receptive they would be to outside contribution

onyx hinge
#

o_O

ionic elk
#

Honestly the whole project is kind of impenetrable, does anyone know who even runs it? Like, is it just some guy, or is it sponsored, or what?

tulip sleet
ionic elk
#

I meant more along the lines of a wiki, or a readthedocs. Maybe it's the entitled millennial in me though lol. I've never really "gotten" mailing lists.

#

We have one for A2, and it seems so hard to follow conversations - I always figured there was some kind of special client I was missing that made them practical to use

solar whale
#

Are there known issues with CLUE and the current CP main? I am not seeing the REPL displayed on the screen and the 'spirit level' demo does not work -- no errors, just no display.

#

works ok with CP 5.3.1

#

No REPL on display with 6.0.0-alpha3 and later -- REPL works OK in terminal

#

The display does show the blinka icon and the bootup messages

lone axle
#

Confirmed same symptoms on a CLUE on my end as well.

#

6.0.0-alpha.2 is working correctly for me also.

solar whale
#

Thanks for confirming ...

lone axle
#

Mine is one of the "early" CLUEs that got listed in those first few listings at small QTYs. I know there was a warning on the page that hardware might still change, not sure if it did end up actually changing or not, and if so whether that change could affect this issue or not, but mine would be one of the earliest versions that were actually shipped out.

solar whale
#

the one I am using is a new one -- From Adabox 15.

#

I'll open an issue

manic glacierBOT
tulip sleet
#

@solar whale btw, does your clue present as CLUEBOOT, or F840BOOT when in the bootloader

solar whale
#

CLUEBOOT

#

for this one

tulip sleet
#

I am helping some folks with a batch of CLUEs that are acting badly on MacOS. OK, thanks, I seem to have one CLUE that has FTHR840BOOT, for unknown reasons.

solar whale
#

I have an older one as well

tulip sleet
#

maybe it was my fault

solar whale
#

IIRC the original batch were FTHR840BOOT

#

Mine is on MacOS now -- no issues with that.

#

I was testing the "bonsai buckaroo" and it was working fine, but then i tried one of the graphic demos (spirit level) and it would not display. That s when I noticed the display was not echoing the REPL at all. So everything except display code seems to be working OK.

tulip sleet
#

I seem to have "new old stock" with FTH840BOOT

solar whale
#

I found one that does FTH840bOOT as well

onyx hinge
#

I have had CLUEs with the FTHR840BOOT

solar whale
#

Have to walk dog now. I’ll try some other displays later and try to pin down when it broke

manic glacierBOT
#

I'm trying to flash nRF52 Radio Soft Device to the usb dongle, but I got this error: `
2020-09-01 20:03:31,019 LIBUSB_ERROR_ACCESS: Unable to connect to trigger interface.

Traceback (most recent call last):
File "/home/yannes/.local/lib/python3.8/site-packages/serial/serialposix.py", line 265, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyACM0'

During handling of the above exception, a...

#

I think we'll want a separate function rather than putting it in reload. That way the code can set if for all reload causes, not just manual reload. Something closer to set_next_stack_limit: https://circuitpython.readthedocs.io/en/5.3.x/shared-bindings/supervisor/__init__.html#supervisor.set_next_stack_limit

Then we can have multiple kwargs for different reload reasons or separate functions. I imagine you want: reload, exception, safe mode and completion as reasons.

#

I don't know how most folks use refresh, but currently it can be used solely by setting the minimum_frames_per_second to a given value and the target_frames_per_second will default to 60.

I wrote this version to closely replicate the current version, so it would default to target_frames_per_second value of 60, and the only change is to accept the None value, or called with no parameters at all to trigger the immediate refresh.

Before making the change and updating the docs, I...

#

@ciscorn Oddly some literal backspace characters appeared in some translations:

/home/weblate/data/vcs/circuitpython/main/locale/ja.po:2146: warning: internationalized messages should not contain the '\b' escape sequence

I have corrected the problem by deleting them.

The messages were

#: shared-bindings/displayio/Palette.c
msgid "color must be between 0x000000 and 0xffffff"
msgstr "色は0x000000から0xffffff^Hでγͺγ‘γ‚Œγ°γͺγ‚ŠγΎγ›γ‚“"

and

#: py/runtime.c
#, c-format
msgid "ne...
#

I need min buf size of 4K. If I can have 16K there's small performance gain

python maybe needs help to place bytearray in RAM instead of PSRAM.
buf=machine.ram(bytearray(512)) or similar... but that are just my random
thoughts, any fix is good thing :)

On 9/1/20, Scott Shawcroft notifications@github.com wrote:

Ok, thanks for testing this! I've gotta decide how to fix it. We want
bytearrays in PSRAM by default but need them in RAM when sending them to
SPI.

--
You are receiving...

#

It broke between these 2 builds from S3

last working build

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.2-432-gfe73cfb92 on 2020-08-27; Adafruit CLUE nRF52840 Express with nRF52840
>>> 
>```


not working

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.2-434-g610002724 on 2020-08-27; Adafruit CLUE nRF52840 Express with nRF52840

#

To test the output report I am using a tool called SimpleHIDWrite. The error I get is from this tool but it's not a specific error, rather a generic one: "A device attached to the system is not functioning".. but if I get the report count down to 0x08 in the report descriptor and then test it with SimpleHIDWrite it works.
My thoughts were that maybe there is a maximum limitation for report counts which you can input in the hid_report_descriptors.py

ionic elk
#

@slender iron did you ever get any further with ESP32 debugging than the thread issues you were running into when you did your stream?

#

I'm getting the same "The current thread has terminated" and "Cannot kill process" stuff

#

Google is surprisingly useless at turning up anything for it

manic glacierBOT
#

Repeated the search and now find that the last working version was

Adafruit CircuitPython 6.0.0-alpha.2-26-gb7e6bf959 on 2020-07-25; Adafruit CLUE nRF52840 Express with nRF52840

and first broken version was

Adafruit CircuitPython 6.0.0-alpha.2-43-g7ab5c520e on 2020-07-25; Adafruit CLUE nRF52840 Express with nRF52840

HOWEVER when I reloaded 6.0.0-alpha.2-43-g7ab5c520e worked for REPL, but not when I ran a program thatt used the display it did display but with odd behavior -- after ...

ionic elk
#

I think I landed on the answer, adding -Wl,--undefined=uxTopUsedPriority to LDFLAGS seems to have done it... whatever that means πŸ˜‚

manic glacierBOT
#

Reverting the changed in #3190 seems to fix it.

[Jerry-desktop-mini:circuitpython/ports/nrf] jerryneedell% git diff
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index 3fef68e88..1fdf79958 100755
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -89,13 +89,11 @@ ifeq ($(DEBUG), 1)
   CFLAGS += -ggdb3
   OPTIMIZATION_FLAGS = -Og
 else
-  OPTIMIZATION_FLAGS ?= -O2
-  CFLAGS += -DNDEBUG -ggdb3
+  CFLAGS += -Os -DNDEBUG -ggdb3
   CFLAGS += -flto -flto-partition=none
...
solar whale
#

Yay! I can safely say I have a CLUE again....

onyx hinge
slender iron
#

@ionic elk nice! I never figured it out

tulip sleet
#

@slender iron yes, though not right away. will put it on my list

solar whale
#

@onyx hinge when you have a chance, would you please add those notes to the clue issue?

onyx hinge
#

@solar whale why doesn't discord do that automatically?

solar whale
#

add that to the bot

manic glacierBOT
#

I'm not sure how I did it but I just made a broken touchio.TouchIn(board.P0) . I had been using P0 for other things but I'm fairly certain I then did a a control-D and control-c in REPL to reset things. The value was always False. The threshold was 100. I power-cycled and it's working now and has a threshold of 161.

Could this be related to the this issue?

#

A similar fix was offered at #3249 but closed without merge because @dhalbert filed #3281 and @DavePutz reported that it fixed #3247.

Were any other nrf-with-display boards tested? This reminds me, I had trouble with the Sharp Memory Display corrupting random lines of the display with nrf52840 and not on other micros. I chalked it up to the particular device being a Particle Xenon rather than an Adafruit board and moved on with a different board (that happened to be non-nRF)

manic glacierBOT
#

Issue #3296 is another case where compiling with -O2 optimization on the Clue broke something (in that case, BLE). @dhalbert has mentioned that these sorts of issues are most often due to a bug such as an uninitialized variable or something that should be volatile is not. I have spent a lot of time looking at #3296, and have traced it down to compiling ports/nrf/common-hal/busio/SPI.c with -O2 causing the BLE issue. But, I have not found anything in that source file that would seem to fit Da...

onyx hinge
#

@solar whale was there more to reproducing this problem than trying to show text on the lcd?

solar whale
#

Does it continue to echo the REPL. Try loading a graphic program like the spirit level demo

#

It was clearly flaky. Not always consistent.

#

Running graphics hosed the REPL echo

#

I always saw the boot messages, just nothing beyond if I entered the REPL

dire spruce
#

Help with circuit python room is gone. Does anyone know why?

ornate breach
#

Hit the help category

#

If there are no new messages and it’s collapsed, it won’t show the rooms.

solar whale
#

It’s there for me, I see your post.

crimson ferry
#

If there's no SD card, the only other thing I've come up with is using nvm with a simple wear-leveling algorithm.

manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@tannewt Here's the relevant commit message about the rotation fix:

The expectations of displayio.Display and frambufferio.FramebufferDisplay
are different when it comes to rotation.

In displayio.Display, if you call core_construct with a WxH = 64x32
and rotation=90, you get something that is 32 pixels wide and 64 pixels
tall in the LCD's coordinate system.

This is fine, as the existing definitions were written to work like this.
With framebuffer displays, however, the underly...
#

This line can probably be removed. In Arduino, either your program is starting fresh so the heap is zeroed OR you allocate storage with operator new which returns zero-filled storage. In CircuitPython, this storage could be filled with data left over from earlier. I wanted to eliminate the possibility that any bugs encountered were due to core containing something other than zeros when _PM_init is called.

manic glacierBOT
#

I realized that I can use USBlyzer together with SimpleHIDWrite (the application for which we do not have the source code).
So I get the following response in the USBlyzer when sending the set dots output report with report count larger than 8:
URB Control Transfer failed
Device Object 0000005b
Driver Object usbccgp

URB Function URB_FUNCTION_CONTROL_TRANSFER
URB Status USBD_STATUS_STALL_PID

Endpoint 0 Default Control

Request Set Report
Report Type Output
Report ID 1
Report Le...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

yay the sharp memory display ALSO works in rotated mode now

manic glacierBOT
onyx hinge
#

(so happy to switch it over for my github user!)

slender iron
#

goes and changes my orgs

manic glacierBOT
#

Compress common unicode bigrams by making code points in the range 0x80 - 0xbf (inclusive) represent them. Then, they can be greedily encoded and the substituted code points handled by the existing Huffman compression. Normally code points in the range 0x80-0xbf are not used in Unicode, so we stake our own claim. Using the more arguably correct "Private Use Area" (PUA) would mean that for scripts that only use code points under 256 we would use more memory for the "values" table.

bigram me...

onyx hinge
#

as tempting as it was to just merge and be done with it πŸ™‚

slender iron
#

πŸ™‚

onyx hinge
#

@slender iron thank you, good reviews really do help.

#

I don't always keep the big picture stuff in mind, and it's easy to miss things that will confound the next person working in or reviewing the code, like core.

manic glacierBOT
#

I think the main question is whether this is going to be a Spresense-specific module, or whether the API is generic enough to use for other devices. I'd prefer the latter.

Given that, I would suggest not defining a fixed set of image sizes, but just the pass the width and height in to the Camera constructor, and have size be validated for the particular camera. We may want to support the same API with other cameras that support other sizes. Then the ImageSize class can be completely re...

#

Thank you! Camera support is exciting and I agree with Dan. I'd like to see one API work for many cameras.

I'd like @PaintYourDragon to take a look as well because he's looked at the OV something something cameras too. The ESP32S2 Kaluga comes with an OV2640.

Two main questions I have are:

  1. How does initialization vary with different cameras?
  2. How does pixel collection vary? Is it different per-camera and per-port?
#

I'd prefer passing in a file-like object or a bytearray. This could then be:

//|         with open("/sd/image.jpg","wb") as file:
//|             cam.take_picture(file)"""

It could also be:

b = bytearray(width * height)
cam.take_picture(b)

What format will it produce? That seems missing in this API. I could see wanting a raw rgb565 to display on the screen for example.

Is it possible to change the image size on a per-picture basis?

slender iron
#

I don't always keep the big picture stuff in mind, and it's easy to miss things that will confound the next person working in or reviewing the code, like core.
@onyx hinge I'm on the opposite end. I think too big picture sometime and miss the details. My sinus headache helped with the core confusion. πŸ™‚

manic glacierBOT
ionic elk
#

@slender iron @tulip sleet the H7 series STM32 also comes with a built in camera module

tulip sleet
#

oh my goodness, here's a Python idiom I didn't know about for substituting a value instead of a falsey value (usually None). E.g., Instead of:

if foo is None:   # use default of 33 if foo is None
    foo = 33

you can do:

foo = foo or 33
ionic elk
#

huh

tulip sleet
#

because the or operator returns the operand, not just True or False

#

you have to being willing to give up strict None checking but often on writes if not foo: or similar anyway

slender iron
#

you and can also do foo = foo if foo else 33

tulip sleet
#

right, I was doing that, but this is shorter and is the same thing

slender iron
#

of course if it's a kwarg then you should just set the default

tulip sleet
#

i can't atcually, in this case, because the default is board.ESP_BUSY, which might not exist... or would that work anyway, because it doesn't get eval'd if the arg is supplied?

#

I should check that

#

nope, can't:

>>> import board
>>> def f(x=board.FOO):
...     print(x)
...     
...     
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'FOO'
slender iron
#

it'd fail on import I think

tulip sleet
#

then it might fail on import anyway, oops, have to use getattr, maybe

#

no, that is OK:

>>> import board
>>> def f(x=None):
...     x = x or board.FOO
...
>>>
slender iron
#

it'll error when you call it

tulip sleet
#

not if x is not None

slender iron
#

correct

tulip sleet
#

so this works nicely:
self._reset_io = digitalio.DigitalInOut(reset_pin or board.ESP_RESET)

onyx hinge
#

I find that style perfectly good, lots of languages uses that kind of chaining. but it is a surprise the first 7 or 77 times you encounter it, depending how much you understand and/or (and whether you bring wrong comceptions of how and/or operate in other languages to the discussion)

#

(e.g., a || b in C is either false or true, it's not 'the value of a if it's truthy, otherwise the value of b')

manic glacierBOT
#

this keeps getting stranger -- With the build i crated yesterday - reverting the optimization settings, the CLUE works normally as long as it is connected to the computer USB port. If I power it via a battery alone, the Display does not work. The program in code.py runs, but nothing is displayed. If I go back to CP 5.3.1 it works normally via battery.... It seems like something in the display is requiring the USB connection to be active...
I'm confused!

manic glacierBOT
#

It's all 600 lines of my code so I can fit this to let it work

buffer is reused for performance (it is allocated only once)
but just give me some hint how should I use it now.
I can make during init a dummy DMA for the first time to
let buffer move into RAM or something similar, just fine

On 9/2/20, Scott Shawcroft notifications@github.com wrote:

Do you reuse the buffer? Would it work if we moved the bytearray into RAM
when first used for DMA?

--
You are receiving this because...

onyx hinge
#

I'm going to give something a try soon, once some parts come. The problems I have on Linux with USB and crashing/rebooting/unplugging CircuitPython boards are not as severe as some people here, but I've decided to try having a dedicated computer to plug the CircuitPython board I'm developing for into. I'll be attempting to use sshfs to access the device's CIRCUITPY and XYZBOOT files from my desktop, and probably running the serial terminal also in an ssh.

For the most part I don't have crashes on unplug, but the thing that's a real thorn in my side is that when I have gdb+jlink running and it is at a breakpoint for very long, my keyboard will stop being able to type until I unplug the debugged circuitpython board. So as long as the pi isn't super crashy in these circumstances, I will mind less if I have to reboot it multiple times per day than what I have to do now to recover from the confused USB due to debugger halt.

slender iron
#

@onyx hinge for the gdb case get a usb cable that can disconnect the data lines

manic glacierBOT
#

I can reproduce this as well. But, I don't think we can blame this one on
the -O2 optimization. I tried the
first build after that change went in (7ab5c52
https://adafruit-circuit-python.s3.amazonaws.com/bin/clue_nrf52840_express/en_US/adafruit-circuitpython-clue_nrf52840_express-en_US-20200725-7ab5c52.uf2)
and the display still works with the battery. I'll see if I can
narrow down which commit broke this functionality.

On Wed, Sep 2, 2020 at 2:42 PM jerryneedell notifications@github.com...

onyx hinge
#

@slender iron I have those but I almost always want to see the serial output too so I'm trying to figure out how to split the baby on this one

#

@tulip sleet if you were going to tackle the "rgbmatrix as built in display", please let me know if you run into trouble. I think it should be doable, but I didn't do it.

slender iron
#

I turn data off the moment gdb breaks

#

and if I'm using gdb I don't usually rely on serial usb

onyx hinge
#

if only there were a way for debug prints to come not through usb. even better if it was a standard, like swd.

slender iron
#

swd has swo but I've never used it

#

probably worth adding

onyx hinge
#

yeah same here .. and I'm not sure if pins are connected on the boards .. ?

slender iron
#

they may not be

onyx hinge
#

stm32f405 feather, the first I looked at, swo isn't connected at the debug header

manic glacierBOT
onyx hinge
#

JTDO is used as FLASH_SCK so if it's SWO that won't work

slender iron
#

I don't think those are necessarily the same. what chip are you looking at?

onyx hinge
#

SWO is connected on Metro M4

slender iron
#

πŸ‘

onyx hinge
#

first I was talking about STM32F405 Feather, had just taken a quick look at the schematic from learn

#

so I guess it would be interesting if in a debug build of metro m4, stdout went on swo also?

slender iron
#

ya

onyx hinge
#

I need more stuff to do to avoid making progress on can, eh

slender iron
#

I hacked something similar with esp32s2 too

#

you can do it after can πŸ™‚

slender iron
kindred zenith
#

With a pushbutton input, is there an easy way to detect long press as opposed to short press?

slender iron
#

we don't have a library. you can track the last time it was unpressed and then compare the duration when it is pressed

kindred zenith
#

What I want to do is e.g. "if pressed for one second, do x and stop"

manic glacierBOT
#

Unicode designates a number of ranges of code points as "private use areas". This is commonly abbreviated PUA. The initial implementation used the private use area starting at 0xe000. However, the current implementation uses a different region of code points, 0x80 through 0x9f, which are officially designated for other uses within Unicode but should never appear in source or translated strings in CircuitPython. (for instance, the unicode code point 0x9f indicates APPLICATION PROGRAM COMMA...

kindred zenith
#

But not disrupt short press behavior.

slender iron
#

how are you detecting the short press?

kindred zenith
#

but1 = digitalio.DigitalInOut(board.A0)
while True:
if not but1.value:
keyboard.sendcode(Keycode.SHIFT, Keycode.P)

#

sleep(0.5)

slender iron
#

so you can get a reference time with time.monotonic()

kindred zenith
#

Sleep is to prevent multiple keypresses with a click.

slender iron
#

right, on a long press would you want to send the keycode too?

kindred zenith
#

So my question with time.monotonic() is how can I make it time out? I don't want to have to guess how long to hold the button.

#

Long press: different keycode

#

I want it to be like, press-release: send A, press-hold, timeout after time x and send B

slender iron
#

you save the time the button was last not pressed and compare the current time to that when it is pressed

kindred zenith
#

But that just evaluates on release, right?

slender iron
#

it depends on how you implement it

kindred zenith
#

I just couldn't figure out how to have it time out in the way I wanted.

slender iron
#

I think the tricky thing is that you will need to detect a release

#

otherwise you can't tell a short press from waiting for a long press

kindred zenith
#

I want it to be like: on press, start timing. On release do A. If no release after 1s, do B then stop.

slender iron
#

hrm

#

something like: ```python
but1 = digitalio.DigitalInOut(board.A0)
last_pressed = but1.value
last_press = None
while True:
pressed = not but1.value
now = time.monotonic()
if not last_pressed and pressed: # press
last_press = now
elif last_pressed and not pressed: # release
if now - last_press > 1:
# long
else:
# short
keyboard.sendcode(Keycode.SHIFT, Keycode.P)
sleep(0.5)
last_pressed = pressed

manic glacierBOT
#

Seems that the cause of this is PR #3244. The intent was to turn off QSPI
when USB was not connected.
Looks like this is interfering with the display on the Clue ??

On Wed, Sep 2, 2020 at 5:08 PM Dave Putz dwputz@gmail.com wrote:

I can reproduce this as well. But, I don't think we can blame this one on
the -O2 optimization. I tried the
first build after that change went in (7ab5c52
<https://adafruit-circuit-python.s3.amazonaws.com/bin/clue_nrf52840_express/en_US/adafruit-circuitpy...

kindred zenith
#

@slender iron thanks. But this waits for unpress, right?

slender iron
#

it does but you should be able to modify it

kindred zenith
#

Okay, I have to study it. I am not very good at python.

slender iron
#

np, this is good practice

silver tapir
#

One of the talks will be about designing new board for CircuitPython, and another on how to get UF2 to a new board. So we will have to add eng subtitles, as I'm sure you folks will love them.

manic glacierBOT
manic glacierBOT
#

Ok, let me know when I can pull compiled binary and test.
In the meantime I took WROVER-E with micropython and
tried my source with 256KB buffer which is required to hold
content of erase block of new FLASH chips and it works good,
and with some speedup as buffer is larger.

I don't know how they make this work, is old ESP32
better handling PSRAM DMA but I guess WROVER-E
with all loaded is not likely to have 256KB free in RAM.

On 9/3/20, Scott Shawcroft notifications@github.com wrote:

R...

lone sandalBOT
manic glacierBOT
#

Thanks for all comments. I wanted to make a module that can be used for other ports. My implementation was based on this: https://learn.adafruit.com/ttl-serial-camera/circuitpython-python-usage

About ImageSize, I wanted the user not to have to search and type correct and supported height and width by himself, but could use the predefined sizes. I thought that in the case of more devices supporting the camera, the list of available sizes will grow. Sizes that were not supported by the cam...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

However, behavior on systems which don't distinguish between "Makefile" and "makefile", like windows, may be a reason to not accept this PR. I can't easily check those systems.

Both Windows and MacOS also have case-insensitive filesystems by default. I think those are showstoppers.

Alternatives:

  1. Add
-include makefile.local

to the Makefiles, and put makefile.local in .gitignore. See https://stackoverflow.com/questions/3910054/makefile-conditional-include.

...

manic glacierBOT
#

I’m starting to look into this issues. @tannewt, I will appreciate if you can confirm I am heading in the right direction:

shared_module\Group.c has a function called displayio_group_get_refresh_areas that seeks out the refresh areas of Vectorio, TileGrid or Group display elements. Also there is a corresponding function displayio_group_finish_refresh that Is called after a refresh is completed, that also has entries for the same three display structures.

I suspect that a n...

tulip sleet
#

This opens up the idea of us merging from upstream from a defined release.

onyx hinge
#

Yay, and congratulations are sure to be in order

slender iron
tulip sleet
#

yes

#

i'll try to reproduce

slender iron
#

thanks

manic glacierBOT
#

I have no idea why sleep impacts it.

Group shouldn't need to change because Shape acts similar to Bitmap. TileGrid manages it's refresh area. You can see one TODO about it here: https://github.com/adafruit/circuitpython/blob/main/shared-module/displayio/TileGrid.c#L502

You'll also want to do something similar to this: https://github.com/adafruit/circuitpython/blob/main/shared-module/displayio/TileGrid.c#L533

#

Thanks for all comments. I wanted to make a module that can be used for other ports. My implementation was based on this: https://learn.adafruit.com/ttl-serial-camera/circuitpython-python-usage

Great! I hadn't seen that library so that is a great place to start.

About ImageSize, I wanted the user not to have to search and type correct and supported height and width by himself, but could use the predefined sizes. I thought that in the case of more devices supporting the camera, the...

#

I've made some additions to this port, including adding in support for F1/F0 style page-based filesystems, and fixing some issues with the clock and USB setup phases which also caused compilation errors. I'm now able to compile this for the STM32F103ZE, and I can confirm that it reaches main and at least activates TinyUSB. However, shortly after startup, I find that it crashes to the WWDG_IRQHandler, in a non-deterministic way (it happens in different places every reset cycle). I think th...

#

I think taking width and height as ints is best. We do it already for displays. Having an enum will make completion easier. However, I worry that we'd end up always having to expand the list of supported resolutions which cost code size for each variable name.

I agree. Either the resolutions supported could be documented elsewhere, or the camera API could return an optional list of resolutions. It may even be the case that some camera impls don't require fixed dimensions, so there is no l...

olive lava
#

@pastel panther Bryan, thank you for posting your code for Adafruit_CircuitPython_ADXL34x and
Adafruit_CircuitPython_MPU6050 very very helpful!
@pastel panther ADXL34x tap, motion and freefall are solid examples. wondering if this could possibly be considered for the MPU6050 also, to be added

manic glacierBOT
low monolith
#

Any news on the development of interrupts support for the CircuitPython? 8-)

tulip sleet
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@FoamyGuy and @tannewt I replicated your observation about the screen drawing related to time.sleep on an NRF52840 Itsy Bitsy.

Here is one hypothesis on why sometimes the drawing updates. In your example code, perhaps the Shape boundary gets updated to the 80 size before the screen refresh timing hits. So, even though there is no dirty rectangle tracking, if the display refresh cycle hits after the screen was drawn at 30 and then at 80, then it will only show the 80 size.

I fidd...

low monolith
#

@tulip sleet Thanks. I’ll have a look. I am looking for anything that could work πŸ™‚

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Could this be related to falling off the end of the stack? I've got two functions in CircuitPython with huge arg lists so perhaps I'm using a lot and then it goes off into the CircuitPython C code plus whatever the nordic library code gets up to.

Is there a way in a CircuitPython to check the MP_MAX_STACK_USAGE_SENTINEL_BYTE are intact?

Does the 52840 have a basic MMU?

manic glacierBOT
#

CircuitPython checks for stack overflow in Python code, and there's 1k of extra stack space to handle exceptions, etc. The Nordic SoftDevice uses pre-allocated RAM in general instead of allocating things on the stack. Usually a stack overflow causes some other terrible problem. I think it's more likely this is just a bug somewhere.

There is some simple memory protection, but given that the writeable heap and stack are adjacent, we'd have to insert a guard region and would lose that RAM.

#
manic glacierBOT
#

The comments like

consumes up to 2K more on the stack when any deep interrupts fire.

started me pondering this but 24k sounds like a lot to chew through.

BTW, perhaps this is not a fair test but I ran this with 6 args on a CLUE with 5.3.1 and got RuntimeError: maximum recursion depth exceeded which is the sort of thing I was expecting. I doubled it up to 12 and got 50 prints per function and a trip to safe mode.

>>> def stack_test_longer_arg(a, b, c, d, e, f,  g, h, i, j,...
onyx hinge
#

huzzah! I just got a CAN packet out of my SAM E54 !

#

at least I think that's what Logic is telling me -- the dot/Γ— should stay fixed with respect to the signal edges

teal bear
#

\o/

onyx hinge
#

@pastel panther I'm ready to chat when you are

pastel panther
#

@onyx hinge yup, lemme just do a quick audio check

#

@onyx hinge not sure what's up, I just did an audio check in discord itself and it was fine

#

Β―_(ツ)_/Β―

onyx hinge
#

odd

pastel panther
#

@onyx hinge can we use whereby?

onyx hinge
#

sure, we'll just make sure to mention any "results" of the meeting in here to keep the community in the loop

pastel panther
#

@onyx hinge can you do a quick check and make sure I have voice permissions in Amelia

onyx hinge
#

we used amelia last time didn't we? I'll see what I can figure out..

pastel panther
#

true... my phone was fine 🀷

#

@onyx hinge nm, I can look into it later; whereby in one sec..

onyx hinge
#

I am pretty sure you are supposed to be able to connect & speak, you may not have video permission though

#

but you had video last time so 🀷

#
//|     def __init__(self, id: int, data: Optional[bytes] = None, *, size: Optional[int] = None, rtr: bool = False):
//|         """Construct a Message to send on a CAN bus
//|
//|         :param int id: The numeric ID of the message
//|         :param bytes data: The content of the message
//|         :param int size: The amount of data requested, for an rtr
//|         :param bool rtr: True if the message represents an rtr (Remote Transmission Request)
//|
//|         In CAN, messages can have a size from 0 to 8 bytes.
//|
//|         For a non-rtr message, specify `data`.  For an rtr-message, specify either `data` (a dummy buffer of the requested size) or `size`.
//|         """
onyx hinge
#

We didn't really have any big revisions to the draft API. Action items: @pastel panther will start sketching out adafruit_can, which will contain the non-Core implementations of Message, Match, and other ancillary objects; and work on the receive implementation on the MCP canbus chip. I'm going to add the missing "extended address" flag to my implementation of Message, and continue working on the sending end on the SAM E microcontroller. We'll probably have our next conversation after 9/9 CircuitPython day. And hopefully iron out the tech issues that stopped us from meeting on the Amelia voice channel.

#

assuming it's technically possible it would also be nice if adafruit_can had a specification of the CAN low level API (_canio.CAN) as an interface or whatever they're called in Python typing terms... I think it's possible.

#

the goal would be for that to be the general reference for everything CAN except the specifics of the constructor of a particular HW interface

manic glacierBOT
#

I do like send_report() since it is sending a stream of reports, not setting a value over and over. I don't think .report = next report is the right thing to do.

Then .report is a read-only property. But to distinguish the incoming (OUT) report from the outgoing (IN) report, I am suggesting calling it received_report. (The "OUT" vs "IN" designations are very confusing to the layperson, since they reflect the host's view.)

manic glacierBOT
pastel panther
#

Thanks for summarizing @onyx hinge

manic glacierBOT
manic glacierBOT
#

In common_hal_busio_spi_never_reset() and common_hal_busio_spi_deinit() no check was being made to see if the values of self->MOSI_pin_number and self->MISO_pin_number were valid. Since, if those pins were unused they have a value of NO_PIN(0xff), the result was that values in memory past the never_reset_pins array were getting stepped on. In particular, the nrf_nvic_state.__cr_flag was being set to a non-zero value, which kept the ble IRQ from being enabled. This fix adds tests for NO_PIN be...

#

Excellent catch. I'm only not reviewing as "approved" so that we can talk about whether the check for 'no pin' could be moved down into the lower level routine (so that it's part of the API that it may be called with NO_PIN). This would mean that just 1 check would have to be added instead of 4, not to mention other sites that might be affected (unidirectional UART for instance) would automatically become fixed.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I tested this on a CLUE and PyPortal using the code from the issue. This version does fix the problem on both devices with that code as it's written.

I noticed on the CLUE I could get back to non-refreshing state still by using lower values for the time.sleep(). I do think there is still something else going on there somehere.

The PyPortal seemed to handle it fine even at faster speeds that didn't work on the CLUE.

This is great extra functionality to be able to resize the Shape ...

modest dagger
#

Hello, I am trying to build a custom c module and having a little trouble figuring out where to reference the module. I am following the guide linked below. I pulled down the 4.0 src to try and match up with the guide better but it still does not match. Specifically, the mpconfigport.h file. Wanted to see if anyone has any pointers on resources. Thanks

EDIT: Looks like I need to go further back for the guide to be relevant. Any info on doing this for newer versions is much appreciated.

manic glacierBOT
#

Looking at that possibility, I see that reset_pin_number() in common-hal/microcontroller/Pin.c already checks for NO_PIN, so we would only need to add that check to never_reset_pin_number(). If you think that is a better way to deal with the issue let me know and I'll make the necessary changes.

That looks like a good idea, but I'd also check to see if should be done on all the other ports.

thorny jay
#

I have a mysterious behaviour that I can reproduce, but not really know how to troubleshoot for the moment. My code works fine with the USB connected to a computer, but it quickly fail when connected to a powerbank or charger. I removed all the print but it does not change anything. My code seems to freeze in less than a minute when not connected to a PC. And that with or without opening Mu. (This ressemble to one of the current issue where CLUE does not behave the same.) But here my hardware is a Feather nRF52 Sense. It does: (1) Connect in UART over BT (2) measure pressure with I2C (3) change LED color (4) control the BT hardware. Similar code without the BT did work well in both case. Right now it seems to be related to BT and to negotiation of the CDC/mass storage with the PC. I would be interested in any known issue on alpha3 or any possible side effect of beeing connected to a PC.

#

I can try with nightly build to see if it is better now, or if it was better before.

#

I can try to simplify the code and make it reproducable without additional hardware.

#

But right now, I don't really know where to start to troubleshoot this issue... because it occurs when I don't have access to the console to troubleshoot it. And of course it does not occurs when I have the console.

#

How would you debug such a thing?

solar whale
#

In my case, the code actually runs, but there is just no display.

#

Sorry == now I see it is a Bluefruit sense. Not sure if it is related. Still, may be worth trying the earlier CP version just to check.

#

I found that it was OK at 6.0.0-alpha.2 so you might try that.

#

I read (or tried to read) your post before my coffee πŸ˜‰ -- It does look like you were aware of the previous issue and this is different but perhaps not unrelated....

#

AS far as debugging can you blink the D13 LED as an indicator of where in the code you are.?

manic glacierBOT
manic glacierBOT
thorny jay
#

I read (or tried to read) your post before my coffee πŸ˜‰ -- It does look like you were aware of the previous issue and this is different but perhaps not unrelated....
@solar whale I reverted to 5.3.1 and it seems to work for me. It is not clear yet what the problem is... alpha2 did not work for me. There is a little bit of math so some stuff could go wrong such as float to int conversion, or divided by zero, so I could make things more robust, without any guarantee that the problem is in my code.

manic glacierBOT
manic glacierBOT
thorny jay
#

I believe there are issues with BLE in 6.0.0 and right now for two problems I encountered, I have things working with 5.3.1. One problem has been explained here 12H ago (something that stop working after less than a minute when not connected to a computer). And the other one has been discussed with @crimson ferry on #help-with-circuitpython just right now (ble.start_scan not exiting). I am reusing old code that I guess was developped in 5.x time, so it seems normal to work on 5.3.1. Maybe it need some adaptation for 6.0.0 ...

#

Maybe I need to rewrite from scratch based on simple_test demo code, just to make sure I am using the right/current pattern.

crimson ferry
#

This is weird, and I can't explain it...```import board
import busio
import digitalio
import adafruit_fram

this doesn't work

i2c = board.I2C

this works

i2c = busio.I2C(board.SCL, board.SDA)

wp = digitalio.DigitalInOut(board.D6)
fram = adafruit_fram.FRAM_I2C(i2c, wp_pin=wp)```

#
Traceback (most recent call last):
  File "code.py", line 14, in <module>
  File "adafruit_fram.py", line 225, in __init__
  File "adafruit_bus_device/i2c_device.py", line 68, in __init__
  File "adafruit_bus_device/i2c_device.py", line 170, in __probe_for_device
AttributeError: 'function' object has no attribute 'try_lock'```
#

Adafruit CircuitPython 6.0.0-alpha.3 on 2020-08-28; Adafruit Feather M4 Express with samd51j19

#

adafruit-circuitpython-bundle-6.x-mpy-20200904

onyx hinge
#

You have to write: board.I2C() -- it is a function which returns the common I2C bus object. It is not an I2C bus itself.

crimson ferry
#

oh, duh

#

thanks

onyx hinge
#

this is somewhat of a technical limitation, the value of every item in a built in module has to be fixed at build time

crimson ferry
#

i've done it a million times, but not this time

onyx hinge
#

hehe ok I'll stop explaining it then

lone sandalBOT
onyx hinge
#

I wonder how atrophied the ability to build without softdevice support is. that would get 56 or 64kB extra heap available, right?

onyx hinge
#

ooh it's slim enough to fit now. I haven't tested much of the functionality yet, or if it'll fit with sharp memory display framebuffer and the rest of my calculator program. ```Adafruit CircuitPython 6.0.0-alpha.3-92-g121975f8e-dirty on 2020-09-06; Particle Xenon with nRF52840

import udecimal
udecimal.Decimal("3.14159") * 2
Decimal('6.28318')

#
Decimal('0.3333333333333333333333333333')
manic glacierBOT
#

Hi I used Adafruit STM32F405 Feather Express board.

When I read continually range from the VL53L0X sensor, then after while this error occurs:

Traceback (most recent call last):
File "code.py", line 54, in
File "/lib/adafruit_vl53l0x.py", line 600, in getRange
File "/lib/adafruit_vl53l0x.py", line 324, in _read_u8
File "/lib/adafruit_vl53l0x.py", line 323, in _read_u8
File "adafruit_bus_device/i2c_device.py", line 102, in write
OSError: [Errno 5] Input/output error

C...

onyx hinge
#
>>> udecimal.Decimal("1") / 3
Decimal('0.3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333')
#
Decimal('2.302585092994045684017991455')
>>> Decimal(10).exp()
Decimal('22026.46579480671651695790065')
#

wow most of this even works properly πŸ™‚

manic glacierBOT
manic glacierBOT
#

@tannewt I’m interested in working on this one.

There should be a way of tapping into the display redrawing code and the display elements get_pixel routines you determine which is opaque and take advantage of any x,y and mirror, rotation transform code that is already there. If you suggest an approach I will try to figure out how to make it work.

As for operation of this child_at(x,y) function, how should it deal with a child element that is a Group?

  1. If the child Group is at...
onyx hinge
#

in addition to udecimal, I've also written trig functions atop it, based on the routines used in the unix bc calculator. https://gist.github.com/jepler/d6fd1133d926347192a1ff22d3995f0f -- the results agree with bc, except for rounding (bc rounds to zero, udecimal rounds to nearest) ```$ python3 -c 'from utrig import *; f="11.373"; print(atan(f), cos(f), sin(f), sep="\n")'
1.483094330462666230579325971
0.3685285931944669592773918397
-0.9296164133652692134932163577

Gist

GitHub Gist: instantly share code, notes, and snippets.

#

only 1.5kB of mpy file, too

#

<@&356864093652516868> Just a reminder: the meeting is NOT happening tomorrow, it's moved to Wednesday at the same hour. Come celebrate CircuitPython Day with us on Wednesday 9/9!

cobalt grail
#

Found this string from shared-bindings/_bleio/Adapter.c in weblate - Cannot create a new Adapter; use _bleio.adapter;.
Why the use of semi colon here?

#

Weblate complained when I added a translation without it.

tulip sleet
#

@cobalt grail the trailing semicolon is a typo. The middle semicolon was just typical English punctuation

#

i can change either or both. I'm surprised weblat requires it

cobalt grail
#

It complains if I don't match the trailing semicolon. πŸ™‚

stuck elbow
#

it preserves punctuation of the original, I think

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

24806

Roles

34

tulip sleet
#

@cobalt grail I'll fix it in some future PR, and remove the semicolon you had to add too :). Not worth doing a whole PR for a one character change right now πŸ™‚

manic glacierBOT
#

Hi, I am sorry but do not want to read all comments on this issue. I study and work on real-time systems. Circuit python is for microcontrollers. They are not PCs - real PC-multitasking on a single CPU is not needed at all.

Everything that CircuitPython programmer needs is scheduler :) If three tasks (A, B, C) with two sections (example: AA) runs this way:
ABACBC or BBAACC is the same. If you need cooperation between tasks, you can use shared variables, queues, etc. and split tasks into...

manic glacierBOT
#

@deshipu Async&await is for PCs or Mobile phones when you do not need information on how asynchronous functions are executed in the background and only required is the result and smooth GUI response. A small delay or more significant overhead is easily overlooked and usually does not bother anyone. ...and!.. usually good async scheduler needs another thread or some level of cooperative multitasking. When the async&await mechanism is implemented using some sort of synchronous polling it is not...

teal bear
#

Where is cpx build docs?

#

I have done it before, so somehow I figured it out, but I'd like to point others to something

lone axle
#

do you mean building Circuit Python for the CPX?

manic glacierBOT
teal bear
lone axle
teal bear
#

yes that. thanks.

manic glacierBOT
#

Hi, I am sorry but do not want to read all comments on this issue.

Hi @eLEcTRiCZiTy, this issue has moved well past the theoretical and into practical territory. Please feel free to avail yourself of the concrete code listings in this issue and both the Circuitpython and upstream Micropython projects if you'd like to share insights from a position of context and understanding.

manic glacierBOT
#

In any case, async/await is the Pythonic way to talk about cooperative multitasking. Its overhead is implementation dependent and could be anything, including zero.
How to actually schedule these tasks when you need soft realtime (hint: you often don't) is an orthogonal problem. Same for the tasks' side effects, same for the method(s) to wake up a task that's waiting for an external event (= interrupt).

Please don't conflate these issues.

manic glacierBOT
manic glacierBOT
pine plover
#

Does circutpython work with spi on the esp32 s2 now?

manic glacierBOT
manic glacierBOT
#

Does this mean that the allocations are guaranteed 16-byte aligned, though? Supervisor allocations are in 4 byte increments, and the base address of the heap is created via supervisor allocation.

I see what you mean. @kamtom480, is 4-byte alignment is good enough? If not, I think it might be good to guarantee BYTES_PER_BLOCK alignment for the heap, for reasons like this.

supple gale
pine plover
#

Cool thanks :)

onyx hinge
#

huh. During a long debug-pause, information about the related USB device in /sys becomes unreadable. attempting to retrieve it hangs, but can be recovered with ctrl-c.
I wonder if it's related to the crashes I encounter during debugging on my desktop. root@raspberrypi:/sys/devices/platform/soc/20980000.usb/usb1/1-1/1-1.1# cat manufacturer

#

during that time, another USB device plugged into the same hub can't finish enumerating either

solar whale
#

Now that you are mentioning it, I do recall a warning from Scott to unplug the USB when debugging on my Metro M4. Easy to do there since it has an alternate power source. ...

manic glacierBOT
#

Hello! Long time listener, first time caller.

I'm looking to add support to CircuitPython for the NFC tag functionality of the nRF52 devices. I've been using the functionality for a short while now in a personal project so I feel like I've got a fairly good understanding of how to bring it over to CP, at least in the sense of type 2 tags. Before I started, I wanted to flesh out a few details and ask some questions so that I can contribute in the best way possible.

Before I get to my qu...

onyx hinge
#

Yup, this is my workaround for unplugging the device under debugging

solar whale
#

I do have to ask -- why do you have a monitor (hdmi) plugged in to it?

stuck elbow
#

so it seems that the latest firmware update on my laptop fixed the crashing on disconnecting circuitpython devices

solar whale
#

Nice! There is hope....

tulip sleet
#

!!

stuck elbow
#

I mean, it was random, and it hasn't happened since, but you never know...

solar whale
#

I have been brave enough to try a few cycles in that past week, and survived ... what did you update - was it a new kernel or something specific to the laptop?

stuck elbow
#

system firmware and thunderbolt controller

onyx hinge
#

@solar whale just for the bring-up, I don't expect to continue needing it

solar whale
#

Thanks - just curious -- I did not see a keyboard connected, so i was trying to figure out how it came into play...

#

I happen to have a Zero-4u mounted on a pi zero (non w) with a WiFi dongle. I may see if I can get it working on that.

onyx hinge
#

I'll be interested to know how that goes -- on the 0W the onboard wifi is connected via an SDIO bus and survives USB getting confused, which is a plus

#

it let me actually inspect the state of the system at that time

solar whale
#

hmmm -- good point ... I have both w and non-W's available to compare ... the potential project list just keeps on growing...

#

What does tio add rather than using using screen?

#

oo-- I see -- it reconnects --- cool!

idle wharf
#

Anyone successful flashing their ESP32-S2 Kaluga from macOS? I see /dev/tty.usbserial-1413300 and /dev/tty.usbserial-1413301 are present but when I use the PORT on the make command along with flash it cannot connect to either device. I've also tried the holding boot and reset, release reset sequence. I feel like I'm missing a step...

#

example of my make command: make BOARD=espressif_kaluga_1 PORT=/dev/tty.usbserial-141330 flash

onyx hinge
#

interesting, cube roots are not exact in Decimal: ```>>> Decimal("1e3") ** (Decimal("1")/Decimal("3"))
Decimal('9.999999999999999999999999998')

#

but I guess 1/3 isn't exact either

#

Decimal("1e4") ** 1/Decimal("4") is exact

idle wharf
#

No issue with CP or my Kaluga. Bad cable. Cable now in trash...

manic glacierBOT
manic glacierBOT
onyx hinge
#
7205759403792796.0
>>> round(_)
7205759403792794
``` well that's a bit odd
#

(circuitpython unix port)

#
7205759403792794.0
>>> round(_)
7205759403792794
``` the error arises in the display of the FP value, not the rounded value (the second paste is from standard python3)
manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

Does anyone remember that some samd processors were hanging when trying to retrieve the microcontroller temperature? I've encountered that on the sam e54 xplained board this weekend.

manic glacierBOT
onyx hinge
#

@slender iron if you're streaming the meeting tomorrow, does that mean you'll also take the timecodes?

tulip sleet
onyx hinge
#

ouch, okay

tulip sleet
#

But I did get it to work, albeit with less accuracy than I might have liked.

#

It might be that inserting a delay like i did with voltage would help

onyx hinge
#

on my sam e54 (sample of 1), it hangs in tip of main

tulip sleet
#

does .voltage hang?

manic glacierBOT
onyx hinge
#

I should make double sure whether it was temperature or voltage. what actually hung was tab-completing microcontroller.cpu and I looked at it for a second in the debugger and then moved on

tulip sleet
#

well, the fix is already in main, so it -should- be ok. I insert a 1msec delay after setting the voltage reference for .voltage. You could try someting similar for temperature.

#

this was really tricky: I had two SAMD51 boards with seemingly identical chips (same revision) except for the date code: one hung up and one didn't

onyx hinge
#
>>> import microcontroller
>>> microcontroller.cpu.temperature
29.9796
>>> microcontroller.cpu.voltage
[hangs]```
tulip sleet
#

ugh; maybe try lengthening the delay

#

Line 298 in Processor.c

#

if you lengthen it, fine to have it be longer for both SAMD51 and SAME54, since they're almost certainly the same chip internally

onyx hinge
#

100ms delay didn't fix it

tulip sleet
#

it may be a newer rev of the chip that has just broken it completely

#

the muxing of the TEMP sensors is a mess internally

onyx hinge
#

2000ms + stopping in the debugger did

tulip sleet
#

you could try some delays before/after the SUPC bit settings, but that's just guessing. Or try adding a delay between the double calls to adc_sync_read_channel(), though it's probably hanging on the first call.

onyx hinge
#

well now I'm getting more puzzled. I put a delay of 1000 ms in the source, it reads the voltage back just fine, but .. there's nothing like a 1s pause

tulip sleet
#

but i wouldn't spend a lot of time on this. I think if you return NaN or something like that, shared-bindings will raise NotImplementedError

onyx hinge
#

i.e., it returns immediately. Shouldn't mp_hal_delay_ms(1000); be 1 second and very noticible by a human like me?

tulip sleet
#

uh, yes πŸ™‚ . So maybe something broke recently in the tick stuff??

onyx hinge
#

OK, failure to load the new firmware

tulip sleet
#

so i bet the 1ms fix is fine, and there's something else wrong. if you call time.sleep() does it sleep? Does that use mp_hal_delay_ms ?

#

or maybe never mind πŸ™‚

onyx hinge
#

gdb with openocd is just a little bit different than gdb with jlink,and my fingers do the wrong things when I'm not watching them

#

also confusing things: if I decrease the delay it works ... until I read temperature (disturbing the mux?) and then read voltage again

#
3.32308
33.1896
[hangs]```
tulip sleet
#

right, I think the temp code changes the reference voltage setting. If you just repeat, the reference is already set, and doesn't need time to settle or change

#

the delay was just an empirical fix: there's nothing in the datasheet that says you have to delay. There is no READY bit to check, unfortunately

#

i bought one of these boards too, so I could try this too, and you could go back to CAN. I just have to find it; it's somewhere within 5 feet of me but I'm not sure where.

onyx hinge
#

I could also file an issue and move on

tulip sleet
#

i agree

manic glacierBOT
#

Except possibly with very long delays, microcontroller.cpu.voltage hangs on the SAM E54 Xplained board. Sometimes it will read after previously hanging and then being reset, but this testing procedure would reliably hang for me:

>>> import microcontroller; microcontroller.cpu.voltage; microcontroller.cpu.temperature; microcontroller.cpu.voltage; microcontroller.cpu.temperature; 
3.32308
33.1896
[hangs]

Tested with a local branch somewhere a few commits after alpha.3, but t...

#

We could simply disable it, as this patch would do:

From: Jeff Epler <jepler@gmail.com>
Date: Tue, 8 Sep 2020 09:10:31 -0500
Subject: [PATCH] Straw proposal: disable microcontroller.cpu.voltage on all
 SAM E54

---
 ports/atmel-samd/common-hal/microcontroller/Processor.c | 8 +++++++-
 ports/atmel-samd/mpconfigport.h                         | 7 +++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff -...
tulip sleet
#

@onyx hinge I found my board. btw, how come you are using openocd instead of just the swd connector on board with a J-Link? is the EDBG connector openocd?

onyx hinge
#

"debug usb" is "Atmel Corp. Xplained Pro board debugger and programmer"

#

so I've been using openocd with a commandline like: /home/jepler/.local/openocd/bin/openocd -f /home/jepler/.local/openocd/share/openocd/scripts/board/microchip_same54_xplained_pro.cfg -c "gdb_port 2331"