This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Serialization S132 strange behavior

Hi,

I am currently using the NRF52 in a serialized application, with the SPI bus. I am using the SDK 12.1.0 and the softdevice S132 V3.0.0

My application is running well, as expected : We perform scanning and receive ADV_REPORT packet from the connectivity chip.

After 2-3 minutes of running, the process is blocked : no more events are received from the connectivity chip. After checking on SPI bus, we have observed that the connectivity board requests to transfer to the application chip, a packet with a length of zero:

  • First step : REQ line is assearted
  • Second step : The zero header is send to the connectivity chip
  • Third step : The REQ line is dessearted
  • Fourth step : The payload length is send, but contains the value 0

image description

After this sequence, the connectivity stop sending RX requests on the SPI line.

All the process seems OK when we take a look at the signals. Do you have an idea of the issue causing such a behavior ?

Regards,

Romain

EDIT :

Hi,

I came back to our current issue and I have been able to log several things. The internal log already present on the connectivity software were not enought to be usefull in my case. So I added my logs in the spi slave state machine of the connectivity board and in the SPI driver module.

At the same time I probed the SPI signal :

image description

We can see the same issue as the previous one described.

Here are the logs I have collected at the same time (With a little improvment, to enhance readability).

...

- Event NRF_DRV_SPIS_BUFFERS_SET_DONE, state machine stay into state SPI_RAW_STATE_RX_HEADER
- call to ser_phy_tx_pkt_send() and set_request_line()  
- Event NRF_DRV_SPIS_XFER_DONE, state machine goes into state SPI_RAW_STATE_TX_HEADER
call to header_send() with parameter 53 
- In function nrf_spis_tx_buffer_set() p_reg->MAXTX is set to 2 and p_reg->TXDPTR is set to a buffer containing [53, 0] (which is the right value to send)
- Event NRF_DRV_SPIS_BUFFERS_SET_DONE, state machine goes into state SPI_RAW_STATE_TX_HEADER
- Call to set_ready_line()
- Event NRF_DRV_SPIS_XFER_DONE, state machine goes into state SPI_RAW_STATE_TX_PAYLOAD
- Transfert done with event.tx_amount=2, call to frame_send()
- Event NRF_DRV_SPIS_BUFFERS_SET_DONE

...

From here the master state machine and the slave state machine are in a deadlock, as the slave wait for the master to query the payload, but the master doesn't have the information about the payload size.

To add some context to this issue : this behavior is observed after several hours of scanning and calling sd_ble_gatts_hvx() (~ scan interval 40ms, scan windows 30ms and call to sd_ble_gatts_hvx() every 100ms).

I don't see any error in the behavior of the connectivity state machine : the right buffer is set into p_reg->TXDPTR, and the transfert done is acknowledge, but the SPI probe shows that the wrong bytes are send. What could possibly go wrong and create this state ?

Regards,

Romain

Related