using nrf connect sdk 1.4.0 and nrf9160 DK
build: nrf9160dk_nrf9160ns
SES version: V5.10d
Windows 10 Pro 64bit
1. Please note I used https_client project to implement spi slave(but have removed all the https code.. ignore the cert file)
2. Used some details from tickets this and this.. Please trust me when I say i have searched the devzone and documents as much as I could
proj.conf looks like this
# SPI
CONFIG_SPI=y
## for slave only
CONFIG_SPI_SLAVE=y
CONFIG_SPI_3_OP_MODES=3
#commented these out as per some devzone discussions
#CONFIG_SPI_3=y
#CONFIG_SPI_NRFX=y
#CONFIG_SPI_3_NRF_SPIS=y #this gives an error while opening a project if uncommented
CONFIG_RESET_ON_FATAL_ERROR=n
overlay file
&spi3 {
compatible = "nordic,nrf-spis";
status = "okay";
mosi-pin = <10>;
miso-pin = <11>;
sck-pin = <12>;
csn-pin = <13>;
def-char = <0xde>;
};
main.c
Notes:
I have closed the solution and opened after changing proj.conf. I am using SPIS3
Issue is that nrfx_spis_init fails with error 0xbad0005.. and the reason for that is this line in nrfx_spi.c fails
if (p_cb->state != NRFX_DRV_STATE_UNINITIALIZED)
I am just confused to see that p_cb->state is set to NRFX_DRV_STATE for some reason
m_cb[p_instance->drv_inst_idx] has valid data... that array has ONLY ONE element (given only spi3 is available) and drv_inst_idx=0;
It is clear that I a missing some configuration.. I was told to make some spis related changes using the SES ->project->configure nrf sdk project.. I tried to enable spis2 instance and spis3 driver and that made no difference.. I am sure you have some document in there somewhere in your ocean of documents explaining this but unfortunately I couldn't find any details
3. The SPI master worked without any issue.. Not that it helps but just FYI
4. attached the entire project in zip file