pio_encode_mov(pio_pindirs, pio_x) gives wrong value #2754
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#2754
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When calling:
it returns
0xA081, while according to datasheet the correct value would be0xA061I think this is a left-over bug from RP2040 which doesn't support
pindirsasmovdestination.I did a bit of digging, and it looks like you're right.
I compiled these tables of encoding bit-patterns from the PIO chapters of the RP2040 and RP2350 datasheets:
(with bold highlighting where RP2350 differs from RP2040)
WAITWAITINOUTMOVMOVSETINOUTMOVMOVSETpio_encode_mov(enum pio_src_dest dest, enum pio_src_dest src)just doespio_src_destis defined as:which explains why
pio_encode_mov(pio_pindirs, pio_x);is encodingpio_pindirsas binary100instead of the binary011that theMOVinstruction in RP2350's PIO expects.So perhaps
pio_src_destneeds to be tweaked to add:and then your example-code would need to do
pio_encode_mov(pio_pindirs_mov, pio_x);instead ofpio_encode_mov(pio_pindirs, pio_x);.fix merged into develop