cyw43_driver only works with SM0 #1077
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#1077
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?
The cyw43_driver (see cyw43_bus_pio_spi.c) only supports SM0. It tries to play nice by allocating a free PIO and requesting a SM but if it gets an SM other than 0 it doesn't work.
The workaround is to make sure that you keep SM 0 free on a PIO for this driver.
In cyw43_bus_pio_spi.c (line 263) we have code like this ....
dma_channel_configure(bus_data->dma_out, &out_config, &bus_data->pio->txf[0], tx, tx_length / 4, true);Which is hardwiring the DMA to pio SM 0 fifo.
Have tried to fix, but not completely working yet :(
I would thing just changing from
txf[0]totxf[bus_data->pio_sm]should do it, no? (also for the othertxf[0]/rxf[0])Hi, thanks for the reply. Yes tried all of that, there are other places in the code where it's hard coded as well. But it still doesn't transfer properly. So it's a bit more deep rooted. I'll take a deeper look at the weekend. At the moment I've just made sure my SM is not claiming 0.
I was wondering if it might have to do with the offset in the SM memory. Because I bet it's never had to share with another program.
Worked out what the final issue was, there needed to be a change to the fdebug flag for the SM in use, see PR.
merged into develop