I've been struggling bringing up a working SPIS test application and would appreciate any help I can get. I'm much more of a HW person, so this hyper abstracted Zephyr stuff is not easy for me.
First Question:
In my overlay (see below) for the reg: attribute, I get the warning:
/soc/spi@40004000/spi-dev-a@0/
I've seen in https://devzone.nordicsemi.com/f/nordic-q-a/93484/struggling-to-use-spi-with-zephyr
the following response: "The overlay warnings I can see here also, but they don't seem to affect the example. I will try to find some time later to look into this." referring to a similar warning, so I'm not sure if this actually an issue or not.
my_spis: &spi1 { compatible = "nordic,nrf-spis"; status = "okay"; pinctrl-0 = <&spi1_default>; pinctrl-1 = <&spi1_sleep>; pinctrl-names = "default", "sleep"; cs-gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; def-char = <0x00>; reg_my_spis: spi-dev-a@0 { reg = <0>; }; }; &spi1_default { group1 { psels = <NRF_PSEL(SPIS_SCK, 0, 31)>, <NRF_PSEL(SPIS_MOSI, 0, 30)>, <NRF_PSEL(SPIS_MISO, 1, 8)>; }; };
Are there any issues that are easily seen with this?
CONFIG_SPI=y CONFIG_GPIO=y CONFIG_SPI_SLAVE=y CONFIG_SPI_ASYNC=y CONFIG_DEBUG=y CONFIG_PRINTK=y #CONFIG_NRFX_SPIS1=y CONFIG_USERSPACE=n CONFIG_UART_CONSOLE=y CONFIG_LOG=y #CONFIG_LOG_BACKEND_RTT=n CONFIG_LOG_BACKEND_UART=y CONFIG_LOG_PRINTK=y CONFIG_LOG_DEFAULT_LEVEL=4 CONFIG_HEAP_MEM_POOL_SIZE=50512 #CONFIG_IDLE_STACK_SIZE=4096 #CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 CONFIG_MAIN_STACK_SIZE=4096 CONFIG_USE_SEGGER_RTT=n #CONFIG_RTT_CONSOLE=n CONFIG_SERIAL=y
struct spi_config spi_cfg = { .operation = SPI_WORD_SET(8) | SPI_OP_MODE_SLAVE | SPI_TRANSFER_MSB | SPI_LINES_SINGLE, .frequency = 4000000, .slave = 0, };
spi_cfg.cs = &spi_cs;
static struct spi_cs_control spi_cs = { // .gpio.pin = cs_gpio_pin, // .gpio.dt_flags = cs_gpio_flags, .gpio = SPI_CS_GPIOS_DT_SPEC_GET(DT_NODELABEL(reg_my_spis)), .delay = 0, };
const struct spi_buf rx_buf = { .buf = buffer, .len = BUFFER_SIZE, }; const struct spi_buf_set rx = { .buffers = &rx_buf, .count = 1, };
void spi_slave_callback(const struct device *dev, int result, void *data)