#circuitpython-dev
1 messages Β· Page 232 of 1
what is it supposed to be?!
you mean they only have one clock for both?
yeah
so if you create an enum out of that chart without reading all the indexes, you end up off by one and you turn on the wrong clock instead of the sercom clock
I think you should file an issue with MicroChip about that, to note it in the doc.
haha, there are several issues I could file with microchip
I'm just looking to see if it's a typo or something
they state that divsel makes the divider 2^(n+1) when in fact it's 2*(n+1)
I've found a few issues in their SVD as well
Any objections to me calling my CP version of Lispy "CircuitLisp"?
They do respond to filed cases via their issues/case mechanism. At least it will be put on someone's TODO list.
@exotic pumice
Note entry 26. The entries for 9 should be like that.
@umbral dagger I'd say pass it by pt.
or like entry 3
yah
where is this issue tracker?
hold on...
@exotic pumice https://microchip.secure.force.com/microchipknowledge/articles/en_US/FAQ/How-to-submit-a-case/?l=en_US&fs=Search&pn=1 you'll need to register for an account
How to submit a technical support case in our new technical support system?
alright, I'll get on that
Hello,
I spent the last two months trying to track down a bug that ultimately ended up being due to the confusing way you have listed TC0 and TC1 in the PCHCTRLm table, table 14-9. You have two entries in the table with the same index (9), but no visual indication that they are linked. This caused me to write an enum starting at 0, going along every row of the table, which led to an off by one error, because I didn't see TC0 and TC1 were actually the same index. I recommend you change the way you have noted TC0 and TC1 to something more like entry 3 or entry 25, so it is more visually clear that they are the same index. I'm hoping an improvement to this documentation can prevent others from making the same mistake I did.
Cheers,
Paul Sajna
submitted one for divsel, now I gotta remember all the SVD issues I found
maybe I'll just send them a diff as a .patch file
@exotic pumice wow - nice find
there are some typos in ASF and they are Really Exciting :/
@slender iron FYI -- I was able to get the displaytest you posted yesterday running with these two changes -- do they make sesnse?
@gilded cradle heya do you need any help with seting up ESPSPI? ive been swamped π
@slender iron second change
@meager fog I think she has it running -- she tested some examples I posted in a PR to the repo
I filed 3 issues.
This PR adds:
- 3 upstream commits which brings in the latest changes (upstream history)
- One stalled patch by @deshipu that enabled me to parse ini file headers for the CPython configparser
- One
match(..., pos, endpos)patch that enabled me to port the CPython textwrap module without a lot of custom parsing code - Enable this on samd boards with a l...
@slender iron any naming preference on the shape lib?
@solar whale cool - yeah i commented that maybe a wifi manager could be useful. i dont think ill get to writing one soon - i have some socket optimizations to work on which are weedy
but if you want, you could gank some of my code from here https://github.com/ladyada/Adafruit_CircuitPython_PyPortal/blob/master/adafruit_pyportal.py
to make a happy wrapper that is optimized for requests which, honestly, is what everyone wants
like you'd call get or post directly on the object and it would ferry that to requests for you
then you just init it, and call get/post to fetch data. then on each call it would also check connection n all that
read settings.py n all that
maybe also expose ping
i like using the neopixel for status too, blinks when xfering data, red when connecting to wifi, etc
OK - thanks -- will take a look -- lots of new stuff for me so it may not be fast...
any suggestions?
you dont have to write it all, i can probably do some π
just figure it would be nice to not replicate the access point code
and a shapes ever not in a tilegrid?
@meager fog OK -- took a few minutes to sink in , but I think I see waht you are looking for. sounds likea good way to go. I'll see what I can do - should have some time this weekend
or if @gilded cradle would prefer to take it on, thats fine with me
@solar whale ya, those fixes look good
@marble hornet how about "Adafruit_CircuitPython_Display_Shape"?
and ya, I think all in a tilegrid to start so that the api can include color
https://github.com/TG-Techie/TG_Display_Shape mind think alike
give me a min to commit my local code
i haz more questions, do you have a few min?
pushed!
okay two things: does adafruit mind forking from my repo? (if not this is me giving express permission to gank the code as long as it is attributed)
@notro Thank you for the update! Because its hard to reproduce and likely timing related I'd like to punt this to future versions. I think it'll be a large task now. Any related bugs/behavior make it easier to debug.
@TG-Techie Do you have a debugger handy like a JLink? That would allow you to get a backtrace.
not hand, I'm back near one on Saturday after 5
@marble hornet We have forked other repos previously, but it's usually easier to create a new repo. You have to put all the code into cookiecutter and deal with all of that anyway. And of course you would get attribution π
TG, my use case is with needing to 'cache' online data and displaying it within the same runtime so moving files on reset wouldnt be able to use that technique
Hi @meager fog, yeah I got it working. @solar whale, yeah I could probably take that on. Seems pretty straight forward and is definitely in my wheelhouse.
@gilded cradle Great! Go for it -- let me know if you need any help or testing.
Ok. I'll have to wait until later tonight to work on it, but I'll let you know if I have any questions.
I would not have done anthing until Friday at the soonest.
Yeah, I'm trying to juggle a bunch of stuff with moving and all, so I'll need to sneak in a little development here and there when I can.
Life happens π Good luck moving?
Thanks @solar whale
@tulip sleet ran into an interesting issue -- I am testingthe adafruit_featherwing library alphanum or sevensegment functions and they work fine on a feather_m4_express, but they put the feather_nrf52840 (and argon) into safe mode -- I am running current master on all boards
They use the Adafruit_CircuitPython_HT16K33 library. Could you try the example in that?
actually they crash the nrf boards -- drop USB and end up in safe mode
could you figure out the simplest example and file an issue? They are I2C, right?
yes -- working on a simple example -- will file an issue -- just wanted to give a heads up. Yes I2C
we haven't changed anything about I2C recently, so hmm
I've heard that before π
i'll set it up with a doubler or something to debug. It might be due to I2C hogging the CPU so the BLE softdevice gets mad, maybe, maybe
OK -- I'm just running the "simpletest" for the alphanum or sevensegment (in latest pr). I'll try the ht16k33 test now
ht16k33 test works OK on the feather_nrf52840
Oh, that's good news. Can you tell which functionality on the FeatherWing library simpletest it fails on? I usually try and have it do a thorough range of stuff.
not yet -- it fails very quickly at the start and the terminal session closes so I loose any messages. working on a test
Ok. I was thinking of commenting out most of the stuff and slowly uncommenting until it fails.
Ill first jsut run in manually in the REPL
That works too
very strange -- the alphanum works fine when I run the commands normally fial the REPL
Maybe it's running stuff too rapidly that causes it?
kk
it crashes on the import of the featherwing lib.
this kills it ```print("import sleep")
from time import sleep
sleep(1)
print("import featherwing")
from adafruit_featherwing import alphanum_featherwing
Ok, that's odd. I'll take a closer look at the code. I just ordered an NRF52840 so I can use that for testing in the future.
from adafruit_featherwing import alphanum_featherwing works via REPL but crashes if in script. just the one line
I wonder if we can change it to import alphanum_featherwing and then in the instantiation change it to alphanum_featherwing.AlphaNumFeatherWing(
@tulip sleet see above -- one line kills it -- shpuld I file the issue in circuitpython or featherwing?
@solar whale, could you try different versions of CP?
yes, will try that
not sure if 3 support the nrf boards
Oh, good point
I try earlier version of 4.
Ok. If we can get it to not fail then it may be a CP bug.
@solar whale @gilded cradle if you can, try beta.1 or alpha.5 on the nRF too, since there have been significant changes since then
it fails on beta2 and on beta0
beta.2 changed how the BLE and tinyusb stuff were set up. It's a significant change for the nRF52840
Yeah, I think I tried it on all betas while developing with the Feather M4 Express
However, I'll try it on the nrf board when that comes in
I have to rebuild before beta0 since there are not .uf2s --- but since it work in REPL -- hard to thin whats going on.
but since it does work in the RPL, hard to blame the library... I'll open an issue in CP.
Well, what probably happens is that when it's imported, it cascades other imports within those libraries, so maybe we need to dig a little deeper.
However, I'm not sure why it wouldn't fail in the REPL in that case, but worth looking at.
i'm trying to find it, but i remember an issue with periph calls too early after reset... can't remember if it was in the GH issues or on the forum.
Executing this line from the REPL on an nrf52840 succeeds but if it is placed ina script and executed the board crashes - drops USB connection and enters safe mode
from adafruit_featherwing import alphanum_featherwing
I have to go for a few hours -- will dig more later.
Ok, thanks for your work with looking into that Jerry
it would be nice if someone can reproduce the issue
"You build it, we'll break it!" - Jerryn Industries. π Thanks @solar whale. if i had any of my particle boards CP'd, I would try. prob won't have any cycles tonight...
uh-oh...
/usr/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld: build-itsybitsy_m0_express/firmware.elf section `.text' will not fit in region `FLASH'
/usr/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 7380 bytes
collect2: error: ld returned 1 exit status
Makefile:446: recipe for target 'build-itsybitsy_m0_express/firmware.elf' failed
make: *** [build-itsybitsy_m0_express/firmware.elf] Error 1
may have to try and update the branch to current, or abandon M0. π¬
oh...that's even more perplexing. π€
What do you mean by manually imported script?
Huh, I'll have to try that.
REPL
Ah, ok. That makes sense then.
Yeah, I just was asking how jerry did it.
its a nice little technique. reduces having to keep track of all those code/main .py's. π
I just copy the file to the.board then import.
I hadn't thought about doing that, but I probably will more often now.
whats a finished project? never experienced that... π€£
I use it for dev work because I can just save it and it reloads
That scares me π
Well, it sure speeds things up. However, I can see it being a problem if it puts your board in a looping state.
In that case, it may be good to place a 2 second delay before code starts executing so you have a chance to put it in REPL mode.
but now you can force boot to safe mode so you can remove the file
How do you do that?
slow double tap on RESET button about .5 sec -- instead of going to bootloader - it goes to safe mode -- yellow neopixel
Oh, thanks. I didn't know about that.
i have never used until just now it works!
π
more like 1 second between tap
Ah, ok
I thought I was leaving ... soon
π
looking at the library code -- it ia hard to see a cause, but as I have learned, when code does not work, stop focusing on waht it is supposed to do and focus on what it is doing....
Yeah
hmm. time to ask myself this question again: to git reset --hard or wade through a painful merge/rebase. reset and re-glue wins...
I'm fond of git pull --rebase upstream master git push --force-with-lease origin master
- Fixes safe mode on the SAMD51. The "preserved" value was being
clobbered by the bootloader. - Fixes auto-reload loop when in safe mode.
- Fixes reading Group children with [].
- Check that a TileGrid actually moves before queueing a refresh.
i guess i could give that a shot. i am way off from current, and have changes peppered throughout. thanks @solar whale
i've backed up the "difficult" stuff, so if i lose it all the easy things won't take to long.
at least it's a known starting point. just save your changes!!
yay -- finally time to go -- I'm hungry -- back later.
This shouldn't be long-lived because it is freed below. That will leave a hole in the long-lived area. It won't move because no other python bytecode is run while it's alive.
windows and symlinks. π‘
@dhalbert What do you want to do for this?
@tulip sleet Howdy, you were awesome helping me with some tips on MemoryError yesterday. I uploaded my code here: https://github.com/steclarkdev/BeeLamp/blob/MemoryErrorCode/code.py
@tulip sleet Really, I was hoping there was a comprehensive guide on memory profiling, optimization etc. I did my due diligence but only found the one page on expectations that mentioned around 250 lines of code. CPX board
@tulip sleet Idk if there's coding tips somewhere or a guide to "Just skip python and move to c code if you...".
@wild pasture i'm in a mtg but will get back to you!
@tulip sleet No rush! Sorry, i had to bail yest bc I have a 13 week pregnant gf who needed dinner ASAP lol. Ty, appreciate it!
OK, I was worried that MICROPY_VM_HOOK_LOOP might end up doing something. But it looks like even the displayio stuff will not trigger anything. (Just checking.)
@ladyada Do you think we should try to make certain pins high drive strength (e.g. those assigned as I2C or SPI), or just forget this for now?
@wild pasture I did a memory deep dive a couple weeks ago if you want to jump in the deep end: https://www.youtube.com/watch?v=baa5ILZTRkQ
Live stream of @tannewt debugging memory issues in CircuitPython. Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------...
No ure module in the Feather nRF52840 build?
Β―_(γ)_/Β―
It's there on the grand central and feather m4 & itsy bitsy m4
@umbral dagger, that's an accident; could you file an issue? Is json there also?
is it re instead of ure?
I'm wary of splitting what re supports across m0 and m4 boards. What do you think about slimming down the SAMD clock stuff further to fit these changes? We're basically out of space in the m0 expresses so we'd need to trade out something for this.
The ure module is present on the Feather, ItsyBitsy, & GrandCentral, but not on the Feather nRF52840.
@slender iron will do. Any self-service i can do i will. Appreciate it!
Updated to not use long-lived. Travis is happy.
Please try it with #1548.
Smaller examples that cause the crash are handier as well. Thanks!
I'm going to refactor the mpconfigport.h files so we have a common set of features turned on/off across the atmel and nrf ports.
There are some serious differences, including choice of MICROPY_OBJ_REPR (!).
@slender iron ohmygoodness, the nrf port is actually using MICROPY_OBJ_REPR_A, and atmel-samd is using REPR_C. REPR_A uses heap-allocated floats (!) (which means two more bits of accuracy, but more ram)
like I said, I'm going to refactor the includes so these are all consistent
interesting! I'm considering boxing in 2-tuple of small int
really handy for position tuples
you could overlay that with the 31-bit ints, I guess - no need to actually make it identifiable as a 2-tuple
atmel:
>>> 1/3
0.333333
nrf:
>>> 1/3
0.3333333
we're not going to keep this
gotta have that quad floating point π
One item mailbag! A look at the Swissmicro DM42, the world's most precise pocket calculator. A clone and improvement of the famous HP42S, with open source fi...
it's an stm32
id have em all be high drive strength - people like to connect LEDs and stuff...maybe at some point we can offer a way to configure the microcontroller.pin drive but we high strength default on samd already!
@slender iron @tulip sleet i'm trying to get FrequencyIn back to an active review, but in seeing that we're out of memory on M0 express, I'm guessing that I should just scrap M0 support?
@raven canopy ya, maybe make a frequencyio for it
you can leave any m0 code in that you have
π€ yeah, that would probably be the easiest way. seeing as how we're trying to get out of the #ifdef quagmire.
yup yup
haha pound-define heck
good thing i'm re-gluing anyway... haha
@ladyada Note comment above (https://github.com/adafruit/circuitpython/issues/1270#issuecomment-429569293) that Nordic says low-speed pins should use standard drive to avoid RFI. So there are arguments both ways: high drive so we can drive a lot of stuff easily; standard drive to avoid RFI. Maybe we'll have to document this, since if we respect the guidelines, it'll be confusing which are available for high drive.
I'd be happy to help review if you like
seeing as I know so much about clocks now π
I just submitted a very (IMO) interesting guide and code. π
lispy?
Now officially CircuitScheme
cool
It has a ways to go, but it's a good start. A better REPL is next on my list for it. I expect it to be an ongoing project for a while.
saaaaaaaaaame. I just "finished" atsamd-rs for samd51 but it has a ways to go for things like the dac, adc, dma, rng, aes, etc.
If I want to build up abstractions on all those
@gilded cradle I wonβt be able to do any more with the FeatherWing lib on the nRF52840 tonight. May be Friday before I can spend much time on it. In the meantime can someone with an nRF52840 try to reproduce the issue?
https://github.com/adafruit/circuitpython/issues/1545
Ok @solar whale . If somebody else isn't able to, I should get my board and be able to take over on Friday.
Great! Iβll be able to dig into it as well. Iβm really curious what is going on.
i'll look at this also, but prob not tonight
oh btw @raven canopy , I ended up needing a C version of clock_out for my debugging, might help you out in creating your own test frequencies
#include "sam.h"
int main(void)
{
GCLK->GENCTRL[2].reg =
GCLK_GENCTRL_SRC(GCLK_GENCTRL_SRC_DFLL_Val) |
GCLK_GENCTRL_GENEN |
GCLK_GENCTRL_DIV(4u) |
GCLK_GENCTRL_OE;
PORT->Group[0].DIRSET.reg=PORT_PA16;
PORT->Group[0].PINCFG[PIN_PA16].bit.PMUXEN = 1;
PORT->Group[0].PMUX[PIN_PA16 >> 1].reg |= GPIO_PIN_FUNCTION_M;
while (1) {}
}
indentation is hard
hehe. yeah, especially in the code blocks. the kerning there is...bleh.
that's gclk2, 12MHz, PA16 (metro m4 d13)
you have to pick a gclk matching your pin
it's under pin function m on the datasheet
or h on '21
in which case you also have to change the 12 up there
I wrote this in a hurry π
there
@slender iron looks from that deep dive video like you're a fellow Graphviz aficionado.
I regularly abuse Graphviz
π it worked well enough
@tulip sleet We did it!
@raven canopy have you looked into the freqm peripheral for frequency in on D51?
I guess you probably want something that works on 21 and nRF and such
@exotic pumice Yay!
to clarify -- I test this as follows:
create a script named alnum.py containing the single line
from adafruit_featherwing import alphanum_featherwing
then copy alnum.py to the CIRCUITOY drive and execute it via the REPL:
import alnum
the board immediately disconnects from USB and the NEOPIXEL goes Yellow indicating safe mode.
pressing RESET brings it back to normal
If you copy/paste the same command to the REPL it executes normally.
I have removed the samd module on M0 which freed 1232 bytes of flash.
Also enabled the ure functionality on #if BOARD_FLASH_SIZE > 192000, which I assume is all Express boards.
Note that I have just started doing a large refactor of the #define stuff so we can have consistent settings across our ports. See #1547. I'm introducing an mpconfig_circuitpy.h file (or some name like that), which will have common settings, will check for small and large flash sizes, etc. Also I'll have on/off #defines for each native module so they are easily enabled/disabled in mpconfigport.h or mpconfigboard.h.
@exotic pumice I have. But FREQM is only for measuring internal clocks. I actually used it in a previous iteration, to help adjust readings due to open-loop DFLL drifting.
@exotic pumice here is the since reverted implementation of FREQM I did: https://github.com/adafruit/samd-peripherals/commit/51784042a567d703e0a1c2f138875d4d203f2bb2
@raven canopy It looked like you could feed in external clocks on gclk_io, the way I read it
@tulip sleet Let me know when ure is available in the '840 build and I'll build/test it against CircuitScheme.
Having a mpconfigboard.h as you mention in https://github.com/adafruit/circuitpython/pull/1544#issuecomment-463655178 would be real sweet. This way the board will have full controll of the config. Ofc this means that the defines needs to be checked in mpconfigport.h to see if they're defined first before setting a default like how it's done in mpconfig.h.
@exotic pumice well, yeah, that might actually work. Could be an interesting dance with configuring the REF_CLK though (lower-but-not-too-low frequency, adequate REFNUM). Not that using the TC hasn't been a dance. Haha
And thanks for pointing that out. My inexperience let me look past that as an option.
@exotic pumice just read your comment about atsamd-rs. VERY exciting π π
haha post them in case other folks are interested. But I already hunted your fork down.
https://github.com/sajattack/atsamd
lol, it should be merged soon into https://github.com/atsamd-rs/atsamd and gitter is https://gitter.im/atsamd-rs/community
woohoo
@exotic pumice would love to get a SAM32 into your hands to tinker on with atsamd-rs!
https://github.com/maholli/SAM32
ESP32 would be totally new to me,but you could add a board def for the M4, which exact chip are you using?
The J20A
ah ok, so it would be a tiny bit more work than a board def, we'd need to add the pac for that chip too.
ESP32 is actually most easily interacted with via ladyada's ESP32 SPI library
@lime trellis, so that library would need a rust version too
It would be cool to get Phil Levis excited about this. He's the guy behind Tock http://csl.stanford.edu/~pal/
cool
Yes, thanks for pointing that out. I did miss a couple of cases as I'm working on this. The new file has a ton of #ifdef's and #ifndef's. However, the individual port and board files should be a lot nicer.
I want also to combine the .mk settings as well, such as a common set of warnings, etc. Right now -flto doesn't work on nrf, it should, and it's very hard to debug why it isn't working.
@meager fog thank you for the pyp tool! it is really useful
try making s shape have no width! then putting it in a group and showing it
it should raise a ValueError: Width of Shape cannot be zero
@marble hornet wrt ^^^, I haven't even read any of displayio, but are Shapes static or dynamic? If dynamic, zero could be allowed, but handled better?
@TG-Techie if you can write a minimal (but complete) example code for these bugs to demonstrate it crashing, plus the output of the crash that will really help us find and squish these bugs! the more details/info, the better as it lets us focus on fixing :)
Totally will write one up now
error message: starts boot looping and does not appear on usb
from displayio import *
shp = Shape(20, 0)
a24fabb extmod/modure: Add match.groups() method, and t... - dpgeorge
cbeac09 extmod/modure: Add match.span(), start() and en... - dpgeorge
b9dc23c extmod/modure: Add ure.sub() function and metho... - dpgeorge
20a787a extmod/ure: Handle some escape sequences. - deshipu
0865c9d extmod/ure: Support search/match() pos and endp... - notro
Please update to the latest master. I fixed this with #1548. Thank you for the small code example.
Also, it should no longer boot loop. It should enter safe mode now after a crash.
@dhalbert Can we close this now after #1541 ?
Yes, I thought it was going to get closed automatically.
It's not super smart about how when it knows to close: https://help.github.com/articles/closing-issues-using-keywords/
ok how about low speed pins we low drive (theres no lowspeed's on the feather nrf) and then high speed high drive :) we can document this in product pages
@slender iron i'm doing a big sweep of all the config files. framebuf should be off by default everywhere, right?
@tulip sleet nice! yup
yes, this is massive, but it should be a lot better in the long run, no more EXTRA_BUILTIN_MODULES and stuff like that
great!
also, if I conditionalize all the module defintions, maybe i can get rid of the WEAK_LINKS stuff? Do you know a strong reason to keep that? like the _time and other such modules, etc.?
this is relying on -flto to discard compiled but unused modules
i mean this refactoring is relying on that
I could put the on/off definitions in the .mk files, but right now they are in the .h files, and we rely on -flto to discard
its meant to allow default implementations
I know the interrupt handlers use weak
be careful that you aren't getting yourself in too deep
this reorg will be good but its a large task
yah, but that's not MICROPY_PY_MODULE_WEAK_LINKS; that's what I mean I'm getting rid of, not weak links in general
yes, it seems to be leftovers that we've moved to shared-bindings, mostly
ya, I'd believe that
ok, the proof is in the compilation, which will take a while to check everything
hopefully I can get -flto working on nrf too, though that's not vital now since we have the space
@slender iron displayio should be usable on nrf, right? Just checking for root pointer definitions
yup!
great!
I don't think I added parallel bus but the fourwire should work
I've potentially got a board (Mini SAM Nordic version in the works) that would use a low speed pin (P1.10) to drive the builtin_led. Would this be configurable via board definition to set to high drive? Or is this not possible currently? I could just create a fork and modify to suite my needs, but I'd rather not fork CP too much if I can just define in the board files.
Owner of Python Discord here! Really looking forward to getting into circuit python, going to order myself some kit this week and have a play around, it looks awesome
hmmm -- I hope this is a clue: If I cop yht contents of alphanum_featherwing.py
import adafruit_ht16k33.segments as segments
from adafruit_featherwing import shared
from adafruit_featherwing.led_segments import Segments
class AlphaNumFeatherWing(Segments):
"""Class representing an `Adafruit 14-segment AlphaNumeric FeatherWing
<https://www.adafruit.com/product/3139>`_.
Automatically uses the feather's I2C bus."""
def __init__(self, address=0x70):
...
Could this issue have something to do with the execution of multiple layers of imports ? Is that different on the atmel_samd51 from the nrf_52840?
Oh wow, looking through this page https://learn.adafruit.com/sensor-plotting-with-mu-and-circuitpython?view=all, I need to get my hands on a Circuit Playground Express
that Mu integration is fantastic as well, kudos to whoever is behind that!
@rare geode Group effort, but @plucky flint is the primary author of Mu π
It's awesome! Great idea to use print statements and tuples, I love it
@ladyada That sounds good -- thanks!
@bwshockley We don't currently store any info labelling pins as low-speed or high-speed, but we could store that in the pin table and add some kind of setting or override mechanism.
The regular drive might actually be fine for your LED. What's the current draw you set via resistor?
Thanks, I didn't check the makefiles...
I tried it on an Metro M4 Express and I get same result.
I can ping the board, it is able to resolve the dns name, but fails when sending:
Adafruit CircuitPython 4.0.0-beta.2 on 2019-02-05; Adafruit Metro M4 Express with samd51j19
>>>
>>>
>>> import board
>>> import busio
>>> import wiznet
>>> import socket
>>> import time
>>>
>>> spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> eth = wiznet.WIZNET5K(spi, boar...
Oh - by all means, there is no need to make changes on my account, just curious. 2ma should actually be okay - I tend to choose my resistors to set lower current anyway in case I'm on battery. But, I was trying to make sure that if I determined I needed a little more, I could get to it.
I think 'll just close this for now and maybe pick this up later.
just one left...and its stubborn!
vagrant@ubuntu-xenial:~/source/circuitpython/lib/tinyusb/src/osal$ git stash
No local changes to save
vagrant@ubuntu-xenial:~/source/circuitpython/lib/tinyusb/src/osal$ cd ../../../..
vagrant@ubuntu-xenial:~/source/circuitpython$ git submodule update --init --recursive
error: The following untracked working tree files would be overwritten by checkout:
src/osal/osal_freertos.h
Please move or remove them before you can switch branches.
Aborting
Unable to checkout '29b49199beb8e9b5fead83e5cd36105f8746f1d7' in submodule path 'lib/tinyusb'
hah! just keep throwing git commands until...i win!
vagrant@ubuntu-xenial:~/source/circuitpython/lib/tinyusb$ git branch
* (HEAD detached at 6d96b12)
master
vagrant@ubuntu-xenial:~/source/circuitpython/lib/tinyusb$ git checkout master
warning: unable to rmdir hw/mcu/nordic/nrfx: Directory not empty
Previous HEAD position was 6d96b12... improve auto descriptor
Switched to branch 'master'
Your branch is behind 'origin/master' by 742 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
vagrant@ubuntu-xenial:~/source/circuitpython/lib/tinyusb$ cd ../..
vagrant@ubuntu-xenial:~/source/circuitpython$ git submodule update --init --recursive
Submodule path 'lib/tinyusb': checked out '29b49199beb8e9b5fead83e5cd36105f8746f1d7'
Try git submodule sync
i did. several times. to include:
git submodule foreach --recursive 'git fetch'
git submodule foreach --recursive 'git stash'
i had about 4 that complained before all of that, but tinyusb was so detached it needed some brute force. π
I use git submodule update --init --recursive git submodule foreach --recursive 'git fetch --tags'
And I stand on my left foot π
ahh! that's probably it. i was sitting down. π€¦
Is this expected when building CP? ```
../../shared-bindings/usb_hid/init.h:33:23: warning: size of 'common_hal_usb_hid_devices' differ from the size of original declaration [-Wlto-type-mismatch]
extern mp_obj_tuple_t common_hal_usb_hid_devices;
i think that is a known warning message. i've been building out of date, so haven't come across it.
It's a really strange one, I wouldn't expect the size of a typedef to change, trying to wrap my head around how that could even happen.
Ah, it looks like it's a conflict between an array-in-place and an array pointer. Tricky.
@main meteor are you using a version of arm-gcc older than 7.3.1? That looks like something fixed in 7.3.1.
@slender iron exciting build results: we've been relying on -flto to excise unused code, but it's still leaving remants. If I actually excise the source files in the Makefile conditionally, we get back hundreds of bytes from modules that aren't used
Back from the frozen northwest. Thanks everyone for the HID help. Anyone happen to know if a ps4 will take an HID game pad? Or if thereβs a breakout board that emulates a ps4 controller?
OK, this hole goes even deeper: if I compile with -O1 it works as expected.
With -Os or -O2 it gives the weird TypeError: Tuple or struct_time argument required error.
Same result with gcc-arm-none-eabi-8-2018-q4-major and gcc-arm-none-eabi-7-2018-q2-update
I am doing a ton of refactoring of the makefiles and the config system, so if you have something else to work on, you can hold off on the rabbit hole for now and we can try again when I finish. It won't necessarily fix this problem, but it might be easier to debug and try different things.
Now that drivers.rst is located at the Bundle and building on RTD, we can point the core docs there for #1405.
I added some info on the Community bundle as a bonus.
I almost added some "how to contribute to libraries" info, but pulled short for now. Let me know if you'd like it in there.
Sure enough, I clicked on the wrong one when I backgraded from gcc 8 to 7. I grabbed the q4 one instead of q2, missing the detail that it was q4 2017. π³
Oh cool, thanks Dan. Will do, I'll check back in next week.
The atmel-samd port works fine with the same shared-bindings and arm
compiler so I'm a bit flummoxed.Maybe different compiler flags & stuff.
@slender iron following up on build results after compiling only source files that are really needed: trinket m0 build has 1936 more free bytes after doing this. Will try more builds. It's all working out nicely. Had to move a lot of setting stuff from .h to .mk, but it's all pretty clean. Time to π€
@idle owl @rare geode these things are always a group effort.... the "lone programmer" is a myth. We all depend so much on the work of others, which is one of the main reasons community is so important. π
@tulip sleet That's epic! I think french is our largest language so try that too!
how does one get rid of a code.py that has their board in a boot loop?
remembers the debugger in front of him
hmm... no dice
(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
π€
@pastel panther yes, I would love to see more of your "itsybitsy -knockoff", do you have a link or github-repo ?
@pastel panther boot to safe mode. Slow double tap, about 1 second between taps. Then you can get to REPL and import os then os.remove(βcode.pyβ)
since we have dropped nrf52832 -- should we close this?
Since no one has complained about this in 52840, let's close.
I have simplified the test to cause this issue:
create two scripts
test.py containing this line
import adafruit_ht16k33.segments as segments
and test1.py containing:
import test
copy both files onto the feather_nrf52840
at the REPL
import test1
the nrf52840 crashes -- drops USB and enter safe mode
note: running import test at the REPL works...
I alos tried importing from a different library
in test.py:
import adafruit_bus_device.i2c_device as myimport
this does not cause the crash. Perhaps it is something in the ht16k33 lib
@slender iron on Metro M0, looks like the fr build has 1396 bytes free now as opposed to 244.
note that metro m0 has wiznet ethernet support turned on by default (that's not new)
the more features included in a build, the less you save (since more of the files would have been compiled in anyway)
forgot to post safe mode message
You are running in safe mode which means something unanticipated happened.
Looks like our core CircuitPython code crashed hard. Whoops!
Please file an issue at https://github.com/adafruit/circuitpython/issues
with the contents of your CIRCUITPY drive and this message:
Crash into the HardFault_Handler.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-beta.2-58-g35e3d99f6 on 2019-02-14; Adafruit Feather nRF528...
"each library" -> "all the libraries in the bundle"
WOOHOO gui 1.x is done ! 2.x will include dislayio support.
Ozone screensho after trap to HardDault_Handler -- unsupported return stack adderss -- not much information

gdb backtrace:
(gdb) break HardFault_Handler
Breakpoint 1 at 0x44686: file supervisor/port.c, line 121.
(gdb) c
Continuing.
Breakpoint 1, HardFault_Handler () at supervisor/port.c:121
121 reset_into_safe_mode(HARD_CRASH);
(gdb) tr
Note: breakpoint 1 also set at pc 0x44686.
Tracepoint 2 at 0x44686: file supervisor/port.c, line 121.
(gdb) his
Undefined command: "his". Try "help".
(gdb) backtr
#0 HardFault_Handler () at supervisor/port.c:121
#1 <signal handler called>...
@solar whale No dice; tried various speeds of double taps, the best I can do is get into bootloader mode; I tried using the flash eraser from the troubleshooting page but macos says it's 141k too large and won't copy it π
what version of CP did you have loaded and on what board
a fork off master (working on bitmap stuff)? I may have also flashed whatever the latest release is
what board?
Grand Central
just a sec -- I can make you an eraser -- maybe
been awhile -- trying to fin the correct spot.
init fileystem in main.c -- make last arg true, or something like tthat
try this
diff --git a/main.c b/main.c
index c1244f36c..e81392027 100755
--- a/main.c
+++ b/main.c
@@ -389,7 +389,7 @@ int __attribute__((used)) main(void) {
// 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);
+ filesystem_init(safe_mode == NO_SAFE_MODE, true);
// Reset everything and prep MicroPython to run boot.py.
reset_port();
definitely filing that one away in my bag of tricks
@tulip sleet any idea why the GC flash eraser build on the troubleshooting page would show up as being too large but a freshly built one would not?
are you sure you were trying to copy it to the boot drive and not the CIRCUITPY drive?
otherwise I don't know, but that's an arduino program, and could have been built wrong
(I have made the copy mistake in the past)
ya; I couldn't get a CIRCUITPY drive because of the boot loop so I'm sure it was the boot drive
what's the name of the uf2 you were using?
GC_M4_QSPI_Erase.UF2
i do not know - I'l try it myself later. afk for a coupla hours now
ttyl
thanks for the help
yay, still-in-bed-half-asleep-hacking is the best; 565 support here we come!
@pastel panther update your repo. I fixed safe mode so it shouldn
't boot loop anymore
ok, thanks
bootloader was overwriting the safe mode state
ah
Is there a schematic around for the PyPortal?
you have eagle? what form is best?
are there spare PyPortals around? π€£
eagle is good. PDF is fine. I just want some details.
@pastel panther not yet. I have an old rev myself
greens overflowing... π€
I would take it one step further and say documentation for the library bundle. It's not really docs for all the libraries either.
I would include Library in this for Adafruit CircuitPython Library Bundle. Better to be as clear as possible.
@gilded cradle I have a pyportal on my desk if you'd want me to review the WiFiManager PR?
@slender iron When you get a moment, can you look at this? I know you had an idea in your head of how to fix this issue and I want to make sure it's in line with that. https://github.com/adafruit/Adafruit_CircuitPython_Register/pull/21
Sure @prime flower
@idle owl sure, looking now
Thanks!
I've only tested it with a MetroM4 + Huzzah32 Feather
@slender iron Thank you!
np
@slender iron is mp_obj_t* children; the list inside of groups that holds the items ?
@gilded cradle bump is the word Limor uses for creating a new release. Because you're "bumping up" the release tag number. π
Yeah, just trying to learn some of the terminology.
I understand entirely! I figured I'd make it even clearer if I could.
Yeah. When you said I was already bumping, I was pretty sure what that meant. Just wanted to verify.
@slender iron i can't inherit from two objects that each individually inherit from Group
File "main.py", line 3, in <module>
File "/lib/tg_gui/gui.py", line 761, in <module>
TypeError: multiple bases have instance lay-out conflict```
why would you inherit from two things?
i have a rect and a pointable object and i want to make a button
@gilded cradle just tested it on my pyportal, it's awesome.
text is added ontop
I like the ability to include headers as a dict
@marble hornet I'd have button inherit from Group and then have rect and pointable object as children
@gilded cradle Do you think adding in code for handling disconnects from a router (AP drops off) would be useful?
Yeah, that's why it checks to see if it's connected on each call
self.connect()``` Oh, it pings on each `get` or `post`
Yeah
good idea
Thanks. That was part of the original request.
Adafruit IO Arduino does a ping at the top of each loop to stay connected to the api/broker, this is way more elegant.
π
I'm going to try to whip together a really basic Adafruit IO wrapper to sit on top of WiFiManager
@slender iron what about inheriting from both causes the conflict?
Is this the double diamond problem?
never heard of that
my issue is that you rarely want a combination of APIs
more often you want a smaller api that wraps the two
and simplifies how to use them
can you say more about that? i'm not picturing how
What's the most common adafruit part used on/with a circuitpython board?
@ancient sage That's a tough one. There's support for a lot of things. Maybe NeoPixels because who doesn't love LED rainbows?
The Circuit Playground Express has a ton of stuff built into the board, so it gives you a lot of options for learning different things in one package.
I'm going to try to support people with CircuitPython and I'm just wondering what would give the broadest range of testing. Already going to get a C.P.E.
I think understanding the protocols, e.g. I2C and SPI, etc, is a good way to start. Because while different sensors do different things, if they're I2C and you know how to troubleshoot that, you're covered for a ton of different sensors. If that makes sense.
Check out the CircuitPython Essentials guide if you haven't already. It covers the different things built into CircuitPython, which most of our sensors/breakouts/etc use.
Nice!
@marble hornet have button subclass group and then in __init__ create the rectangle and add it to self's children (since self is a group)
@gilded cradle io.send() workin'. I'm going to toss this in a repo before I break for lunch
need to figure out a better way of constructing the URLs passed into the $path though
Awesome work @prime flower!
thank you, i think i have some ideas
mac people, is there some package manager that has arm-none-eabi-gcc or do y'all just install the tarball every time?
brew used to have it
I couldn't find it searching their package list online
they removed it because it was a cask and shouldn't have been π
I just install the tarball. I tried using the gcc that comes with Arduino, but it's not the right vintage.
speaking of vintage compilers, I wrote some 6502 assembly for C64 yesterday
it just endlessly prints "green on black" in green on black
Nice! Tempted to fire up my old 6800 machine and see if it still goes.
@exotic pumice the brew cask people removed it because they said it belongs in regular brew but they didn't think to/want to /have time to add a PR to add it to brew
I was planning on submitting a PR but haven't had time
got it, thanks
I just asked to see if someone is working on it
is cask binary package versus source package or something?
ya
their github page also mentions targeting GUI apps
I've been working on approaching this a slightly different way. I've been removing a lot of contents of the libraries that import it and it seems to have something to do with an import chain. I'm not sure why it's specific to the nRF52840, but maybe Jerry's comments would help shed more light on that. Either way, I was also able to reproduce this bug.
Just a wild guess, but I wonder if it is something to do with running out of stack space.. I found that if I compile with DEBUG=1 I can reproduce the problem -- see above, but when I tried to run some tests of the ESP32SPI code, It also went to Safe Mode but in that case, the Safe Mode message reported the reason as running out of stack space. I normal build w/o DEBUG runs the ESP32SPI code fine on the nrf52840.
Fortunately running with code.py works just fine and I think that's how most users would approach it.
oh - that is interesting -- I never tried that -- yuk :-(
@slender iron If I want to increase the stack for the nrf52840 build do I only have to change the setting in mpconfigport.h -- or are there other places as well?
I think just there
thnaks -- I'll try increasing it to see if it helps
it'd be good to add stack checks so this fails more gracefully next time
is that an mpconfigport.h setting?
yup -- doubling the stack got rid of the problem ....
at least for the simple test -- trin ghte full test next
that will cause a safe mode
that will raise an exception
Just a wild guess, but I wonder if it is something to do with running out of stack space..
I just noticed (while doing something else) that the default nRF stack is only 4k. I am adjusting that. It would be interesting to know if this also fails on an M0, where the default stack is also that size.
so in does atmle report stack when going to safe mode, but nrf does not -- it issed HardFault
yes -- raising it to 8K fixes the problem!!
right, we can only go into safe mode if we check before we crash
I think it is going into safe mode
right -- it goes to safe mode but says it was due to HardFault, not stack overrun.
ideally we'd notice we're out of stack and throw an exception before we crash
it did taht for me in another test, so it may depend on how it runs out of stack
stack checking was turned off in the nrf port, for some reason. I noticed that while refactoring. It will be on after my big PR.
also the default stack will be 24k
ah, so it can be turned on?
MICROPY_STACK_CHECK
great! issue solved π
may be worth trying jerry
π
just to see if it fails nicer
OK will try
We should try on the Argon too
argon is same
no stack check and 4k check are common across all the nrf boards
as of now
gdb was not much help!
in gdb I like to break on reset_into_safe_mode
I had break on HardFault_Handler, and it worked ok -- more my lack of familiarity with what was reported -- rusty on gdb...
Even with stack checking enabled, it went to HardFault
hrm
hardfault_handler is good too
it'll call reset_into_safe_mode too
the checks may not be in the right places
I posted the backtrace to the issue -- you can read it at your leisure -- it may tell you more than it did me.... I guess I'll leave the issue open until Dans PR is in -- I'll add some notes
I just wrote a better repl (read more than readline from stdin) for CircuitScheme. Basic readline move left/right, backspace/forward-delete, history using up/down, multi-line command input.
Would a guide be of interest? It's general purpose (just a parse and eval ties it to CircuitScheme).
It's pure CircuitPython code.
Increasing the stack size to 8K resolved this issue. Tested on feather_nrf52840_express and particle_argon.
I guess we should leave this issue open until the nrf52840 builds are reconfigured for larger stack -- @dhalbert has a PR in work for that and other changes.
@gilded cradle argon works!
Sweet
Whew! I don't have many hairs left -- lost quite a few on that one π
I got an Argon too. I just haven't put the bootloader on it yet.
I mean it just got here today.
Tape 'em back on, @solar whale!
@gilded cradle ave fun with the Argon -- If you put the AT Firmware on the ESP32 you might get inspired to add the Wifi Wrapper to the ESPATControl library! Let me know if you have any problems getting it going.
Ah, ok. I might try that.
Debugging is like an onion. There are multiple layers to it, and the more you peel them back, the more likely you're going to start crying at inappropriate times.
698
1972
@exotic pumice this was a great exercise for me -- I need be quicker to pull out the J-Link and gdb. It's a thrill!
hahaha
from board import DISPLAY
import displayio, time
class rect(displayio.TileGrid):
def __init__(self, x, y, width, height, color):
self.plt = displayio.Palette(2)
self.plt.make_transparent(0)
self.color = color
super().__init__(displayio.Shape(width, height), pixel_shader = self.plt, position = (x,y))
@property
def color(self):
return self.plt[1]
@color.setter
def col...
how much storage space would typically be used by circuitpython's code and libraries? assuming this is a small project with not much code. rough estimate is fine.
Ah, ya good point. Will fix. Thanks!
@TG-Techie did you get a chance to test this with the latest code?
@dhalbert Ah windows throws my ideas out the window. Will keep brainstorming but close this.
This also fixes writability checks so the internal filesystem is no longer writable with a storage.remount. Use the SD card for caching.
The pyportal init has been changed to speed up displaying bitmaps by aligning their access pattern with their orientation.
@ruby tiger it's small, so even with images and sounds, everything does not fill up the "USB" drive
but like, on the playground express, how much of those 2MB can I actually use to store media?
@gilded cradle Can I extend your WiFiManager for DELETE/PUT?
Sure @prime flower, that works for me.
They're within requests.py, not sure if you are going to add them or not and dont want to overrun your work
@ruby tiger almost the full 2mbs
super cool. thanks @river quest
ah np, they work great
super early and ugly (not for public consumption unless you really want to break things) , but ya can pass it in the wifi manager
Nice. That should make doing stuff with Adafruit IO even easier.
It would be nice to add stack checking to throw an exception in this case. Raising the stack size isn't a great fix because other imports can still cause the same crash.
Can I do THUMB-2 assembler inline in CircuitPython on the ATSAMD21?
As is we would return the native superclass object only.
Fixes #1551
@ancient sage no, we don't support it because it is a very advanced feature
@lime trellis I'm writing docs on adding new chips and boards to atsamd-rs https://github.com/atsamd-rs/atsamd/wiki/Adding-a-new-chip
Being a strict subset of cpython is a noble goal as well π
I was a little freaked out by the form of the files in tests/ from micropython at first, but it seems that the strategy is to run everything against cpython and micro/circuitpython and check for differences?
it was like, these are the worst tests I've ever seen
@ancient sage the tests do catch errors. If you think those are bad, wait until you see the ones we don't have.
Haha... Is there a need for more tests?
Initially I thought that it only ran the test files and checked for exceptions
Thus my astonishment
we need more hardware-based regression testing. Those tests were written by the micropython folks. We have the start of some hw tests, but it's not automated yet. We had an automated tester that ran the test suite on several actual hardware boards, but it was kind of flaky and we haven't revived it (it lives at tannewt's house). https://github.com/adafruit/Adafruit_CircuitPython_BoardTest
that's the board test library. The automated tester is called rosie, and didn't do pin checking. the code for that is elsewhere
the micropython based tests of course are run on travis builds
Right, that wouldn't catch anything that only shows up when cross compiled
the mpy tests are quite good at catching regressions in the core language impl, which we don't mess with much
@slender iron do you have a strategy for dealing with translation merge conflicts? Maybe I should just do git checkout --theirs ... and take the upstream one?
@tulip sleet I think I take theirs and then rerun make translate
that's what I think, but I need to make sure it's doing the right thing. ok tnx
aha, needed to do git add after git checkout --theirs kk
@tulip sleet @idle owl for the bundle link description, i'm thinking of a merge of both ideas. something like "Documentation for the bundle, which includes links to documentation for all libraries". thoughts?
@raven canopy Sounds good
that sounds good -- i didn't really know what it was actually pointing to
is there a summary page of all the libraries you could link to instead of just the bundle RTD link?
instead of or in addition to?
kk. commit imminent...or wait. π
That's what the bundle RTD is
shows how much i know
yeah, we just moved the "old" drivers.rst list to the bundle.
π
Bundle RTD is links to all the libraries. And being added to the process of adding a lib to the bundle, is updating that file.
That way we're not forking CP just to update that drivers file anymore.
And it'll be kept up to date!
i love it
and now...we wait for Travis to test two lines of text. π°
Anyone wanna add a board to atsamd-rs? π https://github.com/atsamd-rs/atsamd/wiki/Adding-a-new-board
@exotic pumice is knowing Rust a requirement? π
@raven canopy So.... idea....
@raven canopy barely
having it installed and following my instructions should be enough lol
uh-oh...ideas.
@raven canopy In the bundle RTD under "Adding a library" should we include instructions for updating the docs page? I mean we need to update the guide on "Creating and Sharing a Library", but should it also be in the Bundle RTD?
Also my weirdo caching issue is magically fixed so that's nice.
that was the thing i kind of noted on the PR. i almost started to put in a "how to contribute to the bundle" section, linking to the guide and having an outline.
Ahhh ok
I remember that in the PR, wasn't thinking it was the same thing. Obviously it is.
i mean, it costs nothing (or, very little?) to add it.
Hmm. Let's get the guide updated first maybe?
Mostly so you don't have to do more right now π
ahh, that's just a little creatively technical writing. always cycles for that. π after deciding dinner and retrieving it of course. hehe
You want to update the guide too? π
walked into that one. π€¦ i mean, of course i do!
π
seriously though, yeah, i can add it. though i think i'll need access to it.
Nah that wasn't yelling. It was meant to be more of a creepy whisper.
But well played π
π
This is a large refactoring of mpconfig*.{h,mk} settings to share as much as possible and to make enabling and disabling builtin modules easier.
There's a new directory ports/circuitpy-common/ containing settings that can be shared across ports:
mpconfig_circuitpy.h-- refactoring of common aspects of{atmel-samd,nrf}/mpconfigport.hmpconfig_circuitpy.mk: refactoring of common aspects of{atmel-samd,nrf}/mpconfigport.mkcircuitpy_defns.mk: refactoring of common e...
I don't think we use this at all. It should all be dynamic now.
I'm not a fan of
ports/circuitpy-commonthough. I'd rather have those three files inpywhere the micropython equivalents are. They could just start withcircuitpyto separate them out.
That's fine -- I wasn't completely happy with this, and was going to ask you about it but forgot.
Yep, defined a lot of places but not used at all. I'll remove
Woohoo! My Adafruit box came in today!
I have goodies for days!
I didn't realize that the JTAG ribbon cable was so small
pins are lot smalle than 0.1" spacing
I dig this! Much cleaner, and more modular. Thanks @dhalbert!!
Oh right, the Adabox. Mine hasn't shipped yet and I'm about to move, so I just changed my address to my friend's house since it might come after I move.
I just bought an Adabox 10 ad-hoc
Ah, that makes sense. I think the next ones ship next month.
That is my understanding as well
But just in case I forgot to change my addr, I set it to something where I could still get it.
Nice!
yay
why do the pixels hate me so? π’
Fighting displayio?
kinda; trying to add 565 support to OnDiskBitmap and my green channel is overflowing
I was just looking over OnDiskBitmap last night, amusingly enough.
I thought I had my bitmask wrong but the input pixel from the disk seems to agree with what I'm getting out so either what's coming in is wrong or my expectations are
@slender iron the last several travis merge builds have failed, not sure why. Restarting doesn't help. The shallow clone claims something has changed. This happened before my big PR. The PR builds are fine. π€·
signs are pointing to me being wrong....
Success!
Don't over shift your bitz, boyz and gurlz
A for effort?
@raven canopy are you happy with the Move the Docs PR? I can merge it. All the merge builds seem to be failing due to depth 1 and a lot of outstanding merges, I think.
hehe. i just kicked the tires on the Travis for that PR. even after reading your post. i'm good with the PR. want me to stop the Travis?
no problem. I'll just wait and see, or approve anyway. I'm not sure why the depth:1 is fialing but it might be due to so many simultaneous PR's.
it seems to be past the funky bits.
the PR builds are fine, it's the merge builds after the merge is doen
ahh. my last PR run failed with the same error, so i thought it was across the board.
ok, didn't see that, but I'll wait for it to finish before I merge
π
https://stackoverflow.com/questions/31278233/disadvantages-of-shallow-cloning-on-travis-and-other-ci-services but I'm not sure some of the answers are correct (@slender iron take note too)
Needs merging from upstream.
hmm. interesting theories...
the accepted answer does seem to be wrong about the commit hash. but we have a backlong of multiple commits and a depth of 1 wouldn't fetch the right one if there were merge commits of other PR's in between.
i will knock off a bunch of these and re-run the top one if necessary
I just got CircuitPython running on my Particle Argon. I knew buying a JLink would come in handy down the road. π
lol
@tulip sleet @slender iron from the Travis docs on clone depth:
Please note that if you use a depth of 1 and have a queue of jobs, Travis CI wonβt build commits that are in the queue when you push a new commit.
https://docs.travis-ci.com/user/customizing-the-build#git-clone-depth
that is definitive!
we have depth: 1 but we also have:
- git fetch --shallow-exclude=4.0.0-alpha.1 || git fetch --unshallow
- git fetch --depth 1 origin $LAST_TAG:$LAST_TAG
so I'm confused
Fixed by #132 & #1550.
Step 3: ReadTheDocs!! π
Added to nrf builds by #1554. Enhanced by #1544.
Hi,
I have the following piece of code, however when I run it, it returned CCCD error:
OSError: Failed to read CCCD value, err 0x3002
chara = bleio.Characteristic(uuid_char_temp, notify=True, read=True, write=False)
serv = bleio.Service(uuid_env_sense, [chara])
periph = bleio.Peripheral([serv], name="BME680")
periph.start_advertising()
while True:
send_temp()
time.sleep(5)
send_temp() is essentially `chara.value = byte...
hey guys! does CPy support f-strings?
Found what's wrong, it was due to a bug causing send_temp() to set the chara.value before periph.connected returned True.
Closing the issue.
BTW, great works on the bleio, it is really friendly and very easy to use!
Found what's wrong, it was due to a bug causing send_temp() to set the chara.value before periph.connected returned True.
Closing the issue.
BTW, great works on the bleio, it is really friendly and very easy to use!
@ruby tiger no f-strings - it's not in MicroPython either
aww. that's too bad, they're lovely.
@tulip sleet how's Travis looking this morning? still a bunch of βs?
he asks lazily, while waiting for coffee to work π
I approved a PR a few minutes ago and it messed up too. If Scott is not around this weekend, we can discuss it on Monday/Tuesday, about increasing the depth, etc. I need to go back and look at the old changes to see why we did what we did.
i would hazard a guess that it was done in the interest of speed..
I don't think the clone time is the major bottleneck now. It's the zillions of translations. Making a depth of 6 or something might be fine.
The extra git fetch is supposed to pull more as necessary, but it doesn't seem to be working. I should try this by hand locally and see what's going on.
and the associated PR: https://github.com/adafruit/circuitpython/pull/1360
I Need to check about
MICROPY_MODULE_WEAK_LINKS, which I think is no longer necessary but may need a bit of cleanup if it's still used.
The CPython std library port I'm working on requires this. It makes it possible to extend bare bones builtin modules using pure python.
Most noteable are the os and time modules that I have ported.
...
One question is whether it should be safe to set the value when not connected. Maybe it should just suppress trying to notify in that case, since you may want to set an initial value.
Thanks for the compliment! Getting to a pleasant API is hard.
@notro I'll open an issue about this. Yes, WEAK_LINKS is not a great phrase, since it overlaps with linker weak links, and that was confusing for a bit.
@notro needs MICROPY_MODULE_WEAK_LINKS for library extension. I'll look at this more carefully and see if we can turn it on without issues. I think it's off for small builds right now (which is probably fine since there's really no room for library extensions).
oof. re-gluing code in and trying to remember why i had done certain things. taking 4 month breaks on something has detrimental effects. π¬ π€·
I know that feel.
eureka! now i remember. π
hiya :) i seem to be unable to connect to the REPL on my circuit playground express. saving and modifying the circuitpython code works fine and it behaves as expected, but mu shows this error when attempting to open a serial connection. i've pressed the reset button but that doesn't help either. i've also had a look at this https://learn.adafruit.com/welcome-to-circuitpython/advanced-serial-console-on-mac-and-linux but nothing shows up when i do ls /dev/ttyACM* (i'm running arch linux, btw). is there perhaps anything else i could try? :D
@sinful thorn try lsusb. does that list the device?
hmm, not from what i can see: ```
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 003: ID 256c:006e
Bus 005 Device 022: ID 239a:8019
Bus 005 Device 002: ID 093a:2521 Pixart Imaging, Inc. Optical Mouse
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 045e:07f8 Microsoft Corp. Wired Keyboard 600 (model 1576)
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
yep. Bus 005 Device 022: ID 239a:8019. now, does ls /dev/ttyUSB show anything?
is it sad when USB VID/PIDs are burned in your memory?
not particularly :D
i'm trying to find it, but i seem to remember a conflict with modemmanager...
well, i don't even have modemmanager installed.
sweet. cause the "fix" is to remove it. haha
yeah i read about that when looking for a solution myself, but i didn't even have it installed in the first place so.. Β―_(γ)_/Β―
just for grins and giggles, what does ls /dev/tty* spit out?
/dev/tty /dev/tty19 /dev/tty3 /dev/tty40 /dev/tty51 /dev/tty62
/dev/tty0 /dev/tty2 /dev/tty30 /dev/tty41 /dev/tty52 /dev/tty63
/dev/tty1 /dev/tty20 /dev/tty31 /dev/tty42 /dev/tty53 /dev/tty7
/dev/tty10 /dev/tty21 /dev/tty32 /dev/tty43 /dev/tty54 /dev/tty8
/dev/tty11 /dev/tty22 /dev/tty33 /dev/tty44 /dev/tty55 /dev/tty9
/dev/tty12 /dev/tty23 /dev/tty34 /dev/tty45 /dev/tty56 /dev/ttyS0
/dev/tty13 /dev/tty24 /dev/tty35 /dev/tty46 /dev/tty57 /dev/ttyS1
/dev/tty14 /dev/tty25 /dev/tty36 /dev/tty47 /dev/tty58 /dev/ttyS2
/dev/tty15 /dev/tty26 /dev/tty37 /dev/tty48 /dev/tty59 /dev/ttyS3
/dev/tty16 /dev/tty27 /dev/tty38 /dev/tty49 /dev/tty6
/dev/tty17 /dev/tty28 /dev/tty39 /dev/tty5 /dev/tty60
/dev/tty18 /dev/tty29 /dev/tty4 /dev/tty50 /dev/tty61
forgot to mention actually, i believe the /dev/ttyS* would be serial ports but i just got a blank screen when attempting to use screen to connect to /dev/ttyS0 (which is the only one which didn't immediately terminate with or without sudo) with a baud rate of 115200.
really just stalling to avoid sifting through dmesg π
haha, i avoid my own dmesg when i can. :D
yeah, nothing there looks like it would be it. i have no arch experience, but kernel is kernel, right?
how do you mean?
if you are running a main.py, screen to /dev/ttyS0 will be blank until you type ctrl-C
@tulip sleet have you Arch experience? would it show up on ttyS*?
no, no arch experience. what version of arch? Are you up to date?
do you have any other computers in the house, Windows or Mac?
i did try pressing ctrl-C, didn't work either. i'm running kernel version 4.20.6 (i upgraded to 4.20.8 earlier but haven't rebooted since, actually). all of the computers in my house are running linux. i could dig around for an old windows laptop, but i think it still needs windows 7 SP1 haha
all arch, or any debian or ubuntu
there's a linux mint computer somewhere, which is ubuntu-based.
not mine though, so i'd have to wait until it's not in use.
maybe I can find a DVD-boot arch to try, or find an external disk to boot from.
looks like you should see /dev/ttyACM0
i don't, unfortunately. my entire ls /dev/tty* output is shown above
what version of CPy are you running on the CPX?
version 3.1.2
ok, that's good - i see some arch linux live-cd/usb instructions. i'll give it a brief go. will get back to you later. in the meantime maybe bother the linux mint person if available
will do. :D
@sinful thorn what type of port do you have it plugged into (USB2, USB3)? shouldn't matter, but long-shot
have any other ports available to try? other than that, its a wait on dan or dmesg. dan is much smarter than i...so i'll defer to him. π
yeah i'll try a few others.
flashing a usb drive...
works perfectly on linux mint. :)
I made a bootable arch 4.20.6 usb drive, booted it, plugged in a CPX, and I see /dev/ttyACM0. You said you updated but haven't rebooted yet? So maybe reboot and see if that fixes things.
okay sure.
heck of course that works haha. reboots fix everything, don't they? sorry for wasting your time, thanks for the help :D
yay! π
ok, wait, this is interesting. I pressed the reset button and then /dev/ttyACM0 did not reappear, or when I unplugged it and plugged it back in. Try unplugging and replugging and see if it appears
That was after doing cat </dev/ttyACM0
@sinful thorn ^
@sinful thorn ok, good! I was getting weird errors, but quite possibly due to booting from USB drive
that's possible, yeah. everything's working fine for me though, thanks :D
<@&356864093652516868> Here is the notes doc for next week's meeting on TUESDAY! https://docs.google.com/document/d/1Nd29jwuRkcS4M415TvGDRGjx6aA2M3xzeYl5m-gPJaI/edit?usp=sharing
Possibly this could be combined with deepsleep, which also needs an RTC timer as timeout and to advance the systick so time.monotonic() returns a reasonable result after sleep. This however would require a lower divide value (1024). My implementation of deepsleep is here: https://github.com/bboser/iotpython/blob/master/ports/nrf/common-hal/microcontroller/__init__.c.
The other possible issue is that apparently the softdevices (BT?) also use RTC timers. Somewhere I read that RTC0 is used by...
@slender iron I put "Community News" after the State of CircuitPython in my template π I'll move it to before. Mostly I'm entertained that we chose different places for it.
@tulip sleet is it kosher to have PRs targeting master coming from a branch on the fork, or is it preferred to have them coming from master on the fork?
@pastel panther If you're asking what I think you're asking, branches are fine. As long as it's up to date and you know it is, it shouldn't matter.
kk
id say that's fine and generally preferred. i try to do it that way and make the branch name reflect the point of the PR, like give it an issue number, or feature name, etc.
and. well. there's this learn page with a pretty direct title:
https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github/always-work-on-a-branch
@pastel panther I always use branches so I can keep my work organized and save a line of development away if necessary
cater and kattni are on the money
I do too! For some reason I'd previously always made PRs from master and I didn't know if that reason was a rule or something I just did arbitrarily
Hey I wrote that guide! π
i'm not skilled enough to have multiple branches going at one time though
This adds support for 565 16bpp BMPs as well as hacky support for 8bpp grayscale that ignores the palette because it's just a ramp of values and uses the index as a value for RGB. I started looking into actually reading in the palette for 8bpp indexed images but figured to check in before I go any farther.
The output is also kinda hacky; in the case of 565 each of the color values have been shifted up only to later be shifted back down by ColorConverter.
I'm sure there is much room for...
@ladyada and @tannewt I think the travis issue isn't my fault (but then again it may just be masking an issue that is my fault :) ). Please take a gander when you have a minute
Travis is having trouble due to multple PR's at once and only fetch depth 1. We're working on fixing it. Not your fault.
@tidal kiln its a total juggling nightmare. i've gotten into that state only a couple times, but...ugh.
the important thing is to make sure to commit before you switch branches. you can also use git stash, but that's harder to keep track of.
or just clone again
Sometimes I work on multiple branches for the Adafruit_CircuitPython_FeatherWing library. I just merge them into master when the branches are ready to go.
git clean -xf will clean out build junk, etc.
Travis builds have been failing recently. Example:
https://travis-ci.com/adafruit/circuitpython/jobs/178330132
0.58s$ LAST_TAG=`git ls-remote --quiet --tags --sort=version:refname | egrep -o "refs/tags/[0-9]+.*\$" | tail -n 1`
3.11s$ git fetch --shallow-exclude=4.0.0-alpha.1 || git fetch --unshallow
remote: Enumerating objects: 8166, done.
remote: Counting objects: 100% (8164/8164), done.
remote: Compressing objects: 100% (2944/2944), done.
remote: Total 7180 (delta 5557), reused ...
Attempting to fix #1559.
@slender iron I'll have to miss the meeting tomorrow, robotics. But I did make a pwm tool with circuit python to help with the robot. Best of luck to all and a large group hug
@marble hornet The meeting is on Tuesday this week.
Also tomorrow is Sunday π
We're making the notes doc on Saturdays now to provide more time to enter notes into it.
These problems are new. .travis.yml hasn't changed in a couple of months or so.
This fix is good for now. The old way should have worked, but seems to have stopped working.
@slender iron i only sort of understand what is going on with Travis, so I'm going to leave that ^^ PR to you for approval.
@pastel panther I always use branches for new work as well.
k, I'm gonna look next week. shouldn't need to rush it
uh, how is dotstar_sck on pad 0 in the neotrellis m4?
my understanding was sck could only be pad 1 or pad 3
@exotic pumice i see I2S/SCK[0] in the I/O for PB16. pg 34.
can be either, is how i've understood that. how to choose... π€·
well, not either. but...you know what i mean. i hope. what are we talking about? lol
dotstar_clk is pb02, which is sercom5pad0 which can't be sck as far as I can tell https://cdn-learn.adafruit.com/assets/assets/000/064/889/original/adafruit_products_mainschem.png?1541024554
well, nvm. seems SCK in that instance is related to I2S?
yeah
you threw me off with the SCK. too used to SCLK or CLK. π
datasheet also calls it that
yeah, i'm tracking now. SERCOM5/PAD[0] is available for PB02
it uses bitbangio, not busio: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h#L11
ah darn
was that pin choice a mistake I wonder?
if you swap sck and mosi then you can use a sercom
may have been more to keep the sercoms available for other things?
maybe
I don't have a rust bitbang apa102 driver, so I'll have to move onto something else
I find the "keep sercoms free" theory implausible, aren't you only using 1 sercom for i2c?
π€· it was just a thought. ladyada is way more smarter and experienced on board design than i'll prob ever be. π
Regarding Discussion in PR https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing/pull/27, in the latest official release (beta 2), the functions are there, but cause a BCDDateTimeRegister object to be returned. @jerryneedell had compiled a build from master on 2/15 and that was missing the mktime() and localtime() functions, but the BCDDateTimeRegister seemed to be fixed.
Forgot to mention, Dan mentioned there was work being done on this in #1534.
If I wanted to compile the latest CircuitPython on my local computer for a particular board, what command would I use? I think I might already have all of the dependencies (I've successfully compiled bootloaders and mpycross before).
Well, for now I'll just grab the latest from https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin
Anyone here have experience building CP on linux?
@gilded cradle this guide should help. https://learn.adafruit.com/building-circuitpython
Hi there, I'm newbie. Actually I don't know difference between circuitpython and micropython. But I have a problem about micropython's re library. It have not DOTALL flag. How can I match (.) special charachter with newline characters too?
@tired steppe yes, what information are you looking for?
@woeful juniper I don't think I understand your question - can you provide an example of what you are trying to do -- the newline can be represented as "\n" - carriage return as "\r" if that helps.
@gilded cradle the actual build is done much like the bootloader make BOARD=feather_m4_express clean then make BOARD=feather_m4_express for example. The tricky part is getting the full repo and tools installed but you may have most of that done. This page has the crucial stull https://learn.adafruit.com/building-circuitpython/build-circuitpython#fetch-the-code-to-build-6-1 and I would ad one thing after you clone or update the repo do git submodule update --init --recursive git submodule foreach --recursive 'git fetch --tags'
@solar whale Thanks for attention, I'm just trying create simple template engine so I need to parse template string. I'm trying split with re string with {{(.*?)}} template and re.DOTALL flag. It's not matching {{thing\nsomething\n anotherthing}} without DOTALL flag. As you know the dot char (.) matching everthing except newline. But this flag is not available on micropython. How can I handle it?
@woeful juniper sorry - you are well beyond my knowledge of regular expressions - Hopefully someone else can help later in the day. Good luck!
@solar whale thank you so much. Actually I have another idea its all about reading string char-by-char and parse it. But I'm not sure is it best way for performance. Do you have any suggestion about it?
@woeful juniper just to be sure -- have you looked at the ure module http://docs.micropython.org/en/latest/library/ure.html
as to parsing each character, I'm not sure how much difference it really makes. I guess it depends on how often you are executing this code.
also this may help https://stackoverflow.com/questions/29020866/can-i-match-multiline-string-in-python-without-using-re-dotall
@solar whale thanks again, I didn't see this topic on stackoverf. It looks like great solution.
@woeful juniper great! You are welcome. Good luck!
@solar whale Nevermind, I figured out my problem last night and was able to build CP without any issues
@kattni this appears to be good now? All of the listed repos have RTD builds within the last month. Granted, I didn't check any RTDs for libraries not listed here...
CP keyboard handling head scratcher: I'm working on a REPL for CircuitScheme. It's coming along well (maybe done for now) except for supporting C-c. I'm catching KeyboardInterrupt and am getting it when C-c is pressed... but not until another key is pressed. I'm using sys.stdin.read(1) to get keys. Thoughts?
@umbral dagger it works normally on your board in CP, correct -- or does sys.stdin.read(1) block it?
oh -- I see, it does
same for input()
Fine in CP
at least on the nrf build it does
Having async C-c is pretty important. For the same reasons it is in CP
for me in cp if so sys.stdin.read(1) or input() it does not respond to control-c until next char
But I don't want it to break out to the CP REPL. Just the CS REPL.
actually until next EOL
I'm seeing it happen on next char
clarify: input() waits for EOL sys.stdin.read(1) waits for another char
that is in CP
right - now I understand -- looks like it blocks until at least one char is received, but the contol-C is not treated as a received char.
yikes -- don't do sys.stdin.read() w/o argument -- it just hangs
Right. I never read the \x03 character
Which is fine since I need it to be asynchronous so as to interrupt running code
still trying to find the code for sys.stdin
doesn't look good π
Thanks for the information @solar whale
Ok, yeah it compiled successfully without having to install anything new beyond submodules. Also the 2 time functions you mentioned to be missing are now gone on mine too, but the rest of it works.
Ok, now that I've successfully compiled the latest version of circuitpython, it appears the specific functionality I need is the mktime() and localtime() functions in the time package.
Yeah I think this is probably fine. If anything comes up again, we'll deal with it then.
@tulip sleet I built the latest for the nrf52840 feather. Now it's saying there's no io module. Shall I open an issue for that?
Yes. Just 'io`?
The rest are just the usual suspects.
So that should be it.
How do I add it? You've revamped that stuff, right?
Whatβs the specific error?
Here are simple fixes for 3 build issues I encountered while working on my unofficial firmware images for the TI-Python Adapter (basically stripped-down Trinket-M0), featuring DPFP + cmath + special math functions + longint. Clearly, such changes belong upstream, under some form :)
@tulip sleet ```Adafruit CircuitPython 4.0.0-beta.2-74-g90bc09a31 on 2019-02-17; Adafruit Feather nRF52840 Express with nRF52840
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 31, in <module>
ImportError: no module named 'io'
Line 31: from io import StringIO
@umbral dagger did this code used to work? Could you point me to the code?
Works on SAMD51 boards
did you ever test it on nrf before today?
Yes, that's how I discovered that ure wasn't included.
I'm in the process of trying to get it running on the nRF feather (and eventually others)
yes, but did you do a successful from io on nrf before today? I know it needs to be defined; I'm just trying to figure out if this is an old or a new problem.
@tulip sleet ran into this -is is it expected when setting an int with a large value? ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-beta.2-72-gf7a397d52 on 2019-02-16; Particle Argon with nRF52840
import featherwing_rtc_simpletest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: long int not supported in this build
this is the cause rtc.unixtime = 1550335257
could you try on f840? Has something to do with size of build.
ok -- is argon differnt from nrf52840?
@umbral dagger @gilded cradle @solar whale I have a lead on missing time stuff, etc.
@tulip sleet Have not imported io on an 840 board before. This is my first real attempt at CP on 840
from io didn't actually work on f840 before, but it should, and I'm fixing it.
does argon have a spi flash chip/
yes 8Mbytes
ok, I'll check the definitions, might be an ordering problem or something
ok, tried on f840, longint is off, by mistake
will fix that too
sorry only 4Mbytes
can you fix this too - argon does not mount the file system if you load the feather_nrf52840_express UF2 to it π€¦
I was almost ready to create an issue...
Thanks @tulip sleet. Also, I'm not sure if this was intentional or not, but the Argon's debug LED does not light up for me (at least on the latest Alpha 2 release).
Does CP even try to use the Argon LED? -- it is not a neopixel but an RGB LED
Ohhh, that explains it. I think there's an issue to add an RGB LED to CP.
and D7 blinks a blue LED (not D13)
i missed the earlier discussion: which boards are missing ure in the latest master?
What is ure?
micropython's version of re. We should rename it to re sooner or later.
Ah, ok.
sorry - I was not part of the ure discussion -- not sure where the issue was.
I found it missing on the feather nrf52840 build.
And if we're revisiting ure/re it'd be nice to flesh it out.
It's missing character classes when I looked.
It's missing on argon too
ok, thanks, on the trck of that too
@tulip sleet o good deed goes unpunished π
ok, i have fixes for missing time.mktime() and missing ure. still working on io. It will all be in one PR.
i expected worse!
will it also fix time.localtime?
and longint fixed
is it that localtime() is missing altogether or isn't taking the right args?
Adafruit CircuitPython 4.0.0-beta.2-72-gf7a397d52 on 2019-02-16; Particle Argon with nRF52840
>>> import time
>>> dir(time)
['__class__', '__name__', 'monotonic', 'sleep', 'struct_time']
>>>
ok, there is no rtc on nrf yet, so right now `time.localtime() throws RuntimeError: RTC is not supported on this board. should it do something else?
it's missing altogether from what I compiled this morning.
should it work with the RTC Featherwing ?
CPy doesn't know if the featherwing is there or not, so I don't think so
so only time.locatime needs the builtin rtc? everything else works for rtc via the library
i guess, not sure what it does on boards without rtc enabled (or did do)
I see -- it is time.localtime,, not rtc.localtime -- nevermind
ok -- but for now all but the "unixtime" commands work on the rtc featherwing on the nrfs so that is good -- and time.locatime gives an message along wit the error.
Well, that's on the latest master. It's been about 2 weeks since the latest official release of CP and that one chokes.
It chokes on the DS3231 simpletest too
and there is no rtc.localtime -- the rtc.unixtime functions just call time.localtime
I think rtc.localtime() is a coincidentally named low level function.
There should be a simple example in the doc, and rtc.RTC datetime should say it takes a struct_time, etc.
After #1554, there were some errors:
-- MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS wasn't set up properly.
-- nRF port was missing some modules.
I believe this fixes both of these. Should fix #1557.
@notro maybe take a look too. Not sure if it's still completely right for you.
Hi, i just got a feather nrf52840 board and i'm playing with it, this might be super easy mistake i'm doing but the pinout says the user switch can be used as D7 but i get the following error when trying to use it switch = DigitalInOut(board.D7) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'D7'
@granite crow From the REPL: do import board and then do dir(board). It might be something like board.SWITCH.
I don't have one connected at the moment to check.
just looked at the source, yes, board.SWITCH
There you go π
says "D7" in the pinouts stuff User/DFU Switch
A tactile switch is provided for use in your projects, which is connected to P1.02 and is accessible in code as D7. Maybe we should say "Arduino pin 7 or CircuitPython board.SWITCH" or something like that
great, it works! thanks for the fast reply
yep, also maybe with the user led can be used as led = DigitalInOut(board.RED_LED)
what does the magic number 500000 represent in bitbangio spi?
self->us_delay = 500000 / frequency; frequency is in Hertz. us_delay is microseconds delay, so this is half of a clock cycle
the lucky winner? π
oh I see, 1Hz is 1000000us
yah
got it
i agree a comment might be good
can someone point me at any directions for how to build CircuitPython from sources?
Yeah, I just had that question answered earlier today: https://learn.adafruit.com/building-circuitpython/build-circuitpython
Thanks!
what's the max speed of bitbangio spi?
my reimplementation is going 30KHz when I tell it to go 3MHz and I'm not sure if that's a math bug or a limit
seems like a limit
turning on optimizations got me to 150KHz, interesting
Can anyone point me at what circuitpython components are excluded for the trinket_m0?
