#circuitpython-dev
1 messages ยท Page 310 of 1
oo thought it was about putting out ADs/commercials sorry
no, sorry
@slender iron welp, I've got no idea. Have to go to dinner but I'll take another look tomorrow morning, if that's cool.
I've tried putting every pin that's been affiliated with flash, USB or SWD in never_reset and it's still not booting. At this point I'm probably going to go back and cross test with the EVKs to make sure we didn't get a global boot bug in here somehow
@ionic elk all good. it may be simplest to binary search it based on port and pin number
I'm also not sure what kind of primitives you require. Maybe you could give me a simple example of the kind of a program you wanted to write with those counters, and I can show you how this can be done with that library?
I've been thinking quite a bit on this topic about the primitives that I DO want.
When I write threads in normal python (NP) using the threading library, I essentially have two choices as how to create a thread:
- create a threading.Thread() on an existing functio...
Note for myself: https://github.com/avrxml/asf/blame/61c7353e0183bbd0615db1d0a3144cbdcd09983a/common/components/memory/sd_mmc/sd_mmc.c
Also, this PR presently reverts two submodules to an intended ref. oof.
This needs review from @hierophect -- the implementation of HAL_GetTick didn't work, but I believe something's needed
revert these unintended changes
@tannewt is this way of making _sdcardio.SDIOSDCard "optional" going to fly, or does it need to be 2 modules? When this define is 0, a stub constructor which throws an error is included instead.
@gentle bronze I saw you created a uf2 repo for esp32s2, why not use tinyuf2? i thought that was the idea, to not have a separate bootloader for each platform
@tannewt "iso" was the probably wrongly named generated firmware.
Being fixed is that there is just no RAM problems when using frozen modules, so just provide the firmwares with frozen modules !
@indigo wedge nice project! I'll add some boards later
a) easy way to say "run this function"
await your_function()
b) easy way to say "run this method with this object"
await your_object.your_method()
c) easy way for those methods to give up control, either after performing some work and to say it needs to wait for
await
c) a way for the cooperating segments of code to say "I'm done", to say "wait for that cooperating segment to say its done", and for them to be reaped
return
d) some primitive th...
just got a new clue and im trying to upload a simple code can any one help me pls.
where are you stuck?
Does the whitespace change leave one blank line at the end of the file? I think we tend to.
It leaves an empty line the way Emacs and other editors do โ which matches what the Adafruit_CircuitPython_* libraries appear to have. It seems to be different in this repo though, and a lot of files have two empty lines, which is what it's correcting.
Looks like some test outputs were changed and broken. They'll need to be exempted.
Yeah I'm still trying to get this all to pass, it's no...
This fails to compile for the teensy41
jerryneedell@jerryneedell-ubuntu-macmini:~/projects/circuitpython_master/ports/mimxrt10xx$ make BOARD=teensy41
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
boards/teensy41/board.c: In function 'board_init':
boards/teensy41/board.c:33:5: error: implicit declaration of function 'common_hal_never_reset_pin' [-Werror=implicit-function-declaration]
33 | common_hal_...
Yay, passed!
I'll follow up with REUSE changes separately, since the CI is a bit heavy, and I don't have as much time as I had a couple of weeks ago, but I do have something working on.
@onyx hinge double checking an i.mx crash this morning but I'll check out your GetTick issue as a part of my wider clock rework
Does anyone happen to know if the STM32 Black Pill goes by any other names for the purposes of the Support Matrix: https://circuitpython.readthedocs.io/en/5.0.x/shared-bindings/support_matrix.html I'm not seeing it listed in the matrix, perhaps it's still a bit too new to be included?
I'm not seeing any stm32 boards on the support matrix
@raven canopy did something get changed with the support matrix generator?
there was a change, yes. jeff switched the generator: https://github.com/adafruit/circuitpython/pull/2957
i would make sure to view the latest version of the docs; not a pinned version (unless super necessary)
Ah, yep that was the issue. At this link: https://circuitpython.readthedocs.io/en/latest/shared-bindings/support_matrix.html everything is present
(as far as I can tell, though I am less in tune with some of the newer boards)
The 5.0 support matrix page does not have one of the "warning this document is for an older version" alert boxes. Also to be honest I still find myself on old docs pages lots of times from google searches and for some reason the orange / red color of that alert does not stand out to me much so I often don't realize it's old until something in the API seems wonky to me. I wonder if it might be worthwhile to make that warning a little bit more "in your face" within the docs. Perhaps a bolder color, or "scroll with the page".
@ionic elk I appreciate it, thank you
Let me know if I can furnish any additional info
dang I hate debugging without a debugger
wish these teensy people had at least stuck a couple pads or something on there I could tap into
@lone axle I agree, landing on an old version of the docs and not noticing for a couple seconds is a daily frustration for me
@ionic elk how do you upload code to the imxrt1010-evk?
You can use the jtag connector or the DAP link (onboard debugger)
I have a JLINK on the connect, but it is not seeing it -- anything special I need to do -- is is SWD?
the DAP is super easy, move the J1 power connector from the furthest left to the second-to-furthest left and plug into the J41 USB
if the J1 power connector is already on the second-to-left the Jlink and USB-OTG might not work
ah --- checking
wait no hang on I'm looking at the manual
RE docs pages old version warning: I will spend some time brainstorming this week and looking at other projects docs to find some good examples (I use Django docs pretty regularly and don't have the same problem with it, perhaps we can take inspiration that or other docs pages). I'll make a note to discuss it in the weeds next week.
Ok, so J1 position 1 (pins 1 and 2) is power from J41 (CMSIS DAP) so I was wrong
J1 position 2 (pins 3 and 4) is J9, the main USB-OTG connector, which shares a circuit with the JTAG
Or rather it doesn't interfere with the JTAG? I think that if you have the DAP powered, it prevents the Jlink from working.
Also yes, your JLink settings should be for SWD.
so - should I remove the jumper on J1 1-2?
I'm saying JTAG here as a name for the header but that's not the protocol you're using
Move the jumper from J1 1-2 to J1 3-4
and plug in the USB cable to J9
then start your Jlink
@lone axle thanks for checking that out, if you can figure out what they do to always route to the latest docs that'd be sweet
np
I'd consider grabbing the Hardware Guide from the NXP website. You have to sign up for an account to get it (sigh) but it's got all this info about the power and USB connections in it.
thanks -- I am working through that now!
Not that it'll solve all your problems, NXP docs are pretty garbo in my opinion. You need to cross reference with the schematic PDF a lot
do you then just load the firmware.hex file
with .bin do you need to specify an address?
You're using a Jlink, right? Are you using Jlink FlashLite or something?
Normally with a Jlink you always use gdb and an .elf file for symbol information, then connect and use load
tried with JLinkExe ```J-Link>loadfile build-imxrt1010_evk/firmware.hex
Downloading file [build-imxrt1010_evk/firmware.hex]...
Comparing flash [100%] Done.
Erasing flash [100%] Done.
****** Error: Failed to erase sectors.
Unspecified error -1
I'll try gdb
what's that trick with JLinkExe?? I was bugging dan about that the other day
what are the commands you're using?
what's that trick with JLinkExe?? I was bugging dan about that the other day
[11:05 AM]
SEGGER J-Link Commander V6.70g (Compiled Apr 23 2020 09:14:12)
DLL version V6.70g, compiled Apr 23 2020 09:14:02
Connecting to J-Link via USB.../opt/SEGGER/JLink_V670g/JLinkGUIServerExe: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
O.K.
Firmware: J-Link V10 compiled Mar 19 2020 11:10:39
Hardware version: V10.10
S/N: 260101649
License(s): FlashBP, GDB
OEM: SEGGER-EDU
VTref=3.333V
Type "connect" to establish a target connection, '?' for help
J-Link>con
Please specify device / core. <Default>: MIMXRT1011XXX5A
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>s
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "MIMXRT1011XXX5A" selected.
Found SW-DP with ID 0x0BD11477
DPIDR: 0x0BD11477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770041)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FD000
CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
Found Cortex-M7 r1p2, Little endian.
FPUnit: 8 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ E00FD000
ROMTbl[0][0]: E00FE000, CID: B105100D, PID: 000BB4C8 ROM Table
ROMTbl[1] @ E00FE000
ROMTbl[1][0]: E00FF000, CID: B105100D, PID: 000BB4C7 ROM Table
ROMTbl[2] @ E00FF000
ROMTbl[2][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[2][1]: E0001000, CID: B105E00D, PID: 000BB002 DWT
ROMTbl[2][2]: E0002000, CID: B105E00D, PID: 000BB00E FPB-M7
ROMTbl[2][3]: E0000000, CID: B105E00D, PID: 000BB001 ITM
ROMTbl[1][1]: E0041000, CID: B105900D, PID: 001BB975 ETM-M7
ROMTbl[1][2]: E0042000, CID: B105900D, PID: 004BB906 CTI
ROMTbl[0][1]: E0040000, CID: B105900D, PID: 000BB9A9 TPIU-M7
ROMTbl[0][2]: E0043000, CID: B105F00D, PID: 001BB101 TSG
Cache: Separate I- and D-cache.
I-Cache L1: 16 KB, 256 Sets, 32 Bytes/Line, 2-Way
D-Cache L1: 8 KB, 64 Sets, 32 Bytes/Line, 4-Way
Cortex-M7 identified.
Thanks! I'm not practiced at Jlink Commander yet. I'll try and wrap all that up in a script when I have a free second
but loadhex fails -- for loadbin I need the load address -- is it at 0?
I don't know that off the top of my head, I'm not a pro on the i.MX flash loading shenanigans yet
I'd probably just try loading with GDB and then following what it does
I tried, but it did not work either -- will try again -- loaded, but immediately halted when I typed c
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from firmware.elf...
(gdb) load
Loading section .dtcm_bss, size 0x228 lma 0x20000400
Loading section .flash_config, size 0x200 lma 0x60000400
Loading section .ivt, size 0x30 lma 0x60001000
Loading section .text, size 0x50010 lma 0x6000c000
Loading section .ARM.exidx, size 0x8 lma 0x6005c010
Loading section .data, size 0xc08 lma 0x6005c018
Loading section .itcm, size 0x1ab0 lma 0x6005cc20
Loading section .dtcm_data, size 0x400 lma 0x6005e6d0
Start address 0x6002318c, load size 339752
Transfer rate: 16589 KB/sec, 12134 bytes/write.
(gdb) c
Continuing.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x20201d78 in ?? ()
(gdb)
I'm rusty with gdb -- am I missing something simple -- started with tar extended-remote:2331 then loaded file
try mon halt, mon reset, load
and check out the actual Jlink process to see if it's telling you about failing to halt or inability to access code locations or something
if all else fails you can try loading with the DAP, after swapping over the power connector like I mentioned
it's just drag and drop
thanks -- I'll keep working at it. sorry to taek so much of your time. -- just got the maunal
for DAp -- which file do you load?
I have some .gdbinit aliases that allow simpler connection and loading:
define jlink
target extended-remote :2331
end
define jload
jlink
mon reset
load
mon reset
end
define jloadc
jload
echo Starting...\n
continue
end
(gdb) mon halt
(gdb) mon reset
Resetting target
(gdb) load
Loading section .dtcm_bss, size 0x228 lma 0x20000400
Loading section .flash_config, size 0x200 lma 0x60000400
Loading section .ivt, size 0x30 lma 0x60001000
Loading section .text, size 0x50010 lma 0x6000c000
Loading section .ARM.exidx, size 0x8 lma 0x6005c010
Loading section .data, size 0xc08 lma 0x6005c018
Loading section .itcm, size 0x1ab0 lma 0x6005cc20
Loading section .dtcm_data, size 0x400 lma 0x6005e6d0
Start address 0x6002318c, load size 339752
Transfer rate: 19517 KB/sec, 12134 bytes/write.
(gdb) c
Continuing.
Program received signal SIGTRAP, Trace/breakpoint trap.
0xfffffffe in ?? ()
(gdb)
which file type does the DAP drag/drop accept?
.bins
hmmm -- not my day -- that results in a FAIL.TXT file with error: File sent out of order by PC. Target might not be programmed correctly. type: transient
for the record I'm in the same boat, trying to get the 1062 to do literally anything and it's failing at every turn
I dunno if Jlink just isn't up to date with these boards or what
Thanks for trying to help -- good luck with the current issues...
such is the price for cutting edge I guess.
life in the fast lane ๐
it's a miracle!! ( I reconnected) to J41 -- ws goin g to try Ozone -- and CIRCUITPY came up ``` Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.0-483-g5f1398f27 on 2020-06-03; IMXRT1010-EVK with IMXRT1011DAE5A
help('modules')
main collections microcontroller supervisor
_os digitalio micropython sys
_pixelbuf displayio neopixel_write terminalio
_time errno os time
analogio fontio pulseio touchio
array gamepad random ulab
bitbangio gc re usb_hid
board io rtc usb_midi
builtins json storage vectorio
busio math struct
Plus any modules on the filesystem
so you're powering it off J41 but using USB on J9?
sorry only on J9, not J41
@half sedge Did you encounter any issues with the airlift+nrf52840 advertisement project https://twitter.com/DavidGlaude/status/1224816939173908481 ?
specifically - any pin mapping problems ?
@ionic elk so -I'm not sure how it got loaded -- via JLink or DAP, but it is working via J9 --- BTW this build does not work on the teensys.
I'm not sure anything is working on the 1060
Jlink can't load onto a 1060 which makes everything really slow to determine, but it seems to be crashing directly after boot
I am just using teensy_loader_cli for the teensys
aaaand now Jlink can't connect to it at all
hmm -- now I can repeatedly load the .hex file cleanly via J-Lin -- Uising JLinkExe -- just set device , SWD default speed then loadfile firmware.hex ```J-Link>loadfile firmware.hex
Downloading file [firmware.hex]...
Comparing flash [100%] Done.
Erasing flash [100%] Done.
Programming flash [100%] Done.
Verifying flash [100%] Done.
J-Link: Flash download: Bank 0 @ 0x60000000: 1 range affected (393216 bytes)
J-Link: Flash download: Total time needed: 7.635s (Prepare: 0.051s, Compare: 2.837s, Erase: 1.324s, Program: 1.992s, Verify: 1.424s, Restore: 0.004s)
O.K.
needs a RESET after load (press SW9) or power cycle
I've updated this PR to disable reset_all_pins on the 1060 as a temporary fix for the teensy boards and EVK. I'll revisit this when I have some more time to investigate what's going on with the debugger - I'm currently unable to erase or flash the 1060 EVK with a Jlink, and it's making this bug a lot more daunting than it should be.
@jerryneedell also fixed your issue compiling the 4.1, that was just a missing include.
teensy41 works ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.0-485-gc93ccd1e9 on 2020-06-03; Teensy 4.1 with IMXRT1062DVJ6A
@hierophect thanks -- tested on teensy41 -- looks good! ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.0-485-gc93ccd1e9 on 2020-06-03; Teensy 4.1 with IMXRT1062DVJ6A
teensy40 boots ok with PR 3001 as well --
Is there any reason to be using busio.I2C(board.SCL, board.SDA) anymore with board.I2C being a thing?
@idle owl not that I can imagine, especially for examples because it lowers the cognitive overhead.
right.
The longer form is useful if you have multiple i2c buses available.
I kind of want to push using it directly even.
But that can be explained in the guide specifically about i2c
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_ahtx0.AHTx0(i2c)```
becomes
```python
sensor = adafruit_ahtx0.AHTx0(board.I2C())```
But that can be explained in the guide specifically about i2c
@ivory yew entirely valid.
Yeah I'm all for that.
Especially since most folks will only use one i2c bus unless they're doing some fancy stuff.
What is the concept of board.I2C() called? I'm trying to include a comment in this code about it but realised I'm not sure how to refer to it.
I don't know if we have any intentional terminology for that, but I generally refer to those types of things as helper constructors.
"alias" or "shortcut" works too
i'd agree with alias.
I ran into the one/multiple I2C bus thing not long ago. One potential source of error is some drivers may take the pins SDA/SDC and not the board.I2C reference. That prevented re-use (or I did it wrong been a couple weeks now).
but now i'm trying to remember exactly where the object is created/handled. ๐
If all drivers took board.I2C() rather then pins that would simplify things (or your own created I2C object)
@idle owl I think you want singleton. It always refers to the same object even if you do it more than once.
@slender iron It was for a comment in a simpletest. I went with something simpler that says essentially "create the object with I2C." It wasn't the place for programming terminology.
@slender iron But thank you for letting me know. I'll use that if I'm ever explaining it more thoroughly.
kk, np
so that's what singleton means ๐
@fgallaire I couldn't fit the libraries in the firmware. I didn't want to reduce the filesystem size because 64k is already very tight for user code.
Please add a comment here that it is temporary and also create an issue to fix it.
but which pin?
I'd suggest binary searching it. Make reset_all_pins only reset half of them and then repeat for the bad half.
@tannewt yeah I tried that this morning, it actually fails with every pin in never_reset. From what I could briefly gather with the Jlink before it stopped connecting altogether, the chip might actually be crashing when it hits the never reset portion?
I'd prefer two modules. That way it'll fit into the support matrix and its related machinery. Maybe sdioio :-P ?
@onyx hinge would it make sense to have sdcardio.SDCard take in a bus that is either a busio.SPI or sdioio.SDIO?
that way you don't duplicate the block API
To a user, absolutely. The structure of the C code didn't turn out to share any implementation, though.
are the command sets related? aka is there a world where it could be?
I think it's ok if the C impl splits hard
writeblocks for stm32 sdio: https://github.com/adafruit/circuitpython/pull/2863/files#diff-3eade69fb70b24d00c80794e875b68f5R178 for spi, generic https://github.com/adafruit/circuitpython/pull/2863/files#diff-be3b780a3a595598e0d1aba0b3717f43R423
Translations update from Weblate for CircuitPython/master.
"stopped connecting altogether" sounds like you are resetting the SWD pins.
@onyx hinge I don't think the Python API should reflect the reality of the C
would the type exposed to Python use function pointers for the "real functionality" then?
whether with protocols or not
I'll need to think about how that would work, but it is probably doable
ya, if you want to do it that way
I think you answered the Python API question though ๐
thanks for the check on my natural laziness. Jot something down on the PR so I keep going in the right direction?
๐ will reply there
maybe write what the constructor should look like, it might take an SPI bus plus a required CS pin, or an SDIO bus; either one takes a frequency/baud rate
SDCard(bus, *, frequency, chip_select=None)
?
I think it'd be better to separate the bus from the SDCard APIs here.
# Connect to the card and mount the filesystem.
bus = busio.SPI(board.SD_SCK, board.SD_MOSI, board.SD_MISO)
device = adafruit_bus_device.SPIDevice(bus, board.SD_CS) # Also takes frequency, polarity and phase.
# For SDIO
# device = sdioio.SDIO(clock=board.SDIO_CLOCK, command=board.SDIO_COMMAND, data=(board.SDIO_DATA,), frequency=25000000)
sdcard = sdcardio.SDCard(device)
@slender iron yeah we can't use busdevice here unless it's in C too
and it's having to cooperate with foreground python use that gets us https://github.com/adafruit/circuitpython/issues/1762 -- the way that this PR was going to solve it also involved taking sole usage of the whole SPI bus ๐ฆ
I tried to make a game that would have both music and graphics. I decided to make a simple Tetris game for the Hallowing. The code is here: https://github.com/deshipu/hallowing-tetris Unfortunately...
er maybe that's not the bug I meant, the one where SD card access in foreground interferes with background
the "solution" is that only C code touches the bus, never python code that locks it via busdevice
@slender iron so, uh, I was trying to figure out if I could use some scripting magic to full the SPDX copyright lines in circuitpython (because those are definitely not as straightforward as the other repos) and I have a feeling that a .mailmap might be useful :)
you appear to have four separate email addresses in the log XD
sorry, five
@ionic elk I was just playing with the imxrt1010-evk a bit and ran out of memory when running a test -- is this correct? ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.0-483-g5f1398f27 on 2020-06-03; IMXRT1010-EVK with IMXRT1011DAE5A
import gc
gc.mem_free()
27792
Hah, the docs already use the grouped option: copyright = '2014-2020, MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)'
I guess I can do that
@solar whale I know there's an issue where the i.MX chips are showing a way smaller stack size than they're supposed to have, but I don't know an easy way to solve it. On STM32 it was just changing a variable that wasn't supposed to be set.
I was trying to run a test with an ESP32SPI Airlift board but it runs out or memory loading the libraries.
Adafruit CircuitPython 5.4.0-beta.0-483-g5f1398f27 on 2020-06-03; IMXRT1010-EVK with IMXRT1011DAE5A
>>> import esp32spi_simpletest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "esp32spi_simpletest.py", line 4, in <module>
File "adafruit_esp32spi/adafruit_esp32spi_socket.py", line 37, in <module>
File "adafruit_esp32spi/adafruit_esp32spi.py", line 146, in <module>
File "adafruit_esp32spi/adafruit_esp32spi.py", line 527, in ESP_SPIcontrol
MemoryError: memory allocation failed, allocating 376 bytes
>>>
not surprising if < 28K is avaialble
the teensy41 shows >900k availalbe !
I was just curious if this was expected or if something was not configured properly
Maybe that is consistent - the teensy41 has 1M of ram and shows ~930K free. CP must be using ~90K of the avaialble RAM
or somthing is taking 90K out of avaiability
ports/mimxrt10xx/linking/chip_family/MIMXRT1011.ld:ram_size = 128K;
it appears to reserve 64K for other purposes
OCRAM (rwx) : ORIGIN = 0x20200000, LENGTH = ram_size - 64K
so only 28K available is realistic -- too bad -- really limits the usefulness
an M4 only has 192K to start but ~160K is avaialbe once CP starts up. Since this chip only has 128K and holds back 64K ....
I guess thats why its an EVK
@slender iron so, uh, I was trying to figure out if I could use some scripting magic to full the SPDX copyright lines in circuitpython (because those are definitely not as straightforward as the other repos) and I have a feeling that a
.mailmapmight be useful :)
you appear to have four separate email addresses in the log XD
@topaz quest heh, oops!
@lucid solar when you were setting up the clocks for the F746, was there a particular reason you wanted the USB on the SAI PLL? Or was it just circumstantial?
@ionic elk I think I took the defaults from cubemx
@solar whale the 64k is used for ITCM and DTCM (which is where the stack lives)
32k each
but 28K is not enough to live on ...
@topaz quest heh, oops!
@slender iron I'll send a mailmap on the pull request for reuse. You're far from the only one so it's nice to sort out names ๐
@ionic elk or...no...there was no reason...so if you need to change it...do it...as long as it works ๐
for importing libs
@lucid solar there was a reason you can't remember?
that's why I've said the 1010 is small but fast
@ionic elk no reason
The F412 uses it, but that's because the divisors to achieve 100MHz are mutually exclusive with getting 48M for the USB
just too bad it can't support esp32spi....
if you don't have the TCMs you are relying on the CPU cache to keep you going fast. otherwise you are fetching from flash
arturo frozen esp32spi in
we have tons of flash
ah -- great idea -- I'll play with that
Ok, all good! Just wanted to make sure. I'm leaving it in there as an option just in case somebody wants to set their system clock to something weird.
@ionic elk Is this for disco, or nucleo, or both?
@slender iron which board did arturo do that for? freeze esp32spi?
his feather
thanks
np
True... I'll try stepping through the reset portion more carefully and try and figure out what's going on. Maybe it isn't adding them to never reset, somehow? It'd be weird, since it works just fine on the 1010
@ionic elk ok...yes...there was a reason...now I remember ๐ The nucleo board has it on PLLQ...which is fine. But the disco needs it because the clock speed should be 200mhz max (for the external sram, or external flash...I forget which). And I couldn't get the clocks to calculate by having it on the PLLQ...so it's on SAI...which is what the default is on cubemx
Oh that's right yeah you were talking about that
Did you actually ever implement the external SRAM?
No, but it's on my todo list.
In any case, OK! good reason to keep that whole option available.
This is still a bit work in progress, and does not yet pass lint, but it starts adding useful licensing information, particularly around the logos.
This is a request for capability for slice manipulation for multi-dimensional arrays. This would allow more of the code to be performed "down" at the C-level rather than item-by-item manipulation up at the CircuitPython level.
Use case description: For developing an updated text display capability to reduce memory usage vs. label when using imported BDF files, one way is to create a bitmap buffer to contain the text, rather than a group of tileGrids. To do this, I copy each glyph bitmap ...
Pretty low-key PR. These are some changes I've been holding onto while working on RosiePi.
-
Biggest change is to the use of
asyncas a parameter/variable.asyncbecame a keyword in CPython 3.7, so its usage would raise an exception. -
Updated usage of
pyserialto match the changes from version 3. -
Ran
blackon the file. -
Added VID/PID for
itsybitsy_m4_expressto the respective USB device lookup functions
Hmmm I merged this PR and then I went looking at it. Isn't the sense of "wait_for_response" backwards from what it actually does?
Oh this is awesome, you can zoom in on just one commit out of all of the commits in a PR
so I could look at the parts before "run black formatter", which made the other changes harder to spot
Isn't the sense of "wait_for_response" backwards from what it actually does?
Right you are. ๐คฆ I've actually had a few of these edits in branches as my use of it progressed; I think I had it proper at one point, but this definitely isn't. Fix imminent.
oh. did the new UI go GA? or are you on the preview too?
Are there any other good examples of games utilizing the Stages library aside from Vacuum-Invaders and Jumper-Wire?
@pseudo gale not that I am aware of
I'm working on a sokoban clone, but it's not ready yet
I'm in your GitHubs, wrangling your APDS9500 library!
@raven canopy I may be on preview
@pastel panther im looking at your code for i2c on adxl34x and notice that when calling to read data you only use 0x32 which equates to X-Axis Data 0, you never call the y or z data, yet you get all three channels. i cant find this written in the datasheet anywhere that it pull all the data from 0x32
@balmy sail you mean x, y, z = unpack("<hhh", self._read_register(_REG_DATAX0, 6)) ?
you can read consecutive registers if you read more bytes from them
That reads 6 bytes starting from 0x32, using register auto-increment, and then uses struct to unpack them into three two-byte, little-endian, signed integers (short).
Whether the i2c device at the other end sends the same byte, or auto-increments is an exercise left to the manufacturer though ๐
Oh, my, check this out. Will Adafruit be picking this up for a new breakout? https://www.st.com/en/imaging-and-photonics-solutions/vl53l3cx.html?ecmp=tt15486_gl_enews_may2020&cid=stmDM29177&bid=301274364&uid=I/tmuBRkj80vU7yIDi9JgjyIYVqoBFNe
Thanks. It might be a bit better to def execute(self, code, timeout=10, *, wait_for_response=True): so that any old code that called execute(code, timeout, True) intending to get async behvior will be a runtime error, instead of turning into a call with wait_for_response=True. If the only users are in the circuitpython source tree, though, this scarcely matters.
Marking this "approve" so that you can merge if you're not worried about the nit I picked.
This is a very excellent point, and I don't consider it a nit-pick at all.
I don't expect many people are using this. I point to it as an example how to interact with boards via a PC, but that's about it.
A lot of the semantics are so that it remains py2/py3 compatible, from what I understand (its base is MicroPython's tools/pyboard.py. I'll likely give it more scrubs for a multitude of reasons. One of those scrubs will include removing Python2 use; not worth using at this point.
๐ for not clinging to python2 compatibility at this point
@onyx hinge Hey I'm sorry for not getting to your PR yesterday, I should be able to check it out this afternoon.
@ionic elk that's fine, thanks!
@timber mango the VL53L3CX is mentioned here: https://www.youtube.com/watch?v=3PocFz427NE
This week's EYE on NPI is on a super super fresh NPI that we're excited about - the ST VL53L3CX (https://www.digikey.com/en/product-highlight/s/stmicroelectronics/vl53l3cx-time-of-flight-ranging-sensor) which is the latest version of the 'micro-LIDAR' sensors from ST. Starting...
all is a keyword arg for _bleio.ScanEntry.matches(), but all() is also the name of a builtin function, and so the keyword arg is flagged by pylint, etc. as masking the builtin function name. So let's change the arg name.
pylint will complain insome cases about _bleio.ConnectionError shadowing the original global ConnectionError exception.
Let's consider changing the name of the _bleio exception.
This PR significantly reworks the STM32 clock system, moving all LSE related settings to the peripherals directory, and streamlining clock settings across all development boards. Resolves a number of crashes that could occur across dev boards due to incorrect LSE setup, and adds LSE capability to the F7 and H7 chip families.
The restructuring of the clock system merges the clock setup of all SoCs in a family, reducing chip-line differences and defaults to macros only. Also introduces the ...
@tannewt fix is in, sorry if I've been holding up the beta! I'll start work on a permanent fix as soon as I've checked out Jepler's timer issue.
Hi All - I noticed that there is no option for getting 5.3.0 nor 5.4.0-beta on our CircuitPython.org page. Is that because our board was merged after those builds were released?
@old smelt yup! which reminds me that I meant to release a beta this week
Thanks @slender iron . So, if I want to make a clean build for our boards, I could do that locally by checking out the 5.3.0 branch?
that won't have your board
@onyx hinge what's with the _ prefix on sdcardio?
the beta will be on master
Oh. Yeah, that makes sense.
Ok. It's not urgent. I'll just wait for the next Beta release.
๐ will do by the end of tomorrow
Cool. I'll message you at 11:59:59pm PDT. ๐
๐
@ionic elk we expect it's not the final API
and/or the final API will be wrapped by adafruit_sdcard
So are you going to replace it? Or is it a new class of common-hal module for a wrapped API?
It's going to change compared to what's there now
ultimately, we want a "bus object" for SDIO buses, for instance. Not sure if joking, tannewt suggested "sdioio"
is the "_" causing a problem for you at this time?
oh no I was just curious, didn't mean it to sound abrasive
ah yes, sdioioioioioio.
@balmy sail re: x-axis vs. y and z, it's a common (and good) practice to read all of the measurement registers at once rather than individually, and most sensors will have a way to automatically increment the register address that you're reading from. We use this to start reading at the first byte of the x-axis data and read through all six bytes of data to get it all at once
@ivory yew are you working on the theme song for "eye on sdio"?
@balmy sail Regarding spidev vs. adafruit_spi_device, the former is a CPython (normal python) library and the later is a CircuitPython library meant to be used with microcontrollers running CircuitPython, though it can be used on the RPi and other computers through Blinka.
since Adafruit_CircuitPython_ADXL34X is a CircuitPython library, the later is what we use
@onyx hinge @ivory yew I think Phil Collins already wrote one...
Also - @slender iron - still up for an abstraction library discussion?
@slender iron could you help me to understand how Systick works in the low power system? Is it disabled by your low power code, or turned on periodically? I don't see references to it in port.c so I'm kinda confused.
systick isn't used at all
what's turned on periodically is a period interrupt from the rtc
huh
I'm puzzled at how basically anything in the HAL is working then, because they all use GetTick all the time, and that depends on Systick incrementing
the hal could turn it on
I think it's got to be on right now for all ST boards
The altfunction is GPIO_AF12_SDIO. Do you think we should bring this in as a peripheral in the peripherals/ directory? I'm a little split on it because the pins are actually the exact same across every F4, F7 and H7 chip line, including the altfunction. That was also the case for the DAC, so I just defined it in-module. But it's a bit of a deviation from the rest of the ST modules to have actual chip information in the module itself instead of using peripheral instances.
We'd probably want to use claim_pin here to reserve the pins (and allow some planned gpio bank power optimization), which would require an instance of the pins in question. This would tie into the peripheral question above.
I'm not totally sure what to do here. In Micropython's low power implementation, HAL_GetTick isn't overridden at all - they use the system version, which depends on SysTick. HAL_Delay dynamically selects whether to run a SysTick based delay or a busy loop depending on whether interrupts are enabled or not.
I don't know how anything in the HAL could even be working without HAL_GetTick since it's used more or less constantly for timeouts, which implies to me that the Systick is currently tu...
Just a couple comments about the Systick and peripherals structures. I'm going to take a closer look at HAL_GetTick and try to get a handle on what's going on with the low power code.
@old smelt going for a run now but will be around after
You can slice 2D array in ulab. Or did I interpret your question incorrectly? In any case, if the question is really about ulab, we should probably move it to https://github.com/v923z/micropython-ulab/issues.
@onyx hinge what was your actual experience trying to overwrite HAL_GetTick()
Like what happened
@ionic elk it hung at startup. I think, because there are (were) HAL_GetTick() calls inside the clock setup stuff
fwiw I have merged your clock PR into my sdio branch and the SDIO code isn't working
and then I started going down a rabbit hole
Yeah. This is going to be tricky. Right now I don't think that the low power code on STM32 is actually doing anything, because Systick is turned on by HAL_Init and is never explicitly turned off
I have not made sure to fully power cycle (vs just doing a jlonk flash) so I should do that
So basically all of this RTC stuff is running in parallel to just normal, full speed SysTick driven operation
Possibly, but my testing shows that the SysTick interrupt stops being called, with SysTick->CTRL set to 0 and I don't know why yet (that's the rabbit hole)
does it really?
The issue is that every single HAL init function uses HAL_GetTick for timeouts, and it depends on SysTick. So right now, if Systick turns off, that means that every single module is going to stop working.
I see SysTick_Handler be hit 4 times as a breakpoint after reset, and then no more
On my new power PR?
yes, though likely also before it
(because that's consistent with what I saw before it, that the GetTick value never increased)
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/jepler/src/circuitpython/ports/stm/build-feather_stm32f405_express/firmware.elf
[Switching to Thread 57005]
Breakpoint 11, HAL_InitTick (TickPriority=15)
at st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:256
256 if (HAL_SYSTICK_Config(SystemCoreClock / (1000U / uwTickFreq)) > 0U)
(gdb) c
Continuing.
Breakpoint 8, SysTick_Handler () at supervisor/port.c:190
190 SysTick->CTRL;
(gdb)
Continuing.
Breakpoint 11, HAL_InitTick (TickPriority=15)
at st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:256
256 if (HAL_SYSTICK_Config(SystemCoreClock / (1000U / uwTickFreq)) > 0U)
(gdb)
Continuing.
Breakpoint 8, SysTick_Handler () at supervisor/port.c:190
190 SysTick->CTRL;
(gdb)
Continuing.
Breakpoint 8, SysTick_Handler () at supervisor/port.c:190
190 SysTick->CTRL;
(gdb)
Continuing.
Breakpoint 8, SysTick_Handler () at supervisor/port.c:190
190 SysTick->CTRL;
(gdb)
Continuing.
``` (and never after that, while typing in the repl)
Man that is pretty baffling, I don't know how it's even getting through my clock code if that's the case. And that PR works fine on all my chips, I just tested it
I must be missing something
@onyx hinge Jeff, do you happen to have a snippet, where you pass a ulab array to something with the buffer protocol? I thought your blood pressure sensor did that, but I don't see it now.
@lapis hemlock I may not. Here's what the fft demo did: mic.record(samples_bit, len(samples_bit)) samples = ulab.array(samples_bit[3:])
wait not my new power pr my new clock pr? the one I just posted
with all the new clock setup shenanigans?
the clock PR
hmmm
@lapis hemlock I may not. Here's what the fft demo did:...
@onyx hinge That should probably do, thanks!
Ok. I'm going to take a quick break and then come back to this. I don't want to completely dive down the rabbit hole without @slender iron around, I'm worried I might waste time rediscovering something he already solved
OK, let me just recap. I have an stm32f405 feather with an attached jlink. I flashed it with Adafruit CircuitPython 5.4.0-beta.0-493-gfffe171d5 on 2020-06-04; Feather STM32F405 Express with STM32F405RG via jlink, restarted and re-powered everything
I set a breakpoint on SysTick_Handler and continued in gdb. The breakpoint is only hit 3 or 4 times before it stops
I think that explains why Hal_Delay and Hal_GetTick do not work as expected
but I have not found what resets SysTick. It ends up looking like this: ```(gdb) p $SysTick = (SysTick_Type*)0xe000e010
$1 = (SysTick_Type *) 0xe000e010
(gdb) p *$1
$2 = {CTRL = 0, LOAD = 5040, VAL = 5028, CALIB = 1073760574}
Old value = 7
New value = 5
0x080500c6 in common_hal_mcu_delay_us (delay=840000) at common-hal/microcontroller/__init__.c:48
48 while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0) {}
(gdb)
Continuing.
Hardware watchpoint 2: -location $1->CTRL
Old value = 5
New value = 0
0x080500da in common_hal_mcu_delay_us (delay=840000) at common-hal/microcontroller/__init__.c:50
50 }
oh.
Right. But it doesn't explain why everything else is working. Right now I don't understand conceptually what the state of SysTick is. If it's turned off, then without overrides of Hal_GetTick and Hal_Delay, basically nothing should be working - not the clock setup, GPIO, nothing. But you're saying that it is turned off, and I know that the chips aren't totally broken because I just tested them. So I'm confused.
@onyx hinge what's your revelation?
That common_hal_mcu_delay_us is what is changing SysTick setup
uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq()/1000000;
delay *= ticks_per_us;
SysTick->LOAD = delay;
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk;
while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0) {}
SysTick->CTRL = 0;
}
so this turns on SysTick for the duration and then turns it off again
Frustratingly, since I thought my code and hardware worked, my sdio test code is failing before I merge in your code, so that's a red herring
๐คท
Maybe the HAL turns on the SysTick for every HAL function?
I don't see any code doing that, and my gdb session is telling me that SysTick isn't usually being executed
and if the "watch" of the CTRL register is working, it's telling me there aren't any manipulations of CTRL from C code
I think it is working during early setup until the first common_hal_mcu_delay_us and broken after that
many of the uses of GetTick that I saw are for waiting for something to time out; so if things happen on schedule, it doesn't matter that the ticks aren't counting up. But there are explicit delays in the sdio setup and it is well after the rest of circuitpython startup, and those definitely fail
Yeah that seems likely to me. So basically the low power code isn't really running until a module calls common_hal_mcu_delay_us and then it probably breaks. I don't think many (any?) of my existing modules call it so I may simply have just never noticed it in testing
yeah only PulseIn uses it
I'm stepping away, before I get too frustrated at my own code which stopped working while I wasn't watching. I hope this is useful food for thought.
(not because of you, the code I pushed also isn't working)
Well it's possibly a pretty big bug so yeah! Good we found it. I'll think about a quick/long term fix for now
I'll try and use PulseIn on Master and see if it crashes everything
If so we might want to disable low power as a short term fix and then I'll need to spend some time messing with the HAL_Delay and HAL_GetTick overrides so they can use SysTick for the beginning of Port Init for clock setup and then turn it off and use the RTC code only after that.
Cool. Right now, nothing passed in is being used. This code is pure junk, because we won't hard-code the pins like you see here. Instead, it'll have to be more like SPI with the tables of functions and instances and so on.
Since HAL_GetTick doesn't seem to work, happy to see these lines go
I concentrated on the parts relevant to the STM32F405 Feather and didn't see any problems.
I initially thought there was something functionally wrong about the code, because I merged it into my SDIO branch and got I/O errors. However, I am now seeing these I/O errors with the current tip of that PR's branch, so they do not seem to be due to this PR's changes after all.
They're still around in stm32_peripherals_clocks_init(), which contains the HAL code for the clocks. I think that the systick incrementation you saw was the timeouts used for clock setup, before it gets turned off.
Hello. I have a custom board Iโve made using Adafruitโs Itsy Bitsy M0 board. I can get the ITSYBOOT. But when I drag a CircuitPython file over, it copies, goes away, and nothing else happens.
@steep oasis what file are you copying over? Is it this? https://downloads.circuitpython.org/bin/itsybitsy_m0_express/en_US/adafruit-circuitpython-itsybitsy_m0_express-en_US-5.3.0.uf2
@old smelt free in 20 minutes?
Yes. Iโve tried that and the 5.4.0 beta.
In the ITSYBOOT drive, there is a file INFO_UF2.txt, can you see what version of the bootloader you have? @steep oasis
@lucid solar UF2 Bootloader v3.10.0 model ItsyBitsy M0 Express.
OK, that's the latest
@lucid solar I want to point one thing in the HW. Adafruit doesnโt list the memory chip they use. I sourced my own. Not 100% sure if itโs the right one. Or if it even matters.
Ah, did you make your own board? not a board with an Adafruit's Itsy Bitsy on it?
@lucid solar thatโs correct! I took their schematics and made my own PCB.
Aha, I misunderstood ๐ That explains it though...there is probably something custom that the default firmware won't work. What's the flash chip you brought?
MX25R2035FZUIL0. One sec and I can bring up a data sheet link.
That's ok...don't need that.
It seems 'W25Q16FW, GD25Q16C' are the ones used on the itsy-bitsy M0 according to the code.
Dang. I didnโt think to look at the code for the PN they used. Iโm guessing the quickest path forward is to replace the part? Probably easier than making my own board variant?
Hi Folks - been a while - hope everyone's healthy and safe
Well...maybe that's best if you want to use the pre-built firmware....but it might be quick to add support for your chip...are you able to compile circuitpython yourself @steep oasis
@lucid solar link for getting started with that?
Does anyone know of a USB C jack that is pin-compatible with the USB Micro jacks on the Feathers? I have a project that basically needs a feather but needs USB-C support to connect to an ios device
@steep oasis I can try to compile it for you quickly...just need some settings...maybe you can get them from the datasheet to save me time?
That would allow the NRF52840 Sense feather to do everything in CP instead of building a custom board
.total_size = (1 << 21), /* 2 MiB */ \
.start_up_time_us = 5000, \
.manufacturer_id = 0xef, \
.memory_type = 0x60, \
.capacity = 0x15, \
.max_clock_speed_mhz = 133, \
.quad_enable_bit_mask = 0x02, \
.has_sector_protection = false, \
.supports_fast_read = true, \
.supports_qspi = true, \
.supports_qspi_writes = true, \
.write_status_register_split = false, \
.single_status_byte = false, \
}``` This is what info we need to find out.
@tough flax does it have to be a jack? You can get a USB-C male to micro-B male cable easily. https://www.adafruit.com/product/3878 and 3879, but many people have these
@lucid solar ooooof. Let me see if I can find all this quickly.
@tulip sleet the goal is to connect a lightning -> USB-C cable to the device
Honestly, what I want is an NRF52 board w/a USB-C jack on it.
I haven't found one yet (from the fruit or on CP.org)
as opposed to lightning to USB A female
this is promising: https://www.monoprice.com/product?p_id=14850
With the Monoprice Palette Series of USB-C cables, you can connect your USB-C equipped PC or Macยฎ to the various USB devices in your life. Featuring a female USB-C connector on one end and a male
It might work
I have found the fewer adapters the better with ios
This board is close https://store.makerdiary.com/collections/frontpage/products/nrf52840-mdk-iot-development-kit
But it's higher cost and doesn't have the charging support
I will send that cable to them and ask if it's OK
@old smelt I'm around just ping me when you are done
@lucid solar Iโll need to get to you on this info. Unsure on some of these values.
@steep oasis I'll take a look...
@lucid solar thanks. Iโll be back on in a bit. Thanks for your help!
@steep oasis One thing to note, the chip you have is 2M-bit, but the one on the itsy is 2M-byte...that's a big part of the issue
@slender iron - looks like I need to head to the Home Office from the Office Office. So, I'll be traveling for a bit. You free for a while? Or should we try for tomorrow instead?
@old smelt I'm around for three hours at least so today should work
ok
The ST Hal makes extensive use of the HAL_Delay and HAL_GetTick for timing out operations. Normally, these functions use the SysTick interrupt to increment every millisecond - this remains true for the startup period of the STM32, as SysTick is turned on by HAL_Init and is not explicitly turned off until the common_hal_mcu_delay_us is called, which sets the SysTick->CTRL register to 0 (typically the first instance of this function is in microcontroller __init__.c). After SysTick is turned...
@steep oasis This is the firmware for CircuitPython with the settings I believe should work. However...you might need an updated bootloader also. Try this, if it fails I'll take a look.
@steep oasis One thing to note, the chip you have is 2M-bit, but the one on the itsy is 2M-byte...that's a big part of the issue
@lucid solar bits. Bytes. Whatโs the difference? ๐๐คฆ๐ปโโ๏ธ
@lucid solar I was tasked with cooking. Iโll try after dinner.
ok, good luck
@lucid solar with cooking or updating? Expert in neither.
@slender iron - back online. Have a few minutes?
@old smelt yup, let me grab some water
I just noticed an error in my program caused REPL to appear ```Traceback (most recent call last):
File "code.py", line 646, in <module>
File "code.py", line 413, in broadcastAndReceive
NameError: name 'seqs' is not defined
Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit Circuit Playground Bluefruit with nRF52840
``` but usually Press any key to enter the REPL. Use CTRL-D to reload. pops up before that. Is that expected in this case? This is 5.3.0 on a CPB. Added later: I can't recreate this with simple code perhaps I'd pressed a key after Cntrl-D but I don't think I did.
@lucid solar same behavior. I just copied the file you sent to the ITSYBOOT drive since it was a UF2 file. Rebooted. And nothing after that. Adafruit is probably not using the W25Q16FW since the max voltage is 1.95V. I found the GD25Q16CEIGR on digikey. Iโll get it ordered one of these days and test it out. Iโm willing to try compiling it if you can point me to the right direction.
I have been tinkering with I2C as I start working on the multi-display code for the HT16K33 library. When I dopython import board import busio i2c = board.I2C()My script can not get a lock on the bus. However, if I switch topython i2c = busio.I2C(board.SCL, board.SDA)everything works as expected. Is this a problem for anyone else? Circuitpython v5.3.0 on a Feather M4 Express.
uh this is fun โ extmod/crypto-algorithms/ is imported from http://web.archive.org/web/20180225071418/http://bradconte.com/sha256_c โ which is hosted on github https://github.com/B-Con/crypto-algorithms with a single note that the code is public domain
except that's a bit ... iffy for me to contribute to now ๐
@steep oasis Just so you know, I'm on European time (CET). Shame that didn't work. We can try to compile something that's more simple...like a blink test for example. Let me know when you're next working on it and I'll guide you through things.
Update: I might have a way to contact the author, and see if I can get a proper license attached to those files, and see if they can be synced then
Just a heads up for now -- I'l try to characterize this better.
when I copy/paste code to the REPL on MIMXRT boards I have seen the following
on Teensy 41 - trying to past this
import adafruit_sdcard
import digitalio
import board
import storage
import sys
# Connect to the card and mount the filesystem.
spi = board.SPI()
causes the board to enter the bootloader (red LED starts "breathing" - CIRCUITPY drive disconnects)
on the IMIXRT1010-EVK - a similar large-ish past ...
better example
on both the teensy 41 ans imxrt1010-evk
0123456789
0123456789
0123456789
0123456789
0123456789
``` work OK but adding one line
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
causes it to crash -- teensy4.1 enters bootloader - imixrt1010-evk just hangs
@lucid solar Iโll be around most of the day. Iโm on EST time.
@lucid solar Iโll be around most of the day. Iโm on EST time.
@steep oasis switching to a direct-message so as to not clutter this channel.
I've been experimenting with SPI on the IMIXRT1010-EVK and have found that I can only connect to SPI devices if I use D10 as the CS pin
I have tried D9 and D5 and they both fail - I have not tried every pin ... yet
I tried this with a FRAM_SPI, BMP_388 , SD Card Breakout
All work on D10 but fail on other pins.
Is there a known reason for this?
The board document - shows SDP_CS on D10 but on other boards - any GPIO works,
I have verified that other pins work fine on the Teensy41 and...
Hi ๐ I have a nRF52840 development board that will be available soon, and I was wondering where to get started adding support for CiruitPython as well as the eligibility of the board to get a VID/PID donation.
@odd warren check out the ports/nrf52 directory of the source code
@odd warren and check the closed issues on that repo for examples of vid/pid requests
is there one that comes first in the process? as in should I get the board working with circuit python before requesting for a VID/PID or the other way around?
you need to know vid/pid to write the board definition
ok, thanks!
oh, you may also need a bootloader config, that's in the uf2-samdx1 repo
also in the boards directory
I put in a pull-request to add my board to the adafruit-nrf52-bootloader repo, but that's where I got told to come here first for a vid/pid
ah, sorry, of course, that's nrf52 not samd, my bad
@timber mango can't recreate that issue.
>>> import board
>>> import busio
>>> i2c = board.I2C()
>>> i2c.try_lock()
True
>>>
Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit Feather M4 Express with samd51j19
>>> import board
>>> import busio
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> i2c.try_lock()
True
>>>
but also, you generally shouldn't be calling try_lock directly. instead, use i2c_device with a context manager
I'm requesting a VID/PID for my new nRF52840 development board called the "nice!nano" that will be available soon. https://docs.nicekeyboards.com/#/nice!nano/ It's a general purpose board that many will be using for keyboards.
Thanks!
@nicell will you be submitting a circuitpython board support definition?
Yes! I was taking a look at the other nRF boards, and it looks like I should be able to add a definition quickly.
great :)
nice!nano VID 0x239A PID 0x00B3 # bootloader
PID 0x80B3 # arduino
PID 0x80B4 # circuitpython
@timber mango meaning i2c.try_lock() is never True, you can't scan the bus, etc? I've been running 5.3.0 and 5.4 beta with board.I2C() and haven't noticed any issues scanning or using devices.
@crimson ferry @tidal kiln I can not reproduce it this morning either. I have no idea what was wrong last night.
ah. the classic wait a day solution. i use that one also ๐
it might start happening again though. if it does, post the full stack trace.
@onyx hinge could you help me understand this little snippet you used?
uint8_t subticks;
uint32_t result = (uint32_t)port_get_raw_ticks(&subticks);
return (result * 1000) + (subticks * 1000 / 32);
is it returning milliseconds from boot?
When setting a bitmap palette item to transparent using palette.make_transparent(0), the display is not redrawn.
This test code shows a full-screen bitmap that is first printed as red. Then the bitmap's palette color is updated to white. Then the bitmap's palette color is set to transparent. However, this does not trigger the screen to redraw as transparent, instead the color remains white in this example.
Perhaps this is an issue with the dirty rectangle tracking in displayio.
...
@ionic elk One misunderstanding I had was thinking that HAL ticks were us, not ms. so I was trying to return us from this function, which is not right.
"subticks" are apparently 32us each from what I could see
Yeah I've been poking at it since I posted and I've just swapped over to a direct return of port_get_raw_ticks
working ok so far
er still not sure how long a subtick is, but subticks are a red herring here
Ok I think I've got it
Try merging my latest push to the clock PR
It has overrides for HAL Delay and GetTick
Now overrides HAL_Delay and HAL_GetTick, replacing the HAL Systick with a port.c static variable systick_ms. Systick is used for the RTC and RCC clock setup, and then disabled at the end of port_init, after which @tannewt's system tick takes over. Tested on Feather F405. Resolves #3010.
Also, is this new style checker trying to actually automatically change things and failing, or is it functioning as a warning system that I need to go in and manually correct? It's a little hard to tell.
@onyx hinge sorry, should have pinged directly. My new push should have a fix for your SDIO clock issues.
redirected me to a login page - is that expected ?
I just tried it on an incognito page and it worked fine
@teal bear what browser are you using?
FF... hmm.. let me dig
maybe delete your cookies or something
weird, works now
first time I ctrl-clicked the link here: : https://github.com/CarlFK/cpx#carls-custom-circuitpython-circuitplayground_express
yeah, works everywhere. never mind :p
I sometimes get sent to an unexpected page when visiting learn.adafruit.com, haven't figured out the pattern.
@ionic elk I'll try your latest code with my sdio code today or tomorrow.
@ionic elk if you are asking about the "black" formatter check, in my experience, once you submit, it checks and flags if it finds anything it does not like. it is up to you to run it locally to actually make the changes.
@topaz quest I see he's got rot13 in there https://github.com/B-Con/crypto-algorithms/blob/master/rot-13.c#L6 "Implementation of the ROT-13 encryption algorithm." Must be a hardcore crypto nut.
@onyx hinge a tick is 1/1024 of a second and it has 32 subticks. basically standardizing on a 32.768khz crystal
@tannewt new comment is in, sorry if I've been holding up the beta! I'll start work on a permanent fix as soon as I've checked out Jepler's timer issue.
No worries. I've been distracted by other things.
@slender iron q re type hints in c code doc. I am seeing stuff like:
//| some_property: bool = ...
//| "The docstring for some_property"""
but in the mypy doc, they use @property, e.g.:
//| @property
//| def some_property(self) -> bool:
//| ...
Did you intend in the long run to do the former or the latter?
2nd q: I am seeing def __init__(self, ) with the extraneous comma. Was that deliberate or just the result of some auto-generation.
(All the above is due to me doing a bit of cleanup in _bleio as part of the the bleak work.) Tnx
- either way is fine with me as long as it works
- it's something dylan did. I'm not sure why
tnx, I think the @property is actually the way that's expected. It is a big task to clean all the defns up. I'll open one or more issues eventually.
@trim elm do you have any comment on the above (starting 1:38pm)
the first form is super common in Sphinx documentation, so it should work just as well.
but does mypy and pycharm etc, understand it?
also it doesn't distinguish r/o vs r/w
MyPy should be able to pick up that type annotation.
ok, tnx, I am looking at the mypy doc and don't see any examples like that
it's from pep526: https://www.python.org/dev/peps/pep-0526/#specification
i was looking at PEP484 only
Overall a really good cleanup. Just a couple questions and two boards that fail to build.
Please explain this further. What clock needs to be lower to use external RAM? Why?
Do you want to account for the fact that a tick is 1/1024 of a second to CP? This is done because most LSEs are actually 32.768khz. Does the HAL expect a tick to be 1/1000th of a second?
@tulip sleet Yeah, I was more or less just copying the stubs generated by the previous version of make stubs. If it's something that need fixing (or testing) I'd be willing to do either.
oh, yeah, and on question 2, that was a result of auto-generation. It was discussed at some point during the process that it would be better for me to remove them, but that completely slipped my mind
@tannewt this is @k0d's deal, I don't know much about it. I just edited his values to match style.
@trim elm not a big deal; there has to be a lot of hand cleanup of these annotations anyway, so it can be part of that. e.g. Most of the Anys have to get more specific
Ok. Sounds good. I was asked to help with that but I've been out most of this week since the school-year is ending today. I'll try to put in some work on that in the coming week
i am not the keeper of your task list, so check what else is more important first
devnull@unpythonic.net is from @jepler's weblate instance and probably shouldn't be mapped to me alone.
Looks like a good start. Thank you!
I saw your comment on discord and I don't think it matters too much. Every instance I've seen the HAL use these functions is to do this:
uint32_t tickstart = HAL_GetTick();
while ((HAL_GetTick() - tickstart) <= timout_dur) {
with a timeout_dur of 2 or 4 or something. It doesn't strike me as super precise, and the HAL even allows for the frequency and timeout durations to be tweaked. So I don't think the 2.3% difference is going to cause any differences in behavior.
@lucid solar can you remind me what was up with the external RAM on the F746DISCO so I can summarize it in a comment? Something about the RAM speed capping out at 200MHz? @slender iron asked me for a more informative description in the board profile.
Which I think is reasonable, it'll be a good example of manually overriding the clocks to meet a board spec.
ยฏ\_(โ๏ธฟโ)_/ยฏ
@slender iron awesome bender project - I've been thinking of doing an LED-Matrix version of Expression Engine, I think it'd be fast enough on a F4 or H7
@slender iron are you doing a deep dive today.
@inland tusk yup, plan on it
what time. I am EST
normal time. just under three hours from now
good see you then.
๐
@tannewt CI failure was just a silly typo. I think the HAL timing thing shouldn't be an issue, so pending whether you'd like a better comment for @k0d's board I think this is good to go.
yikes -- another DHT22-like sensor https://learn.adafruit.com/adafruit-aht20 The AHT20 is a nice but inexpensive temperature and humidity sensor from the same folks that brought us the DHT22. let the fun begin
hello
@solar whale I2C though!
@ionic elk My "working" code for sdio had suddenly stopped working. I traced back through my git history, and I believe that it's because I reverted a change (that was not intended to be shared) that made DEBUG=1 build have "-Og" optimization (enable optimizations that do not interfere with debugging)
When I turn off DEBUG, I also get working code. Any advice on debugging it?
usually it's the reverse, code that is bad or has missing "volatile" qualifications gets broken by the debugger
@prime flower so was the am2320 --not a huge improvement over the DHT22 -- hope this one is less quirky
is dht22 the one that's fine unless you're trying to read it from something with unreliable timing like the rpi?
it can be a mess on the Pi
@solar whale ๐คท dunno. I haven't used it yet, might for something soon.
agreed tho
I'll get some as soon as they are available -- really nice to have STEMMA connecters.
I have an hts221 arriving today -- looking forward to trying it
@onyx hinge I'm confused. What do you mean by reverse? Typically for me introducing optimizations can lead to all kinds of bad stuff happening if you combine it with the wrong CFLAGs
I've never had a program have errors because it didn't have optimizations
That's why I'm scratching my head
it fails (I/O error) with DEBUG=1, works with DEBUG=0
But you just said you turned on -Og
confusing things, I had a local change which added -Og when DEBUG=1, and that worked too
have you tried not turning that on?
so basically it's a bug under "no optimization", which is normally introduced by DEBUG=1
but beyond that I don't know what the bug is yet
Have you tried not setting any optimizations at all.
That's what DEBUG=1 does, right?
ifeq ($(DEBUG), 1)
CFLAGS += -ggdb
# You may want to enable these flags to make setting breakpoints easier.
CFLAGS += -fno-inline -fno-ipa-sra
else
CFLAGS += -Os -DNDEBUG
CFLAGS += -ggdb
# TODO: Test with -flto
# CFLAGS += -flto
endif
not if you put -0g in there
I am sorry I mentioned -Og, it's a red herring. Disregard it.
(it just complicated my troubleshooting)
Ok, if you're experiencing errors with no optimization I don't know what that is
Sorry, I don't totally understand the conditions where it is failing vs not
DEBUG=0 -> WORKS
DEBUG=1 -> Fails at runtime with IOError
I just ran two builds, one with DEBUG and one without, and neither failed.
IOError where
this is about code in my sdio branch, and it's a runtime error accessing the SDIO card
Ok. I thought you were running into issues at boot. I'd say it's probably a timing problem. Maybe you had something that got inlined and your program started relying on it for timing, and then you dropped the optimization, it slowed down, and failed.
or something like that
Thanks, I'll look into it further.
I know my explanation was disjointed, it's one of those situations where I just spent what feels like too much time trying to diagnose a thing, and I got frustrated.
having/not having optimization can definitely screw up timing.
also totally cool, same thing happens to me all the time
Yeah it might just be timing
there's a loop that has to keep a FIFO full, maybe it just doesn't when not optimized
it "only" has to place a new item on the FIFO every 320ns or something
It's definitely weirder for it to go backwards like that but I'd check out the HAL implementation and see if there's anything that might be fishy with timeouts
(average)
I "should" convert it to DMA, except that the direct I/O did seem to work
anyway, messing with that stopped me from reviewing your code so far. I will try to get to that tomorrow when I have a fresh mind.
Or, you know, enjoy your weekend lol
I'm doing a Screenless Saturday tomorrow so I won't get to it until Monday probably
Enjoy!
Yay! Finally got an airlift working with the imixrt1010-evk. Running cheerlights
@ionic elk TIL about screenless saturday unless you just made that up
@solar whale fastest cheerlights example out there?
all behind the sceens ...
I made it up. but everyone should do it
I get more ideas on that day than the rest of the week combined.
focuses your whole week its noice
Author: Tannewt devnull@unpythonic.net
I hope this will be the only time it happens, it was an artifact of the early selfhosted weblate server. There's just one commit with this Author.
I'd prefer to have jepler@gmail.com as my "official" e-mail address, and treat the others as aliases. Thanks!
@ionic elk The external SDRAM on the disco board has a max speed of 200mhz, whilst the F7 MCU can go 216mhz. So we have to cap it at 200mhz...and that means using different settings for the clocks, especially the 48mhz USB clock.
@lucid solar why is the ram speed tied to the core speed?
shouldn't it just introduce a wait state?
No idea...but what's wrong with having a different clock speed?
I don't think there is anything wrong with it. I just don't think it should correlate to the ram speed
I'll do some research at some point.
Trying to build CPY for the saola before the stream...so I can actually test things in the stream...now I have an awesome baseboard for my Saola!
This PR fixes a very old typo in the pin definitions of the 1060 that lead to incorrect enums for a subset of pins used for flash memory. This was causing these pins to never be protected from reset, causing the chip to cut off its own flash memory.
Also fixes an issue for the Teensy pin definitions that skipped the protections for a critical pin, as it is grounded in the schematic, but which still needs to retain its pullup and drive settings across resets.
Properly solves #2998 - 10...
@ionic elk nice!
turns out it was a hecka old typo in the pindefs.
like, first PR of mimxrt old
but I'm better at GDB now so that's nice!
Ok now imma do some RGBMatrix stuff and take a break from all this bugfixing
๐ฏ
@tulip sleet For adafruit_ble, is there a way to start_scan for a specific Advertisement sub-class/type and get the associated scan responses back too?
the scan responses should come back automatically for the specified sublcass
Would't that confuse typical code, i.e. listen for MyAdvertisement and then extract myfield but myfield won't be present on a scan response?
So on device A I am sending ```>>> send_ad = JoinGameAdvertisement(game="SRTEST")
ble.start_advertising(send_ad)
and I'm receiving on device B>>> for adv in ble.start_scan(JoinGameAdvertisement, minimum_rssi=-127, timeout=2):
... print(adv)
...
...
...
<JoinGameAdvertisement manufacturer_data=<ManufacturerData company_id=0822 data=0a 30 fe 53 52 54 45 53 54 00 00 > >
<JoinGameAdvertisement manufacturer_data=<ManufacturerData company_id=0822 data=0a 30 fe 53 52 54 45 53 54 00 00 > >
<JoinGameAdvertisement manufacturer_data=<ManufacturerData company_id=0822 data=0a 30 fe 53 52 54 45 53 54 00 00 > >
...etc..
so there's only one type of received Advertisement. Peering inside to see if it has waited for and embedded the subsequent scan response in it somewhere, I see>>> type(adv.complete_name)
<class 'NoneType'>
type(adv.tx_power)
<class 'NoneType'>
type(adv.scan_response)
<class 'bool'>
adv.scan_response
False
@simple pulsar we have the scan response requested automatically on the scanner side. Are you supplying a scan response when you set up the JoinGameAdvertisement?
@tulip sleet No, just allowing the default one to be created with tx_power and complete_name.
If you listen for Advertisement you get everything and it works. But for MyAdvertisement the default scan response doesn't seem that useful if one is listening for MyAdvertisement only.
Is the expectation that the API user creates something like MyAdvertisementScanResponseExtraBits and passes that to start_advertising scan_response kwarg?
i'm looking at the code...
@simple pulsar I believe the filtering code was written on the assumption that the single advertisement would be enough. When Scott wrote the filtering code I don't think he had the model of a general BLE central in mind, necessarily. Also, the hardware he was using (iPhone 7 and later) supported extended advertising, which allows for longer advertisements.
I agree that the filtering could be more sophisticated. Also, the scan response fields could be merged into a single large "Advertisement+ScanResponse" kind of thing. @slender iron Am I misinterpreting the capabilities you had in mind?
@tulip sleet scott is streaming right now, guess he'll reply later ๐
(thanks! @lucid solar )
JP ran into problems with playing multiple MP3 files within the same program. One stumbling point was around the MP3Decoder.file property.
Before this, it was the responsibility of the user to close the old file, which led to inconvenient and non-obvious code such as
old_file = decoder.file
decoder.file = open("example.mp3", "w")
old_file.close()
Compatibility with this idiom is preserved, as it's permitted to close() a file as many times as desired; the second...
@tulip sleet The merge/stick the SR in a single Advertisement might be tricky to implement. If there's no help in the underlying api then you're just getting a stream of Advertisements over a fairly lossy comms channel, i.e. you have to wait and then timeout. And possibly between that other Advertisements will appear from other devices/etc.
@tulip sleet There's no rush on this, I have a plan B as I've already implemented local matching of Advertisements and I only need the scan_responses for one thing. Actually, I could abandon them altogether and just send the name in my ad packet...
if you look at the message sequence charts, it appears to me that the scan response data is going to get appended to the low-level advertising report event that the nRF softdevice returns: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v6.1.1%2Fgroup___b_l_e___g_a_p___s_c_a_n___m_s_c___l_e_g_a_c_y.html
see "Variant #1" at the bottom of that chart
When making a new port....do we still use "MINIMAL"? or ?
so I'm a little confused why you're not seeing the scan response data included.
@lucid solar let's ping @ionic elk about this, because he reorganized it. There's a file somewhere with all the CIRCUITPY_SOMETHINGIO etc, turned off, and you can start with that. I'm not sure MINIMAL is interesting anymore.
I have been using vscode for editing. I have one file that pylint says there is one problem, but I do not know how to find out what it is not happy with. I need some help here please. ๐
what is the problem?
I do not know what the problem is. PyLint just says there is one problem, indicated by the file name in vscode.
pylint is going to print out an error message or warning, so what does it print
paste everything pylint printed
@tulip sleet sorted it, thanks!
Vscode just indicates there is one problem. It is possible it is not a PyLint problem. I just do not know how to find out what the problem is.
does vscode run pylint? Doesn't it show you the details of what pylint complained about?
paste a screenshot if necessary
you can hover over the underlined issue to see the details, or look in the "Problems" panel. https://code.visualstudio.com/docs/python/linting
Most polite error message:
../../py/misc.h:179:1: sorry, unimplemented: Thumb-1 hard-float VFP ABI
thumb-1, huh? does they chip not have thumb-2?
@tulip sleet new chip family...still implementing a lot of stuff...ignore the actual message...just thought it was nice that it said sorry.
i agree it's polite ๐
The HAL-9000 said sorry too.
passive-aggressive
@tulip sleet I got it figured out. I just found the Problem Panel. ๐
I almost hate to admit this, but I am actually starting to like PyLint. I am also using Black, just like Adafruit. ๐
i find it catches a lot of silly errors i make; i don't mind
Same here. Hopefully, running PyLint and Black on my code locally will help me get through CI a lot quicker and save me some commits to fix stuff.
Is there instructions (or a template) anywhere on how to add board support for a new board to CircuitPython, or should I just use other similar boards as reference?
nvm I just found this: https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython/get-setup-to-add-your-board
@odd warren It is a great tutorial! I have been using it. ๐
@lucid solar I started with the fomu port for esp32s2
@tulip sleet I think the filtering adv + sr is tricky because you may only hear the sr
@slender iron I'm past that now...a lot further ๐ Thanks anyway
maybe we should add a flag to not filter SRs
that sounds like a nice solution. It's true we are using the filtering right now in a lot of the librries, and maybe be missing some data in the scan response that we might need, like the complete name. I think it's been an accident that I haven't hit that yet (e.g., the iBBQ thermometer complete name is in the initial advertisement).
When does the #define MICROPY_HW_LED_STATUS LED get activated by circuit python? I have it set to the right pin, but it isn't lighting up.
@tulip sleet @slender iron are there any docs on how/when the garbage collector runs and how to make best use of it? I'm thinking about possible solutions to memory overhead from Register
it runs after import, on gc.collect and when an allocation fails
@slender iron ok, thanks. I'm thinking about having something like a context manager to create and then destroy the register helpers as needed so you don't have to have a bunch sitting around that you only use for init and the occasional rate change or similar
it's a tricky tradeoff because that's then code size
right
๐ค
@slender iron do you know the approximate overhead of a class instance? Like how many LOC is it worth? or does that comparison even make sense?
an allocation is always in 16b blocks
so that's the minimum. I'd encourage you to look at the heap stuff I did if you want to dig in
one thing I changed early on was any buffers created in __init__
code in the register classes is shared amongst instances
where should I look to see more about this? I'm interested in what you meant about buffers created in __init__ because if I'm understanding, that is the incremental cost of a new instance, right?
I've added the board definition for the nice!nano nRF52840 development board. https://docs.nicekeyboards.com/#/nice!nano/
@lucid solar @tulip sleet There are no flags anymore, other than FULL BUILD, which you turn off on certain Atmel chips only. I thought I'd put the list in the porting guide but either it didn't make it in or someone got rid of it? Anyway, right now you explicitly turn off everything you don't support in mpconfigport.mk and then work on it as a sort of todo list.
If I have the following code:python with self.i2c_device: # Byte 0 is 0x00, address of LED data register. The remaining 16 # bytes are the display register data to set. self.i2c_device.write(self._buffer)Is the second i2c_device redundant? Could it be shortened to just write(self._buffer)?
It seems like the way the original code is written that it defeats the whole purpose of the with in it.
no, the with causes __enter__() and __exit__() to be called at the appropriate times. It is not required that a with statement have an as. https://docs.python.org/3/reference/compound_stmts.html#with
self.i2c_device is a device, in this case a display device.
it is an instance of I2CDevice, which has __enter__() and __exit__() methods: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/blob/master/adafruit_bus_device/i2c_device.py#L166
those methods are called when the with block is entered and exited
OK, got that now. However, with the shortened version inside the with, wouldn't the proper methods be called anyway?
Because of the way the with is initialized?
you can say with self.I2c_device as x, and then do x.write(...), etc
but you can't say just write(...)
in general, you would do as <something>, and then use the <something> inside the with
Oh, OK, I see the difference now. Thank you Mr. Wizard. ๐ ๐
need help w basic python
@shy zephyr please ask
I'm using tkinter and I'm having trouble closing the main window after a new window opens
basically there's a button and a textbox. if the password is entered correctly a new window opens, but idk how to close the old window
idk tkinter, maybe post in #general-tech and someone can help
ok i did. thanks
@gilded cradle I am working on the multi-display support for the HT16K33 library now. I am almost done modifying ht16k33.py. I still have to deal with _get_buffer() and _set_buffer(). I also just successfully initialized three alphanumeric displays. Everything works as it does now when there is just a single display. ๐ I do have a power problem I have to deal with, but I expected that with three displays.
Sounds excellent @timber mango
Thank you. It is taking quite a bit of work to make everything work transparently, regardless of how many displays there, but I believe it is worth it to not break any existing code. ๐
I'm actually going to go ahead and merge this. No reason to leave it open, as I won't get to removing Python2 support for while.
I'm experimenting with capacitative sensing at the moment, and the only interface I seem to have is the touchio module. It's entirely boolean - either it senses something or it doesn't. Is there anything that will give me a more graduated reading, or is the boolean reading built into the hardware?
Quick'n'dirty code: ```python
import time
import board
import touchio
import neopixel
touch_pad = board.A1
touch = touchio.TouchIn(touch_pad)
pixels = neopixel.NeoPixel(board.D8, 10)
state = False
while True:
if touch.value and state == False:
state = True
for p in range(10):
pixels[p] = (64,64,64)
elif not touch.value and state == True:
state = False
for p in range(10):
pixels[p] = (0,0,0)
time.sleep(0.05)
And the makeshift hardware:
Hi, I am testing Bluefruit feather sense I received couple days ago using this demo code: https://learn.adafruit.com/adafruit-feather-sense/circuitpython-sense-demo
I am watching response in serial. Everything seems to be working, except gyro and acceleration. I get 0 values no mather how much I move it.
Feather Sense Sensor Demo
---------------------------------------------
Proximity: 0
Red: 310, Green: 291, Blue: 307, Clear: 856
Temperature: 26.8 C
Barometric pressure: 973.315
Altitude: 337.8 m
Magnetic: -1.184 -35.165 26.235 uTesla
Acceleration: 0.00 0.00 0.00 m/s^2
Gyro: 0.00 0.00 0.00 dps
Humidity: 53.3 %
Sound level: 8
Is it possible the sensor is faulty or are there some settings I am missing?
ok, got it working fine with some example code
๐
And I think this should be added to demo code
default lsm6ds33 accelerometer_data_rate and gyro_data_rate is at 0Hz. If I set it to 1066Hz, it works like a charm, otherwise it is just zeros.
@somber garden You do not have to compare boolean variables to True or False. You can just use if state or if not state in your if statements. ๐
@stable aspen I know, but I often put those in for clarity.
I ran the code through black and pylint later on and took them out anyway :)
These are just now becoming available, the ESP32-s2 w/ LCD Kaluga Dev Kit - Amazon has a handful. Along with the esp32-s2 boards which are tarrif free making them cheaper than digikey. https://www.amazon.com/gp/product/B087T7L3BP/ref=ox_sc_act_title_2?smid=A33XZ36WFNH796&psc=1
The issue actually looks to be in https://github.com/adafruit/circuitpython/blob/master/ports/esp32s2/supervisor/port.c#L118 . The code ends up dividing tv_usec by 32768 to get all_subticks, and then divides that by 32 before adding it in the return statement. That is equivalent to dividing by 1048576. Since tv_usec seems to run from 1 to 1,000,000; the result is that nothing gets added to tv_sec and the return from port_get_raw_ricks(NULL) is always going to be just seconds.
So, in a Python...
from adafruit_ble.services.standard.hid import HIDService
from adafruit_hid.gamepad import Gamepad
hid = HIDService()
gp = Gamepad(hid.devices)
This returns an error:
Traceback (most recent call last):
File "code.py", line 5, in
File "adafruit_hid/gamepad.py", line 55, in __init__
File "adafruit_hid/__init__.py", line 56, in find_device
ValueError: Could not find matching HID device.
While using keyboard/mouse works fine. Is gamepad not supported as a ...
Anyone super familiar with the ESP32SPI library? I'm designing something similar and have some questions about how y'all handled SPI.
Hello I have a adafruit feather bluefruit sense. How do I convert it from circuit python to arduino?
@ivory yew as far as I've grokked, it was dictated by the NINA implementation, I think ladyada wrote most of the early foundation for the ESP32SPI library
Yeah
The biggest question is why the ready pin was needed
I'm also running into issues with using the SAMD21 as a SPI peripheral with higher frequency clocks from the main chip. :/
@orchid shell no conversion necessary. Just upload your Arduino sketch. It will replace CIrcuitPython.
@solar whale but I get an error that says cannot compile for adafruit bluefruit sense
Then your Arduino environment is not properly configured. Did you install the necessary BSP for the nrf52840 boards?
@ivory yew the ready/busy pin requirement comes from the NINA side, you'd have to probably ask the author of that code, https://github.com/arduino/nina-fw/graphs/contributors
I am battling with the can not get a lock on the I2C bus problem again. ๐ฆ I have a small script that demonstrates the problem. It first scans the I2C bus and then tries to initialize a display at each address.
you can see the ready pin logic here and blame says it came with the first commit https://github.com/arduino/nina-fw/blob/2aed17fc1e084277fbeec5cb5e4a4baa3a586300/arduino/libraries/SPIS/src/SPIS.cpp#L75
@orchid shell check this guide https://learn.adafruit.com/adafruit-feather-sense/arduino-support-setup?preview_token=dyY85Mu2YU6ZtwW6DgpjSA
I always assumed the Ready pin was to keep from having to poll the esp32 for indeterminate-length operations
This I2C problem seems to be a sporadic thing and I do not know what triggers it. Is it possible this is a bug that will be very difficult to fix?
@solar whale Yeah I followed that guide
Never make assumptions, especially with respect to electronics and software. ๐
@orchid shell try the standard blink example. What code is failing to build?
@timber mango gotta start somewhere ๐
I am starting somewhere. ๐ I am thinking about opening an issue on this.
@solar whale just some code to control a neopixel strip over Bluetooth
Does blink compile?
I have gone through all the troubleshooting steps to remove my Feather M4 as a cause of this, including erasing it and reinstalling Circuitpython.
One step at a time ๐
@solar whale It does not
Something basic is missing. What error is it giving? I suggest going back through the guide to make sure something was not missed
Arduino: 1.8.12 (Windows 10), Board: "Adafruit Feather Bluefruit Sense, 0.3.2 SoftDevice s140 6.1.1, Level 2 (Full Debug)"
exec: "C:\Users\Aidan\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\0.20.1/tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe": file does not exist
Error compiling for board Adafruit Feather Bluefruit Sense.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
@solar whale
\Arduino15\packages\adafruit\hardware\nrf52\0.20.1/tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe": file does not exist
nrfutil is not installed
@solar whale How do I install it?
@solar whale I am using Windows 10
I am going to try to reinstall the nrf85240 boards
Sorry, I donโt know. I suggest posting in #help-with-arduino - hopefully someone else can help.
I have been running into a problem off and on where a script can not get a lock on the I2C bus. This is one of those soft failures that only shows up once in a while. :( I have a small script that demonstrates this problem when it occurs. I can scan the I2C bus successfully and show what devices are there, but I can not instantiate a display. I believe this might be a bug in the underlying C code.
[i2cscan_displays.zip](https://github.com/adafruit/circuitpython/files/4743228/i2cscan_displa...
Ok @solar whale thanks for trying ๐
Good luck!
Am I correct in the assumption that pin.P0_## means a pin is being treated as โinternalโ?
I just noticed that two of the pins on my nRF52840 dongle, 20 and 21, arenโt showing up in the board module, despite them being listed on the pin out. In microcontroller it shows up like this. P0_18 -- microcontroller.pin.P18
P0_19 -- microcontroller.pin.P19
P0_20 -- microcontroller.pin.P0_20
P0_21 -- microcontroller.pin.P0_21
P0_22 -- microcontroller.pin.P22
P0_23 -- microcontroller.pin.P23
P0_24 -- microcontroller.pin.P24
I just loaded 5.4.0-beta.0 on my Feather M4 with the same results on I2C. Can scan, but not initialize a display.
Assumptions are dangerous things... ๐
@pseudo gale That does look suspicious.
@pseudo gale microcontroller.pin shows all of the pins, but if they aren't in board then they're typically either not exposed, or may go by another name, e.g., SDA, RX, etc. Could be an oversight in the board config.
Nordic, or MakerDiary?
Seems to be left out of the MakerDiary dongle pins https://github.com/adafruit/circuitpython/blob/master/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/pins.c
but 19 and 20 seem to be RX and TX https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/master/config/nrf52840_mdk_usb_dongle.h... are those in board? I don't see what happened to 21.
@crimson ferry MakerDiary
Board does have 19 and 20, though only listed as pins.
AIN0 -- microcontroller.pin.AIN0
AIN1 -- microcontroller.pin.AIN1
AIN2 -- microcontroller.pin.AIN2
AIN3 -- microcontroller.pin.AIN3
AREF -- microcontroller.pin.AIN2
VDIV -- microcontroller.pin.AIN3
P2 -- microcontroller.pin.AIN0
P3 -- microcontroller.pin.AIN1
P4 -- microcontroller.pin.AIN2
P5 -- microcontroller.pin.AIN3
P6 -- microcontroller.pin.P6
P7 -- microcontroller.pin.P7
P8 -- microcontroller.pin.P8
P9 -- microcontroller.pin.P9
P10 -- microcontroller.pin.P10
P18 -- microcontroller.pin.P18
P19 -- microcontroller.pin.P19
P22 -- microcontroller.pin.P22
P23 -- microcontroller.pin.P23
P24 -- microcontroller.pin.P24
LED_RED -- microcontroller.pin.P23
LED_GREEN -- microcontroller.pin.P22
LED_BLUE -- microcontroller.pin.P24
BUTTON -- microcontroller.pin.P18
@pseudo gale What do you get in the REPL when you do:?```>>> import board
dir(board)```
['class', 'AIN0', 'AIN1', 'AIN2', 'AIN3', 'AREF', 'BUTTON', 'LED_BLUE', 'LED_GREEN', 'LED_RED', 'P10', 'P18', 'P19', 'P2', 'P22', 'P23', 'P24', 'P3', 'P4', 'P5', 'P6', 'P7', 'P8', 'P9', 'VDIV']
21 seems to be an oversight, but then it isn't in MakerDiary's file either
so they're all in microcontroller.pins, but 20 and 21 are not in board ...maybe I'm missing something, but perhaps an issue is in order on the repo
at least for now you can do DigitalInOut(microcontroller.pin.P0_21) (or however it shows up)
@DavePutz Would you mind opening a PR for this? I think you are on the right track. The raw tick count should be in 1/1024ths of a second. A subtick is 1/32nd of that. (Most boards use a 32.768khz clock for timing 1 second.)
What happens if you try and use the file afterwards? Seems like there is a weird ownership issue here.
@crimson ferry alright, thx
in your example , you are locking the I2C bus -- I think you have to unlock before using it
try adding i2c.unlock() before you initialize the disply
#!/usr/bin/env python3
import board
import busio
from time import sleep
from adafruit_ht16k33.segments import Seg14x4
i2c = busio.I2C(board.SCL, board.SDA)
displays = []
print()
print("Simple I2C bus scanner")
print()
while not i2c.try_lock():
sleep(0.5)
scan = i2c.scan()
if scan:
print("Found:")
for addr ...
Before this change, if you keep old_file around, it was an open file that you could perform operations on. After it, if you keep old_file around, it is a closed file and most operations raise an exception.
My assumption was that it was important to reach the file's close() / __exit__ or some resource would be leaked (like file descriptor numbers on linux would be, in the absence of reference counting in cpython3). However, this may not be true. The identity of the opened file cy...
Well, this does seem to work! I moved the unlock to the beginning of the if block and it still does work, although I still see an occasional lock up. I have never had to do this before but will start doing it now. I will close this issue for now and reopen it if necessary.
Thank you!
Interesting. Maybe this is the reason for #2977? It's an unusual issue because we don't support hardware CS - whatever you select for CS should be getting bitbanged by DigitalIO. I'll look into it further.
The calculations being done in port_get_raw_ticks basically insured that only seconds were being returned. Since the tv_usec ranges from 1 to 1000000, and ticks are 1/1024 of a second, the correct calculation would be to divide usec by 1024, not 32768 and then 32. A quick script to show the issue and fix:
import time
print (time.monotonic_ns())
for a in range(10):
time.sleep(0.9)
print (time.monotonic_ns())
for a in range(10):
time.sleep(1.1)
print (time.monotonic_ns())
...
@prime flower Is there a reason all of the examples here do not have the lib name in them? Which is to say, is there any reason they can't have azureiot_ added to the beginning, e.g. would it be misleading etc? https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/tree/master/examples
@idle owl They should be able to have the library name prefix added in a way it makes sense for each of the platforms it supports: (azureiot_central_example and azureiot_hub_example seem like good example names to me). @cyan breach may know more as he recently redid that library/examples.
Alright, I'll file an issue on the lib and engage with Jim there.
Thanks for noticing it @idle owl
Could I get a voice check please?
@timber mango I can jump in the voice channel for a moment to help with a sound check.
The beginning was cut off but I did hear the end of "hello" I think
@slender iron ckd . tech & saola adapter url are 404?
the ckd.tech urls from the board? I know. They are basically version numbers ๐
@raven canopy these are from the adabot repo right? https://adafruit-circuit-python.s3.amazonaws.com/adabot/bin/reports/circuitpython_library_report_20200608.txt
I should swap it away from my token. looks like it's logged in as me
Hi! If you're going to be in the Discord meeting but not talking, please let us know here that you'll be "lurking". If you have notes you'd like us to read, please put them in the document. The meeting will be getting started soon
Happily lurking today, updated the Google Doc to reflect as such ๐
If you update the doc with your lurking status, so much better!
Lurking
lurking today, thanks!
Also lurking
Canโt attend today. One hug report added.
Sorry, forgot the meeting... did not update the Doc. Hug report to all.
How do I turn off the gallery in Android?
@timber mango on my android phone seems like the back button exits the gallery without exiting audio
Article
OK, got it. ๐ Is there a way to make just the speaker show on video when they are talking?
Interview.
The plan is to recap ESP32-S2 work Scott did this week (just a little), talk US voter info and https://electioncal.us .
Visit the Adafruit shop online - http://www.adafruit.com
LIVE CHAT IS HERE! http://adafru.it/discord
Adafruit on...
Made a DIY "Nanoleaf" scuplture. Triangle PCBs use side-emitting LEDs which diffuse into a translucent acrylic layer. It's free standing and modular. Assembled by screwing smaller PCB connectors to the back of adjoining boards. https://t.co/NfLvCRWsV8
315
lurking
Lurking text only. Left a couple of notes in the Doc.
That's a nifty project ๐
Adafruit Industries, Unique & fun DIY electronics and kits : - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPixe...
I have seen pre-COVID shipping times.
๐ ๐ ๐
There is something I never understood about the Blinka description: "Add CircuitPython hardware API and libraries to MicroPython & CPython devices". (1) CPython device (like a Trinked) does not need Blinka. (2) Raspberry Pi and other SBC do need Blinka. (3) Can I really add a bit of Blinka to a MicroPython to make it CP compatible and use CP library?
It's because I kept adding more hug reports when I remembered how everyone was helping me and doing good this week
@thorny jay it was originally written to run on MicroPython boards, but I've personally never tried it on there.
@gilded cradle Since you are the expert, maybe you can adapt the description? ๐
Looks really cool to me!
Looks really cool to me!
@lone axle Thanks!
I always forget what the acronym is: digital audio workstation (DAW)
@ionic elk I would like to subscribe to your hot sauce
@ionic elk Yes! Bundle it!
I send you all virtual hot sauce energy ๐ฅ ๐ถ๏ธ ๐ฅ
scoville++;
recipe is actually super easy: as many peppers as you can fit in your jar, carrots/onion/garlic if you want, 5tsp salt for every 2 cups water, a little sourcrout or kimji liquid as a starter, blend, cover, and leave it for a year
Just incrementing by one?
then strain it and add white wine vinegar
Cat Cage is amazing! that is a really cool idea.
I like the cat cage idea as well.
the cats love it!
awww if our cats were still with us I'd feel bad that I wasn't going to drop everything and make one for them
Not if it succeeded
๐คท
๐
Great to see you again @ruby atlas
In progress: parser/renderer for Markdown in CP, now with code blocks.
@lapis hemlock Your "fork" of micropython should be able to function as a fork of circuitpython, it just takes a little more care when creating pull requests. "My" fork is a circuitpython fork but I've successfully created PRs against micropython. However, I know we ran into trouble when we tried together to have you create a pull request to upate ulab in circuitpython, and we decided to just postpone figuring it out
Oh, the Wizard:)
If you're still stuck ask on the chat and we'll get through it together
I don't want to dwell on your time, so I will try to figure it out, and if I become really desperate, I will reach out to you.
But thanks for the offer!
That would actually be interesting.
I mean ulab with framebuffers.
@lapis hemlock I recommend creating a new "git clone" of adafruit circuitpython, so that is the "origin" repository; then add your own fork as a remote. That's a part of how I switch between authoring circuitpython and micropython PRs
But you'll need tensors of rank 3, won't you?
for RGB images, seems like you do need (x,y,3) shapes
Right.
@lapis hemlock Are the pins on those carrier boards 0.1" spaced or smaller?
1 mm.
The board measures 19x25 mm, plus USB connector.
But you can break off the USB connector, if you don't specifically need it.
๐
๐
๐
๐ฏ
(I didn't know you could re-assign a PR's branch)
๐
They're just branches @onyx hinge
.github/workflows/pre-commit.yml: branches: [master]
I'm a little concerned about the affect on beginners
since all tutorials on git refer to master
and we can't control guides outside of Adafruit
Is there a plan to change the terminology in I2C?
main/secondary have the same first letters. I have seen that suggested for SPI
Yeah, as @solar whale says, hardware is going to take a while (SCSI has the same problem)
somebody's got to do it first, or 99'th, or 999'th
for RGB images, seems like you do need (x,y,3) shapes
@onyx hinge OK, so it is time to step up my efforts on the higher-dimensional branch.
the master branch could be empty with a RENAMED.md
some lobbying of GitHub may be in order in the long run too
a lot of board silkscreens too
is there something that still implies the correct control relationship?
@slender iron @onyx hinge If you change anything in I2C, then I would also like to move spectrogram from the extras sub-module of ulab๐
master/subsidiary?
moose / squirrel
I don't feel like master has the intense connotations that slave has
master is used for a lot of stuff, it's not just an ownership term
Thanks for bringing it up!
@lapis hemlock That is tight pitch! I would need a long carrier board with 0.1" spaced holes in order to use that so I could use it on a breadboard. I will just stick to the Feathers then.
๐
@lapis hemlock That is tight pitch! I would need a long carrier board with 0.1" spaced holes in order to use that so I could use it on a breadboard. I will just stick to the Feathers then.
@timber mango The feather does not expose all pins.
I know. That is why I asked about your new boards.
Thanks everyone!
If you need all 60 pins, than it is going to be something like 60mm x 40 mm, which is huge.
@lapis hemlock Well, I can dream. ๐
That's actually not smaller than the raspberry pi zero...
Do you think that a 1-mm pitch is too small?
I just do not like to be limited even if I may never use all the pins. Do you expose any MCU resources that Adafruit does not expose?
For me, 1mm is too small. I am old and have old eyes.
I just do not like to be limited even if I may never use all the pins. Do you expose any MCU resources that Adafruit does not expose?
@timber mango I wanted to make it "compatible" with the feather, so the same bootloader can be used. But what kind of MCU resources do you have in mind?
More DAC and ADC, more I2C and SPI buses, I2S, and anything new that has not been exposed before.
Scott told me last week that the circuitpython firmware does not hide hardware resources, even if the hardware itself does not expose them.
But I still have to assemble the board, and flash it with firmware to see where I stand.
More DAC and ADC, more I2C and SPI buses, I2S, and anything new that has not been exposed before.
@timber mango I think the nrf52840 has no DACs, but I might be wrong.
@slender iron found manager/subordinate online just now
Or mad/sane...
or supervisor/minion if you want to cause a ruckus
I am looking for something that has support for quadrature encoders, preferably at least two and four would be better.
lots of interesting examples of projects changing terms. looks like most choose more specific terms
It's a clearer term with less history.
Nope, no DAC on the nRF52840 as far as I can tell now.
https://github.com/desktop/desktop/issues/6478 did something equivalent, and mentions a few things to make sure to change. Also, there are mentions of that issue by a bunch of other folks, so check out the linked issues at the end, for further things to check for.
Nope, no DAC on the nRF52840 as far as I can tell now.
@timber mango If you need DAC, you would have to add that yourself. I didn't actually want to make a board that has everything, like a bigger version of the feather, because you can't have eveything, you always have to be selective, and I don't know what people would need. On the other hand, having a piece of hardware that you can easily embed into your hardware is useful, because you have then something that you can customise.
We could also rename all of our repos programmatically.
@onyx hinge sorry I just noticed your comment on the pull request โ did you find how to update .mailmap or should I send you a pull request for it?
@topaz quest if it's been committed already I can make a PR to update it, that's fine
hm I thought it was but maybe it wasn't, then I'll just fix it here!
@slender iron I think Manager/Subordinate actually describes the relationship between devices more accurately than before (implies a back-and-forth of information), and it matches the existing acronyms.
Should I attribute it to Scott or to Hosted Weblate?
Looks like a good start. Thank you!
@lapis hemlock True on all accounts! External DACs can be had at much higher resolutions than are found in MCUs, at a price of course. I notice that two I2C buses are available, one master and one slave. Are both exposed? QSPI exposed?
@lapis hemlock True on all accounts! External DACs can be had at much higher resolutions than are found in MCUs, at a price of course. I notice that two I2C buses are available, one master and one slave. Are both exposed? QSPI exposed?
@timber mango As I said, all pins are exposed, but without any specific role. You can actually use the SPI pins as GPIO pins on the nrf52840. But this is just a bare board with a single voltage regulator, and two resistors for the USB port, nothing more. You decide what you want to do with the pins.
All this board does is bring out the pins of the nrf52840 in a human-usable form factor (I know, we might disagree on this).
Here is the notes document for Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the meeting - itโs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1CZOWdmPGYcvt9WVl_NBxi-M3RXRtTklC13YtziBAu_Y/edit?usp=sharing
I'm worried it's not clear that the file is closed when set. It also seems counter-intuitive to close a file that is still in use.
I think the best thing is to omit this. Do you agree?
Thanks for the PR! I don't think it's right as-is.
I don't think this is correct because all_subticks should range from 0 to 32767 which would be achieved by dividing 1000000 by 30.517. We can approximate this with the change below. Line 125 should be preserved.
uint64_t all_subticks = (uint64_t)(tv_now.tv_usec * 2) / 71;
Me is fine. I made the change through the server.
One naming suggestion that you should follow up with a PR for. Going to merge now so it's in Beta 1.
I believe we use VOLTAGE_MONITOR in most board modules.
I have run up on and interesting situation with my multi-display code. I have three alphanumeric displays addressed at 0x70, 0x71, and 0x72. I hold the displays for these addresses in a list. When I cycle through the list, everything always goes to display 1 (0x70) and never to the others. I have attached a short script that demonstrates this issue.
Is it not possible to hold these in a list and use them as display[0].show(), display[1].show(), and display[2].show?
@onyx hinge couple quick questions about your RGBMatrix tutorial: https://learn.adafruit.com/rgb-led-matrices-matrix-panels-with-circuitpython/example-simple-two-line-text-scroller
- is there an official way to lower the speed of the scrolling? It seems that inserting a time.sleep delay over 15ms borks it.
- would it be possible to edit the fritzing diagram for the STM32 to match the proto shield diagrams? All the pins are named different things (R0 = R1, R1 = R2) and it's a bit confusing
JP verified that his code is working without the manual close so I guess it's okay.
@ionic elk I have never gotten the hang of displayio refresh rate stuff. And yes my fritzing diagrams are not great. Matching other sources was apparently not my priority
it's all good
that's good because I've got some more ๐ I can't really get static text to display, any ideas?
^attempt at "hello"
actually, it might just be that I have kinda crappy connections, nevermind.
though the stretched text might still be something worth asking about I dunno.
On the older version docs pages such as this one: https://circuitpython.readthedocs.io/en/4.x/shared-bindings/displayio/Group.html
There is a warning at the top and center but I find it somewhat easy to overlook when I arrive on a docs page from a google search or other link.
The two ideas for improvement I had were to make the warning a bolder color and/or make it scroll with the page so it's always visible.
I use the Django docs somewhat frequently as well and tend to overlook the warning less. Here is an example of their out of date pages: https://docs.djangoproject.com/en/2.1/
The warning is a top bar and it stays with the user as they scroll.
I added a variable _address and an address() property function to expose it to the adafruit_ht16k33.segments.Seg14x4 class so I could find out what address is really being stored with each display. Everything is correct, so I do not understand why only the first display is being written to regardless of which one is selected. Something is definitely off, but I have not figured out what that is yet.
Automated website update for release 5.4.0-beta.1 by Blinka.
New boards:
- fluff_m0
- aloriumtech_evo_m51
- pycubed_mram
- espressif_saola_1_wrover
- espressif_saola_1_wroom
- hiibot_bluefi
- nice_nano
New languages:
- cs
- nl
Is there a hacky way of doing this, e.g.
while True:
if dac.atend() or dac.nearend(): ### can this be done somehow with current implementation?
dac.stop()
break
With tv_usec having a value between 1 and 1 million, multiplying it by 2 and dividing by 71 give us values from 1 to 28168. Since a tick is 1/1024th of a second, that could add to the return value by up to 27 seconds. It seems correct to me to multiply seconds by 1024, and add subticks of 1000000 divided by 1024, which is what the original fix did. That would give us subticks of 1 to 1000, which when added to seconds*1024 would be the right number of ticks.
Testing of the proposed fix show...
How are you measuring the sleep duration? I think there is more going on with FreeRTOS that makes it harder to measure.
The all_subticks should be divided by 32 before being added to seconds * 1024 because one tick is 32 subticks. (Most boards have 32.768khz crystals which is 1024 * 32)
Looks good other than a duplicate as noted in the specifics.
@lapis hemlock That is tight pitch! I would need a long carrier board with 0.1" spaced holes in order to use that so I could use it on a breadboard. I will just stick to the Feathers then.
@midnight wedge Actually, if you need all pins with a 0.1" pitch, you should take a look at the BLYST840 breakout board: https://www.crowdsupply.com/i-syst/blyst840/updates/launch-announcement That has exactly that, for the extra space.
@indigo wedge I made uf2-esp32s a seperated repo since it is kind of difference, it is actually an application serves as 3rd stage bootloader. It is still in the making, and I don't want to deal with idf build system. The project also includes a modified 2nd bootloader along with parition table for esp32s2 as well. It is kind of complicated https://github.com/hathach/uf2-esp32s I have just finish the readme for sum up there.
Once I figured out and put everything together, we will see if we could integrate it into tinyuf2. Though I am not sure if that could work that way.
@idle owl About the LED Animation, I tested a few days ago with a ring of 24 APA (now you added even more stuff). And I noticed that some animation could look better if the library knew it is circular. In particular, Meteor did seems odd (I had disabled the bouncing mode). One meteor start, goes to the end (that is next to the begining) and then disapear, then another one start. Do you think it does make sense to wish for the meteor to do a continuous loop? I don't know if that is difficult or only apply to Meteor. Just it did seems odd at the time I tested.
@ionic elk just saw your notes & video from yesterday. I can't tell from what I can see for sure, so just want to make sure you have a good power supply. Don't try to run the panels just from USB. I use a 5V 2A power supply on my 64x32 panel and that seems to be marginal.
@onyx hinge I've got what I think is a decent 5V 4A power supply but my connections are not the most amazing, so I asked for one of the Featherwings. That said I don't think the stretched font issue is related to the connections, because Conways game of Life seems to work just fine without any "stretching"
That's odd
I could be wrong though, it isn't super easy to tell.
I used the script above to measure sleep time, running 10 sleep()s in a loop and displaying the times before and after. I realized that when I tested the suggested correction I did not restore the division by 32 in the return statement. Doing that now yields correct results, and I have updated the pull request accordingly.
maybe a year ago I got a python command to rebuild the fs on the cpx - what is it?
I updated from 3.x to 5.x and now dmesg: FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 1606)
@teal bear to erase the file system import storage storage.erase_filesystem() MAKE SURE YOU HAVE BACKUPS
it will erase everything
yeah, thats it. thanks.
but... I can't get a prompt. tio /dev/ttyACM0 - says "connected" but no >>> and typing doesn't echo
that was my next question ๐
yay, cpx rebuilt setup everything with 5.x - thanks for the helps
Dear all, are there any news regarding the support for the SD Card on the STM32F405 feather with CP?
To save power, a GPIO bank that is not currently running any pins should have its RCC clock turned off. The most logical place to implement this is probably the claim-pin section of microcontroller/Pin.c.
This concept could potentially be expanded to encompass entire collections of peripherals on chips like the H7, which has multiple power domains.
@gusty topaz this is probably the best place for up-to-date news and status https://github.com/adafruit/circuitpython/pull/2863
@thorny jay I don't think it would be hard to implement, if I understand what you're suggesting anyway. Please consider filing an issue on the GitHub repo for the library if you'd like a new feature or concept to be added.
@prime flower https://forums.adafruit.com/viewtopic.php?f=60&t=166139
@slender iron responding..
thanks!
Here is a blog with tips from @shanselman : https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx
@slender iron how did you figure out the endianness of the ARM_MPU_RASR MPU functions? They don't seem to have usable documentation anywhere
@slender iron It's electioncal.us, correct?
@idle owl yup! "cal as in calendar"
@ionic elk no idea
I don't know why you think I figured it out
Right. Wanted to mention it in the newsletter, but wanted to make sure I remembered it right.
thanks!
@slender iron What's a good once sentence description of it.... a website to provide election dates and information to folks around the US?