NRF5340 spi-master and spi-slave communication issues

NRF5340, V2.3.0, UBUNTU20.04, VSCODE.

Hi Nordic,

I have a product that needs to use nrf5340's spim ->spis for data transmission, so

I validated the demo code (v2.3.0/modules/hal/nordic/nrfx/samples/src/nrfx_spim_spis),
It is indeed possible to achieve bidirectional communication between SPIM and SPIS,
In order to facilitate waveform analysis, I also made small changes to the code:
Modify the sending content to a simple 'A', 'B' string:

/** @brief Symbol specifying message to be sent via SPIM data transfer. */
#define MSG_TO_SEND_MASTER "A"

/** @brief Symbol specifying message to be sent via SPIS data transfer. */
#define MSG_TO_SEND_SLAVE "B"

2. The configuration definition for replacing GPIO pins is as follows:

spi-master: sck, mosi, miso, cs => p1.10, p1.11, p1.12, p1.13
spi-slave: sck, mosi, miso, ss => p1.6, p1.7, p1.8, p1.9
3. Add LED display reminder. When the SPIS receives the correct message, LED 1 will flash,
and when the SPIM receives the correct message, LED 0 will flash, making it easy to check the status
After connecting spim and spis' gpio,

After recompiling the code and burning it to 5340, you can see that the expected log is output:

[11:40:27:034] main(): Starting nrfx_spim_spis basic non-blocking example.
[11:40:29:043] spim_handler(): SPIM finished. Context passed to the handler: Some context
[11:40:29:052] spim_handler(): SPIM rx buffer: B
[11:40:29:054] spis_handler(): SPIS finished. Context passed to the handler
[11:40:29:060] spis_handler(): SPIS rx buffer: A

LED 0 and LED 1 also meet the expected behavior

The normal SPI waveform can be seen by using the Logic analyzer:

##### Everything is normal here. #####

Then when I use two nrf5340 development boards, with 5340#1 as the spi master

and 5340#2 as the spi slave, the pin definitions remained the same:

5340#1: spi-master: sck, mosi, miso, cs => p1.10, p1.11, p1.12, p1.13
5340#2: spi-slave: sck, mosi, miso, ss => p1.6, p1.7, p1.8, p1.9

After burning the same code and connecting the SCK, MOSI, MISO, and CS cables,

I found a problem,
1. 5340#2 can output the log normally, indicating that the data for 5340#1 has been received:

[13:48:42:883] spis_ handler(): SPIS finished. Context passed to the handler
[13:48:42:889] spis_ handler(): SPIS rx buffer: A

But 5340#1 did not receive the expected log:

[13:49:32:458] spim_ handler(): SPIM finished. Context passed to the handler: spim context
[13:49:32:464] spim_ handler(): SPIM rx buffer: <0xff><0xff>

Looking at the waveform, it was found SCK,MOSI,CS is correct wave,but there is no MISO signal:


Make sure there is no problem with the physical wiring.

I have checked it many times but still cannot find the cause,
Can you help me take a look at this issue? the attachment contains my code changes

Looking forward to your reply very much!

Thanks.

Related