spi_set_slave should disable SPI #713
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 milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#713
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?
According to PrimeCell documentation copied into the RP2040 datasheet SSPCR1::MS should not be modified unless disabled.
https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf
https://developer.arm.com/documentation/ddi0194/h/programmer-s-model/register-descriptions/control-register-1--sspcr1
Looking at this, it would appear that we are to call spi_init followed by spi_set_slave.
github.com/raspberrypi/pico-sdk@2062372d20/src/rp2_common/hardware_spi/include/hardware/spi.h (L193-L207)Documentation from https://raspberrypi.github.io/pico-sdk-doxygen/group__hardware__spi.html#ga1dba14fb5488b5e4a69b30678f774df0
SPI is enabled by spi_init.
github.com/raspberrypi/pico-sdk@2062372d20/src/rp2_common/hardware_spi/spi.c (L21-L33)Does the API support SPI? Deinit says I have to call init. I could modify it manually; however, I think this should be corrected. Unless I am missing something.
This would be valid work around?
This worked for me. I had to use SPI Mode 1, because of ARM PrimeCell SPI.
To get SPI Mode 1:
Pull request: #1158
fixed in 1.5.0
@kilograham Can I get this marked as hardware_spi?