#circuitpython-dev
1 messages · Page 43 of 1
oh not sure if the guide mentions it but you have to make BOARD=... clean after changing .mk files, the changes are not automatically detected (or may be partially applied)
Oh, that makes sense. I'll remember that!
Ok, question:
A handful of the settings were removed in this commit. This includes the CIRCUITPY_ROTARYIO = 1. I've added it back and set it to 0, but that makes me think there are some kind of defaults not included in the file that might make it hard for me to know what I can remove. I don't know if you might know anything about this, but it's a point of confusion/concern for me.
I tend to add V=2 to the make command because all of the CIRCUITPY_ directives end up on the command line
that way you can see what they are all set to
Oh cool! That definitely helps. Thanks!
I'm trying to compile one of my own boards with some frozen py files, and I'm getting:
MKMANIFEST ../../frozen/circuitpython-stage/pewpew_pi
(cd build-ugame22/frozen_mpy && find * -name \*.py -exec printf 'freeze_as_mpy("frozen_mpy", "%s")\n' {} \; )> build-ugame22/manifest.py.tmp && mv -f build-ugame22/manifest.py.tmp build-ugame22/manifest.py
MPY pew.py
MPY stage.py
MPY ugame.py
GEN build-ugame22/frozen_content.c
build-ugame22/stage2.c:128:16: error: 'read_flash_sreg' defined but not used [-Werror=unused-function]
128 | static uint8_t read_flash_sreg(uint8_t status_command) {
|
anybody has any idea what changed?
I never defined or used such a function in my code
stage2.c is a file generated during the build for rp2040 boards. If something went wrong when generating stage2 (what? not sure) maybe that error could result. does it happen after a make clean?
that is after make clean
what flash chip?
W25Q16JVxM
I bet there's a bug in stage2.c.jinja. the function read_flash_sreg shouldn't be generated if not quad_ok
it is a qspi chip
OK, just guessing here
I use git submodule update --recursive but I'm not sure if that's the official advice
can you post the full content of the generated stage2.c in the build directory?
ah, fetch-port-submodules
make: *** No rule to make target 'fetch-port-submodules'. Stop.
hmmm
OK I do get that problem if I change the flash chip to W25Q16JVxM
serves me right for not submitting that board definition
I thought this has something to do with my library called stage
I think the template is concluding that there is no register to set to enable quad spi access, so it never uses that register read function, which causes the fatal error
so it would make sense to fix that, by NOT defining the functions if they are not used. but from what you said, it's not correct that this chip should be treated as not quad SPI
so there may be a bug in nvm.toml or cascadetoml?
but the mini_sam_m4 and datalore_ip_m4 boards also use the same chip?
this stage2.c.jinja thing is only for rp2040
it prepares the 256 bytes at the start of the flash chip that function as the 2nd stage bootloader. it configures the flash chip and XIP before starting the main application (circuitpython)
The W25Q16JV supports Quad SPI operation when using instructions such as “Fast Read Quad Output
(6Bh)”, and “Fast Read Quad I/O (EBh). These instructions allow data to be transferred to or from the device
four to six times the rate of ordinary Serial Flash. When using Quad SPI instructions, the DI and DO pins
become bidirectional IO0 and IO1, with the additional I/O pins: IO2, IO3.
This doesn't reset the current directory until code.py is run, after. The current directory should probably be reset for boot.py, safemode.py, and code.py. So I think it should be reset in start_mp(). Or should it not be reset between boot.py and code.py? That's something to ponder, about whether to make boot.py be able to change the current directory in a sticky way.
Also, if the filesystem is not working, I think chdir() may throw an error. Maybe better to check with ...
diff --git a/ports/raspberrypi/stage2.c.jinja b/ports/raspberrypi/stage2.c.jinja
index 4c001525dc..ee6f3bac21 100644
--- a/ports/raspberrypi/stage2.c.jinja
+++ b/ports/raspberrypi/stage2.c.jinja
@@ -36,7 +36,10 @@
#define SREG_DATA 0x02
+// If !quad_ok, these functions are not used.
+__attribute__((unused))
static uint32_t wait_and_read(uint8_t);
+__attribute__((unused))
static uint8_t read_flash_sreg(uint8_t status_command);
// This function is use by the bootloader to enable the XIP flash. It is also
```Adding these tells the compiler it's OK if the functions are not used and lets compilation continue
nothing about any registers, though
@slender iron ^^^ do you have some wisdom about this? I know you had all this info in your head at one time
I'm worried that they should be used, but the chip definition lacks the register number or something like that
quad_enable_bit_mask = all_match(flashes["nvm"], "quad_enable_bit_mask")
```there has to be a `quad_enable_status_byte` and `_bit_mask`.
The Quad Enable (QE) bit is a non-volatile read/write bit in the status register (S9) that allows Quad SPI
operation. When the QE bit is set to a 0 state (factory default for part numbers with ordering options “IM”),
the /WP pin and /HOLD are enabled. When the QE bit is set to a 1(factory default for Quad Enabled part
numbers with ordering option “IQ”), the Quad IO2 and IO3 pins are enabled, and /WP and /HOLD functions
are disabled.
but I'm not sure what is the register number?
2?
quad_enable_bit_mask = 0x02
```nvm.toml indeed lacks the register number.
but it's there:
# Settings for the Winbond W25Q128JV-PM 16MiB SPI flash. Note that JV-IM has a different .memory_type (0x70)
# Datasheet: https://www.winbond.com/resource-files/w25q128jv%20revf%2003272018%20plus.pdf
total_size = 0x1000000 # 16 MiB
start_up_time_us = 5000
memory_type = 0x70
capacity = 0x18
max_clock_speed_mhz = 133
quad_enable_status_byte = 2
quad_enable_bit_mask = 0x02
write_status_register_split = true
01_continuous_status_write = true
6b_quad_read = true
32_qspi_write = true
ah, that's the 128. sorry
ok, adding quad_enable_status_byte = 2 makes it compile and work on my device
at least that's good information that the correct value is probably 2.
you probably know the drill but you'll need to submit a PR to nvm.toml and once that's merged submit a 2nd PR to update nvm.toml in circuitpython
that 2nd PR could just be the one for adding the board, if you choose to do that.
There is no way to change the directory before boot.py runs, so I don't think there is a need to reset it there. Also, start_mp only runs once at the beginning, but the nature of the problem comes from cwd persisting across reloads, not from the initial conditions.
I don't see the maybe_run_list function checking for the filesystem, so I assumed that by this point it has already been checked? I don't really have a way of testing this without a filesystem.
yeah, on it
shaves that yak
@onyx hinge thanks for help, I would have never found it myself
you're quite welcome of course
Good point about boot.py, I wasn't thinking too clearly.
To fake not having a filesystem, temporarily add a return false; just before // try to mount the flash in filesystem_init() in supervisor/shared/filesystem.c.
When I do that, I get:
Auto-reload is off.
Running in safe mode! Not running saved code.
You are in safe mode because:
CIRCUITPY drive could not be found or created.
Press any key to enter the REPL. Use CTRL-D to reload.
No crash.
I have a socket question. In CPython, I can create a Multicast UDP sender or receiver by doing socket.setsockopt() , e.g. for a multicast receiver:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
ttl = 2
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl)
while True:
sock.sendto(udp_message, (udp_host,udp_port) )
time.sleep(1)
and then if that's invoked with a udp_host,udp_port=224.0.0.1,5000 I am sending on the LAN multicast net to multicast group 5000. (I put some simple working examples in CPython here: https://gist.github.com/todbot/375e539740cfb790e8c6296ca423ebfe)
This UDP receiver code is exactly the same as unicast UDP (which does work in CircuitPython), except for setsockopt.
So how do I do setsockopt equivalent in CircuitPython? I'm mostly concerned about ESP32-S{2,3} cores if that helps
we do have setsockopt according to the docs: shared-bindings/socketpool/Socket.c://| def setsockopt(self, level: int, optname: int, value: int) -> None:
but the related constants are almost certainly not available.
it looks like from doing full text search that IPPROTO_IP is 0 (matches linux python) and IP_MULTICAST_TTL is 5 (linux python is 33)
it does appear that Espressif will support multicast
CircuitPython will only pick one major and one minor version of MicroPython per major version of CircuitPython? This would be to enable consistency of native modules. Native modules must be promoted to CircuitPython major versions.
ahh! how did I miss that. trying it now
adding more constants is not tough, so we can do that if they're useful
So it never gets to running the code.py that's good.
My concerns (some incorrect) all accounted for. Thanks!
There is still the case when someone uses chdir in boot.py and the board goes into safe mode and runs the wrong safemode.py, but I think that's a self-inflicted wound?
ja pygamer is overflowing, but we don't need to fix that here.
omg that actually worked. I now have an ESP32-S3 QTPy receiving multicast UDP while my Linux box and Mac laptop are also receiving them. gist updated: https://gist.github.com/todbot/375e539740cfb790e8c6296ca423ebfe
ok cool!
There is still the case when someone uses chdir in boot.py and the board goes into safe mode and runs the wrong safemode.py, but I think that's a self-inflicted wound?
safemode.py is run after a hard reset, so I think that cannot happen?
Symbols are an area which will require a top level choice and there will be consequences of that choice. This choice will likely involve some level of support by Adafruit. MicroPython currently is a fan of static symbols and management be provided by fork or firmware flavors. (Based on your quote.) This represents one choice. The RP2040 and SDK somewhat forces this.
This creates challenges for Adafruit. To avoid this Adafruit may decided to ban certain practices in native modules. This wi...
Ok, I've got things setup for compiling a custom CP for rotary trinkey, and I used the advice of @slender iron to get a list of the CIRCUITPY parameters. I have some questions about some of them. To start with:
I see that busio.SPI and busio.I2C are part of the default modules. The rotary trinkey doesn't have enough exposed pins to use either of those procols (well, I guess you could solder to the touchpad for the forth...). Is there some other reason to keep those, if I'm not going to use them?
Just tried sending multicast UDP at 100 Hz for a minute or so and the number of missed messages by the QTPy ESP32-S3 was about the same as my Linux box. So perhaps that stackoverflow issue is not that big of a deal now
the writeup sounds more like any interference is an issue for multicast, not necessarily bad for ESP in paritcular
glad it works in general!
yeah I am pretty stoked. thanks to you and @onyx hinge
you'll need SPI if there is onboard flash. I don't remember the details of that board
Ah, that's the kind of thing I was looking for. I don't know if there is onboard flash, but I figured there might be something I hadn't thought of, that it needed for its own operations.
Well, it worked! My temperature sensor is definitely a thermistor, so now I have to build the voltage splitter and figure out how to do it on a tiny board. Turns out this board is perfect though, since I'll need the ground pad on the three rotary encoder pins for the voltage splitter. (I just set the other pin to high as a voltage source, but I'll have to measure the internal resistance to work out the numbers for calculating the temperature. That's the fun part though!...well somewhat fun.)
Anyhow, thanks! I now have a Rotary Trinkey build with analogio.
I'm not using sockets directly, just the webserver from adafruit (adafruit_httpserver).
Any suggestions what a similar fix would be for http?
I'm not using sockets directly, just the webserver from adafruit (
adafruit_httpserver). Any suggestions what a similar fix would be for http?Code is based on https://learn.adafruit.com/pico-w-http-server-with-circuitpython/code-the-pico-w-http-server
Looks like you can change it. The default is 1024. See https://docs.circuitpython.org/projects/httpserver/en/latest/api.html#adafruit_httpserver.server.Server.request_buffer_size
So in your code you would have to add the reques...
@patent peak when i run anything in the REPL on my zero, it just hangs and prints \n infinitely
i went into shared/runtime/pyexec.c and added prints until i could narrow down the cause:
#if CIRCUITPY_ATEXIT
mp_hal_stdout_tx_str("g\r\n");
if (exec_flags & EXEC_FLAG_SOURCE_IS_ATEXIT) {
atexit_callback_t *callback = (atexit_callback_t *)source;
mp_call_function_n_kw(callback->func, callback->n_pos, callback->n_kw, callback->args);
} else
#endif
{
mp_hal_stdout_tx_str("e\r\n");
mp_call_function_0(module_fun);
mp_hal_stdout_tx_str("c\r\n");
}
mp_hal_stdout_tx_str("f\r\n");
this just prints g&e, c&f never show up
ah, and on a second look, i now see a MICROPY_DEBUG_VERBOSE i could turn on....
/circuitpython/ports/broadcom/../../py/gc.c:124: undefined reference to `DEBUG_printf'
but that just breaks the build
forced that on, i now have debug!
gc_alloc(4 bytes -> 1 blocks)
gc_alloc(0x21f9240)
gc_alloc(2 bytes -> 1 blocks)
gc_alloc(0x21f9230)
0;�🐍REPL | 8.2.0-45-g75ba17e84-dirtygc_alloc(32 bytes -> 2 blocks)
gc_alloc(0x2c5900)
Adafruit CircuitPython 8.2.0-45-g75ba17e84-dirty on 2023-08-19; Raspberry Pi Zero with bcm2835
Type "help()" for more information.
>>>
>>>
gc_alloc(16 bytes -> 1 blocks)
gc_alloc(0x2c5ba0)
gc_alloc(33 bytes -> 3 blocks)
gc_alloc(0x2c5bb0)
gc_alloc(24 bytes -> 2 blocks)
gc_alloc(0x2c5be0)
gc_alloc(12 bytes -> 1 blocks)
gc_alloc(0x2c5c00)
it gets into a loop doing this, and doesnt seem to return
e
calling function 0x2c5940(n_args=0, n_kw=0, args=0x0)
call == 0x2a9c4
0002a9c4 <fun_bc_call>:
2a9c4: e92d4ff8 push {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
2a9c8: e1a05001 mov r5, r1
fun_bc_call() doesnt seem to be printing its own debug properly
I reworked the safe mode messages in #7577. I rewrote
"Crash into the HardFault_Handler." to be
"Fault detected by hardware.".
This turns out to be confusing, because it sounds like the hardware is failing. This PR changes it to
"Hard fault: memory access or instruction error."
which is the definition of hard fault on most CPU's.
I made this change in 8.2.x to get it into the next 8.2.x release, and it can be merged up into main.
Writing error messages is tough. Thanks for trying to make this one better!
@dhalbert apologies, completely missed the notifications for this repo :( After the update to the PID it should be mergeable, I've done some rudimentary testing (boot, REPL functions), but nothing beyond.
Writing error messages is tough. Thanks for trying to make this one better!
@dhalbert I was following the automated pre-commit patch for that update - anything I can do to fix it?
Also, could you take a look at the pins to see if there's any further addition needed? The M5Paper is quite limited in exposed pins, and they're all part of the typical M5Stack A/B/C ports, so I'm not sure if there's any point in adding the analog/digital/touch pin definitions.
@fonix232 Don't worry about the pygamer failure. We will fix that later. We can merge without it.
I'm not sure if there's any point in adding the analog/digital/touch pin definitions.
These are the _INT pins? Can they be used at all? Are the pins connected to anything? If they aren't, no reason to add them.
Prompted by a user on discord who asked why canio cannot be imported on the Adafruit RP2040 CAN Bus Feather
I consolidated some error messages to get the failed builds not to overflow. Interestingly, some changes increased the build size, such as removing all the periods and some thes from the safe-mode messages.
@jepler did you also want to restore examples/natmods? They did not get pushed and those builds are failing. Maybe they are still only local in your local repo.
@buoyant lagoon Since I think the printing stuff used to work, doing a bisect or similar would narrow down what changed caused the problem. You could narrow down the version range manually with the builds archive: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin, and then do an actual bisect. Doing bisects across major version changes can be tricky.
i did also find another issue
i think its calling fun_bc_call()
because in the mp_call_function_n_kw() area, that is what was in the call pointer
but the logs in fun_bc_call() never run
is the MMU in use at all?
the cause may be some second-order bug. Not sure about the MMU, but there have been plenty of cache issues.
fun_bc_call() also uses a different print function for its debug
the tinyusb side appears to be working fully
when it crashes, its spamming \n's over the cdc uart!
so its still able to drive the usb device fully
and its spamming them to the framebuffer, and hw uart at the same time
so all of the IO seems to be working
but that could be caused by some error in USB interrupt handling or something: repeatedly sending same buffer or someting
so I think bisecting will be your friend here
gc_alloc(16 bytes -> 1 blocks)
gc_alloc(0x3c62a0)
gc_alloc(33 bytes -> 3 blocks)
gc_alloc(0x3c62b0)
gc_alloc(24 bytes -> 2 blocks)
gc_alloc(0x3c62e0)
gc_alloc(12 bytes -> 1 blocks)
gc_alloc(0x3c6300)
gc_alloc(16 bytes -> 1 blocks)
gc_alloc(0x3c6310)
gc_alloc(33 bytes -> 3 blocks)
gc_alloc(0x3c6320)
gc_alloc(24 bytes -> 2 blocks)
gc_alloc(0x3c6350)
gc_alloc(12 bytes -> 1 blocks)
gc_alloc(0x3c6370)
gc_alloc(16 bytes -> 1 blocks)
gc_alloc(0x3c6380)
gc_alloc(33 bytes -> 3 blocks)
gc_alloc(0x3c6390)
gc_alloc(24 bytes -> 2 blocks)
gc_alloc(0x3c63c0)
gc_alloc(12 bytes -> 1 blocks)
gc_alloc(0x3c63e0)
that doesnt explain it looping like this
I almost always start with a bisect if it used to work, unless I have some confidence that a certain PR is involved
tinyusb avoids malloc at all costs
let me plug the zero back in, and try to narrow it down some more...
but the things that call tinyusb malloc, and if they are getting different or wrong info back from tinyusb...
i think first, i should try to backtrace from gc_alloc
i'm expecting trouble from git bisect, because i modified the makefile some
DEBUG_printf("gc_alloc(" UINT_FMT " bytes -> " UINT_FMT " blocks) caller=%p\n", n_bytes, n_blocks, __builtin_return_address(0));
gc_alloc(16 bytes -> 1 blocks) caller=0x297b0
gc_alloc(0x3c5ba0)
gc_alloc(33 bytes -> 3 blocks) caller=0x297c8
gc_alloc(0x3c5bb0)
gc_alloc(24 bytes -> 2 blocks) caller=0x29864
gc_alloc(0x3c5be0)
gc_alloc(12 bytes -> 1 blocks) caller=0x29888
gc_alloc(0x3c5c00)
it now prints this while looping
I'm saying try 7.3.3, then 8.0.0 final, etc., to see if you can get it narrowed to a version range. Then you can start with a bisect with a narrow range that doesn't span branch changes in a clean clone
00029790 <mp_obj_new_exception_msg_vlist>:
297ac: ebff7aa6 bl 824c <m_malloc_maybe>
297b0: e1a04000 mov r4, r0
...
that seems promising, if its in an infiniteloop, trying to build an exception
and then has an exception while building an exception!
going afk for a while
fmt: 0xc9b8c, caller: 0x29948
0002992c <mp_obj_new_exception_msg_varg>:
0001f840 <mp_raise_msg>:
msg: 0xc9ba4, caller: 0x1fa28
0001fa18 <mp_raise_RuntimeError>:
1fa18: e1a01000 mov r1, r0
1fa1c: e92d4010 push {r4, lr}
1fa20: e59f0000 ldr r0, [pc] ; 1fa28 <mp_raise_RuntimeError+0x10>
1fa24: ebffff85 bl 1f840 <mp_raise_msg>
1fa28: 000c60e0 .word 0x000c60e0
msg: 0xc9ba4, caller: 0x21e4c
00021e40 <mp_raise_recursion_depth>:
21e40: e92d4010 push {r4, lr}
21e44: e59f0000 ldr r0, [pc] ; 21e4c <mp_raise_recursion_depth+0xc>
21e48: ebfff6f2 bl 1fa18 <mp_raise_RuntimeError>
21e4c: 000c9ba4 .word 0x000c9ba4
aha, recursion! while creating a exception about recursion! lol
#if MICROPY_STACK_CHECK || MICROPY_ENABLE_PYSTACK
NORETURN MP_COLD void mp_raise_recursion_depth(void) {
mp_raise_RuntimeError(MP_ERROR_TEXT("maximum recursion depth exceeded"));
ah yep, that explains it perfectly
this does a stack-check before it prints
fun_bc_call() before stack check
msg: 0xc9bec, caller: 0x21e4c
msg: 0xc9bec, caller: 0x1fa3c
fmt: 0xc9bec, caller: 0x1f878
fmt: 0xc9bec, caller: 0x299a4
yep, bingo
usage: -176121704, limit: 65712
@tulip sleet aha, i'm using negative 167mb of stack! lol
top: 0x2309734, current: 0xcaffe98
top: 0x2309734, current: 0xcaffe9c
usage: -176121704, limit: 65712
so, the top of the stack is at 35mb
but the sp is near 202mb
Press any key to enter the REPL. Use CTRL-D to reload.
mp_stack_set_top(0x2309734)
Initializing GC heap: 0x30a4f0..0x22f9270 = 33484160 bytes
GC layout:
so, i think we have 2 bugs
1: the top of the stack is wrong
2: it checks the stack limit, while complaining about a stack limit, and infinitely recurses
port has dynamic stack
stack top 0xcb00000
allocated stack at 0x305344, size = 66736
limit 0x22f9284, length 0x104b0
mp_stack_set_top(0x2309734)
mp_stack_set_top(0x2309734)
so first, it gets the size of the current stack
the it malloc()'s about 65kb, an extra EXCEPTION_STACK_SIZE bytes so it can report failure (which failing)
then it changes the stack top, but doesnt actually change the stack
#define MICROPY_STACK_CHECK 0 is also non-functional
i patched mp_stack_check() to just not check, and now it works
Yes, I would like to investigate why natmods are failing, there's more than just the source files being missing. but if I can't get it sorted, I think the right thing to do is disable the related tests and move on. we can re-review what's up in/after the 1.20 merge.
I think the problem may be that we changed the bytecode format with MP_SCOPE_FLAG_ASYNC but did not make related changes in some related scripts...
py/runtime0.h:41:#define MP_SCOPE_FLAG_VIPERRELOC (0x20) // used on...
ok, lets see, where do i begin with displayio....
was there any bug in 8.2.3 that would explain it not working on the PewPew M4? I compiled the latest source, and it works, so it must have been fixed in the mean time?
[root@amd-nixos:/etc]# hexdump -C /dev/sdc
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001c0 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 |................|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200
[root@amd-nixos:/etc]# fdisk -l /dev/sdc
Disk /dev/sdc: 512 B, 512 bytes, 1 sectors
Disk model: Zero
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sdc1 1 1 0 0B 1 FAT12
ah, thats why thats borked
its only a 512 byte disk drive!
supervisor_flash_get_block_count() claims its 0 blocks
ah, the partition loop code is rather dumb
if it encounters a 3rd or 4th partition, it uses none
not that I know of; do you mean it doesn't come up at all?
@tulip sleet any tips on where i would start with implementing sprites with displayio? i know how the hw works, but not how circuitpython expects it to be exposed
yeah, no disk, no serial
no screen
I didn't try jlink with it
is the pewpew similar to any board I might have?
I think it's the only samd51 board without external flash out there
TileGrids are sprites, basically, e.g. https://learn.adafruit.com/circuitpython-display-support-using-displayio/sprite-sheet
the issue, is that i believe the pi-zero currently lacks sprite/displayio support
and i wish to add it
there is displayio support for a framebuffer thing that works with the HDMI output. I thought it was turned on
yes, but that is not hardware sprites
so it takes a ton of cpu usage to do anything
even just scrolling the text console is cpu intensive
does the broadcom chip have hw sprites?
yes
this demo uses <1% cpu
the 2d pipeline on the SoC is sprite ONLY
the framebuffer CP is using, it just a static sprite
you should talk to Scott about it, since he was directly inspired by sprites for TileGrid. Maybe he had possible hw in mind. But it was insspired by much less powerful machines without a lot of specialized display hw, e.g. old game consoles
at the most basic level, you give the hardware a list of sprites
for each sprite, you define:
- the addr in ram
- the source width/height/stride
- the x/y on the screen
- the dest width/height
by using a width of 32 pixels, but a stride of 320 pixels, you can easily extract a tile from a tileset and draw it
I didn't see anything in the release notes. Do you know at what version it stopped working (and then started again?)
the last version I tested is 8.0.0-beta.1
but since it works in the current version, I don't think it's important
it's weird it broke and then started working again
I was just asking out of curiosity
I could probably try the pewpew build on a random SAMD51 board, since I'm just trying to see if it loads
hmm, let me try with the "abosulte lates" build from the download, maybe it only works when I compile it myself
and/or build 8.2.3 yourself and see
the only real differences vs older consoles, is that the w/h are plain ints, not an enum
the overall res is higher
and it can handle a lot more sprites
so is there something missing from the current TileGrid API?
i think its just missing an implementation of TileGrid for the bcm283{5,6,7}
hmmm, adafruit-circuitpython-pewpew_m4-en_US-20230818-babd2de.uf2 also crashes
TileGrid is is in shared-module: there are not port-specific impls for that kind of class in displayio
where is the port specific code, for configuring hardware sprites?
or is it always cpu rendering?
ahh, thats a much bigger task then
because on boards up to now, the CPU had to drive the display anyway
you could just provide an alternate impl for TileGrid, but I'm not sure it's at the TIleGrid level -- it's in the display update code, maybe?
@slender iron you got any thoughts?
hmm, if I press reset to get into the safe mode, it doesn't crash
i have seen that too, when loading a new UF2. I go into safe mode but a reset cures it
I am usually connected via serial so it's not surprising
I have been seeing this for a long time
I got the issue again. It happens if I am using my home wifi but not if I used my 4G portable router.
But then I did remember I am using a wifi repeater - and I tested that if CP board is configured to connect to home main router it works, but do not work if I connect to the wifi repeater network. Maybe something changed on the wifi repeater, as I didn't had this issue previously...
if I press the rst just right, I get this, but no disk and no serial, otherwise it's just unitialized screen
lsusb doesn't show it either
which compiler is used for the builds published on circuitpython.org?
I will connect a jlink to it tomorrow and see what it crashes on
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)
See https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix= for the tar files we use
how about the bootloader version you are using?
I don't see why that should matter, but maybe..
i tried loading PewPew M4 on a Metro M4: it loads but nothing happens
it does not go back to the bootloader
no, it just hangs
if you press reset to get into safe mode, it will go into safe mode, but without usb
(I guess you won't see it wihout a screen)
oh it is a 51g, I should try an itsy. I have to put some food in the oven, back in a bit
I compiled 8.2.3 myself and it also crashes, I'm going to try earlier versions
fwiw I was using up to date versions on a pygamer just this week, so it's not that all samd51 are broken.
yeah, someone would have noticed I'm sure
why did I save those few cents on the flash chip
8.0.5 works, 8.1.0 crashes, I'm going to check the betas
see if any changes to the samd-peripherals submodule
I'm not updating the submodules, so it must be a change in the main code
i was thinking maybe someone submitted a PR to samd-peripherals which we incorporated
but 8.0.5 with samd-peripherals from 8.2.3 works
and you're not updating tinyusb either?
itsy m4 8.2.3 on itsy works fine
I wonder if some part of flash is overflowing but it's not being checked properly. Could turn off some more modules and see.
some of the crashing uf2s are actually smaller than the working ones
@jepler i think you resolved this, right?
so i think a bisect is in order. it's a pretty narrow range, that's good
it stops working on commit 66edcf5d034432519aac18690806adad2cacf2ac
maybe the stack checking in https://github.com/adafruit/circuitpython/commit/66edcf5d034432519aac18690806adad2cacf2ac#diff-a0cb465674c1b01a07d361f25a0ef2b0214b7dfe9412b7777f89add956da10ec. There are also some shared changes in displayio. If you turn off displayio does it work?
also a change in usb.c
jsut initializing the identification, but you could turn off the usb identification too
@clever was poking around that stack code above
i have found circuitpython to be fragile in terms of config
there are a number of compile-time config options, that just break it
verbose debug logging fails to link
it works with displayio enabled, but display init disabled in board.c
removing the stack bounds checking fails to even compile
yup, it's the ^&#$#&* logo, removing #define CIRCUITPY_REPL_LOGO 0 makes it work again
I think it's because of this?
changing it to
#if CIRCUITPY_REPL_LOGO
scroll_area->height_in_tiles -= 1;
#else
scroll_area->height_in_tiles -= 1;
#endif
makes it work again, but why
ah, because the status bar is still there
CircuitPython version
Adafruit CircuitPython 8.2.3 on 2023-08-11; Adafruit MatrixPortal S3 with ESP32S3
Board ID:adafruit_matrixportal_s3
Code/REPL
# SPDX-FileCopyrightText: 2020 Brent Rubell for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import os
import ipaddress
import ssl
import wifi
import socketpool
import adafruit_requests
# URLs to fetch from
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
JSON_QUOTES_URL = "h...
just more config being fragile, like i mentioned above
Removed adafruit gets and focused only on the Github connection. It's not connecting to that API url. Rest of the script seems to work fine. It's specifically the Github handshake attempt.
that's not helpful
more a comment on the general codebase, those config flags need better testing
We have to make room for the status bar no matter if the logo is enabled or not. We probably should add a similar option for disabling the status bar.
This makes the PewPew M4 port stop crashing.
looks
i can confirm
changing CIRCUITPY_REPL_LOGO to 0 breaks the rpi-zero port too
so its not a samd problem
it enumerated over usb, then stopped responding
checking the source...
if the logo is on, blinka_bitmap_data and blinka_bitmap are declared as extern vars
this fixes it for me
ah, so the height was probably undefined
and then it went out of bounds on the framebuffer
it was defined, but was too big together with the status bar
because CIRCUITPY_REPL_LOGO disables the logo, but the status bar is currently hardcoded
and then because the height wasnt decreased, it went 1 tile past the end of the framebuffer?
possibly
no it shouldn't, it slow enough as it is
a debug only check then?
so when it does crash, you can turn that on, and instantly get an obvious error
nobody ever enabled debug
glad this is figured out
@tulip sleet I'm still suspicious about what happens when the logo is bigger than the status bar
shouldn't then it do -2 or even more on the scroll area?
maybe so -- I have a vague memory of using an emoji that just fits in the status bar, instead of the standalone logo?
but the code clearly allows the logo to be bigger than the font
it could also be a one-time check at startup, that terminal top + height <= framebuffer height
and then you have to go fishing for more room for japanese translation
it's a compromise
no matter what font your using, the terminal should be contained within the bounds of the display
that's what happens when the code is correct
when it's not correct, run-time checks won't help with it
(though they may help pin-pointing the problem)
let's face it, the whole micropython is a huge hack, with a lot of very clever but fragile tricks
@jepler Guard mp_type_coro_wrap too?
// CIRCUITPY
extern const mp_obj_type_t mp_type_coro_wrap;
// CIRCUITPY
#if MICROPY_PY_ASYNC_AWAIT
extern const mp_obj_type_t mp_type_coro_instance;
#endif
written in a language from the '70s
one thing i could see more work being put into, is automated testing on real hardware
we have worked on this on and off; I would like to. Scott originally did it with an RPi, and it was not reliable enough. A more capable test computer would be better. I have spare mini PC's.
https://gist.github.com/cleverca22/f7ec8335d719875c805fb775a00b14d7
with a minor change like this, and
sudo ./rpiboot -l -d ../circuitpython/ports/broadcom/build-raspberrypi_zero/rpiboot
you can boot circuitpython on a pi-zero or pi-zero2, without having to re-flash the SD card
then all you need is a gpio pin to hard-reset the device when its crashed
Do you want to backport this to 8.2.x also? Or submit it to 8.2.x and we'll merge all the recent changes soon into main.
the pi1/pi2/pi3/pi4 can network boot, so if you serve the above directory over tftp, you can repeat the same thing
(pi1/pi2 need bootcode.bin on an SD card to netboot)
that covers everything under ports/broadcom i think
ports/raspberrypi, either use 2 gpio, for bootsel+run, or 2 gpio for full SWD
if bootsel is pulled during boot, you can UF2 flash it over usb
if you use SWD, you can program it with an elf and openocd
Here's a slimmer version that will fail gracefully during testing.
import os
import time
import ipaddress
import ssl
import wifi
import socketpool
import adafruit_requests
pool = socketpool.SocketPool(wifi.radio)
JSON_STARS_URL = "https://api.github.com/repos/adafruit/circuitpython"
# Connect to Wi-Fi
print("\n====== MatrixPortal S3 WebClient Test ======")
print("Connecting to WiFi...")
requests = adafruit_requests.Session(pool, ssl.create_default_context())
while...
@stuck elbow weird build failure in the scheduler job in your PR. I am re-running just in case it is transient.
the yaks just keep on coming ;-)
We have to make room for the status bar no matter if the logo is enabled or not. We probably should add a similar option for disabling the status bar.
This makes the PewPew M4 port stop crashing.
(cherry picked from commit b50a7fb9137383737fcc8f635a714b45f41e20ad)
:🐃 💈
@tulip sleet after thinking about it some, i can picture some ways you could take the broadcom SoC design, and apply it to things like the pico-dvi, to change up how sprites are handled, and potentially improve performance, and maybe even reduce ram usage
i assume that pico-dvi currently just has a standard framebuffer, for whatever the full resolution is, in ram at all times?
yes
and the dvi code is just converting it constantly
the sprite code then draws into that
it is PIO
yep
internally, the HVS on the rpi, will scan the sprite list, composite sprites on the fly, and fill a FIFO with pixels
and the HDMI block then converts that into HDMI/DVI
in theory, you could recreate that HVS on the pico, and just delete the framebuffer
is the background a big "sprite"?
exactly
what i'm thinking, is that you have a FIFO between the new displayIO, and pico-dvi, that holds pixels
plus there is stuff like the shapes
and any time that FIFO has room, you scan the sprite list, fetch pixels from ram, and write to the FIFO
and as long as you can generate pixels at the pixel clock, and the FIFO eats any lag spikes, it works
that's how displayio works on spi displays, roughly
ah, so you already have that code
the rpi hardware is doing exactly the same thing on every frame
it was inspired with how gameboy did it
yeah, there is a trade-off, of time per pixel, constantly
vs time per draw operation
it gets slower if you have many overlapping layers
so at some point you can no longer keep up
in the broadcom implementation, the FIFO holds a couple scanlines
and rather then being a true FIFO, its just a block of ram, so you have a set of pointers defining where the new scanline is, and it draws the sprites into that region
the hardware in the rpi has the exact same issue
the glitching you see here, is when too many sprites overlap, and i underclocked it hard
i was mostly under-clocking it, to measure where the limit was
wouldn't it make more sense to use the gpu?
this is the gpu
I mean the 3d one
the rpi has a 2d only gpu, and a 3d gpu
page-flipping and double-buffering can only be done via sprites on the 2d core
hmmm...
with this example screenshot...
i have a 9x9 grid of sprites, 81 sprites in total
i can repaint the entire map, by just doing 81 x 32bit writes to the display list
while with the 3d core...
i would need to update 4 vertices per sprite, each with a 32bit floating point X/Y
2592 bytes
then i have to run the 3d job, which will write the entire frame to ram
not a cpu task, but still eats up dram bandwidth
then i have to change out the image behind a 2d sprite, to make the 3d render visible
so, for a 2d job, the 2d core is far more light weight
I know there are some python libs for rpi that use the 3d gpu for 2d sprites and they are pretty fast
faster than sdl anyways
throw enough cpu at the problem, and you can mask the overhead from something taking over 8x the resources
@stuck elbow because the build is only building your board, it appears SRC_SUPERVSIOR is not being set (I'm not sure why), but I think the fix would be to change if file in settings["SRC_SUPERVISOR"]: in tools/ci_set_matrix.py to if file in settings.get["SRC_SUPERVISOR", ""]. There are some similar examples in that script.
get() not get[], I will add that
it is working ok on 8.2.x?!
yes, sorry, copy/pasta
but WHY is a mystery, since you do need SRC_SUPERVISOR files
I tested on that 8.0.1-beta-2, but there were no other changes in that code since
yeah, I looked at blame
a lot of the demo animations ive been doing, use <1% cpu time, which means more cpu time for real work
it's easier when you can just write it for your own needs, gets harder when you have to abide by existing api, like displayio
yeah
but of course if you are willing to do the work, that's great
what does displayio have in terms of api?
displayio.Colorspace, the rpi hardware allows each sprite to exist in its own colorspace, and supports a palette
are shapes rects or polygons?
yeah, each bitmap or ondiskbitmap has its own palette
rotation or just mirroring?
they are are more complex, lines, circles, polygons, rectangles, rounded rectangles, ellipses, etc.
ah, so you would need to use per-pixel alpha then
rotation by 90° and mirroring
rotation by 90° is the only part i havent figured out yet on the rpi
its an extra step
mirroring is just a 1bit flag, for each axis
the way the shapes work, they calculate their pixels on the fly
/* 8bpp */
HVS_PIXEL_FORMAT_RGB332 = 0,
/* 16bpp */
HVS_PIXEL_FORMAT_RGBA4444 = 1,
HVS_PIXEL_FORMAT_RGB555 = 2,
HVS_PIXEL_FORMAT_RGBA5551 = 3,
HVS_PIXEL_FORMAT_RGB565 = 4,
/* 24bpp */
HVS_PIXEL_FORMAT_RGB888 = 5,
HVS_PIXEL_FORMAT_RGBA6666 = 6,
/* 32bpp */
HVS_PIXEL_FORMAT_RGBA8888 = 7,
HVS_PIXEL_FORMAT_PALETTE = 13,
these are the pixel formats that sprites can be in, which look useful
spi displays just use the RGB565
1/3/6/7/13 all support per-pixel alpha
3 only has 1bit of alpha per pixel, so its only good for masking a shape off
the rest support varing amounts, from 4bit to 8bits of alpha, so they can blend
palette formats support 1/2/4/8 bits per pixel
and the palette is just an array of RGBA8888, so you have the full 8bits of range, for every color, and alpha
perhaps you should start by writing your own graphics library first, and once you are familiar with it, come back to displayio
i already have
(which is not hard)
lines 33-49 will generate a sprite that is 32x34, and at the right coords on-screen
lines 51-55 will change the tile within the sprite
and this is the end result of that code
one option, would be to just port this to circuitpython, as its own api, and just ignore displayio temporarily
that's what I meant
yeah, i realized that after saying it
i could also slightly hijack display-io, and turn it into another sprite, so you can still see the old ui
another thing sprites can massively help with, is scrolling
this would be the standard terminal in little-kernel, it just uses memcpy() to scroll
yeah, scrolling is something displayio struggles with
and it scrolls slow enough that you can almost read it as it scrolls
this treats the framebuffer as a ringbuffer, and the write-ptr just wraps, and it never scrolls
looks like that helped
it then uses sprites to draw the 2 halves of the buffer
for debug, there is a seam in the framebuffer, which you can see on the final frame of the video
but i can just align things properly, and then its seamless
and it actually scrolls too fast, it updates multiple times within 1 vsync period, and overflows some hw buffers, lol
I'm heading to bed, goodnight
nn
Tried on an Adafruit ESP32-S2 Feather on 8.2.3 with the same result.
Fetching submodules:
Entering 'ports/espressif/esp-idf'
BUG: config.c:129: kvi should not be set while parsing a config source
error: path='ports/espressif/esp-idf'; git fetch --tags --depth 1 died of signal 6
fatal: run_command returned non-zero status for ports/espressif/esp-idf
Any ideas?
Well my bug hunting day is done. Found a big juicy one that affects any S2 or S3 module that is using adafruit_requests starting in 8.2.2
@veloyage - would love to see what you've changed already. Even getting the 3m would be awesome. I am about to go down the road of seeing how things are different, but it's crazy how different the C library is for this one from all the others.
Just to say that I've tried this on a Raspberry Pi Zero W. The latest 7.x (7.3.3) works fine. But 8.1.0 and 8.2.3 both crash, either don't mount at all, or give out a this error on every run: "NLR jump failed. Likely memory corruption."
CircuitPython version
Adafruit CircuitPython 8.2.3 on 2023-08-11; FeatherS2 with ESP32S2
Board ID:unexpectedmaker_feathers2
Code/REPL
import adafruit_dotstar
Behavior
Traceback (most recent call last):
File "", line 1, in
File "adafruit_dotstar.py", line 44, in
ImportError: no module named 'adafruit_pypixelbuf'
Description
Complains about missing adafruit_pypixelbuf. Tried replacing adafruit_dotstar.mpy with the .py version, as th...
yay we've finally gotten to building boards during CI :) :rocket:
Are you sure the Hard fault: is needed?
I am not sure it adds anything of value.
A cpu / stack crash is a hardfault, but that doesn't matter for the user.
I imagine hard fault is a reference to the exception handler that caught it. I think that's a good thing to include. Might even be better to include the file & or memory address that failed? Copy/pasting the same "my board says it crashed into the hard fault handler" doesn't really give the devs much info to go on. Dan is right, with ""Fault detected by hardware."" can't tell you how many times in CP help channel a beginner gets that message and then immediately asks "Did I brick my board?"
well that's a new wrinkle. If long ints aren't supported, only 14-bit(!) integer values can be frozen.
Showing 8.2.2 was released on July 31st but adafruit_requests last real commit was in June. That makes no sense to me. Is it possible the bug was introduced in 8.2.3 and then backported to 8.2.2? I have no clue how the backporting process works. Can't find a reason why things just magically broke in 8.2.2 on July 31st but everything works fine on 8.2.1 from July 25th.
July 20th was the TLS cert update for AdafruitIO. The timing is pretty close but the S2/S3 module shouldn't need that cert with Github for example.
If it was possible to include this much info, it should probably be displayed in a seperate line / section.
But I am pretty sure CP has no idea about source files even when compiled with DEBUG=1.
It may be possible to capture the backtrace (addresses) though.
Not that it would be useful on a non-debug build.
Copy/pasting the same "my board says it crashed into the hard fault handler" doesn't really give the devs much info to go on.
Agreed. Then maybe we should add a link to a...
This is a safemode reason, and they are listed in the safemode guide (and also in the doc): https://learn.adafruit.com/circuitpython-safe-mode. There is a message asking to file an issue that is printed at the same time as this.
Are you sure the
Hard fault:is needed?
"Hard fault" is definitional, at least for ARM chips, so I am leaving it in because it describes what has happened in the hardware.
Shortened error messages are clear to me as is the hard fault one previously approved.
huffman module problems. again. Task: I want to build mpy-cross to make mpys with minimal fuss from a fresh circuitpython clone. What do I do? My options appear to be make fetch-all-submodules or make fetch-port-submodules.
So is the most expedient way to build mpy-cross doing this?
git clone https://github.com/adafruit/circuitpython/
cd circuitpython
(cd ports/atmel-samd && make fetch-port-submodules)
make -C mpy-cross
It looks like the CI build uses a whole different thing, python3 tools/ci_fetch_deps.py mpy-cross.
you can also grab bins of mpy-cross from s3 for several architectures https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/
we could also add a Makefile target for submodules to the mpy-cross Makefile
Interesting I didn’t know there were modern prebuilds of it. That might be the route to go then for most folk
Q: do these strings need to live past the call to mdns_resp_add_service(), or could you allocate them on the stack?
Seems like I’m the only who keeps having this issue so I can just download the prebuilds 🙂
These do need to live for longer since txt_userdata is used by the srv_txt callback within lwIP to respond to requests for TXT records. It may be called at any time and multiple times after starting the mdns service.
The check for adafruit_pypixelbuf was removed in March of 2022. You're using an outdated library bundle. Please grab a more recent Bundle for Version 8.x
Normally I would think # is commented out. Does this mean it is or isn't included as a frozen library? https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk
I am using the one dated 20230815.
On Sun, Aug 20, 2023 at 8:46 PM DJDevon3 @.***> wrote:
The check for adafruit_pypixelbuf was removed in March of 2022
https://github.com/adafruit/Adafruit_CircuitPython_DotStar/commit/fdc63e80404e7405489ac5922addf06a92093aba.
You're using an outdated library bundle. Please grab a more recent Bundle
for Version 8.x https://circuitpython.org/libraries—
Reply to this email directly, view it on GitHub
<https://github.com/a...
Then it should be using the latest version of adafruit_dotstar... I would hope.
It is commented out so not included
So it's not frozen in and the library bundle should be used.
In the meantime I flashed the prior version of CircuitPy (8.2.2) and the
problem was rectified. Same library bundle.
On Sun, Aug 20, 2023 at 9:15 PM DJDevon3 @.***> wrote:
Then it should be using the latest version of adafruit_dotstar
https://github.com/adafruit/Adafruit_CircuitPython_DotStar/blob/67f8c35e2ce4a8abc3cfb24ab5029b40a64857b8/adafruit_dotstar.py...
I would hope.—
Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circui...
If you perhaps had an adafruit_dotstar.py in the same /lib folder it would override the adafruit_dotstar.mpy from the bundle.
I was having some issue with the TinyS2 and dotstar too but didn't have time to investigate. I thought I had the latest but maybe there is something else out of date
This was an otherwise new S2 I had in a drawer for a long time. I flashed
to 8.2.3 and it no longer ran the sample code that flashes the dotstar. At
this point /lib was empty, so I loaded the entire bundle into /lib. Still
broken at that point. You now have the entire history.
On Sun, Aug 20, 2023 at 9:18 PM DJDevon3 @.***> wrote:
If you perhaps had an adafruit_dotstar.py in the same /lib folder it would
override the adafruit_dotstar.mpy from the bundle.—
Reply t...
It's been a while since I've done a fresh UM install but I believe there might be a dotstar function in the feathers2.py helper file included? I'm not sure if that file is included with a new Circuit Python install... I know it ships with it at least. Possible the helper file might be overriding something? Might be a difference in what ships with a UM Feather that you get in the mail.
I'll try to load mine up quickly (i'm half asleep my results may vary ha)
Only load libraries you currently need or actively use into /lib. The fact that the UM Feather can store the entire bundle is a marvel in itself. That's not what should be done for the bundle... normally. ;) It's currently only one of very few boards with enough flash storage to do that.
So there looks like an issue.
Adafruit CircuitPython 8.2.3 on 2023-08-11; FeatherS2 with ESP32S2
>>>
>>> import board
>>> import adafruit_dotstar
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_dotstar.py", line 44, in <module>
ImportError: no module named 'adafruit_pypixelbuf'```
I do not see any bundle library `adafruit_pypixelbuf`. It looks like it was archived so maybe then it does not get included in the bundle?
Yes, that's normally what I do. I was being lazy this time. Are you saying
this is what caused the issue? I did the same thing for 8.2.2 and there is
no issue with it.
On Sun, Aug 20, 2023 at 9:30 PM DJDevon3 @.***> wrote:
Only load libraries you currently need or actively use into /lib. The fact
that the UM Feather can store the entire bundle is a marvel in itself.
That's not what should be done for the bundle... normally. ;) It's
currently only one of very few board...
Which 100% does not seem right looking at the dotstar module
Okay told you I was tired, I had an old dotstar version installed (oops) so on 8.2.3 with the latest library bundle download it works for me.
Most likely yes the .py file sounds like it was an old version that was overriding the newer .mpy from the bundle.
@blissful pollen So you pretty much did exactly what they did step for step. That's a happy accident. Everything working as intended now on 8.2.3 with the dotstar?
Yup worked fine for me
Awesome
I've done it myself, it's easier to make that mistake with the UM boards for some reason.
I'm trying to remember why I even had adafruit_dotstar.py on my drive (not even the mpy!)
I think it might actually ship that way, I could be wrong.
Same reason why there's a feathers2.py or feathers3.py helper file included in the root dir.
Could be, been a while since I received this board
same and I don't think I have any brand new ones laying around to whip out.
Thanks for buying a FeatherS3!
Your board has been tested and here are the results for your reference.
Test Date & Time: 05/29/2022, 07:21:18 <- Australia
MAC Address: obfuscated
PSRAM: 8189552 bytes
FLASH: 12224512 KB
VBAT Sense Check: PASS
VBUS Sense Check: Pass
GPIO Test: PASS
WiFi Test: PASS
WiFi Connection Time: 3.998 secs
This board is good to ship! I hope you enjoy using it :)
Cheers,
Seon
Unexpected Maker
http://unexpectedmaker.com
``` this is the results.txt included on the board... the timestamp shown would make a lot of sense if he included a dotstar.py in the lib folder
I don't have it on this particular board because I already started customizing it for a project. My guess is a new board would likely have it.
It's in the root dir on my UM Feather S2... and the date.
boot_out.txt must be a message to myself from the future. Will definitely read in private.
Shipped with 8.0.5 pre-installed
Adafruit CircuitPython 8.0.5 on 2023-03-31; FeatherS2 with ESP32S2
Board ID:unexpectedmaker_feathers2
Figured out you did nothing wrong. Unexpected Maker ships the board pre-installed with Circuit Python and an adafruit_dotstar.py in the root directory which will override any adafruit_dotstar.py or .mpy in the /lib folder. That's the issue.
Delete that file and upload a newer version from the 8.x bundle to /lib and should be good to go. Was unaware of this issue.. I'm sure we'll...
We might need to contact Unexpected Maker and see about using a different method as it's causing us some support issues. Might be time for him to use a frozen lib and let Circuit Python update the frozen lib?
"""
`adafruit_dotstar` - DotStar strip driver (for CircuitPython 5.0+ with _pixelbuf)
=================================================================================
* Author(s): Damien P. George, Limor Fried, Scott Shawcroft & Roy Hooper
"""
# pylint: disable=ungrouped-imports
import sys
import busio
import digitalio
if sys.implementation.version[0] < 5:
import adafruit_pypixelbuf as _pixelbuf
else:
try:
import _pixelbuf
except ImportError:
import adafruit_pypixelbuf as _pixelbuf
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DotStar.git"
``` yup, the included dotstar.py is from early 2022.
That's just a snippet. I can post the whole contents but I'm sure it's unnecessary for the sake of solving this issue.
@atomic summit See https://github.com/adafruit/circuitpython/issues/8302 and ^^
This was an otherwise new S2 I had in a drawer for a long time. I flashed to 8.2.3 and it no longer ran the sample code that flashes the dotstar. At this point /lib was empty, so I loaded the entire bundle into /lib. Still broken at that point. You now have the entire history.
…
Key point here is "had it for a long time" and now just re-flashed it. The shipping code that was on there was for a much older version of the files, and new shipping files are available (as always) from...
I was advised not to freeze any of my shipping code or libraries in my board firmware, after I did that way back when I first submitted my FeatherS2 CP board files. So that's why the files are separate.
And is why it was there and then commented out 🙂
TinyS2 doesn't use a Dotstar - It has a 1515 Neopixel.
Thanks I did notice that after I tested against the FeatherS2. I knew I was too tired to be properly debugging 🙂
I do freeze the Neopixel library in my newer boards, so I guess it's ok to do that now, so I'm happy to go back and freeze dotstar now as well, and stop adding it during my testjig process.
I added the following print statement to the start_mp function:
mp_printf(&mp_plat_print, "%d, %d, %d\n", stack_bottom,stack_length,sizeof(uint32_t));
which printed 4, 524284, 4 on a zero2w and 35623556, 66736, 4 on a zerow.
I'm really not great at c data types and printing the pointer value of stack_bottom feels suspect to me, however..... based on the math being used to calculate the top of the stack, a "stack_bottom" of 35623556 looks like it will cause problems to me.
If...
That helps thank you. Was going to bring it up in the meeting tomorrow but you’re right on it. Thank you.
Nps. Sorry this popped up again - I remember it happened when the dotstar lib originally changed, but for some reason I didn't think to just freeze it. I hope to have a PR ready for tomorrow 🙂
You really wouldn’t even need to necessarily freeze it. Could just add a /lib folder with the .mpy version. That would allow for easy updates overwriting it with a newer version and the most minimal work on your end.
Just snag the .mpy out of the latest 8.x bundle, throw it in /lib and your all set to ship boards like that. Easiest way for you and us, to my knowledge.
Unless you’re doing something custom in the dotstar library? Seems the easiest way to me.
@dhalbert PortA/PortB/PortC pins are available externally through 4-pin Molex connectors (5V, GND, plus the two pins of the port as per pins.h). The other pins I've defined, such as the internal SPI (pins 12, 13, 14), the additional SPI pins used by the e-ink display controller IT8951 (pins 15, 23, 27), or the MOSFET hookup pins for power control (pin 5 for controlling power to the external ports, pin 23 for controlling the MOSFET supplying power to the IT8951 chip which also acts as reset,...
No tagging because this is the night in the US and Scott is in vacations...
I tried to replicate the MIDI Host Synth from tannewt, but on a Feather RP2040 USB Host (with I2S output): https://github.com/adafruit/Adafruit_CircuitPython_USB_Host_MIDI but I get very bad result in receiving Midi message over USB (they come a lot of seconds late). I know it works for Scott on that huge imx board but maybe there are unfixed things in TinyUSB, fix from TinyUSB not included in CP yet?
Of course it could by my keyboard... but it works well with PC and is detected by CP.
No issue yet as I should build a version of CP with TinyUSB debug if I want to know more... or have some special hardware to sniff the USB. I will just try again later.
I never looked in the top level. Duh. When I went to 8.2.2, I did an erase,
which must have eliminated the unwanted .py file, correcting the issue.
Thank you for your assistance.
On Mon, Aug 21, 2023 at 12:22 AM Unexpected Maker @.***>
wrote:
This was an otherwise new S2 I had in a drawer for a long time. I flashed
to 8.2.3 and it no longer ran the sample code that flashes the dotstar. At
this point /lib was empty, so I loaded the entire bundle into /lib. Still
bro...
CircuitPython version
Working:
Adafruit CircuitPython 8.0.5 on 2023-03-31; Adafruit Grand Central M4 Express with samd51p20
Board ID:grandcentral_m4_express
Not working:
Adafruit CircuitPython 8.2.3 on 2023-08-11; Adafruit Grand Central M4 Express with samd51p20
Board ID:grandcentral_m4_express
Code/REPL
import displayio
import rgbmatrix
import board
import framebufferio
from adafruit_bitmap_font import bitmap_font
from adafruit_display_text.lab...
@PaintYourDragon 8.2.3 is using https://github.com/adafruit/Adafruit_Protomatter/tree/ecab2fa75e9d7675785d2b87f29a22f027da8ce5, which is the fix commit just before the merge commit that is 1.5.10
Thought this might fix https://github.com/adafruit/circuitpython/issues/7682 but got this issue when installing CircuitPython 8.2.3 https://github.com/adafruit/circuitpython/issues/8303
@phantomsixthplayer Could you describe where you got the RGB matrices, with a link too? are they from us? If so, could you take photos of the box label(s), so we can see the batch?
@tulip sleet you may have noticed but the merge PR is now green. I worked a bunch on it over the week-end.
I very much did notice -- thanks!! Do you want to do a proper review now, or merge?
I really don't know how to effectively review it 😕 I mean, we can't possibly review every change upstream made.
I agree -- I mean would you take the time to go through each file to catch anything obvious, or it's not worth it.
I sort of did review the upstream changes, in the sense that I had to understand them and merge appropriately.
do you have a scheme for making an adafruit_circuitpython_asyncio that can run on CP 8.x or 9.x?
I think the updated asyncio might still be compatible for normal use. The exception-handling edge cases might be different, but that may not matter. If the issue is _asyncio differences, that is optional, and we can turn it off on one or the other.
@tulip sleet thanks for moving/centralizing ```make
Print out the value of a make variable.
https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile
print-%:
@echo $* = $($*)
We can have the 9.0.0 builds point to a branch for now, as it does in the current PR
yes though that doesn't help folks who use the bundle
we don't have a 9.0.0 bundle anyway, or we can special-case something in the bundle code. I'm not even sure we should build 9.0.0 bundles until the mpy version is not going to change.
But I think it's worth testing the changed asyncio against 8.x.x.
the changes were really all internal: the queue stuff was redone, but it's internally consistent. There aren't user API changes that I recall
+ File "extmod/uasyncio_gather.py", line 55, in <module>
+ File "/home/jepler/src/cp-pristine/frozen/Adafruit_CircuitPython_asyncio/asyncio/core.py", line 303, in run
+ File "/home/jepler/src/cp-pristine/frozen/Adafruit_CircuitPython_asyncio/asyncio/core.py", line 214, in create_task
+AttributeError: 'TaskQueue' object has no attribute 'push'
```doesn't seem to work, sadly
OK, this is due to _asyncio.TaskQueue native module differences. we could add compatibility code to check for . push() replaced push_head() and push_sorted() -- not sure why there were two.
I don't think we need to solve this problem yet. Let's get v1.20 merged, and use the branched asyncio for now, and include a warning to use the new branch version in the release notes.
This issue of needing incompatible library versions does keep coming up -- I have an issue in the bundle repo about it.
When we get closer to a 9.0.0 release, we can think about adding compatibility code.
OK
if we just turned off using _asyncio if the version was 8 or lower, that would work, later
it looks like adding hasattr() based check would work too
yes
but I don't think we need to mess with the main-line asyncio librarynow, it's too early to do that
pop_head() mapped to pop() is fine. I just don't know why push has sorted and head options.
@dhalbert I got my RGB matrices all from https://www.digikey.com.au/en/products/detail/adafruit-industries-llc/2278/7035036
For the RGB Matrix in the videos. I don't have the original box.
I do have another two spares I haven't tested yet.
![ma...
so I don't KNOW the answer but I think that it was an optimization. Sometimes you know a task is immediately ready (like when it has awaited a read, and the thing has become readable), so you can push_head so that it goes to the front of the queue. Other times it is based on time, and push_sorted figures out where to insert it so that it is correctly ordered according to the time it's intended to happen.
But having push_head is just an optimization, because you could just push_sorted it and it will naturally sort to the front of the list.
apparently they decided the optimization was not important
all that said, even in 8.x / MP 1.18, they were the same implementation: ``` { MP_ROM_QSTR(MP_QSTR_push_sorted), MP_ROM_PTR(&task_queue_push_sorted_obj) },
{ MP_ROM_QSTR(MP_QSTR_push_head), MP_ROM_PTR(&task_queue_push_sorted_obj) },
ha, so it would be easy to remap in the library
yes it would be
i don't know whether there are further changes upstream in v1.20 or later that would make a difference. At the rate we are going there may be a v1.21 soon.
it would be nice to pick up the "drop the u" changes before 9.0.0, for instance. That would clean up some things.
yeah
so yeah I think I'd like us to support both the old & new names in the core during 9.x, and in the lib use the old names. Then once we drop 8 from the bundle, we can use the new names and once we use the new names we can drop the compatibility names in 10.x.
but let's just leave it as it is for right now
leave the library as is or the class dictionaries in _asyncio?
@PaintYourDragon would it be helpful to have a tuning parameter that could be passed in, if it looks like getting a Goldilocks value is not possible?
see my comment just added https://github.com/adafruit/Adafruit_CircuitPython_asyncio/pull/47#issuecomment-1686478963 and let me know if it's clear what I meant
@onyx hinge I'm taking a walk for a bit
<@&356864093652516868> Reminder, the weekly meeting will be occuring here on Discord about 90 from now at 2pm Eastern / 11am pacific. The The notes Doc is here: https://docs.google.com/document/d/1DMsb91O4e6KFiV7sn0TroXW4g6Dr9yukYOOC_vaCMto/edit if you'd like to add your hug reports and / or status updates. We look forward to hearing from everyone!
CircuitPython Weekly Meeting for August 21, 2023 Here is the notes document for next 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 ...
Shoot, I’m testing with those exact matrices, just a later production batch…but on a MatrixPortal M4.
I see this is on a Grand Central board. What’s being used as a go-between? Shield, or jumper wires? Something might be introducing just enough capacitance on the clock line to skew it a bit late. 8.2.3 really should have spot-on timing, I’ve really been obsessing over this with a logic analyzer. That it worked before may have been two wrongs (timing and wiring) making a right.
@dhalbert T...
@phantomsixthplayer Could you show a picture of your wiring from the Grand Central to the panel, and a bird's-eye view of the back so we can see all the inter-panel jumpers?
@PaintYourDragon For tuning the number of NOP's (or whatever), looks like the CBZ and CBNZ instructions (short forward conditional jumps) and the somewhat weird IT (If-Then) instruction might help. I am not at all sure of how the timings on IT work out.
Oh also @dhalbert one more question - since this device comes with some integrated features (display, touchscreen, BMS, SHT3x sensor set, RTC controller, etc.), including some that require mandatory pre-init (e.g. pulling up pin 2 on boot to enable the main power rails)... Is there a way in CircuitPython to make an abstract instance of these features available?
I'm guessing that I could make the power-related init sequences part of board_init(void), but how would I e.g. add a generic tou...
@tulip sleet How would I go about checking to see if a file exists on storage? in CP. Same directory as code.py.
I assume os something or other, but I'm not sure what.
os.stat()
Cheers!
You need to catch FileNotFoundError. You could also just try open()ing it and catch the failure in your program
you can also do os.listdir() and check for it in the list of files
stat worked.
Oh ok
Thank you!
@onyx hinge are you available to read the core section of the state of CircuitPython for the meeting?
For the onboard I2C devices like SHT, touch, RTC, is there a separate on-board I2C bus, or is it shared with external pins? You can make multiple I2C buses that appear in board. See separate board.I2C() and board.STEMMA_I2C() in say QT Py RP2040.
But we don't provide board. instances for specific I2C devices.
Some folks with highly integrated boards or educational boards add board-specific libraries, sometimes frozen, sometimes not. You could do that if you want. CPX is our only...
Sorry, missing the meeting and poor quality report... but I was asked to start a BBQ (and now I am eating the result of it).
@lone axle yes I will read it!
Thank you.
It's 10pm. Do you know where your engineers are? Last time we did a video, we were mucking about with trying to get Linux running on an ESP32-S3 by compiling the shell script provided over at https://gist.github.com/jcmvbkbc/316e6da728021c8ff670a24e674a35e6 - we tried a few methods, and it got quickly into a yak-shaving mess https://www.hanselma...
Nice Todbot and Tyler!
amazing @devout jolt seems to have written MicroOSC just yesterday, after mentioning something about it on CircuitPython day.
Watching FoamyGuy use the tileset program was really interesting.
yeah, tiled saves so much time with tile based games
but xml :-(
oh yeah if other circuitpythonistas would like a gratis board from my Tindie, DM me your address and what you want 🙂
I also meant to specifically thank those who had good questions when we moved into the Q&A segments of the streams.
😂
You have to check every single silkscreen for the revision? oof.
There's a pic of the board on the product page that has the revision in it. And you have to be on the product page to get the rest of the info.
So, oof, yeah, but not as bad as it sounds.
Do they always update the images with new revs 100% though?
95% of the time.
And the OSHWA submissions can be updated if needed. So it's not a huge deal if it's not quite right.
Most of what foamyguy is going through are the new products though, so there won't be new revs yet.
good sleuthing, @midnight ember on that adafruit_dotstar.py issue! I was following that and omg
I'd be really interested in learning the # of boards that bug will end up affecting.
Only tested on 3 boards with S2/S3 and it failed on 8.2.2 and 8.2.3 on all of them with the requests library.
bodge life ❤️
@devout jolt ```py
import adafruit_ticks
from asyncio.core import SingletonGenerator
def deadline_ms(t, sgen=SingletonGenerator()):
"""Sleep until not ticks_less(t, ticks_ms())"""
assert sgen.state is None, "Check for a missing await in your code"
sgen.state = t
return sgen
import random
import time
import asyncio
async def periodic():
when = adafruit_ticks.ticks_ms()
i = 0
while True:
i += 1
await deadline_ms(when := adafruit_ticks.ticks_add(when, 500))
print(i, adafruit_ticks.ticks_ms())
await asyncio.core.sleep_ms(random.randint(10, 50))
asyncio.run(periodic())
On it.
yeah shoutout to JP for a really long day waking up early for everything.
even though it waits a random amount from 10 to 50ms each time, it still starts at about the intended time, and it's not drifting compared to the ticks_ms clock.
(the random wait is to simulate doing a variable amount of work)
The pretty pins diagrams are so nice just to look at. Appropriately named.
The 3D parts for Melissa's message board were also noteworthy. Great job on the enclosure design.
Sneak peek.
So pretty, well done.
Also a sneak peek of the silk. The images in the shop are of the prototype. 😉
I do love the N16R8 variants. It's just the right amount for any requests projects I can throw at it.
For the MilkV boards, is there Arduino core yet? That could really help
Makes sense, I'll try to run blinka on top and report back. Might be tight, and I also think that they are using linux as an example of what it could run. I am trying to compare it with an m7, but using linux directly might be easier.
And sure, let me know anyone who might be interested in playing with such a hardware. Thanks for the notes jeppler, todbod and dan.
iirc the issue was that the dac wasn't supported in the idf yet
Ohh DAC's would become available on most ESP boards possibly?
right. no DMA to DAC
I'll research that.
Do the library owner need to do something, like make a new release? Who/what does compile the new mpy version?
it's automatic when the bundles are rebuilt
Any kind of timeline left for 9? I still have a lot of requests libraries to update with settings.toml but currently can't do it with 8.2.3 until that bug gets fixed.
which bug?
Wait for 8.2.4?
thanks! yep, please keep the lib bundle version -to- CP version number mapping nice and simple (even if redundant, like 7 and 8 are same etc)
This will happen.
Thank you for hosting @lone axle with the numbers in the name.
Thanks
It's started off as a matrix portal bug then turned into an adafruit requests bug.
@lone axle I'm good whenever. I assume you want to get the post-meeting bits done?
I don't think you meant this one?
I have a question... I added Wii Drums support to https://github.com/jfurcean/CircuitPython_WiiChuck , it is accepted in main. But to be present in it's new version in the bundle, do I need to ask @gloomy shuttle to make a new release of the library?
Yep, I'm going to do the wrap up things and grab a snack. I'll let you know once I'm done with that.
yeah fixed wrong one
yes ugh posted the wrong one again. it's 8299.
ohh you changed the name that's why i didn't recognize it. thank you for that. i was thinking of changing the name after it shifted to a broader issue.
I think #8299 is some cert problem. Brent is looking at it. I have some testing in mind but may not have a chance to do it right away
I want to build a fresh set of certs and use those instead of the ones from NINA-FW 1.7.5.
it's a bug that potentially affects all S2/S3 boards running adafruit_requests on 8.2.2 and 8.2.3
who might i talk to, for more information on how mp_stack_check() and allocate_stack() are meant to work?
i'm not sure it's a NINA issue unless NINA is pre-programmed on the non-coprocessor modules on feathers.
it means you can't connetc to certain sites, but I don't think it has anything to do with basic wifi functionality, so it shouldn't hold up settings.toml changes. 8.2.1 would work
we use the cert list from the NINA-FW build. We don't use the firmware. We use the roots.pem file that's in that repo
haven't tried with a board using a co-processor yet
Scott is best for that, but he is afk until Wednesday
ah
sorry that's above my head. i'm just good at breaking things.
Did you try backing out the change in the most recent commit that changed it?
i havent had a change to bisect yet, i justspammed printfs until i found the root cause
let me see what git history says for those 2 files...
yes bisected it to it beginning in 8.2.2
8.2.2 is JUST cert changes
8.2.1 works fine but that's not going to help anyone updating to the latest version from circuitpython.org/downloads
@buoyant lagoon check the stack-checking changes in this commit: https://github.com/adafruit/circuitpython/commit/66edcf5d034432519aac18690806adad2cacf2ac
deshipu narrowed down some other issues to this commit
too many @clever usernames
dang, ~4 of em, no wonder i have 3 _'s on my name, lol
thats just a minor change, to query where the top&bottom are and set the globals
discord hasn't offered you a unique username yet, I guess 🙂
but the problem i ran into, is that allocate_stack() allocates a whole new stack, sets the new bounds, then doesnt use it
and because the stack isnt within those bounds, i'm using -167mb of the stack
underflow!
that could be a long-standing bug then
i was also unable to disable stack protections
if i change MICROPY_STACK_CHECK in the config file, it fails to compile
something about a .x not existing
@slender iron is the right person for that - the rest of us have little experience with the broadcom port
the weird thing, is that the faulting code, is mostly shared, let me find the URL...
that looks like something that would run on many ports
gated only by port_has_fixed_stack()
atmel-samd, litex, nrf, rp2040, stm, all appear to have dynamic stacks
so i'm confused as to why only the broadcom port is breaking
Yes, Adabot will verify the tag generated in the new release and include it in the bundle automatically.
is there better documentation on how the stack is meant to be handled in general, like what allocate_stack() should be doing, and how it switches stacks?
less in the port specific stuff, and more how to make/maintain a port
no real doc, no, just the examples of each and every port
is port_has_fixed_stack true or false?
https://github.com/adafruit/circuitpython/blob/main/ports/broadcom/supervisor/port.c#L126-L132
bool port_has_fixed_stack(void) {
#ifdef __aarch64__
return true;
#else
return false;
#endif
}
false on 32bit, true on 64bit
pi-zero is 32bit
changing it to always true breaks things differently
maybe cpu_get_regs_and_sp() is returning an incorrect sp for some reason? I would just plow through the code, sorry.
ports/broadcom/mphalport.c:mp_uint_t cpu_get_regs_and_sp(mp_uint_t *regs) {
oh, interesting
the broadcom port has its own implementation of that...
Here is the notes document for next 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/1j5Pv4_oJHyVMV9M9QQvvpCHj0E4yjOM3AaDDe58oDsU/edit?usp=sharing
CircuitPython Weekly Meeting for August 28, 2023 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you can’t make the meeting and would still like to par...
__asm__ ("mov %[out], sp" : [out] "=r" (sp));
its just inline asm, fairly standard stuff, should just work
but this is only reading sp, it cant change the active stack
so i dont see how allocate_stack() could ever switch to it
i don't think it is allocating a new stack to switch to, it is reserving a chunk of memory for the current stack, so that further allocations can be done below the "top" of the stack (going down)
no big switch to a new stack is going on. Stack just starts at a place in RAM and grows down, and we need other space too, so figure out how big the stack should be, set a limit on its size, and then use the rest of RAM below that for heap and other thigns
ah, that would imply that in the "fixed" stack case, its just at a hard-coded location
but in the "dynamic" stack case, something in boot.S picked a value dynamically, and you have to figure out what, and mark it as used so the heap doesnt step on it
yes, I think so
so i was mis-understanding the code
it is really "set limits on stack size"
i'll take another stab at it, from that angle
@idle owl okay, I am good to go any time.
that implies that its just mis-detecting where the stack is
oh, but there is also a second kinda more major bug
it reserves some extra space for the exception stack
then recursively faults while throwing the exception
so it can never actually say it ran out of stack space
@dhalbert the internal I2C bus is on pins sda:21 scl:22 - the external I2C is on pins sda:25 scl:32.
I've tried to be descriptive with the naming, as you can see GPIO25 is assigned to the PORTA_SDA name, and GPIO32 is to PORTA_SCL (and similarly the UART external port pins are named PORTC_RX and PORTC_TX).
For internals, I just relied on the standard naming of SDA and SCL for I2C, and MOSI, MISO, SCK for SPI (with the e-ink controller getting the IT8951_CS, `IT8...
Ok, let's do this. Want to do it in the public channel? We can vid and screenshare from there. Jeff and Dan do it regularly for the CP core issue sweeps that way. No worries if you'd rather do DM. Figured I'd offer both.
Yep, sounds good to me. I'll hop in Amelia.
The STEMMA_I2C object here is a second I2C bus:
https://github.com/adafruit/circuitpython/blob/506dca71b0cbb7af749bb51f86b01021db5483b3/ports/espressif/boards/adafruit_qtpy_esp32s2/pins.c#L58-L61
The two buses are created here, with their pins specified. Note the (2):
https://github.com/adafruit/circuitpython/blob/506dca71b0cbb7af749bb51f86b01021db5483b3/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h#L35-L37
The extra singleton for board.STEMMA_I2C is defined at the to...
CPX and CPB are Circuit Playground Express (SAMD21) and Circuit Playground Bluefruit (nRF52840) -- sorry!
@tulip sleet oh, i just found comments, in exactly the place i was going to add some!
https://github.com/adafruit/circuitpython/blob/main/supervisor/port.h
// Get stack limit address
uint32_t *port_stack_get_limit(void);
// Get stack top address
uint32_t *port_stack_get_top(void);
// True if stack is not located inside heap (at the top)
bool port_has_fixed_stack(void);
// Get heap bottom address
uint32_t *port_heap_get_bottom(void);
// Get heap top address
uint32_t *port_heap_get_top(void);
Python docstrings and readthedocs question: where do I find documentation on how to do more complicated docstrings for Python methods/classes? I'd like to describe some function args in more detail and I'd like more structure than just paragraphs of text. When I try to do things described here: https://dev.to/zenulabidin/sphinx-docstring-best-practices-2fca, sphinx errors out
I usually just go straight to the sphinx documentation. sphinx is a slowly-moving target, and I find its syntax leaves something to be desired.
and reading things closer, i can now see why aarch64 broadcom claims a "fixed" stack
the firmware loads the kernel8.img to 0x80000 (512kb) (i think, might be mis-remembering)
and rather then waste all the space below the kernel, circuitpython puts the stack in that hole!
but 32bit broadcom loads the kernel lower by default, so you instead put the stack at the top of ram
however, that is ignoring config.txt, and the fact that you can just load the kernel anywhere
with just 1 line in config.txt, i could have both 32bit and 64bit loading to 1mb (0x100000), and then just have a fixed stack below that, in every case
Ooooooooof. Welcome to Sphinx. 😕 If you're still super stuck after whatever you find, ping me. I might be able to help? Sphinx and I have fought many a time. I don't win every time. 🙄
Thanks yeah I've been there too but have not had much luck. I'm just trying to add an unordered list to a function docstring
Here's an example:
def do_something(good_arg, better_arg):
"""Do something amazing with args
Args should be:
* pretty good
* or better
* but no bad args or excellent args
:param string good_arg: the gooder arg, may not be bad
:param string better_arg: the better arg, may not be excellent
"""
pass
(the "errors" would be if I didn't use the exact right amount of whitespace between lines or at the beginning of lines, so not important, just frustrating). In this example, I would like the bullet list to render as a visible bullet list but instead it renders as paragraphs. The HTML appears to be appropriately <ul><li><ul> but no bullets. If I try to add bullets, sphinx just removes them
There are unordered lists (with -) in shared-bindings/digitalio/DigitalInOut.c and shared-bindings/_bleio/UUID.c. Maybe how they do indentation would help
weird so why does that render with bullet points but mine does not
but thank you, I'll investigate
Whitespace.
ag;lgehg=afh3hgawheghag
@devout jolt Sphinx is the worst about whitespace.
or could be CSS when you're inside a Parameters list
One space here, and suddenly it formats everything as code, or fails completely.
in general parameters are not listed in an unordered list
I feel seen.
oh weird, for some reason the cookiecutter setup I got doesn't render bullets at all in the param lists: https://circuitpython-microosc.readthedocs.io/en/latest/api.html
@onyx hinge I can do smoke tests on representative boards starting now, unless you have already done some
on all ports
ah, found setup_mmu_flat_map(); in the port.c, that answers that question
but where is that defined?
ports/broadcom/peripherals/broadcom/mmu.c:STRICT_ALIGN void setup_mmu_flat_map(void) {
ah, git grep ignoring submodules as usual
and it works!
@tulip sleet no I didn't get out any HW. I was working on asyncio. do you have a sec to consider https://gist.github.com/jepler/de50fe9c89fab489c9fe9a53a997c68b ?
I will push it to that PR branch if this looks like what we agreed on. I tested with main & with the 1.19 branch
and then I'll update the big PR too
it looks good, exactly what we were thinking about. I just tested 4 boards, have 9 to go. It's very quick
OK done
I saw your commit messages and I feel your pain
have you ever had readthedocs.org give a "no theme named 'sphinx_rtd_theme' found" error? I had to add "sphinx_rtd_theme" to my docs/requirements.txt in my latest library, which I've never done before and haven't seen anyone else do
they have been making changes to their build process and requiring a lot more things to be explicit than before. so not that specifically but I guess I'm not surprised.
did you pip3 install -r requirements-doc.txt
We use it. So, I always have it installed. 😕
@devout jolt what were the socket constants that were needed for the UDP thing?
sorry I mean when building the docs on readthedocs.org
Oh hmm.
No, I haven't run into that.
from the code I'm currently dinking with
if impl == "circuitpython":
# these defines are not yet in CirPy socket, known to work for ESP32 native WiFI
IPPROTO_IP = 0 # super secret from @jepler
IP_MULTICAST_TTL = 5 # super secret from @jepler
else:
import socket
IPPROTO_IP = socket.IPPROTO_IP
IP_MULTICAST_TTL = socket.IP_MULTICAST_TTL
@devout jolt and you were using which micro?
When FF_MAX_SS != FF_MIN_SS, access to vfs->fatfs.ssize is needed to keep track of block size. However, the current code incorrectly refers to vfs->ssize rather than vfs->fatfs.ssize, resulting in a compilation error whenever MICROPY_FATFS_MAX_SS is set to anything different than FF_MIN_SS.
while using circuitpython on a pi-zero, i discovered that the stack code code was broken
32bit was operating in dynamic stack mode, but reporting entirely wrong addresses for things
but i noticed, aarch64 on the broadcom port, puts the stack below the kernel load addr
so i just used kernel_address=0x100000 to change the load addr, for both 32bit and 64bit, raising it up a bit more
and made both 32bit and 64bit both have the stack below the kernel, allowing for the code to be simpler
@tulip sleet and there is my initial fix, but i can see how its changing some files that people may not want to change...
I will assign it to Scott to review
hi, I've found a little compilation issue than arises when using the FAT fs with a block size other than 512 bytes: https://github.com/adafruit/circuitpython/pull/8304
ive also only tested the build on a pi-zero, but i made changes that impact the pi3/pi4
makes sense, thanks! CircuitPython doesn't currently exercise this code path in any official builds but it's nice to have the problem fixed.
do you either or both to test?
i do have one of everything in the entire model range
Thanks! - we will review
we would certainly want to test on other affected hw, so go ahead now if you have time
youve also given me an idea on a further change to the makefiles
ESP32-S2 and ESP32-S3
its possible to make a single sd card image, that works on every pi model
shal i throw that into the same pr, or keep it for another pr?
keep that separate, since it could hold up review or approval
now i need to find a better uSD for testing...
This was verified by @todbot to work on esp32 s2 and s3; the constant should match any system that uses LWIP numbering.
It enables use of multicast UDP and gets rid of the need for this block in https://github.com/todbot/CircuitPython_MicroOSC/blob/main/microosc.py#L55:
if impl == "circuitpython":
# these defines are not yet in CirPy socket, known to work for ESP32 native WiFI
IPPROTO_IP = 0 # super secret from @jepler
IP_MULTICAST_TTL = 5 # super secret from @jepl...
root@d235fe3c2fdb:/circuitpython/ports/broadcom# for b in raspberrypi_pi4b raspberrypi_zero2w raspberrypi_zero_w; do make BOARD=$b ; done
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR not updated
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR not updated
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR not updated
root@d235fe3c2fdb:/circuitpython/ports/broadcom# ls */*.zip -lh
-rw-r--r-- 1 root root 13M Aug 21 21:07 build-raspberrypi_pi4b/firmware.disk.img.zip
-rw-r--r-- 1 root root 13M Aug 21 21:08 build-raspberrypi_zero2w/firmware.disk.img.zip
-rw-r--r-- 1 root root 13M Aug 21 21:08 build-raspberrypi_zero_w/firmware.disk.img.zip
these are the 3 main ones i can test
@onyx hinge one odd build thing I noticed while testing is that some of the artifacts have all languages and some only have english. I know microdev set it to build only en_us, but it doesn't seem to be consistent. Not sure if that is new or not. It might be uf2 vs not, i haven't investigated yet
i can confirm, the raspberrypi_zero_w works on the zero-w, usb-device, help() in the repl, and hdmi out
that image also boots on the pi-1b, and generates the same hdmi
but usb-device isnt possible (board is wired for host only), so thats as far as i can test that model
ive written a dwc2 HCD in another kernel, so pi1b usb-host could be a future possibility
then you just plug in a usb keyb and go to work!
raspberrypi_zero2w is next, thats aarch64, so its covering what i didnt test, but is largely the same
we are doing work in other ports on usb host, as you have probably seen
yeah
i briefly tested the pio-usb on a pico
still need to investigate the double-setup issue tannet had
among the github artifacts? I don't see anything that would immediately explain that.
yes, and it is not uf2 vs bin
maybe it is initial push vs subsequent, but not sure that makes sense
if you look at the log of an affected board does it build the translations?
haven't looked yet; doing the last board and then I'll look
all boards test fine except Spresense, but there is some version skew with the bootloader, so I'm not sure it has anything to do with this.
Adafruit CircuitPython 8.2.0-46-g01595c900-dirty on 2023-08-21; Raspberry Pi Zero 2W with bcm2837
>>>
>>> help()
Welcome to Adafruit CircuitPython 8.2.0-46-g01595c900-dirty!
Visit circuitpython.org for more information.
To list built-in modules type `help("modules")`.
@tulip sleet zero2w also works, so i expect pi3 to also work...
cp0_sapling_m0_revb built all langs, cp_sapling_m0_spiflash said "Skipping languages" in the Build board step, and built only English
sorta, hdmi is blank
as an example
@tulip sleet there's some logic that leads to this: tools/build_release_files.py: print("Skipping languages")
try:
with open(
f"../ports/{board_info['port']}/{build_dir}/firmware.size.json", "r"
) as f:
firmware = json.load(f)
if firmware["used_flash"] + LANGUAGE_THRESHOLD < firmware["firmware_region"]:
print("Skipping languages")
break
I tried the other two panels I have and have the same issue.
@phantomsixthplayer Could you show a picture of your wiring from the Grand Central to the panel, and a bird's-eye view of the back so we can see all the inter-panel jumpers?
I have labelled the components that are connected when I recorded the video.
oh, it skips big ones
"if the build has plenty of room don't bother building other languages"
ok never mind
>>> ��Serial console setup
allocate_stack()
fixed stack
setting canary
allocate_stack() done
stack_init() done
Adafruit CircuitP
hangs mid-boot, but its not a supported model, so i can skip it for now
i forgot about the conditionalizing about the builds, to catch overflows
that just leaves the 4
@onyx hinge Anyway, all boards are fine except spresense, so I'd say let's merge after any further updates
we would want the updated asyncio library submodule, that's it, I think
OK! thanks so much for testing. sitting down and iterating through a bunch of boards is a discipline I just can't find on any given day.
pi4 is failing
@tulip sleet pi4 boots and has a working repl on hw uart
but usb-device isnt working, dont think i did that
hdmi is also not working
Tested on a bunch of representative boards. Not tested on broadcom or silabs. Spresense failed, but I think that may be an SDK version skew problem, not necessarily related to this PR. All others passed a simple smoke test: random program running or microcontroller.cpu.temperature.
It's ready! .. for others to test
@onyx hinge - should we merge, or wait until some number of people try the artifacts?
Meeeeeeerrrrrrrrrrrrge.
(I'm not the one you asked.)
i understand your sentiments 🙂
I mean, when it comes down to it, we're breaking things, and so on. We might as well get it out there and find out what else we broke.
Folks are far more likely to test main than a PR.
And it's already not even alpha. So we're not making any guarantees.
So, while I'm being silly about it, I do have reasons for the sentiment. 🙂
@onyx hinge I'm happy to merge now - I agree a build in S3 is worth many in artifacts
CircuitPython version
Any raspberry_pi_pico_dv_base firmware, including 8.2.3: adafruit-circuitpython-pimoroni_pico_dv_base-en_US-8.2.3.uf2
But also 8.1.0 and a few other (see below).
Code/REPL
none
Behavior
n/a
Description
I think there is something broken with the "Pico DV" (from Pimoroni) specific CP image (from https://circuitpython.org/board/pimoroni_pico_dv_base/ ).
I don't see the CIRCUITPY drive after flashing two of my Pico (not ...
Merge!
Reading this, I believe that the problem is known: https://forums.pimoroni.com/t/adding-circuitpython-support-for-pico-dv/22012
I wonder in what version it ever worked, to see when it started to break...
The issue on the Pimoroni forum was that the Pico W doesn't work without a bodge to CP, the Pico was working just fine last time I tested. I'll pull the latest bits and check it out.
The issue on the Pimoroni forum was that the Pico W doesn't work without a bodge to CP, the Pico was working just fine last time I tested. I'll pull the latest bits and check it out.
Yes please, have a look... I am going crazy with this, I was planning a quick sound test before sleeping and fighted for more than 30 minutes.
Now checking Tod guide and pinout of the Pico DV Base... to at least have a beep. :-)
common_hal_picodvi_framebuffer_construct() started interpreting its width and height differently, I think. I changed the arguments in board.c to 320 and 240 from 640 and 480, and the board is now coming up. I will post a test .uf2 in a minute.
- Fixes #8307
@dglaude @RetiredWizard
The DV Base uf2 you posted does boot up with DVI output for me. My build machine is fighting me so I haven't yet checked out the failing builds.
I don't see any video on my 1920x1200 monitor with DVI, but I've never tried this before
oh, now it's working, some old code.py was making it not work
That was fast, now I have sound and image. I plan to play more synthio with that setup as my DIY solution is a bit fragile (and loud) with my speaker attached.
Time to sleep.
Works for me as well, Thanks!
my remark about other people testing meant I wanted it merged.
Did #7922 merge into a branch other than main and recently get moved? I could have sworn that I ran the DV base with a current build in late July, but #7922 was back in April. Just hoping for explanation other than losing my mind :/
Maybe I only attempted a Pico W build (which I didn't really expect to work anyway). I should probably try that built again now that this fix is known 😄
#7922 got incorporated into 8.2.0, which was built from main. So I don't think you are losing your mind. 🙂
maybe you were testing with manually created displays?
Not sure, maybe I had some stale code, but probably just never built the standard Pico version since the question came up about the W. Good news though, with your resolution fix, the Pimoroni base does seem to build for the Pico W now. I'm going to do some more testing and hopefully submit the PR 😄
Now I just have to remember how to create a CP branch in my MicroPython fork.... :/
The merge doc build is failing in a weird way: https://github.com/adafruit/circuitpython/actions/runs/5932484043/job/16088305509#step:8:1
@tulip sleet I'll look into it.
@tulip sleet it's because of this line I added, which makes it try to "call into" esp-idf build routines when parsing Makefile ... PR builds didn't catch it because a change to a platform Makefile doesn't cause docs to be built.
Makefile: $(BUILD)/esp-idf/config/sdkconfig.h
aha - yes I looked at olde builds, and never saw docs being built
ye olde builds ? 🙂
missing "r" there
the Makefile:... version broke the shared bindings matrix generation, as it would fail if esp-idf wasn't in the environment (and we wouldn't want it to do that much work anyway)
but of course this won't TEST doc building during the CI 😕 @tulip sleet if you tested doc building locally did you get the error?
let me try again, I think it was fine
it was fine before i merged from upstream, I think I didn't have your change
fails in the same way make[1]: *** [Makefile:358: build-adafruit_feather_huzzah32/esp-idf/config/sdkconfig.h] Error 1 plus a lot of previous stuff
I think this is because esp-idf/export.sh was not run?
it shouldn't have to be
I need to clean this up a bit, brb
this multiple times:
raceback (most recent call last):
File "/home/halbert/.local/lib/python3.10/site-packages/sphinx/config.py", line 354, in eval_config_file
exec(code, namespace) # NoQA: S102
File "/home/halbert/repos/circuitpython/conf.py", line 54, in <module>
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()
File "/home/halbert/repos/circuitpython/docs/shared_bindings_matrix.py", line 378, in support_matrix_by_board
[board for matrix in mapped_exec for board in matrix], key=lambda x: x[0]
File "/home/halbert/repos/circuitpython/docs/shared_bindings_matrix.py", line 378, in <listcomp>
[board for matrix in mapped_exec for board in matrix], key=lambda x: x[0]
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator
yield _result_or_cancel(fs.pop())
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel
return fut.result(timeout)
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
return self.__get_result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/halbert/repos/circuitpython/docs/shared_bindings_matrix.py", line 306, in support_matrix
settings = get_settings_from_makefile(str(port_dir), entry.name)
File "/home/halbert/repos/circuitpython/docs/shared_bindings_matrix.py", line 192, in get_settings_from_makefile
raise RuntimeError(error_msg)
RuntimeError: Invoking 'make -C /home/halbert/repos/circuitpython/ports/espressif -f Makefile BOARD=adafruit_feather_huzzah32 print-CFLAGS print-CIRCUITPY_BUILD_EXTENSIONS print-FROZEN_MPY_DIRS print-SRC_PATTERNS' exited with 2: make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
CMake Error at esp-idf/tools/cmake/project.cmake:296 (__project):
The CMAKE_C_COMPILER:
xtensa-esp32-elf-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
CMakeLists.txt:19 (project)
or it may depend on whether the esp-idf submodule is populated
it is populated in my tree
but it shouldn't have to be, to just build the docs
now I did esp-idf/export.sh, and it is running a zillion cmakes
well, 12
now make
it did a whole espressif build in the middle of building the docs
It does invoke make a bunch of times, to get make's final idea of what the makefile variables are
but it shouldn't "do" anything like generate targtets; my hasty change cuased it to do that
it took a long time to do that
take a look at the PR I opened
yeah it's not fast even when it's not messed up. unfortunately.
why do we need that?
or more precisely, why did we not need it before?
why is it descending into ports/espressif/Makefile at all?
we did need it before. make is our configuration language for boards, so the only ultimately accurate way to get information about which modules are enabled is to invoke make and inspect its output (things like make -C ports/... BOARD=... print-CFLAGS
so did it used to do this before, but more quickly?
what I broke is that with my change in ports/espressif/Makefile, make print-CFLAGS caused a lot more work to be done, including work that required esp-idf environment to be set, ran cmake, etc.
ah, ok, so it should be back to how it wsa before?
this e.g., time make -C ports/atmel-samd/ BOARD=trinket_m0 print-CFLAGS is about 150ms, but when you multiply that by all the boards it is a substantial amount of work
i have an old repo of adafruit/circuitpython from before this merge, I just did a time make html. Will do the same in your PR barnch.
OK
no problem: just about a minute for either old or the PR. So I'll approve the PR
also should monitor https://readthedocs.org/projects/circuitpython/builds/21678598/
which just failed 😦 😦 ```
[2Kreading sources... [ 1%] BUILDING
[2Kreading sources... [ 1%] CODE_OF_CONDUCT
[2Kreading sources... [ 2%] CONTRIBUTING
[2Kreading sources... [ 3%] README
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/circuitpython/envs/latest/lib/python3.11/site-packages/sphinx/events.py", line 96, in emit
results.append(listener.handler(self.app, *args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/circuitpython/checkouts/latest/docs/rstjinja.py", line 13, in rstjinja
if "shared-bindings/support_matrix" not in docname:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
The above exception was the direct cause of the following exception:
bleh
OK I get that when upgrading to current sphinx. I previously had 6.2.1, current is 7.2.2.
The following error would occur otherwise
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/circuitpython/envs/latest/lib/python3.11/site-packages/sphinx/events.py", line 96, in emit
results.append(listener.handler(self.app, *args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/circuitpython/checkouts/latest/docs/rstjinja.py", line 13, in rstjinja
if "shared-bindings/su...
was it returning "" before? I guess it's an easy fix.
I'm not 100% sure
will want to fix this in 8.2.x as well, maybe don't merge that? but I'm done for the night.
in fact let's not use that fix
I was just thinking that
we have a pile of stuff to merge up from 8.2.x to main anyway
I want to do this differently, and 8.2.x needs the fix as well.
there are some conflicts including in this file.
tomw I think I will do a little more asyncio testing with 8.2.x and the updated library
in 8.2.x I added the ability to tag a doc file content to say "I want jinja templating to run on this file". The "check for substring of path" can be removed once we add that mark to shared_bindings_matrix.rst or whatever it's called.
origin/8.2.x:shared-bindings/busio/__init__.c://| .. jinja
Checked the values are correct and was able to build/test (UM FeatherS2):
import socketpool
socketpool.SocketPool.IPPROTO_IP
0
socketpool.SocketPool.IP_MULTICAST_TTL
5
.. and remove the substring check for the file.
this fixes the problem with sphinx 7.2.2 that the "docname" can be None (see https://github.com/sphinx-doc/sphinx/issues/11620)
It looks to me like the micropython 1.19.1 merge may have applied some of the leading 'u' to module names. I don't seem to be able to import json anymore but ujson works.
CircuitPython version
Adafruit CircuitPython 8.2.3 on 8/21/2023; DOIT ESP32 Development Board
Code/REPL
import analogio
from board import *
pin = analogio.AnalogIn(D32)
print(pin.value)
pin.deinit()
Behavior
Resulting value is always 2819, regardless of whether pin is floating or connected to a sensor, 3v3, or GND
Description
Tested on a few analog pins, all behave the same. Using pin D32 because no analog pins appear in dir(board)
#...
Many MCU ADCs need a few initial reads to start working correctly. What happens if you change your code to something like:
import analogio
import board
import time
pin = analogio.AnalogIn(board.D32)
while True:
print(pin.value)
time.sleep(0.2)
Using the exact code provided I'm just getting repeated readings of 2819
CircuitPython version
Adafruit CircuitPython 8.2.0-80-g282e93d3e3-dirty on 2023-08-22; Pimoroni Pico DV Base W with rp2040
Code/REPL
import json
Behavior
Traceback (most recent call last):
File "", line 1, in
ImportError: no module named 'json'
Description
Entering
import ujson
works fine
Additional information
I looked through the extmod directory and looked for other modules that might have the same issue and di...
I ran into the same problem when writing some tutorials.
In order to display the degree character in builtin font, I wrote a small wrapper that tries to load the character from an external birmap font when the character is not found in builtin.
Then I extracted the degree glyph in FontForge from https://github.com/adafruit/circuitpython/blob/70ce576390c7b21007b1f75f16e6fc591c0f61d7/tools/fonts/ter-u12n.bdf and created tiny bdf file contains only that glyph.
import terminalio
fr...
split from https://github.com/adafruit/circuitpython/issues/7919#issuecomment-1560795024
allow for arrays for pull and value_when_pressed -
so we can use the same object for all three buttons -
i came across this need for the Adafruit ESP32-S3 Reverse TFT Feather
as on these Button D0 is opposite to D1 & D2 for the sake of deep-sleep wake-up..
this is found on the following boards:
- [Adafruit ESP32-S2 Reverse TFT Feather](https://www.a...
I have not tested, and not everything is super clear for me to identify main vs 8.2.x artifacts in the S3... but shouldn't this #8309 also be applied to main so that the problem does not reappear in 9.0.
What is the opposite of backporting... forwardporting?
Brilliant, thanks @dhalbert. I'll be pushing the changes to reflect these details soon.
Also thanks for pointing me at the CPX/CPB boards, the way frozen libraries are handled is really straightforward now that I see an example. I think the best way forward would be to add the necessary drivers to a separate repo, and add that as a submodule, then finally add them as frozen modules to this board. I understand that this wouldn't necessarily be the preferred way of doing things, but since...
split from https://github.com/adafruit/circuitpython/issues/7919#issuecomment-1561834487
allow for digitalio.DigitalInOut, adafruit_tca8418.DigitalInOut, adafruit_74hc595.DigitalInOut and the like.
This way we can remove shift register scanner from keypad library altogether without losing shift register support and still gain support for shift register or mixed matrices.
usage idea - all these examples should work..
based on [tutorial one button](https://learn.adafruit.com/key-pad...
i created two feature-requests out of these comments here..
i think - as @regicidalplutophage already formulated - especially #8316 would solve a bunch of things..
also half of #8315
Thanks for noting this. This is a regression from the merge. I will audit the other MP_REGISTER_MODULE sites.
@dhalbert @tannewt quick question - since this board seems to have a metric 💩 ton of SPI and I2C definitions, would it be safer to not define them as specific numbered ports (i2c0, spi0, etc.), and just let the user configure those when needed? Since there's no extra hardware that needs management, I see no point in enforcing a specific port order on any of the pins.
@tulip sleet I notice that uncrustify.cfg changed, presmuably due to the 1.19 merge? ```diff
-sp_after_comma = ignore # ignore/add/remove/force
+sp_after_comma = add # ignore/add/remove/force
must be - I didn't change that. That would explain all those changes. I prefer the 'add'
I do too
I am doing a lot of stuff to fix #8314, removing u a bunch of places, including in ports/unix tests and stuff. Also removing unused tests like usocket, etc. to reduce the number of skipped tests
OK, that sounds good.
it's jumping the gun a bit on what will be in v1.21. I am not renaming the files to drop the u. The merge can do that.
there's supposed to be code in the import path that allows import json to pick up ujson, but it must not be working in cp; but we also want help() and import <tab> to work
that works in micropython-coverage but I guess not in circuitpython per the user report?
True
I'm not sure where the extra module defs were, but just making (almost) everything not-u is working. There are testfile changes, but those will start matching micropython by v1.21
so coverage is not going to be special here either. We still need moduos for certain things
what I'm saying is, in the testing environment import json works
so it's weird that it didn't work on devices
ah it's subject to #if MICROPY_MODULE_WEAK_LINKS
aha, ok, well, I am removing import ujson as possible now, and changing the tests to match
that's fine by me
Approved based on other users test reports. Low probability of adversely affecting anything else.
I think there are some good ideas here! Thank you for raising this feature request.
That said, I'd like to give some context on why this is implemented as it is.
It's worth acknowledging that the implementation that is ONLY compatible with a microcontroller.Pin object is certainly the easiest implementation! and that is no doubt part of why it's that way.
Another less obvious thing about keypad is that the scanning happens in what we call the "background task" context. At the mom...
- Fixes #8314 and then some
There were some accidental reversions to u-prefixes due to MP_REGISTER_MODULE() changes. But some tests still depended on u prefixes. I took the leap of removing all the u prefixes, getting most of the way toward https://github.com/micropython/micropython/pull/9069, which does the same thing in MicroPython.
- Removed conditional
import ufoo as foostuff in the tests. This happens in https://github.com/micropython/micropython/pull/9069. - Removed `t...
@jepler Thanks for the comments.
A few more comments:
keypad is implemented in C to do the background scanning and debouncing. The debouncing in particular requires low latency. For TouchIn, and maybe even shift registers, scanning could instead be done in CircuitPython code. Right now there isn't a clean way to do this, but if the EventQueue were made more general so that events could be added from Python, I think that would help. Then we could add keypad-style libraries coded in...
Fixed by #8309. @dglaude -- yes, this will be merged up to main. It's actually quite a bit easier to merge from x.x.x to main, in general. There's a PR in progress to pick up a bunch of 8.2.x changes: #8317.
I am not sure why these are in quotes. It's not a "pretend" clock pin, which is sometimes what putting something in quotes means. I think you could drop the quotes. Also I would say "matrix" instead of "display".