-
Notifications
You must be signed in to change notification settings - Fork 971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pioasm: assembly of wait 0 gpio 34
seems dubious
#2141
Comments
Looking at section 11.4.3. of https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf shows that Looking at https://github.com/raspberrypi/pico-sdk/blob/develop/tools/pioasm/pio_assembler.cpp#L394 it seems that it does keep track of which GPIOs are being used, so I guess the part of (This is all just my educated guess - I could be entirely wrong! 😂 ) |
without presuming how the implementation should look, I thought of two possibilities: First, that the encoding in The second one is what I understand from your reply: when pioasm gets to the output stage, and the high gpio range is marked as used, it outputs |
I see there's a file
but I don't see if this is part of an automated test suite that can be run, or whether there's an expected output. However, it looks like someone did at least check that pioasm accepts these high pin numbers in |
Hi! Over in CircuitPython I'm working on proper support for the high IO bank on the RP2350B.
As part of that, I think I've found a problem in pioasm and maybe
add_program_at_offset
.I have the following (useless) pio program:
pioasm from 2.1.0 (& tip of develop, 2.1.0-6-g969f589) compiles it to the following:
Notice how the instruction encoding 0x2022 is used for both the
wait gpio
andwait pin
, and the instruction written aswait 0 gpio 34
has decoded to the impossible (?)wait 0 pin, 34
.I'm not sure what needs to happen here. I am pretty sure that at runtime you need a PIO peripheral with its gpio_offset set to 16, and that the instruction encodings loaded into
instr_mem
should actually be0x2002
(gpio 16+2 = 18) and0x2012
(gpio 16+18=34). but I don't know whether this should be the encoding in theprogram_instructions[]
array, or ifadd_program_at_offset
in the sdk should take care of altering thewait gpio
instruction encodings similar to how it altersjmp
encodings depending on the load address.This bears directly on how we implement this in CircuitPython, since we want to use
pio_add_program
and friends to load the instructions into the PIO peripheral, but also use our own python implementation of pioasm.The text was updated successfully, but these errors were encountered: