#circuitpython-dev

1 messages ยท Page 292 of 1

tulip sleet
indigo wedge
tulip sleet
#

is when it was changed, in December. What I would say is that there are often PR's that go across the whole codebase, and you just have to read them to be aware. The ports are not isolated, but are embedded in a changing world

ionic elk
#

Yeah it's especially tricky in cases like that because that's not even an STM32 issue - if I were skimming it, I'd look like a core issue to me.

#

Totally get you on the not isolated front, which is why I'm just wondering if there's some kind of tool I can dig up to help me out. Something that spots commits within a directory range that aren't mine... if it isn't there, maybe I'll make one.

tulip sleet
#

in this case, there was a change in the STM32 tick.c, so you want to look in your tree of interest

ionic elk
#

Right, exactly

#

What I need to find/make is a tool that highlights commits that change any file in my tree of interest that aren't submitted by me

#

So I can be sure to check them out. ๐Ÿค”

tulip sleet
#

i would google for some tool for that kind of thing, I'm sure you're not the first person with this issue

main meteor
#

Just a wrapper around git status -s might be sufficient

fallen anvil
#

@indigo wedge then when you get to it would be appreciated. Ive just bodged a esp32 board onto mine but it would be much nicer to have something that will be reliable without all the Dupont flywires.

indigo wedge
#

yes i'm gonna try to run the esp32spi code on mine for the first time now

#

had some problems with the uart couldn't flash the esp

#

so bypassed the imx for now and flashed with external uart, will fix it later, want to verify that the spi works ๐Ÿ™‚

ionic elk
fallen anvil
#

@indigo wedge it does now ๐Ÿ˜ tbh I don't think there many changes on 1011, they mostly applied to 1020 (indeed, there are similar i2c ones for 1020 to be submitted shortly). I have the NINA demo running perfectly here.....it's very impressive.

#

(it all becomes a blur after a while)

indigo wedge
#

You're running on 1021, right?

bright aspen
#

I want to eventually be helpful and contribute to CircuitPython, but my immediate project will likely drop down to C on SAMD/E. I can use the Microchip tools and libraries, but if something else will make it easier to move into doing CircuitPython things, I want to consider that. Advice on C tools for SAMD/E boards?

stuck elbow
#

@bright aspen tinyUSB

indigo wedge
#

oh no ๐Ÿ˜ข

Adafruit CircuitPython 5.0.0-rc.0 on 2020-02-26; Feather MIMXRT1011 with IMXRT1011DAE5A                  
>>> from adafruit_esp32spi import adafruit_esp32spi                                                      
Traceback (most recent call last):                                                                       
  File "<stdin>", line 1, in <module>                                                                    
MemoryError: memory allocation failed, allocating 1024 bytes                                             
>>>                                                         
fallen anvil
#

Oh dear.

#

I have pretty much the same setup on 1021 here so if you want any measurements doing let me know...don't know the platform well enough to do them proactively, sorry!

indigo wedge
#

I'm also a bit unfamiliar with the CPY memory management, unsure if this is on the heap or on the stack, ofc it's dynamic allocation so it should be heap unsure ๐Ÿ˜…

#

@slender iron with only 128KB ram total on the rt1011 are we sure we want to keep the current memory map? because this way we can only have max 30K of stack and ~50K of heap

#

@slender iron if we configured the flexram to be one bank of 120KB we would lose the speed improvements but gain more flexibility of dividing the RAM as we wish

timber mango
#

I really need to get a BMP280 breakout board. Many of the Adafruit examples use it and I like to use the exact stuff used in tutorials.

indigo wedge
#

@slender iron right now only 7K of ITCM is used so we just have 25K of RAM sitting there unused

fallen anvil
#

I'm not convinced itcm is worth too much given that you've got cache...seems a reasonable compromise to me to lose it.

#

Give it a whiz...it's only a linker file change.

indigo wedge
#

also flexram register value change and MPU bank change ๐Ÿ˜…

slender iron
fallen anvil
#

Didn't realise the mpu was in use....that's good to hear.

slender iron
#

@indigo wedge @fallen anvil my goal is to be fast but not necessarily support large programs. the speed is what differentiates the imx chips

#

large programs will come with the larger chips

indigo wedge
#

but is trying to run the esp32spi considered large?

#

what good is speed if you can't run a basic script ๐Ÿ˜„

slender iron
#

yes, that's why we only recommend using the m4

#

it's not basic if it imports huge libraries

fallen anvil
#

I honestly don't think you'll lose much speed without the itcm though....and a negative program size isn't too usefu :-/

indigo wedge
#

or any reasonable display cause not enough ram for the FB

slender iron
#

go ahead and do other testing

#

it's all alpha

#

remember that the cost to get anything from the spi flash is significant

#

the cache should only be used to store stuff we don't know up front that we're using

fallen anvil
#

Yes, but once it's cached it's single cycle.

indigo wedge
#

guess this would make my 1011 feather unviable as a product :<

slender iron
#

tcm is also single cycle

#

I don't think that is true

#

it's about speed, not size

#

it can never match the 192k of a samd51 anyway

indigo wedge
#

but the main selling point is the esp on my feather, if i have to remove that then it's the same as the Adafruit one

fallen anvil
#

The 1011 has always been about the cheap option. Can you post your map file?

indigo wedge
#

i moved the bss from ocram to dtcm and now i heave more heap but still not enough

slender iron
#

esp32spi is large and gets even larger once you make requests

indigo wedge
#

too bad the rt1021 is physically too large to fit on a feather ๐Ÿ˜„

fallen anvil
#

Could try flattening everything into ocram and see what the use map looks like

#

There's a 100 pin version....still too big?

indigo wedge
#

yeah 14x14 mm

slender iron
#

ocram is 1/4th the speed of TCM but still better than hitting spi flash

fallen anvil
#

Yeah, it was more an investigative step to figure out where everything is being allocated.

indigo wedge
#

ouch 1021 is over 2x the price of 1011 and you gain pretty much just the 2x ram

#
  • 20 pins
slender iron
#

@indigo wedge for your board I'd recommend looking into freezing in esp32spi. then you can either rely on the cache or place it in dtcm

indigo wedge
#

worth a try

ionic elk
#

@slender iron that's a simple solution, thanks! I'll just add that to what I check every morning

indigo wedge
#

what's the memory gain from freezing?

slender iron
#

you can run python code from outside the heap

#

it's always in flash

indigo wedge
#

ah right

#

let me try ๐Ÿ™‚

#

never played around with freezing

slender iron
#

totally ok to do since you assume people will need it for your feather

indigo wedge
#

yep yep

#

and we have flash o'plenty

slender iron
#

harder to update but helps your heap problem

#

yes, but the cache is not very big

indigo wedge
#

heh so we gain the mhz but then waste them on this

fallen anvil
#

crazy

slender iron
#

ya, that's the challenge

#

ideally when running a simple python script you don't have to read flash at all

#

which is why the vm loop is in itcm

fallen anvil
#

They whacked the data cache down to 8K on the 1010 :-( DTCM is definately your friend!

#

Trying to find the cache access timing information...I used to know this stuff. IIRC its single cycle execution if the instruction/data are in cache, access cycles+1 if not....but I could easily be wrong.

bright aspen
#

@stuck elbow Thanks for the tip for the tinyUSB device stack. The description mentions its use in CircuitPython. It also mentions GCC and Segger Embedded Studio. Do you recommend those?

tulip sleet
#

we don't use Segger Embedded Studio, just gcc and gdb (on Linux or Mac)

indigo wedge
#

woop, that worked ๐Ÿ™‚ @slender iron

indigo wedge
#

Awesome

fallen anvil
#

Hey, congrats!

#

Can you hook a debugger to that board? Are SWD/SWCLK and, importantly, SWO, available? If so we can look at the performance and see what it's spending its time actually doing...

slender iron
#

great @indigo wedge !

indigo wedge
#

yes i have swdio and swclk pads on the back

#

no swo

fallen anvil
#

Hm..its the SWO we need. Any chance of being able to get to it? Seems to be on GPIO_AD_09 or GPIO_AD_01 on your board...

orchid basinBOT
simple pulsar
#

@slender iron For the discussion about running a simple python script and not reading flash, wouldn't things like strings be stored in flash and therefore read from there?

slender iron
#

strings in code? or where?

simple pulsar
#

wouldn't print('hello') caused a read of hello from flash?

slender iron
#

no because string 'hello' is loaded into the heap when the code is parsed

simple pulsar
#

So there's no PROGMEM type ability for constants/immutables to be left in flash to reduce memory usage?

slender iron
#

nope

simple pulsar
#

Did that ever get discussed for micropython?

slender iron
#

not that I know of

#

you can always put a separate file on the disk and load it from circuitpython

simple pulsar
#

Is it trickier to implement leaving variables in flash in CircuitPython because a user can delete the code.py/etc ?

slender iron
#

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

#

it's just the way it works now

fallen anvil
#

Just to give you some idea, here's where the code is spending it's time right now, while idle;

 68.88%    57222 tud_ready
 15.03%    12487 run_code_py
  3.73%     3105 tud_cdc_n_connected
  2.43%     2020 tud_suspended
  2.42%     2012 tud_mounted
  1.27%     1056 dcd_isr
  1.04%      871 dcd_event_handler
  0.97%      809 Unknown
  0.75%      626 USB_OTG1_IRQHandler
  0.47%      391 SCB_CleanInvalidateDCache_by_Addr
  0.37%      315 tu_bit_test
  0.23%      198 $t
  0.21%      182 serial_connected
  0.18%      152 supervisor_tick
  0.16%      135 tud_cdc_n_write_flush
  0.15%      127 common_hal_mcu_enable_interrupts
  0.14%      118 __DMB
  0.13%      115 assert_heap_ok
  0.11%       96 common_hal_mcu_disable_interrupts
  0.11%       93 tud_cdc_connected
  0.10%       87 displayio_background
-----------------
 98.88%    82217 of 83067 Samples

 Ex |   Count  |  MaxD | TotalTicks  |  AveTicks  |  minTicks  |  maxTicks 
----+----------+-------+-------------+------------+------------+------------
 15 |     1021 |     1 |    2288874  |       2241 |      1990  |      3462
129 |     8166 |     1 |   13268867  |       1624 |      1090  |      2177

More on this tomorrow, I'm off to bed.

manic glacierBOT
timber mango
#

I missed most of Ask an Engineer because my Raspberry Pi 4 rebooted itself four times. ๐Ÿ˜ฆ

#

Will Adafruit ever make an audio/voice input/recognition Featherwing? It could use I2S for better sound input quality. ๐Ÿ™‚ ๐Ÿ™‚

#

It could do high quality audio output also. ๐Ÿ™‚

tiny oriole
#

I2S output i believe is existing.

#

input is.... seemingly not

timber mango
#

Maybe not yet but somebody could create it. ๐Ÿ™‚

tiny oriole
#

I started to try to work on supporting an SPH0645

#

got WAY lost in the math x.x

lone axle
#

Edge Badge has a microphone on board and can work with tensorflow lite to do some voice recognition.

#

and it has feather headers on the back, but I dont think it's a featherwing

main meteor
#

You could use a Mikrobus adapter and an EasyVR board

onyx hinge
#

the edge badge's mic doesn't currently work in circuitpython, also needs core driver code added.

manic glacierBOT
#

@tannewt sure ok! Mind you, it looks like some of the translated sentences with English and Arabic content written together don't retain the right order of wording for some reaon. I think I will need to figure out a solution for that as well. I am stocked that we took a nice big leap in the right direction though, so yay!!

Big thanks to @joeycastillo for helping us figure this out.

tulip sleet
#

ALL: CircuitPython 5.0.0-rc.0 is available at https://circuitpython.org/downloads. But if you see some missing downloads, let us know; the build process on github had a number of random failures. I believe all the downloads are there now, but there could be a few missing.

orchid basinBOT
timber mango
#

Hrmmm. I am communicating with my Bluefruit LE SPI Friend, but am not getting any of the responses the tutorial shows that I should get.

#

I have to be sure my module is working right before I jump into trying to use it with Circuitpython.

orchid basinBOT
timber mango
#

Do I have to cross MISO and MOSI?

exotic pumice
#

no

#

that's only for uart

timber mango
#

I know it is for UART, but thought SPI might work the same way. This is the first time I have connected an SPI device.

#

The Adafruit Connect App can not do an update to my module.

lone sandalBOT
tough flax
#

Quick question - I have a Particle Argon in stock - and I have an NRF52840 Express and an AirLift Wing... I have a one-off project that needs bluetooth and wifi. Is the Argon build stable? Is it easy to access the WiFi? Or should I give up the space and just use the two-board solution?

#

Thanks

indigo wedge
#

@meager fog "arturo168"? ๐Ÿ˜‚

solar whale
#

@tough flax I'd recommend a "two board" solution. The Argon build is fine for the nrf52840 support, but the WiFi is an different issue. The ESP32 can only be accessed via UART, not SPI so the ESP32SPI support is not available. There is an "AT command set" WiFi image that can be loaded into he ESP32 for some limited WiFI functionality but it won't be as functional as the "Airlifts". This guide explains how to do it -- see the Argon specific sections https://learn.adafruit.com/adding-a-wifi-co-processor-to-circuitpython-esp8266-esp32/overview Note: you also have to reprogram the Argon bootloader for Circuitpython -- J-Link required. ... using the AT Command module on the Argon will require code changes from your feather_nrf52840+airlift system and it will not work as reliably.

#

If you want to use the Argon, you might want to consider adding an "Airlift Featherwing" or breakout to the Argon and ignoring its on-board ESP32 (use it like a Xenon) In that way it should be much like the nrf52840 Feather express plus airlift. Kind of a waste of the on-board ESP32, but it will work much better.

#

@tough flax FYI - I have verified that you can use an "Air;ift Featherwing" with an Argon with the following pin settings ```esp32_cs = DigitalInOut(board.D8)
esp32_ready = DigitalInOut(board.D6)
esp32_reset = DigitalInOut(board.D7)

main meteor
#

@timber mango That's why they have those names: in an attempt to avoid confusing whose point of view a signal name refers to. MISO is "master in, slave out", from both the master's point of view, and the slave's. MOSI similarly is "master out, slave in". The idea is you can just connect MOSI signals together, MISO signals together, and SCLK (clock) signals (which are also master out) together. The SS ("slave select") leads go from I/O pins on the master, one to each slave.

solar whale
#

@timber mango what have you tried so far for the BLE SPI Friend? What part of the tutorial is not working? I have one of those here and can try to reproduce it. What happened when you tried to update the Firmware using the Adafruit Bluefruit Connect app?

timber mango
#

@solar whale So far, I have only been trying it out with Arduino stuff. I could not get any response with "ATI." In fact, the only response I could get from any command I tried is "AT >>," or something similar. It sure was not what the tutorial said I should be getting. When trying to update the firmware all I got was a loop of it trying to start the bootloader, connect, starting the update (and failing back to starting the bootloader). I do not even know if my Bluefruit LE SPI Friend is good. It sure is not acting right according to the tutorial. This (https://learn.adafruit.com/introducing-the-adafruit-bluefruit-spi-breakout/introduction) is the tutorial I was working with. I would like to know if you can get through that tutorial with your module. I have mine connected to a Feather M4 Express now. My phone could pair with my module, but the app could not connect to the sketch.

solar whale
#

ok - first -- to update the firmware all it has to do is be powered on, open the App and connect to it. It should then tell you there is an update to 0.8.1 -- I just did mine. Has nothing to do with bootloader

#

with no software running on the feather_m4, you should still be able to connect the App the SPI Friend and use the UART Mode to send and echo characters.

#

What pins are you using to connect the SPI Friend to the M4?

#

Are you using the IOS or Android App?

#

I have to go AFK for about 30 min -- be back later.

timber mango
#

After working a bit with Arduino, I am finding I do not really enjoy tinkering with it now. I have a lot of FUN working with Circuitpython and the whole "Adafruit Gang." ๐Ÿ˜ƒ ๐Ÿ˜Ž I would love to get deeper into testing Circuitpython stuff, although I am very hesitant to poke at the actual source code.

solar whale
#

back -- I'm setting up an M4_express with SPI Friend....

timber mango
#

@solar whale I realize the module only has to be connected to the app via Bluetooth to update the firmware. Oh, cool. ๐Ÿ™‚

solar whale
#

what pins are you using?

#

did you get the firmware update to work?

#

I am using CS - 10, IRQ = 11 ,RST = 12 and the ATCOMMAND sketch is up and running

#

I had to set the pins in Bluefruitconfig.h - just those 3

prime flower
#

@solar whale thanks for expeditiously testing the eth. alpha yesterday

#

I'll have a DNS client bundled/released for it by friday ๐Ÿ™‚

solar whale
#

@prime flower glad to help!

#

@timber mango the feather_m4_express and SPI Friend are working OK for me -- I'm switching mine back to CP but can easily go back to Arduino if you need me to try something.

manic glacierBOT
fallen anvil
#

@indigo wedge @tulip sleet Any chance of that getting in the RC? I think I2C on mimxrt isn't too usable without it, but OTOH pushing things late into a RC is asking for trouble, so I leave it to you guys to make the call!

#

...there's still a nasty in there which locks up the I2C, but it's only found under punishing circumstances and if I find it I'll let you know.

indigo wedge
#

I tested i2c with a temp sensor and that worked so if it still works with this fix (and in sure it works better with it) then i think it or make it into the rc

#

Imx port will be a tech preview in 5 so it's expected to fall apart at any moment ;)

fallen anvil
#

A lot of things would have worked at the old frequency (I2C is pretty forgiving) but not reliably.

#

With these patches over the past few days I'm comfortable, within limits, with UART, SPI and I2C now.

#

UART will fall over if RTS/CTS hangs it up for too long, but hopefully no-one will spot that.

indigo wedge
#

Yes it seems to be shaping up well, u still had some issue with uart when trying to flash the esp32 but haven't had time to look into it

fallen anvil
#

(github appears unwell at the moment)

prime flower
manic glacierBOT
manic glacierBOT
solar whale
#

can't do PR until GitHub gets over its issues... if you need the fix before then I can post it.

onyx hinge
#

@lapis hemlock one easy question, one tougher question. Would you like to be added to the circuitpythonistas role? This will allow you to receive notifications about upcoming meetings, etc., because those mention circuitpythonistas.

#

Tougher question: your module organization puts ones and zeros array constructing functions in linalg, where inv, det, and other matrix-only operations are. But while I think some builds might turn off matrix ops, I can't imagine turning off ones() and zeros(). Can we move them, either just to ulab or to a different module?

fallen anvil
#

Well, for some reason, once in a blue moon, we don't detect a STOP condition on the I2C. I can see it there, plain as day, but it seems the CPU can't. There is a guard against this in the NXP driver (I2C_RETRY_TIMES) but it looks like it's one of those define-before-building things. It should certainly be set (otherwise there's no guard against infinate waiting, in lots of places) but I have no idea what a sensible value to set it to is :-(

solar whale
#

@idle owl I tried to do a release for the BluefruitSPI library but it is failing -- can you take a look at it? I'mnot sure what to do about it -- I tried rerunning it but it failed again.

idle owl
#

Checking

solar whale
#

it appears to be there -- should I ignore the complaints...

idle owl
#

Ew. I think we haven't run into this since the initial push to PyPI. You need to delete the release, delete the tag, and then create a new release. Basically I think if it glitches at a certain point, it can't figure itself out after it creates the files.

#

I'm not sure I want to ignore it. If it's there, I guess we can?

solar whale
#

ok -- I'll delete and repeat

idle owl
#

If it fails again and it appears successful, ignore it.

#

GitHub is having issues, I know that much. But that's a PyPI issue.

solar whale
#

i forget -- how do I delete a release?

idle owl
#

Oh right, it's a bit annoying.

#

You have to edit the release, delete all the assets, save it, then you can delete it.

#

Won't delete if it has assets.

#

I can do it

#

if you'd like

solar whale
#

If you don't mind -- I deleted some assets but it may be better for you to take over

idle owl
#

No worries.

#

I've done it too many times ๐Ÿ˜„

#

Alright let's see if that works.

#

@solar whale It worked.

solar whale
#

@idle owl you are a wizard!! Thanks!

idle owl
#

It's a really weird glitch. Where it creates the files but doesn't realise it did. So then you rerun it and it says "file already exists" but it doesn't complete the entire process.

orchid basinBOT
timber mango
#

@solar whale I am using the Andoid app. I am using the hardware SPI pins with CS=5, IRQ=6, and RST=9. I have not gotten the firmware update to work.

solar whale
#

ok -- tryin android app now -- downgrade then upgrade

timber mango
#

@solar whale If I can get the fix from you, that would be great! Apparently, I can not move forward with my testing without your fix. Good work! ๐Ÿ˜ƒ ๐Ÿ˜‰

solar whale
#

android app is working ok for me ....

onyx hinge
#

so nice to finally sit down and work on ulab for a chunk of time! good progress too, I think

solar whale
#

@stable aspen hmm android app just hung -- retrying

#

IOS app works much better!

solar whale
#

@timber mango ok -- this time the android app worked (it is much slower than the IOS app!) I was able to downgrade/upgrade and run the bluefruitspi_simpletest vi CP

umbral dagger
#

The CLUE boot drive is currently FTHR840BOOT. Will that be changed to CLUEBOOT?

onyx hinge
#

@umbral dagger I suspect it will only affect early boards but I haven't heard official word

idle owl
#

@umbral dagger Yes.

orchid basinBOT
#

@ladyada the STM32F4_discovery's annoying name strikes again! Yes, the STM32F4 Discovery is the STM32F407VG board, I think it was the first one they made, so it doesn't actually describe what chip it has on it even in on the ST page, you have to look at the specs. Opinion is divided on whether it should be renamed the F407 Discovery - TinyUSB calls it the stm32f407disco, Zephyr and Micropython call it just the stm32f4_disco and STM32F4DISCO, respectively.

@tannewt you were leaning toward ...

idle owl
#

I imagine as soon as I ask you, Limor will sneak in on it. ๐Ÿ˜„

gilded cradle
#

lol, sure. I'll take a look.

idle owl
#

Thanks

#

Thank you @gilded cradle. The previous PR includes the refactor you suggested, by the way. Code is a lot more compact. And the usage bugs were fixed.

gilded cradle
#

Excellent

idle owl
#

@gilded cradle Thank you again. JP caught that one yesterday and I fixed it and then clobbered it when testing/updating things. It defaults to circuitpython.org but anyone using this example is going to want to know how to change it to something else.

gilded cradle
#

Yeah

onyx hinge
#

wahoo thanks for merging my PR @gilded cradle

gilded cradle
#

You're welcome. Thanks for making the changes.

onyx hinge
#

of course.

manic glacierBOT
tulip sleet
#

@fallen anvil @indigo wedge Given the many fixes still going into the i.MX build, and that we don't yet have an Adafruit i.MX product, I think we'll do a 5.0.0 without new i.MX fixes. We'll have a 5.0.1 or a 5.1.0 (with ulab) soon enough.

lapis hemlock
#

@lapis hemlock one easy question, one tougher question. Would you like to be added to the circuitpythonistas role? This will allow you to receive notifications about upcoming meetings, etc., because those mention circuitpythonistas.
@onyx hinge I wouldn't mind, but I must point out that I don't see myself as a possible future contributor to circuitpython per se. The statement is not about circuitpython as such, because I have absolutely nothing against the community, and the whole concept is extremely cool, but I don't think I would have the time to meaningfully contribute to anything. But I would definitely like to regularly take part in the weekly meetings and such, if that is an option.

indigo wedge
#

but if the fixes affect only the imx port then i think it should be fine?

onyx hinge
#

@lapis hemlock absolutely! You can come when you have something to talk about, whether it's "in the weeds", status updates or hug reports. If not, there's no obligation to attend.

manic glacierBOT
lapis hemlock
#

Tougher question: your module organization puts ones and zeros array constructing functions in linalg, where inv, det, and other matrix-only operations are. But while I think some builds might turn off matrix ops, I can't imagine turning off ones() and zeros(). Can we move them, either just to ulab or to a different module?
@onyx hinge I think you are right. The question is, whether you would want zeros etc. to be always available. I was thinking that ndarray.c should only contain the implementation of ndarray, and the methods thereof, nothing more, because it would then be relatively easy to extend ulab, basically, by sub-classing ndarray. I believe, this is how scipy, e.g., works.

indigo wedge
#

btw something strange happened with tests on the imx i2c fix

#

i stopped and restarted them now

#

they got stuck

tulip sleet
#

@indigo wedge but I have to delay the rc another day or two. It would be nice to have 5.0.0 as a stable release sooner rather than later. I wouldn't go from rc to GA with a fix, we need another RC in between.

lapis hemlock
#

So, zeros etc. should be a new module, I guess.

onyx hinge
#

@lapis hemlock I did the move the cowardly way, by just changing the bindings and not moving them from one file to another...

tulip sleet
#

I consulted with limor re this too, and we'll go for GA sooner

indigo wedge
#

Sure, if it causes that much trouble then let's merge these after release ๐Ÿ™‚

lapis hemlock
#

@lapis hemlock I did the move the cowardly way, by just changing the bindings and not moving them from one file to another...
@onyx hinge You could have. I absolutely see your point, zeros has no place in linalg. To be honest, I have no idea, why I put them there...

manic glacierBOT
#

I think this is a good idea too! We could share a lot of development work between a WebUSB webpage and a standalone, cross-platform Electron app (which is chromium under the hood).

I know this is a very old comment, but just in case this information is useful, the device chooser for electron has not been implemented yet, and I assume this would also apply for WebSerial: https://github.com/electron/electron/issues/14545
But, I think this node implementation could be used as a WebUSB polyf...

fallen anvil
#

@indigo wedge it's not the fixes...they're just showing up the underlying problem so far as I can tell. I'm on its tail.

manic glacierBOT
indigo wedge
#

yes i wouldn't expect a 1 line change in imx to break half the boards ๐Ÿ˜„

fallen anvil
#

@tulip sleet @indigo wedge we definitely shouldn't put any fixes in if they impact timescale.....I wasn't completely comfortable anyway.

lapis hemlock
fallen anvil
#

So far as I can see it's a problem in the OEM driver, and it'll need us to patch their code, but I've walked away from it for dinner to make sure I've got a clear head.

onyx hinge
#

micropython doesn't really support subclassing C types from C. I forget where I ran into this, maybe related to namedtuples?

lapis hemlock
#

@onyx hinge What about circuitpyhon?

tulip sleet
#

@lapis hemlock @slender iron is afk for a few days. We do native subclassing in, for example, displayio. We added some stuff that MicroPython currently doesn't do to make it work better.

lapis hemlock
#

Tougher question: your module organization puts ones and zeros array constructing functions in linalg, where inv, det, and other matrix-only operations are. But while I think some builds might turn off matrix ops, I can't imagine turning off ones() and zeros(). Can we move them, either just to ulab or to a different module?
@onyx hinge Are there other initialisation functions beyond zeros and ones that would warrant a new module?

manic glacierBOT
#

Well, with a scope, but yes, it's been checked. I haven't tried varying the
bus speed, but will do that with the next patch.

Given that this won't make 5.0 please leave the pr open for now while I
hunt down this bug.

On Thu, 27 Feb 2020, 18:29 Dan Halbert, notifications@github.com wrote:

@mubes https://github.com/mubes Did you check the frequencies with a
Saleae or similar?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
...

tulip sleet
#

it still requires some explicit checking for subclasses, but it's been made easier, and we fixed some things that just plain didn't work

lapis hemlock
#

@lapis hemlock @slender iron is afk for a few days. We do native subclassing in, for example, displayio. We added some stuff that MicroPython currently doesn't do to make it work better.
@tulip sleet Dan, can you point me to the implementation? Do you think that one could make an attempt at trying to convince micropython upstream?

tulip sleet
#

however tannewt is much more familiar with the details

#

i'm looking for the pr's, etc. dpgeorge also commented on this, but I wasn't sure whether it was over video or in writing

lapis hemlock
#

I have read somewhere that in CPython, there are a couple of things that were implemented because numpy required tools. I don't remember the specific example, though. While I don't want to draw a complete parallel here, I still believe that there might be pressing reasons for extending micropython's toolset.

#

@lapis hemlock absolutely! You can come when you have something to talk about, whether it's "in the weeds", status updates or hug reports. If not, there's no obligation to attend.
@onyx hinge Thanks, it's very kind.

#

@onyx hinge Do you think that linspace could also go with ones and zeros. For three functions could make a module. We have to come up with a name, though. Any suggestions?

onyx hinge
#

@lapis hemlock I moved only ones and zeros (to the ulab module itself), considered eye and linspace but left them where you put them.

lapis hemlock
#

Right, eye, too. Let's make a new module.

onyx hinge
#

I don't have a good name, I hope you do.

#

ulab.construct? .make? .generate?

#

I also wondered whether eye was more connected to linalg and sould remain there

lapis hemlock
#

construct sounds good, I am cool with that.

onyx hinge
#

okay, it's lunchtime here so I may be slow to respond to mentions

#

thanks!

lapis hemlock
#

eye is also an initialisation function.

tulip sleet
#

@lapis hemlock I failed to find a clear PR for the native subclassing stuff; let's defer until @slender iron can explain.

lapis hemlock
#

@onyx hinge I am working on a facelift for the zeros etc. I should be done soon, but I wanted to notify you, so that we don't work in parallel.

#

@lapis hemlock I failed to find a clear PR for the native subclassing stuff; let's defer until @slender iron can explain.
@tulip sleet Thanks for your efforts! It's not urgent, we can definitely wait till Monday. This was more like a, as you call it, strategic question for the longer-term vision.

orchid basinBOT
lapis hemlock
onyx hinge
#

@lapis hemlock maybe you forgot to commit the new source file?

lapis hemlock
#

Yes, I did. ๐Ÿ‘

#

It fails with the tests now, 00smoke constructors. It's weird, because I haven't actually modified the functions.

onyx hinge
#
>>> ulab.create
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'create'
``` is something still missing?
lapis hemlock
#

It is not a module, I bound everythin at the top level. ulab.linspace(...)

onyx hinge
#

okay!

lapis hemlock
#

And that is why the test fails.

onyx hinge
#

then now just the tests need to be revised, I can do it..

lapis hemlock
#

print(linalg.eye(3)) is no longer valid.

onyx hinge
#

did you spot the "./build.sh" script? If you're on linux, anyway, it will roughly do the same thing as the github actions..

lapis hemlock
#

I have seen it, but didn't look closely. I see that you fixed the tests. If you are satisfied, you can merge it. If not, you can change whatever you would like.

lapis hemlock
#

did you spot the "./build.sh" script? If you're on linux, anyway, it will roughly do the same thing as the github actions..
@onyx hinge Cool, many thanks!

onyx hinge
#

I like automating things. I need to do something to help with generating .exp files.

lapis hemlock
#

@onyx hinge On the conceptual level, there should be no dangling (i.e., those that are not parts of a module) functions that can be switched off with a pre-processor flag, right? Because if we do that, then we can't check that linspace is compiled into the firmware. So, if you think that these initialisation functions should always be there, then we have to remove the #if ULAB_CREATE_MODULE directive. Otherwise, these have to be in a proper module.

onyx hinge
#

@lapis hemlock I think it's very unlikely we'll want to disable linspace or eye; and almost impossible that we'll ever want to disable zeros or ones.

orchid basinBOT
lapis hemlock
#

@onyx hinge Will you remove ULAB_CREATE_MODULE from ulab.h, and ulab.c, then, or shall I?

onyx hinge
#

I can

lapis hemlock
#

Thanks!

onyx hinge
#

oops! I made a mistake with git and pushed directly to the master branch ๐Ÿ‘Ž

lapis hemlock
#

Should be OK, don't worry!

onyx hinge
#

you're easy to work with, thanks!

lapis hemlock
#

You are not difficult, either.

#

To work with, I mean.

#

We no longer need the 2dim and create branches, is that correct?

onyx hinge
#

I think so, branches can always be removed after they are merged

lapis hemlock
#

I will delete them, then.

lone sandalBOT
tulip sleet
#

@idle owl are the download stats for circuitpython itself (as opposed to the libraries) currently broken?

onyx hinge
#

@tulip sleet I think they have been missing for a few meetings in a row

tulip sleet
#

i was just going to check on rc.0 downloads, thinking about when to do GA

manic glacierBOT
#

๐Ÿ˜• I'm surprised 5.0.0 stable release appears might not include new _pixelbuf driven NeoPixel?! Expected that would be one of its main features.

For those who want to try out _pixelbuf accelerated neopixels with 5.0.0 without building / compiling CircuitPython...

You can easily:

  • Download neopixel.py from the pixelbuf branch.
  • Rename neopixel.py to pixelbuf_neopixel.py (_or anythi...
idle owl
#

@tulip sleet Yeah they're broken.

tulip sleet
#

ok, thanks!

#

@idle owl @slender iron @onyx hinge given that there's been no blowup re rc.0, I'm thinking of doing 5.0.0 GA now. The main issue is not the release, it's the download links, because of random github asset upload failures. I could submit a PR to circuitpython.org to change its download links, but then we'd definitely lose download counts. It looks like we can turn on logging on AWS S3 and process the logs later. There's also something called CloudWatch which costs money. Or we can not delay to collect counts.

Or I can release 5.0.0 and hobble along with the current asset problems. I fixed the missing assets last night by hand (about 50 of them), and I can do that again.

#

i think it would be very good to get 5.0.0 out soon.

idle owl
#

I don't like the idea of you manually doing all of that again, or hobbling along with any asset problems. We don't currently have download stats anyway, so I think changing the links to S3 as long as it doesn't change the user experience is fine, and we can deal with getting the stats later.

onyx hinge
#

It seems like counts on the adoption of 5.0.0 would be very nice to have, but I don't know how to compare that to the value of not potentially putting it off by an appreciable length of time

idle owl
#

I do want to see 5.0.0 released.

onyx hinge
#

I mean, feels like the problems on github's end are not magically fixing themselves so doing SOMETHING with log processing on S3 may be in the cards no matter what

tulip sleet
#

@onyx hinge we had an internal mtg yesterday where we pretty much decided to move the assets downloading to S3, because GitHub is not really set up for massive asset lists, so it will happen one way or the other

onyx hinge
#

I see.

tulip sleet
#

so that matches what you're saying; i'll check on the log stuff to see if it makes sense just to turn that on now

onyx hinge
#

anything I can do to help, let me know

fallen anvil
#

@indigo wedge So, here's as far as I've got with the I2C issue...writing it down as much to clear my thoughts as anything else. I tickling the issue with a scan, but I'm 100% certain there are plenty of other ways to make it happen.

slender iron
#

@tulip sleet how long has rc.0 been out? Could we give it a weekend of testing? Any urgent reason to do 5.0.0 stable?

fallen anvil
#

A scan causes busio_i2c_scan to be called, which in turn calls common_hal_busio_i2c_probe. The goes down to the SDK call LPI2C_MasterTransferBlocking. The problem is that when I look on the scope that is not releasing the bus at the end of the transaction....as far as I can see, ever. Certainly, if I run i2cscan at 1s intervals, I see SCL low between scans, which is not what I expect at all, like this;

tulip sleet
#

@slender iron we could wait, i was interested in the download stats, but if they're broken, that's not much help

#

i would like to do stable early next week if nothing arises

#

do you know if they're permanently broken?

slender iron
#

Next week works for me. We can get download stats on a per tag basis still.

#

The current adabot script just tries to load all releases

fallen anvil
#

Sometimes SDA is low in the intervening period, sometimes SCL high....whatever, they're not stable. When the thing fails, SCL is always low and SDA high;

tulip sleet
#

@slender iron i see the API calls to get stats per release. do I need an api key to call the API? I was looking for an easy CLI tool, though I could always just use curl or something

slender iron
#

No api key needed. The rate limit will just be lower iirc

fallen anvil
#

If I interrupt the app, then I get the correct STOP signal, and things carry on again for a while. And that's where I've got to. Basically, your chip is waiting for a STOP condition that doesn't arrive. I'm pretty sure the STOP after program interruption is the auto-STOP you get when there's an error. Suggestions welcome.

#

(I'll shut up for a while now)

half sedge
#

Hi, I have an "electrical" question about the CLUE. My Bit:2:Pi arrived and I have some success with NeoPixel board: https://twitter.com/DavidGlaude/status/1233140189243092998?s=20

A CLUE (from @adafruit)ย driveย a Unicorn pHAT (from @pimoroni) thanks toย a BIT:2:PIย (from @4tronix).

@CircuitPython source code provided, but it is just #NeoPixel

pixels = neopixel.NeoPixel(board.P2, num_pixels, brightness=0.1, auto_write=False)

https://t.co/DGKvZyhac3 http...

โ–ถ Play video
#

But to have the NeoPixel light up, I need to power the Bit:2:Pi from it's USB. As a consequence, I don't see the CLUE as a drive, and I don't have the serial REPL.

#

I am affraid to connect my PC twice to this (once on the CLUE and once on the BIT:2:Pi as this could blow it up and produce smoke.

#

Would there be a safe way to distribute 5V to this, while having USB to work too? I believe the BIT:2:Pi take the 5V, give it to the Pi connector, transform it into 3V and give it to Pi and Microbit.

indigo wedge
#

@fallen anvil no need to shut up, I'm reading and if it helps you to rubberduck then go ahead ๐Ÿ™‚

main meteor
#

I'd probably plug the other one into a USB powerbank, but there may be a better way.

half sedge
#

@main meteor Would that make two source of 3V for the CLUE? Is that "safe"?

main meteor
#

I don't have a Clue... ๐Ÿคช

half sedge
#

I have a CLUE, but I am about to remove the magic smoke out of it...

main meteor
#

Hopefully not.

half sedge
#

I believe the question can be summarized in: Can we plug something in the USB while the CLUE is powered in 3V from the "micro:bit" connector?

#

I kind of always wory about having two power sources simultaneoulsy connected.

tulip sleet
#

@half sedge there should be some diodes to allow you to do that. I'll check the schematic.

half sedge
#

@tulip sleet Thanks.

meager fog
#

@tidal kiln

half sedge
raven canopy
#

@slender iron @tulip sleet i proved with some high satisfaction last night that the asset count is what kills the release API request. verified using the v4 (GraphQL) API, which lets you specify the number of assets to list. choked on 100 (max); no problems with 10.

also, with moving downloads to S3...it looks like download stats will be painful. nothing jumps out in the API docs, and google is turning up massive-effort-log-reading or 3rd party services.

tulip sleet
#

@raven canopy The adafruit web people are enabling some metrics on S3 that should give us counts.

fallen anvil
#

@indigo wedge Yeah, its normally the cat, but shes off in the other room somewhere :-/ TBH I'm s little bit stumped, I can see what it should do, I can see it doing everthing properly when there's a message following, but not when there's nothing following... I've missed something here but, whatever it is, I'm pretty sure its in NXP-driverland.

onyx hinge
#

@half sedge @tulip sleet seems it's the so called battery connector that has the auto switching diodes (and no charging circuit, I guess?)

indigo wedge
#

i'm a bit iffy on the inner workings of I2C so not sure I can help much

tulip sleet
#

right

fallen anvil
#

It should only fail to send a stop when there's an error and, by definition, an error should send a stop.

onyx hinge
meager fog
#

@half sedge hi, what would that be good for?

half sedge
tulip sleet
#

@fallen anvil do you have some other boards you can try the same CircuitPtyhon code on and spy on the I2C to see what's different?

half sedge
#

Apparently it's one way to power a micro:bit and some case use that.

meager fog
#

why does that case not fit

tiny oriole
#

we have https://www.adafruit.com/product/4516 in stock for those who want to pick one up ๐Ÿ™‚
@meager fog Ordered! haha

fallen anvil
#

Yeah, I can probably dig up some sort of ST board or something. Good idea....I'll try that in the morning if I don't crack this this evening when my head is fresh.

half sedge
#

Well, it is a bit "tight", but nothing I cannot dremel I guess. But the battery connector goes on the CLUE where there are surface mounted component...

meager fog
#

yeah we use that spot for the speaker and parts

#

there's no plan to add those pads at this time. if we do a hardware revision and it does not affect manufacturability we will look to add those pads

raven canopy
#

@tulip sleet via CloudWatch, per chance?

meager fog
#

i have not seen that case lately - i dont know if its still made or who makes

half sedge
#

Would you know if it is safe to power the CLUE both from USB and from the micro:bit connector?

meager fog
#

pimoroni does not make it

#

you can but its not a good idea

#

same as microbit

#

power from the USB or battery connector only. they are protected and regulated

tulip sleet
#

@raven canopy CloudWatch is one way to do it but I think this is some kind of lifecycle rule. I don't have access yet, will tell you when I know more.

onyx hinge
half sedge
#

Yes.

#

I might have ordered the last one from Pimoroni.

#

Now I need to find a micro:bit or a kid with a micro:bit and donate.

#

Yes = "I guess" because I don't have a micro:bit. ๐Ÿ˜‰

half sedge
#

I believe the BIT:2:Pi board is protecting the micro:bit as the documentation say: "Any or all power sources can be connected safely at the same time". I tested @main meteor suggestion and it works without magic smoke. I can now access the REPL / Storage and check the result of my code immediatly. Thank you all.

tidal kiln
timber mango
#

@main meteor I wondered when somebody was going to pull that one off! ๐Ÿ˜‰

raven canopy
tulip sleet
#

i guess we may as well use black on all our python code, even the ancillary code.

raven canopy
#

i gather that was the intent. but, its an assumption.

tidal kiln
#
while not pylint:
    black

??

#

those were from cookie cutter, btw

raven canopy
#

huh. that would be good to fix....

tidal kiln
#

@raven canopy thanks. opened an issue fwiw.

main meteor
#

@timber mango Pull which one off?

manic glacierBOT
manic glacierBOT
fallen anvil
#

@indigo wedge ...and now we can be happy;

#

The change is in the sdk, and I have no idea how to submit a patch for a subproject at the moment, so here's the diff you can apply and give it a try;

#
diff --git a/devices/MIMXRT1021/drivers/fsl_lpi2c.c b/devices/MIMXRT1021/drivers/fsl_lpi2c.c
index 1ff3078..1267fff 100644
--- a/devices/MIMXRT1021/drivers/fsl_lpi2c.c
+++ b/devices/MIMXRT1021/drivers/fsl_lpi2c.c
@@ -248,8 +248,12 @@ status_t LPI2C_MasterCheckAndClearError(LPI2C_Type *base, uint32_t status)
         /* Clear the flags. */
         LPI2C_MasterClearStatusFlags(base, status);
 
-        /* Reset fifos. These flags clear automatically. */
-        base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK;
+        /* Reset fifos (Except for NAK, which doesn't generate a STOP automatically). */
+        /* These flags clear automatically. */
+        if (kStatus_LPI2C_Nak != result)
+          {
+            base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK;
+          }
     }
     else
     {
indigo wedge
#

wow, great job!

#

is it also missing in 1011 and 1062?

fallen anvil
#

I would expect so, these sdk libraries are generally pretty uniform. I'll check

#

Try this on your problem child first before we do anything more. Certainly I'm happier with the behaviour now.

#

...did I ever mention that I hate i2c?

indigo wedge
fallen anvil
#

OK, I'm poking NXP direct too at the moment :-)

indigo wedge
#

nice ๐Ÿ™‚

#

It was Limor who mentioned

i2c scanning does not seem to find write-only/read-only devices (?):
SSD1306 OLED, and GTOP I2C GPS are not found on bus

#

when i tried it with a temp sensor it worked

#

I should have a OLED using that IC somewhere so can test

fallen anvil
#

Well...it was misbehaving with the protocol so anything could have happened.

#

It was a race, so on some occasions it would work. I haven't tried my punishing tests yet, but certainly this is an improvement.

#

Oh, actually, my punishment test has started automatically....123K iterations without fail. I'll let it go to 1M before claiming it as a fix.

fallen anvil
#

@indigo wedge Right, bored now, thats 250K without any hiccups. It's done. More testing by other people is needed but the issues I observed are gone. Same code exists for 1011 and 1060. Heres a diff that fixes it across all 3...would you mind doing the honours and merge it with either your or CPs repository? Does that need @slender iron ? I'm trying to avoid having lots of (sub-)projects open.

indigo wedge
fallen anvil
#

bril, ta....makes my life easier not having to deal with all this new fangled CI stuff

manic glacierBOT
fallen anvil
#

Different subject, but at some point it would be interesting to look at removing some of the busy loops....we spend a lot of time, with a very fast CPU,, not doing anything useful;

 23.86%    20768 mp_hal_delay_ms
 21.93%    19090 LPI2C_MasterStop
 14.03%    12212 common_hal_mcu_disable_interrupts
 13.03%    11347 supervisor_ticks_ms64
  9.64%     8394 common_hal_mcu_enable_interrupts
  7.94%     6919 __DMB
  1.62%     1411 dcd_isr
  0.62%      543 USB_OTG1_IRQHandler
  0.61%      538 dcd_event_handler
  0.60%      529 LPI2C_MasterTransferBlocking
  0.51%      446 Unknown
  0.43%      379 SCB_CleanInvalidateDCache_by_Addr
  0.28%      252 busio_i2c_scan
  0.27%      238 common_hal_busio_i2c_probe
  0.26%      233 LPI2C_MasterWaitForTxReady
  0.25%      220 __enable_irq
  0.24%      210 mp_obj_get_type
  0.21%      184 memset
  0.20%      176 common_hal_terminalio_terminal_write
  0.17%      155 $t
-----------------
 96.70%    84244 of 87034 Samples


 Ex |   Count  |  MaxD | TotalTicks  |  AveTicks  |  minTicks  |  maxTicks 
----+----------+-------+-------------+------------+------------+------------
 15 |     1070 |     1 |    2682917  |       2507 |      1739  |      5038
129 |     8555 |     1 |   15914622  |       1860 |      1035  |      4867

[--TH] Interval = 1061mS / 534620993 (~503884 Ticks/mS)
indigo wedge
#

That's a lotta waiting

fallen anvil
#

Yup. You only realise how much you're wasting when you see it like this. The transfer is 0.60% of the CPU!

#

...well, 0.88% if you include the i2c_probe at the top level too.

#

(We should at least figure out how to WFI in mp_hal_delay_ms...that's a real power saving right there). When we're in the REPL we spend a lot of time furiously waiting for a character to arrive;

 44.09%    37569 mp_hal_stdin_rx_chr
 42.84%    36506 tud_cdc_available
  4.24%     3613 tu_fifo_count
  2.44%     2079 Unknown
  1.21%     1032 serial_bytes_available
  1.18%     1008 $t
  0.72%      618 dcd_isr
  0.62%      534 USB_OTG1_IRQHandler
  0.46%      399 SCB_CleanInvalidateDCache_by_Addr
  0.46%      395 dcd_event_handler
  0.23%      203 supervisor_tick
  0.15%      132 displayio_background
  0.15%      130 common_hal_mcu_enable_interrupts
  0.13%      113 __DMB
  0.12%      104 assert_heap_ok
  0.12%      103 tud_cdc_n_write_flush
  0.11%      101 common_hal_mcu_disable_interrupts
  0.10%       89 _osal_q_unlock
-----------------
 99.37%    84728 of 85204 Samples




 Ex |   Count  |  MaxD | TotalTicks  |  AveTicks  |  minTicks  |  maxTicks 
----+----------+-------+-------------+------------+------------+------------
 15 |     1047 |     1 |    2213120  |       2113 |      1985  |      3026
129 |     8377 |     1 |    9957813  |       1188 |      1070  |      2133

[--TH] Interval = 1042mS / 523379914 (~502283 Ticks/mS)
marble hornet
#

I'm making a new circuitpython board (nrf52840) and just started getting only False from trying to lock an I2C object. what are possible reasons for I2C failures of locking, the docs just regurgitate the name.

manic glacierBOT
manic glacierBOT
fallen anvil
#

Yeah, didn't see that button, AKA the 'create more load' button...I can understand why they don't give access to it to mere mortals.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

While I didn't end up prototyping it, I suspect that my idea of blocking the audio background task when an sd card I/O is going on will lead to audio stutters, as it's very easy to cause single I/Os that take >>20ms. Since we can't tell whether the background task is also going to need the same SPI bus (this is what causes the deadlock), we'll be making all audio background suffer for a tiny sliver of all cases, and with no way to make it better. Thus, I think leaving up the "here be drago...

manic glacierBOT
onyx hinge
#

hum, I thought this was supposed to work even if USB is active: ```>>> storage.remount('/', False, disable_concurrent_write_protection=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Cannot remount '/' when USB is active.

meager fog
#

you have to do it in boot.py i thought?

onyx hinge
#

oh, I was running it at the repl

#

it does work if I have also "eject"ed the disk

manic glacierBOT
manic glacierBOT
meager fog
#

@indigo wedge for the '1011 - how is the RAM split up

#

is it like 64K for instruction cache, 64K for use?

indigo wedge
#

Best to ask @slender iron since he implemented that part but I believe it's 32k instruction cache 32k data cache and 64k generic ram

timber mango
#

I don't have a Clue... ๐Ÿคช
@main meteor This one. ๐Ÿ™‚

indigo wedge
#

@meager fog all ok with the Feathers?

meager fog
#

yah tryin' it out

#

ok yah

#

so far so good!

#

wifi...is going to be tough

#

it kinda fits?

indigo wedge
#

I had to freeze the esp32spi library to get it to work on my Feather

meager fog
#

yeah

indigo wedge
#

Otherwise memoryerror

meager fog
#

i can connect and get data - but thats literally the limit ๐Ÿ˜„

#

like cant display on anything

indigo wedge
#

Good thing we have lots of flash ;)

meager fog
#

ok you wanna freeze ESP32spi then?

#

i think thats not a bad idea if you have 1MB flash

indigo wedge
#

Yeah I will in mine for sure

meager fog
#

ok can u give me a uf2

#

i will keep hacking

indigo wedge
#

Sorry I won't be home for quite some hours

meager fog
#

im makin a stock market displayer

#

ooh ok - np

simple pulsar
#

indices or individual stocks or any ticker symbol?

manic glacierBOT
#

There are UF2 bootloaders available for mkrzero and nano33iot in https://github.com/adafruit/uf2-samdx1/tree/master/boards, but you are right, we should publish .bin as well.

Yes, but I see no Arduino boards in the releases

The UF2 files are not densely packed. Each 512-byte block consists of at most 476 bytes of data, and possibly less: https://github.com/microsoft/uf2.

So, if the .bin file used to generate the UF2 file is under 256 KB, the UF2 file is always goof to be fl...

meager fog
#

@simple pulsar either

#

@indigo wedge ok ill put this aside and try out your frozen firmware when you can toss it over ๐Ÿ™‚

indigo wedge
#

Will poke you when I have it :)

simple pulsar
#

FYI, Reuters and the like put a note/warning on pages if the data is from an intentionally delayed source, e.g. All quotes delayed a minimum of 15 minutes. on https://uk.reuters.com/quote/.SPX - Google stick a more complex description under Disclaimer link

Reuters.com for the latest indices and markets news on .SPX

meager fog
#

kk i am using alphavantage api, seems good enough

red tinsel
#

How do I logout from the discord Android app????

tiny oriole
#

How do I logout from the discord Android app????
@red tinsel Tap on the menu in the upper left hand corner of your screen.
at the bottom next to your account info, click on the Gear icon.
then in the upper right hand corner click the square with the arrow, or the logout icon.

timber mango
#

Thank you, Andrew.

#

I am all out of AA batteries for my keyboard, so I can not use my computer now. I will not be able to get more batteries until next month. ๐Ÿ˜ฃ๐Ÿ™

crimson ferry
#

I didn't see anything in open issues or the support matrix. Is there support (or a plan for support) for displayio on MIMXRT10xx/Teensy?

lone sandalBOT
meager fog
#

@crimson ferry theres displayio for RT1011, at least the one arturo sent me ๐Ÿ™‚

manic glacierBOT
#

[this is a draft PR for now]

We now have over 1700 release assets. GitHub releases don't handle this many assets well:

  • The release pages are huge and take a long time to load.
  • Uploading assets can fail sporadically or hit GitHub rate limits.
  • It's difficult to correct the problems above: the release action must be re-run several times and may still continue failing. Uploading the missing assets is tedious.

We already upload the release assets to S3. This PR changes the download ...

fallen anvil
#

Folks, perhaps (probably) being dumb here, but can anyone help with what in this code is causing my board to go into a reboot loop;

import busio
import board
import digitalio
import displayio
import adafruit_ili9341

displayio.release_displays()

# Setup SPI bus using hardware SPI:
spi = busio.SPI(clock=board.EXP_SPI0_CLK, MOSI=board.EXP_SPI0_MOSI, MISO=board.EXP_SPI0_MISO)

print("Starting")
cs_pin=digitalio.DigitalInOut(board.EXP_SPI0_SEL0)
cs_pin.switch_to_output()
dc_pin=digitalio.DigitalInOut(board.EXP_P22)
dc_pin.switch_to_output()

display_bus = displayio.FourWire(spi, command=dc_pin, chip_select=cs_pin)

Its the FourWire instantiation at the end that actually causes the problem. I now appear to have corrupted my on chip drive as a result of it....but I don't know why.

#

(Using todays libraries)

tulip sleet
#

@fallen anvil I don't see anything immediately wrong with the above. Can you get into safe mode?

fallen anvil
#

Now when I try to boot I end up in wait_for_safe_mode_reset with a 4-flash LED

tulip sleet
#

to erase and reformat the filesystem, do you know to do: import storage; storage.erase_filesystem(). Also I can suggest a simple patch to do the equivalent.

#

is there a usable backtrace from wait_for_safe_mode_reset()

fallen anvil
#

Not too much....

(gdb) bt
#0  0x60023964 in wait_for_safe_mode_reset () at ../../supervisor/shared/safe_mode.c:68
#1  0x60022d54 in main () at ../../main.c:420
tulip sleet
#

to force a reformat of the filesystem, temporarily change false to true in main.c:

    // Create a new filesystem only if we're not in a safe mode.
    // A power brownout here could make it appear as if there's
    // no SPI flash filesystem, and we might erase the existing one.
    filesystem_init(safe_mode == NO_SAFE_MODE, false);
fallen anvil
#

I guess I can do that from the debugger, one sec;

tulip sleet
#

are you hanging in wait_for_safe_mode_reset()? that should wait for only 700 msecs. If there's another reset click during that period, then the next restart will go into safe mode and not run code.py.

#

In general when debugging this kind of thing, I don't use code.py and instead import the test program from the REPL manually, so that I don't get into loops.

fallen anvil
#

yeah, I found my way through there....just at stack_init

#

trying to find out where it's getting thrown into the safe mode handler...bear with me. The filesystem seems to be coming up ok

tulip sleet
#

best places to set breakpoints to catch faults are HardFault_Handler and reset_into_safe_mode()

#

that will catch things before it restsarts

fallen anvil
#

yeah, was hoping this one was just sticky fingers rather than a bug :-)

#

OK, I'll get it to reformat the fs then go again. Didn't even think about the avoiding code.py....thats a really useful tip!

#

Right, got a clean fs and up and running...so it was a corrupt fs that was causing the safe mode, but still doesn't explain why my code doesn't fly :-(

#

Now we might be getting somewhere;

Breakpoint 3, reset_into_safe_mode (reason=reason@entry=MEM_MANAGE) at ../../supervisor/shared/safe_mode.c:86
(gdb) bt
#0  reset_into_safe_mode (reason=reason@entry=MEM_MANAGE) at ../../supervisor/shared/safe_mode.c:86
#1  0x600231dc in MemManage_Handler () at supervisor/port.c:349
#2  <signal handler called>
#3  0x60031ff6 in IOMUXC_SetPinMux (configRegister=0, inputOnfield=0, inputDaisy=0, inputRegister=0, muxMode=5, muxRegister=0)
    at sdk/devices/MIMXRT1021/drivers/fsl_iomuxc.h:864
#4  common_hal_digitalio_digitalinout_construct (self=0x2020383c <displays+36>, pin=0x20204aa0) at common-hal/digitalio/DigitalInOut.c:65
#5  0x6002c174 in dcd_isr (rhport=<optimized out>) at ../../lib/tinyusb/src/portable/nxp/transdimension/dcd_transdimension.c:554
#6  0x20203818 in ?? () at ../../supervisor/shared/tick.c:90
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) 

Any clues from that @tulip sleet ? That IOMUXC definition looks dodgy for one thing... I think I have things to investigate and, as a silver lining, this looks pretty definately like a port issue so nothing for anyone else to stress on.

tulip sleet
#

looking...

#

are the arguments to IOMUXC_SetPinMux() sensible (e.g., the ...Register values being zero?

onyx hinge
#

65 IOMUXC_SetPinMux(pin->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0);

#

I'm suspecting that pin is not properly initialized?

#
 865         IOMUXC_SW_MUX_CTL_PAD_MUX_MODE(muxMode) | IOMUXC_SW_MUX_CTL_PAD_SION(inputOnfield);
fallen anvil
#

Yeah, that's what I'm suspecting. Sorry, had to step away for a few mins. Back now

onyx hinge
#

since it just treats it like a pointer, 0 is going to not be a valid value. ummm .. what would cause dcd_isr to be constructing a pin object anyway?

#

554 dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);

fallen anvil
#

Well, it'll be writing on random bits of memory by this point so all bets are off with respect to the stack frame....however, the rest of the values are valid, originating in a common_hal_digitalio_digitalinout_construct call as IOMUXC_SetPinMux(pin->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0); ....question is why configRegister is 0

#

Leave it with me for a while....

onyx hinge
#

yeah maybe dcd_isr is a red herring due to stack corruption. You can try breaking at common_hal_displayio_fourwire_construct and step through it, since in all reasonableness this is where you should have called from

#

you could also see if you can directly create DigitallInOut objects from dc_pin and cs_pin. hey, wait, are you supposed to pass the pin (board.EXP_SPI0_SEL0 e.g.,) rather than a DigitalInOut object? and it's a case of missing type checking?

fallen anvil
#

Now thats certainly possible

onyx hinge
#
                                     command=board.D10,
                                     chip_select=board.D9)``` @fallen anvil
fallen anvil
#

OK...one sec, caught by a phone call, back in a few

onyx hinge
#

hehe no worries

tulip sleet
#

@onyx hinge I was thinking of that, but it didn't rise above the subconscious enough ๐Ÿ™‚

fallen anvil
#

The numbering vs object was indeed an issue, but it would appear that there's no muxReg set for command, so it's writing to *0, which never ends well. Just digging on that.

fallen anvil
#

So, in displayio_fourwire_make_new we parse out command, chip_select and reset into objects which, based on my limited knowledge, are just generic MP/CP objects, aren't they? They are then passed to common_hal_displayio_fourwire_construct that casts them as mcu_pin_obj_t * ...but they only contain part of the information, and they're certainly not pin_XXX const definitions. It seems to me that the second element of what is passed is actually the pin_XXX definition? Sorry, way out my depth here.

#

oooh....hang on, this might be something silly I've done.

fallen anvil
#

No, false alarm, still digging.

manic glacierBOT
#

Just a couple fixes/things I can spot. Thanks @dhalbert.

We will need to figure out how to get download counts and other statistics, but AWS CloudWatch log files can do that (@jwcooper turned them on), which can then be processed by us with https://s3stat.com, https://qloudstat.com, or us directly parsing the log files.

After some further investigation/reading, it looks like AWS's Python SDK boto3 should make this a little easier with CloudWatch. I'll keep reading, and see if I can ...

manic glacierBOT
indigo wedge
fallen anvil
#

So, @tulip sleet and @onyx hinge ...I can see how it's going wrong, but not why. Indeed it's the case that the command and chip_select objects that are parsed out in displayio_fourwire_make_new are variable objects passed on the stack, but they are passed to common_hal_displayio_fourwire_construct as if they were const mcu_pin_obj_t *'s. The second 32-bit word of whats passed is indeed the correct pin_... construct. What I don't understand is how this works for everyone else, and there obviously aren't problems elsewhere so I've done something silly in the setup, but I don't see what.

fallen anvil
#

If the SPI fixes aren't in then I don't think the esp32spi ones will be too useful (although you can cheat and use half baudrates)

simple pulsar
indigo wedge
#
My IP address is 192.168.1.108
IP lookup adafruit.com: 104.20.39.240
Ping google.com: 30 ms
Fetching text from http://wifitest.adafruit.com/testwifi/index.html 
----------------------------------------                            
This is a test of Adafruit WiFi!                                    
If you can read this, its working :) 
fallen anvil
#

yes, but those are the ones that I thought we wren't going to commit?

indigo wedge
#

yeah i dunno, dan merged this and the i2c fix

fallen anvil
#

:-)

#

So we're good, the esp32 one will work ok

tidal kiln
#

or even better, PR updates ๐Ÿ™‚

fallen anvil
#

common_hal_digitalio_digitalinout_construct is definately receiving a duff pin from displayio, but I don't know why yet....but its not a fault in that routine. I'm printing the pin and pin->mux_reg, first two are fine (setup of the SPI), third one it falls over;

>>> import test.py
Starting
(6004a410) Init 401f804c
(6004a330) Init 401f802c
(20204a70) Init 0
cu: Got hangup signal

Tomorrow I'll compare the spi init and parameter collection with the displayio one, that should lead me to the issue. Time to knock off for tonight now.

arctic violet
#

Bought a CLUE, woot woot

manic glacierBOT
meager fog
#

@indigo wedge ok home!

meager fog
#

@indigo wedge yum

#
code.py output:
43344
onyx hinge
#

@fallen anvil what I'm saying is, it's a mistake to pass a DigitalInOut to that function, it should be a microcontroller.Pin. however, that said, there might be examples showing the other, and they might work by coincidence on other platforms, for all I know.

manic glacierBOT
tulip sleet
#

@onyx hinge @fallen anvil It is definitely a problem that some displayio constructors are not validating their args. I'm working on a PR. You do need to pass pins and not DigitalInOut's. If you saw some code that is passing DigitalInOut's, could you point to that so we can fix the example? Thanks.

onyx hinge
#

@tulip sleet I didn't, except for what mubes posted. but I didn't do a deep dive; maybe they can say if they were following an existing example.

tulip sleet
#

i looked at the ILI9341 library and didn't see that, but it certainly could be somewhere else.

manic glacierBOT
#

There was some missing pin argument validation in displayio, and when starting to fix that, I decided to simply how pin argument validation and free pin checking was done.

  • Replace assert_pin completely, and subsume most uses of assert_free_pin() by adding the new routines validate_is_free_pin() and validate_is_free_pin_or_none(), which check whether an mp_obj_t is a pin and return an mcu_pin_obj_t * if it is. This reduces several lines of code to one, improving readabilit...
fallen anvil
#

@onyx hinge @tulip sleet I don't honestly remember where the starting point for that code was, but I fixed that specific issue early on in the test routine so it's not my underlying issue. I'm pretty sure I can find it from this point by comparing and contrasting the spi initialisation and the displayio stuff...spi works for me! Just got to find the time. You can be 90% certain that this is self inflicted rather than something in the platform. I'll post when I've got updates. Hopefully during today but can't be certain.

fallen anvil
#

@onyx hinge @tulip sleet Found it. Yup, self inflicted, as expected. At some point late yesterday evening it seems that I managed to revert the test code to start using the DigitalInOut pin again...so it was indeed using an inappropriate object to construct the FourWire. I suppose, in mitigation, I found a missing parameter validation, but wasted an entire evening in doing so. Sorry for troubling y'all.

onyx hinge
#

@fallen anvil that is frustrating, but take heart that the rest of us didn't spot it immediately either, and thanks to this discussion @tulip sleet will make it better for everyone

simple pulsar
#

@lone axle Returning to old conversation, it turns out that Label has an undocumented scale named argument inherited from the (strange?) parent class of displayio.Group - so text_area2 = label.Label(terminalio.FONT, text="Something", color=0xFF0000, scale=3) works

#

I suppose the followup to that is if it's undocumented should I be using it?

lone axle
#

Ah, good catch! I don't know for sure but I think it might be subclass of Group because each letter is it's own sub object

#

which is also why it has a maximum number of characters, because the group has to be initialized with a certain number of children, and I think it might not be able to grow.

#

scale() is documented on the Group docs but looks like it's getting left out of the label one since it's part of the parent class.

#

I would lean toward it being okay to use, I think it's just a quirk of how the docs page is getting displayed. But I don't actually know for sure. If it's removed or changes significantly in Group it is going to affect Label also, but I think it's probably unlikely that scale() would get removed or drastically changed.

simple pulsar
#

@slender iron Back on storing strings/constants/immutables in flash and not bringing them into RAM, there is mention of this in micropython world if I'm understanding the notes in http://docs.micropython.org/en/latest/reference/constrained.html#execution-phase - it talks about using micropython.qstr_info(1) to allow the programmer to do an "aided PROGMEM" style setting of strings. Doesn't look like great approach for novice programmers.

fallen anvil
#

@onyx hinge yeah, I don't stress on it too much, but when you've only got a limited amount of available time to do things in it's frustrating when you waste it by not being methodical. Oh well, I'd like to say I'll learn from it, but it's doubtful ๐Ÿ˜ฌ

simple pulsar
#

Has anyone seen the colour sensing values freeze from CP 5.0.0.beta5 on CircuitPython? I just saw it on REPL but no clear cause ```>>> clue.color
(811, 500, 481, 1857)

clue.color
(806, 497, 478, 1847)
clue.color
(653, 394, 365, 1064)
clue.color
(653, 394, 365, 1064)
clue.color
(653, 394, 365, 1064)
clue.color
(653, 394, 365, 1064)
clue.color
(653, 394, 365, 1064)

lone axle
#

I have seen that happen once as well.

#

I never did figure out a cause or reliable way to reproduce, and it hasn't happen within the larger project that I used the color readings in.

simple pulsar
#

Another peculiarity on the CLUE: clue.white_leds = True ; clue.white_leds = False most of the time will blip the two white LEDs on very briefly in a non-blinding manner. About 1 in 15 it'll leave them on for maybe (guessing) 200ms which is really obvious visually because of the bright burst of light

#

383ms to be more precise ```>>> t1=time.monotonic() ; clue.white_leds = True ; clue.white_leds = False ; t2=time.monotonic() ; print(t2-t1)
0.382813

t1=time.monotonic() ; clue.white_leds = True ; clue.white_leds = False ; t2=time.monotonic() ; print(t2-t1)
0.0
t1=time.monotonic() ; clue.white_leds = True ; clue.white_leds = False ; t2=time.monotonic() ; print(t2-t1)
0.0
t1=time.monotonic() ; clue.white_leds = True ; clue.white_leds = False ; t2=time.monotonic() ; print(t2-t1)
0.0

lone axle
#

You might try 5.0.0-rc.0. Not sure if anything clue releated changed from beta5 but worth a try.

simple pulsar
#
0.0
>>> t1=time.monotonic() ; clue.white_leds = True ; clue.white_leds = False ; t2=time.monotonic() ; print(t2-t1)
0.0
>>> t1=time.monotonic() ; clue.white_leds = True ; clue.white_leds = False ; t2=time.monotonic() ; print(t2-t1)
0.382813
#

Thanks, will load it up later

lone axle
#

If you try the same test with the regular on-board LED I wonder if you get similar weird delays occasionally

simple pulsar
#
0.0
>>> t1=time.monotonic() ; clue.red_led = True ; clue.red_led = False ; t2=time.monotonic() ; print(t2-t1)
0.390625
>>> t1=time.monotonic() ; clue.red_led = True ; clue.red_led = False ; t2=time.monotonic() ; print(t2-t1)
0.0
``` ๐Ÿ˜ฑ
lone axle
#

weird

simple pulsar
#

I just power cycled to get the resolution of time.monotonic() up and it only did it once on the first run.

lone axle
#

maybe try directly with pin instead of the library if you have a moment.

simple pulsar
#

387ms looks like the magic number here. That's a fraction over 3/8 of a second.

#

5.0.0-rc.0 does it too but the magic delay is ~ 275 ms

manic glacierBOT
#

Trouble at mill:

Adafruit CircuitPython 5.0.0-beta.5 on 2020-02-05; Adafruit CLUE nRF52840 Express with nRF52840
>>> from adafruit_clue import clue
>>> import time
>>> print(time.monotonic())
38.242
>>> t1=time.monotonic() ; clue.white_leds = True ; clue.white_leds = False ; print(time.monotonic()-t1)
0.386993
>>> t1=time.monotonic() ; clue.white_leds = True ; clue.white_leds = False ; print(time.monotonic()-t1)
0.0
>>> t1=time.monotonic() ; clue.white_leds = True ; clue.whit...
manic glacierBOT
arctic violet
#

@meager fog has anyone made a video game on the CLUE yet?

manic glacierBOT
#

The manually initiated refresh does measure at the same value.

>>> board.DISPLAY.auto_refresh=False
>>> t1=time.monotonic() ; clue.red_led = True ; clue.red_led = False ; print(time.monotonic()-t1)
0.0
>>> t1=time.monotonic() ; clue.red_led = True ; clue.red_led = False ; print(time.monotonic()-t1)
0.0
>>> t1=time.monotonic() ; clue.red_led = True ; clue.red_led = False ; print(time.monotonic()-t1)
0.0
>>> t1=time.monotonic() ; clue.red_led = True ; clue.red_led = False ; print...
meager fog
#

@arctic violet not yet ๐Ÿ™‚

#

@indigo wedge silly Q - whats the diff between the RT1011 and RT1010? i can only find them selling 1011 but datasheet for 1010

arctic violet
#

Ok, I ordered one to take a swing

indigo wedge
#

1010 seems to be the name of the sub-family and 1011 is the actual chip

#

There's no 1010 chip

orchid basinBOT
meager fog
#

@indigo wedge ok cool ! im going to make a 'arduino uno' shaped board to start - large but easier to prototype/debug/fit things

#

like boot switches ๐Ÿ™‚

#

i had it mostly done but now i can check against working schems instead of guessin' ๐Ÿ™‚

indigo wedge
#

That's always good :D

ionic elk
#

ooh ooh can I have one

#

when they're done

indigo wedge
#

I'm waiting for rev 2 boards of my Feathers to arrive :)

meager fog
#

@indigo wedge the evk has an auto-reset chip (UM803) ... did ya never see a reset/boot failure?

#

also, ya have SD_13 is grounded but can't figure out what for - just a routing thing?

indigo wedge
#

Yes it has a reset delay chip but I never had problems without it

meager fog
#

kk i might toss one on and DNP

#

ive seen the feather m7 'not boot' on power up a few times

#

could be unrelated

fallen anvil
#

Watch out for the power sequencing errata. Don't know if it applies to the 1010s but on the 1020s you have to bring up the battery supply a couple of mS after the main supply...it's in the errata.

meager fog
#

kk yah

#

im checkin my power supply section now - lots goin on ๐Ÿ™‚

fallen anvil
#

The not boot is probably down to that.

indigo wedge
#

SD_13 is low because it's BT_CFG3 and it needs to be low for reasons that escape me now

meager fog
#

k np ill check it out

#

sometimes if my plane needs some โค๏ธ ill ground unused GPIO

fallen anvil
#

@indigo wedge do you use the boot fuses or have the full set of pins pulled?

indigo wedge
#

i use pins cause i couldn't figure out how to burn fuses until recently

#

mubes yeah i believe its the same on the 1010 and that's why the delay chip is there but i've never seen that problem

fallen anvil
#

I have :-(

meager fog
#

@indigo wedge one thing, no biggie but noticing as i compare EVK and yr schem - there's a lot of DNP caps you place

fallen anvil
#

The delay chip pulls it out of reset after the supplies are stable but doesn't affect the relative timing of the two supplies.

meager fog
fallen anvil
#

@meager fog have you looked at the hardware design guidance document?

indigo wedge
#

I followed the hardware design document for those

meager fog
#

im using the EVK for now

#

im placin' all the DNP - wonder why they dropped them on the evk

indigo wedge
#

It lists at least one 0.1 and 4.7 on that and more nets

meager fog
#

npnp

#

ill also get the hardware doc

#

i like those cause you can tell it was written by frustrated apps engineers

fallen anvil
#

It's actually a pretty good doc...nice and clear.

meager fog
#

"look just PUT THE PULLUP OK?"

#

"STOP EMAILING US IF YOU DO NOT PUT IN THE PULLUP"

indigo wedge
#

My Feather has even more caps, I had to remove like 3 or 4 on this one cause of space

#

But each net has at least one of the recommended ones

meager fog
#

~the most caps~

indigo wedge
#

It was the first one I designed so didn't want to undercap it :D

fallen anvil
#

1010/1020 are a bit over the top because they assume two layer.

meager fog
#

im gonna try to 2 layer this metro

indigo wedge
#

I can probably remove some one mine too

meager fog
#

i like using 0805s for 4.7uF+

#

we'll see what fits

fallen anvil
#

Good luck. I did first rev 2 layer and immediately went to 4...signal integrity wasn't good.

meager fog
#

๐Ÿ˜ฆ

#

im ok with that...

fallen anvil
#

My grounds were shoddy though.

indigo wedge
#

Yeah I attempted 2 layer on yours first but the was no way to route power and have good ground

#

But on a arduino sized board it might be possible

#

Way larger

meager fog
#

ya totally - feather gotta go 4

#

we'll see ๐Ÿ™‚

indigo wedge
#

I'm impressed I managed to get 4 layer for the 1062 even :D

meager fog
#

thats nice - i think the teensy is 8 or 10

#

@fallen anvil which board did you make?

fallen anvil
#

Versiboard2...a 1020 with can,rs485, ethernet, WiFi, by and a pi header....pretty much a kitchen sink board.

meager fog
#

nice!

#

are you planning to port circuitpy to the '20?

#

or use linux..?

fallen anvil
#

Already runs CP :-) that's what I'm working with. It's open source but I'm not intending making any commercially...if anyone else wants to they're welcome.

indigo wedge
#

@fallen anvil seems odd

meager fog
#

wow thats a pretty big hobby project ๐Ÿ˜„

indigo wedge
#

1062 has some awesome peripherals and would make a nice board but it would require way too much SW dev for my liking :D

river quest
#

here's the DRAFT of the upcoming โ€œPython for microcontrollersโ€ newsletter that ships out tuesday at 11am ET via adafruitdaily.com - please send any links, news, events and more via an issue/PR, or @ us or really any thing ๐Ÿ™‚ we'll get it added! https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2020-03-03-draft.md

simple pulsar
#

For circuitpython library, is it intentional that the apds9960 RGB sensor is initialised to run at about 1.4Hz?

manic glacierBOT
fallen anvil
#

@meager fog sorry, was diverted running an ice hockey match. Yes, it was a bigger job than I expected to be fair, especially since I wanted to do the EMC/ESD properly. It actually ends up a really useful board cos I can plug most pi hats straight onto it. Trouble is the pins on the pi header are the boot selection pins so you generally have to burn the boot fuses if you want to use that (mostly cos I wanted to experiment with the boot from sd functions)

meager fog
#

huh

fallen anvil
#

@indigo wedge obviously gone into stealth mode, but not intentionally :-/ not sure what happened there. Could do with producing a new rev that tidies up a few flappy edges (move from bcm to esp32 for WiFi, change a bit of pinning) anyway.

meager fog
#

ok got a rough draft whew - seems like the gpio pins will go underneath ๐Ÿ™‚

fallen anvil
#

Using the 100 pin? Would be really handy if you made sure Swo is available on the debug header....

meager fog
#

oh yeah i gotta find SWO

indigo wedge
#

Nice, is that first adafruit arduino form factor with type c?

meager fog
#

P1_14/GPIO1[7]/U1_RXD/EMC_D7/T0_MAT2/SGPIO10

#

yeah

#

its actually a ripped up metro airlift

indigo wedge
#

@fallen anvil 1011 only comes in 80 pins

meager fog
#

P1_14/GPIO1[7]/U1_RXD/EMC_D7/T0_MAT2/SGPIO10P1_14/GPIO1[7]/U1_RXD/EMC_D7/T0_MAT2/SGPIO10

#

is swo

fallen anvil
#

Ah, didn't know that....

#

We'll, acrually, I think I did somewhere in the back of my head, but I didn't pull it out.

indigo wedge
#

My 1062 Feather LCD header breakout pcb is delayed, really want to try to get that working with displayio

meager fog
#

wait no thats wrong part of schem

fallen anvil
#

Well, displayio deffo works on imxrt ๐Ÿ˜

meager fog
#

@mrubes do you remember whats the hardware app note?

fallen anvil
#

I'm not home at the moment, I'll dig it out in a few hours. It's not actually an ap note, I think it's called something like the hardware design manual. I've only dealt with the 1020 version though.

meager fog
#

npnp will find

#

theres about 30 dox

fallen anvil
#

Yeah, and it's pretty low profile...you can easily miss such a useful doc.

#

Ping if you find it, otherwise I'll dig it out later.

#

I never did get to the bottom of using a rechargable battery (Panasonic ml10 or similar) properly on these boards, but it would be really handy to have cos it enables rtc and non volatile storage.

meager fog
#

i found it

#

ya

#

but doesnt have any info on swo

#

๐Ÿ˜›

#

๐ŸŒฎ time

onyx hinge
#

swo is the thing that lets you do debug prints that show up via j-link, not over the repl?

hybrid flume
#

Hi, I read in some old blog posts going back to 2017 that the Feather M0 Wifi cannot run with wifi with Circuitpython? Is that still the case? (bought my 1st one this week - I hope it does !)

onyx hinge
#

@hybrid flume Unfortunately, I think that is still the case. There's just not enough resources (not sure if RAM or ROM/flash is the limiting factor) to include the required functionality for wifi and circuitpython at the same time. You can use it with the Arduino environment, and there may be a way to use it with circuitpython but without the wifi functionality.

manic glacierBOT
indigo wedge
meager fog
#

@indigo wedge ๐ŸŒฎ'd and ready to route the gpio

main meteor
#

Two layers? An ESP32, a USB-C, and that other high pin count chip? I don't know what you're building, but colour me impressed.

meager fog
#

@fallen anvil do i implement i2c/spi/uart with flexio or use the lp peripherals

indigo wedge
#

lp peripherals, no flexio support in code yet

meager fog
#

ahh ok ill look at the mux options

indigo wedge
#

The 5.0.0 is gonna be a good one ๐Ÿ˜„

fallen anvil
#

@indigo wedge use the LP stuff

#

...ah, what @indigo wedge said :-)

meager fog
#

yep ๐Ÿ˜„

#

the QSPI blocks a lot of options so it isnt too hard ๐Ÿ™‚

fallen anvil
#

Muxing is a pain on the 144 so lord knows what it must be like on the 80!

meager fog
#

its eaier..no options

#

like there's no way to have SPI2 ๐Ÿ˜ฆ

#

cause SCK is either on the QSPI flash or on the SWDCLK pin

fallen anvil
#

<voiceofexperience>make sure you optimise the ground returns on the qspi</voiceofexperience>

#

I'm home now...did you find Swo?

meager fog
#

yep

#

JTAG_TDO AD_09

fallen anvil
#

Great, means we can use Orbuculum to do performance monitoring and optimisation.

tulip sleet
fallen anvil
#

That's how I produce the 'top' style outputs.

tulip sleet
#

so this is substitute for the expensive J-Trace?

#

Which debugging probe do you use?

#

(I am thinking of chips other than i.MX at the moment. SAMD51 is not supported by the BlackMagic.)

fallen anvil
#

Sort of...it only does sampling rather than exhaustive trace (there's some experimental FPGA trace in there but it's not cooked yet) but it's good enough for a lot of applications

meager fog
#

ok lookin for i2s pins next

tulip sleet
#

could I use an ordinary J-Link Basic? Do you know?

fallen anvil
#

Works for a lot of probes. When I'm feeling lazy I use jlink...can get 50mhz out of that

#

Yes

tulip sleet
#

ah, great, this is great new info

fallen anvil
#

I guess I am 'orbcode', so I know a bit about it :-)

#

Goto www.shadetail.com and read forward from the first article (but skip the ones on visual studio code)

#

You need samd51 in bmp?

tulip sleet
#

you are orbcode, is that what you're saying ?!

fallen anvil
#

Yup

meager fog
#

@indigo wedge haha what is this MQS thing? its an internal I2S->HFPWM??

fallen anvil
#

Run away!

tulip sleet
#

you have multiple identities ๐Ÿ™‚

fallen anvil
#

Afaik it's intended for things like ringtone generators

indigo wedge
#

haven't really looked into the Medium Quality Sound thing

fallen anvil
#

Fraid so, you have no idea : ๐Ÿ˜ˆ

tulip sleet
#

i don't personally need samd51 in bmp, because i have a jlink, but it was disappointing that samd51 wasn't added to it (at least the last time I looked)

fallen anvil
#

I guess we can add it...just never been a fan of the sam51 stuff. What reference board?

tulip sleet
#

our metro m4, feather m4, etc. we use it for many boards

meager fog
#

@indigo wedge its on adc pins so im gonna expose it anyhow

#

since theres no DAC

fallen anvil
#

The big issue in bmp at the moment is keeping the probing sane...the idea of bmp is that it just works, but that needs probe support, which gets painful when the probe for one thing Bork's another.

tulip sleet
#

it says nRF52 is supported, but does that include nRF52480?

fallen anvil
#

Tbh i was thinking about putting the 'guts' of bmp as c under cp...then we could run scripts on the target interface

tulip sleet
#

we sell the BMP, and I have one, but I have a jlink too, so i didn't have a strong reason to switch

fallen anvil
#

Yes...there's one report of a problem but I can't create any issues.

#

Actually, I think the ball is in my court to do more testing.

meager fog
#

@indigo wedge any interest in i2s? i didnt see any notes in your schem

fallen anvil
#

Uwe is the main coder on it nowadays....I sort of kick around on the edges and shake out specific issues.

indigo wedge
#

nope, totally skipped that one

fallen anvil
#

Actually, I think imxrt support is the one thing I want to get into bmp.....jlink always feels a bit fragile on it.

meager fog
#

@indigo wedge k ya exposed it on D9-D13 - lucky you ๐Ÿ˜‰

fallen anvil
#

@tulip sleet it's worth noting that Swo will interface even with a simple uart interface as long as you keep the baudrate low enough.

tulip sleet
#

so it's sampling, like you said, I thought it was only for high-speed tracing, that's good to know. I'll take a look at all this. The orboculum stuff will be very useful for profiling, which we have not done a lot of. tnx for all this info!!

indigo wedge
#

yeah we use almost all pins on the 1011 anyway so chances are we expose almost everything

fallen anvil
#

Orb needs more users to start kicking it around and shaking through any bugs. It will do sampling, 32 separate channels of software debug (ASCII or ints or whatever) and 'exceptions' (interrupts) counts and timing. There's also some basic support for profiling using the GNU tools and code performance investigation using kcachegrind....but that definitely needs some love.

#

Swo is desperately underloved :-/

tulip sleet
#

i will read about it, definitely

meager fog
#

@indigo wedge yeah just noticed im short a few pins. i wonder if i can reuse the BOOT pins as outputs :/

indigo wedge
#

this is where i'm a bit unsure, because you can disable the boot pins via a fuse

#

but you also need them to get into rom bootloader mode

meager fog
#

yeah i just need one pin ๐Ÿ˜„

#

no.. 2

#

one for esp cs

#

and one for esp gpio0

#

i guess no separarte UART 4 u esp

onyx hinge
#

the i.mx rt register datasheets are behind a signin-wall? ugh.

fallen anvil
#

...but their drivers are MIT iirc? Takes a long while to change the direction of an oil tanker I guess....

#

Ah, BSD. Same difference, different coast :-)

meager fog
#

startin' to come together...

fallen anvil
#

I know you've not got the earth planes in yet, but pin4 of the QSPI needs to come directly back to the CPU ... pin 63 & 71 at least if you can (assuming I've counted right)

#

..or am I reading it upside down?

#

I am, sorry, gnd isn't in yet :-/

meager fog
#

gnd isnt visible

#

ya i hide em ๐Ÿ™‚

#

and we'll see where we are

#

if i need, can always ez make gnd layer in a 4 layer pcb

#

and signals are outer

fallen anvil
#

You've potentially got 133MHz going through there....it's pretty much the only bit of tracking I'd stress on (besides trying to get the USB something like)

meager fog
#

yeah i wish i didnt have to use vias

#

but like for some reason they didnt align the gpio pins in order!?

#

i see this on the samd51 too

#

whyyy

fallen anvil
#

I know that works :-)

#

...but I do have the luxury of 4 layer

#

Slightly outdated, but that's pretty much the current layout.

meager fog
#

hmm do i have the chip flipped

indigo wedge
#

sweet board mubes

fallen anvil
#

opposite to mine, but IDK if thats how your pinout is arranged on the 80 pin

meager fog
#

nono should be consistant

#

let me commit and try

fallen anvil
#

passives on the back...means jlcpcb can do that stuff and just leave me with some soldering practice :-)

meager fog
#

@fallen anvil can u give me a larger screenshot

#

i cant read the tracenames

fallen anvil
#

sure

#

They're just nettames, not that useful

meager fog
#

odd it doesnt match

#

thinks

fallen anvil
#

yeah, very. Can you snapshot that part of your CD?

meager fog
#

the layout?

fallen anvil
#

the QSPI part of your circuit diagram

meager fog
#

ya

fallen anvil
#

This is mine...the imxrt is different, so perhaps not so useful;

meager fog
#

yah odd - this is artur's

#

maybe they didnt make it as nice ๐Ÿ™‚

#

yay 3 airwires

fallen anvil
#

so were they expecting it to mount on the underside?

indigo wedge
#

this might make a nice CPY candidate cause built-in wifi and usb

#

i have the beta dev kit but on that one the usb doesnt work

meager fog
#

yayy

#

maybe ๐Ÿ™‚

#

maybe clue would be nice with wifi too

#

maybemaybemaybe

#

@fallen anvil i think so

#

gRoUnDpLaNe TiMe

fallen anvil
#

No, from the outside;

meager fog
#

oh yeah

#

i guess

#

but if you're doing these cheap chips

#

you'd do SOIC

fallen anvil
#

Right, really should get onto what I came in here to do :-)

meager fog
#

like why go with an 80 TQFP $1.50 thing

#

and then go with uson flash??

#

hah ok sorry for distracting u!

fallen anvil
#

no, someone elses' problems are always more interesting, 'cos you can walk away from them

main meteor
#

Yay SOIC

meager fog
#

@fallen anvil there should be a discord for routing boards ๐Ÿ˜„

#

and we all just route each others'

#

i think im in good shape

indigo wedge
meager fog
#

oh yeah shoot well

#

i forgot hehe

fallen anvil
#

I like that plan :-) @faint galleon has a 'manufacturing' one which is quite handy

meager fog
#

lol

#

can u invite me

#

im not in that discord

fallen anvil
#

really? I thought you were... @faint galleon is here and green, so I guess he can pick this up and send you an invite

#

I'll see if I can figure out how to shoot you one. I'm not good with technology.

indigo wedge
meager fog
#

thanx

onyx hinge
#

yay, squashed a ulab bug with unusual slicing and added more tests

#

I know of some other hardfaults, will work on some of the next session

fallen anvil
#

This makes me very happy. Only about 30 hours since I started actually working with the python and I've got a network synchronised clock with sht21 temperature and humidity. Impressive platform, kudos to everyone involved!

meager fog
#

@fallen anvil ๐Ÿ™‚ what are you using for network, an esp breakout?

fallen anvil
#

Yes, just an ESP32 running the NINA firmware. These boards support MURATA 1DX modules but frankly the ESP32/NINA is less painful and cheaper.

meager fog
#

yeah agreed- i did the math and given that the esp32 does tls and certificate storage for you...

#

its not worth working with a raw wifi chip - unless you need really fast speeds the esp32 maxes out at 8mhz

fallen anvil
#

Yep, there's a lot of stuff ends up on your own firmware if you don't use those...which means a whole new set of bugs.

meager fog
#

iwrote a tcp stack once and im not doing that again

fallen anvil
#

Well, I was looking at that, there's a QSPI interface available...

meager fog
#

๐Ÿ˜

fallen anvil
#

woohoo

meager fog
#

i tried rerouting the qspi pins so they go around

#

but i didnt like it so much

#

i feel this is better :/ will see

#

2 layer still

fallen anvil
#

Will be interesting to see what the signal integrity is like. The board is quite small so perhaps you'll get away with it.

meager fog
#

the issues you had were with qspi skew?

#

i prioritized the qspi and usb traces since the app note seemed to be very specifica bout em

raven canopy
#

Metro M7. it sounds soo good! ๐Ÿ˜

fallen anvil
#

Just corruption above about 80MHz... Yes, they're important, and the gnd return paths are just as important - those loops are antennas

meager fog
#

hmm

#

you set the qspi freq with the boot fuses?

fallen anvil
#

No, in the flash config. The first chunk of the SPI is read out that contains the boot configuration for the pins. That's done SPI at 30MHz....then it's up to you how fast you go.

meager fog
#

oh thats the little structure you put in the beginning?

fallen anvil
#

...of course, you go too fast, you have a problem.

meager fog
#

lol

#

๐Ÿšค

fallen anvil
#

Yes, there are a few of them; the SPI config, an initial vector table for the runtime and 'dcd_data' which can be used to configure pins on the chip without user code. It gets aweful complex aweful fast. tinyuf2 is a much easier and less painful approach cos it does all that stuff for you.

meager fog
#

๐Ÿฅฑ ok i have to take a break, been routing for a few hours and my eyes ache

fallen anvil
#

yeah, I'm off to bed. Night.

meager fog
#

ill order these PCBs and see how they go ๐Ÿ™‚

orchid basinBOT
onyx hinge
#

time to dust off the xtensa port I guess... any place to buy an evaluation board yet? (re: ESP32-S2)

onyx hinge
#

this looks like a fun chip that could use a circuitpython driver! https://www.sparkfun.com/products/15734 -- not exactly sure how it compares to https://www.adafruit.com/product/2045 except I see the VersaClock (sparkfun) part's datasheet has a low end of 1MHz out while the Si part goes down to 8kHz

#

I think the granularity of the SP49V may be much finer, based on some cursory time with a datasheet

manic glacierBOT
#

@tannewt I opened a new file for the Arabic translation for us to test an alternate way of displaying messages so that the Arabic writing of words retains proper order in a sentence with English words. Whenever you can, please test it out and screenshot the result. I also added commented lines of the displayed message strings within the code so you can see how it's supposed to be displayed.

Hope this resolves things!

manic glacierBOT
tulip sleet
#

@slender iron I'm thinking I'll make an rc.1 today that incorporates the "download from s3" fixes and the minor i.mx fixes. No other code changes. That will vet the s3 downloads links, avoid the release assets problem, so that rc.1 -> GA will be painless.

#

and make the i.mx release work at bit better

manic glacierBOT
#

This is in prep for 5.0.0-rc.1.

  • Merge in a small number of i.MX-related changes to improve 5.0.0 usability for i.MX.
  • Already merged to 5.0.x from previous PR are the changes to not upload assets to github releases, but instead rely on S3 downloads. https://circuitpython.org/downloads is already changed over. This will avoid the need for any manual fixups for the 5.0.0 GA release.

There are no code changes to CircuitPython itself except for the i.MX builds.

simple pulsar
#

Is this a bug? I'm trying to update text on a Label: ```Adafruit CircuitPython 5.0.0-rc.0 on 2020-02-26; Adafruit CLUE nRF52840 Express with nRF52840

import board, terminalio
from adafruit_clue import clue
from adafruit_display_text import label
d_text = label.Label(terminio.FONT, text="One", color=0xff0000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'terminio' is not defined
d_text = label.Label(terminalio.FONT, text="One", color=0xff0000)
d_text.x=100
d_text.y=100
board.DISPLAY.show(d_text)
d_text.text="Two"
d_text.text="Three"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_display_text/label.py", line 203, in text
File "adafruit_display_text/label.py", line 130, in _update_text
RuntimeError: Group full

onyx hinge
#

@simple pulsar the max number of characters in a Label is set at its creation time, because the number of items in a groups is set at group creation type. If the argument is not specified, it is the length of the initial text.

lapis hemlock
#

@onyx hinge I would like to pop a couple of questions in the weeds tomorrow. Do I write it up now, or does that happen during the meeting?

onyx hinge
#

@lapis hemlock it's best if you add at least a small text to the "in the weeds" section, so we don't end the meeting prematurely. Write up as much or as little as you want.

lapis hemlock
#

OK, thanks!

onyx hinge
#

talk to you tomorrow!

lapis hemlock
#

@onyx hinge I'm looking forward to it. Do you want to merge your changes? Thanks, by the way! In the past week, you have been quite busy with ulab. I really appreciate it.

onyx hinge
#

@lapis hemlock thanks! I think the slicing PR is ready for merge, so feel free.

simple pulsar
#

@onyx hinge Thanks, I hadn't realised it was related to the length of the initial string. Someone before had mentioned that each character was treated as a "thing" - i forget the term.

onyx hinge
#

@simple pulsar yes each character is a TileGrid within a Group. (this means they also use a surprisingly large amount of memory!)

manic glacierBOT
simple pulsar
#

@onyx hinge Do you think there's an argument for making the exception more informative/specific to the issue?

onyx hinge
tulip sleet
#

the library could catch the exception and re-throw it with a better message. I agree it's confusing

onyx hinge
#

yes basically what dan said

simple pulsar
onyx hinge
#

I retitled the issue

#

(making groups resizable in the core could also solve the problem and get rid of max_glyphs..)

manic glacierBOT
orchid basinBOT
lone axle
#

Right now scanning is mostly manually triggered with a button press, should it happen automatically on some schedule? It's also hardcoded to 8x8 grid size, but I've tested 15x15 as well. I'm not sure how big of a scan results list will be expected in an environment like pycon, I had planned on adding some logic to choose the best size from a few as the list grows.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 5\.0\.0\-rc\.1
orchid basinBOT
timber mango
#

@ladyada I built Linux from scratch successfully twice but never again. ๐Ÿ˜๐Ÿ˜Ž

#

s/ada/ada

#

Dagnambit.

timber mango
#

I almost have the hardware build of my Little Red Rover complete! After that is done I can continue working on the really fun part - the software.This is an all Adafruit build. I just have to make one cable to complete the hardware and do a little cable management. It will use a VL53L0X for distance checking.

I have already written and tested a lot of code for it.

#

s/for it./for it. ๐Ÿ˜€๐Ÿ˜€

timber mango
#

I do not like the Android Discord app! ๐Ÿ˜•๐Ÿ˜ฃ

indigo wedge
#

@tulip sleet misspelled spi

#

Also thank you for the imx fixes included :)

tulip sleet
#

@indigo wedge will fix, and you're welcome!

manic glacierBOT