cancel
Showing results for 
Search instead for 
Did you mean: 

X-NUCLEO-ST67W61 + STM32N6570-DK - waiting for spi txn ready timeouted

Shirovaty
Associate II

Hello, as in the title I'm facing issues with high intensity BLE transfers (~4 writes and 4 reads and indicates per second) on X-NUCLEO-ST67W71 paired with STM32N6570-DK.
Randomly during the transfer I'm encountering this error which simply breakes the communication with ST67:

ST67 Log:  [ERROR] [1055938] [spi_xfer_engine] (spi_iface.c:448) waiting for spi txn ready timeouted
ST67 Log:  [ERROR] [1057938] [spi_xfer_engine] (spi_iface.c:448) waiting for spi txn ready timeouted
ST67 Log:  Timeout waiting for tx
ST67 Log:  [WARN] [1058941] [ST67Task] (st67_app.c:1138) Set read data error!
ST67 Log:  [ERROR] [1059938] [spi_xfer_engine] (spi_iface.c:448) waiting for spi txn ready timeouted
ST67 Log:  [ERROR] [1061938] [spi_xfer_engine] (spi_iface.c:448) waiting for spi txn ready timeouted
ST67 Log:  [ERROR] [1063938] [spi_xfer_engine] (spi_iface.c:448) waiting for spi txn ready timeouted
ST67 Log:  Timeout waiting for tx
ST67 Log:  [WARN] [1063951] [ST67Task] (st67_app.c:1143) Data indication error!
ST67 Log:  [ERROR] [1065938] [spi_xfer_engine] (spi_iface.c:448) waiting for spi txn ready timeouted
ST67 Log:  [ERROR] [1067938] [spi_xfer_engine] (spi_iface.c:448) waiting for spi txn ready timeouted
ST67 Log:  [ERROR] [1069938] [spi_xfer_engine] (spi_iface.c:448) waiting for spi txn ready timeouted

That's the setup for the SPI5, which is used to communicate with ST67:

  hspi5.Instance = SPI5;
  hspi5.Init.Mode = SPI_MODE_MASTER;
  hspi5.Init.Direction = SPI_DIRECTION_2LINES;
  hspi5.Init.DataSize = SPI_DATASIZE_8BIT;
  hspi5.Init.CLKPolarity = SPI_POLARITY_LOW;
  hspi5.Init.CLKPhase = SPI_PHASE_1EDGE;
  hspi5.Init.NSS = SPI_NSS_SOFT;
  hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_64;
  hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB;
  hspi5.Init.TIMode = SPI_TIMODE_DISABLE;
  hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
  hspi5.Init.CRCPolynomial = 0x7;
  hspi5.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
  hspi5.Init.NSSPolarity = SPI_NSS_POLARITY_LOW;
  hspi5.Init.FifoThreshold = SPI_FIFO_THRESHOLD_01DATA;
  hspi5.Init.MasterSSIdleness = SPI_MASTER_SS_IDLENESS_15CYCLE;
  hspi5.Init.MasterInterDataIdleness = SPI_MASTER_INTERDATA_IDLENESS_15CYCLE;
  hspi5.Init.MasterReceiverAutoSusp = SPI_MASTER_RX_AUTOSUSP_DISABLE;
  hspi5.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_ENABLE;
  hspi5.Init.IOSwap = SPI_IO_SWAP_DISABLE;
  hspi5.Init.ReadyMasterManagement = SPI_RDY_MASTER_MANAGEMENT_INTERNALLY;
  hspi5.Init.ReadyPolarity = SPI_RDY_POLARITY_HIGH;

 And the SPI5 is handled through GPDMA1
Worth mentioning: ST67 is running 2.0.89 binary, X-CUBE-ST67 is v1.1.0

If there is anything more to be provided in terms of info, just let me know!

2 REPLIES 2
Louis AUDOLY
ST Employee

Hello @Shirovaty ,

Thank you for your post.
Just to let you know, there is a newer version of the X-CUBE-ST67W61, v1.3.0 and v2.0.106 for the coprocessor binary, that has been delivered and which is already available under Github.

Regarding the configuration of the SPI, could you please try aligning with the configuration provided in the package and try again to see if this solves your issue ?

Below the configuration of the SPI5 : 

  hspi5.Instance = SPI5;
  hspi5.Init.Mode = SPI_MODE_MASTER;
  hspi5.Init.Direction = SPI_DIRECTION_2LINES;
  hspi5.Init.DataSize = SPI_DATASIZE_8BIT;
  hspi5.Init.CLKPolarity = SPI_POLARITY_LOW;
  hspi5.Init.CLKPhase = SPI_PHASE_1EDGE;
  hspi5.Init.NSS = SPI_NSS_SOFT;
  hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
  hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB;
  hspi5.Init.TIMode = SPI_TIMODE_DISABLE;
  hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
  hspi5.Init.CRCPolynomial = 0x7;
  hspi5.Init.NSSPMode = SPI_NSS_PULSE_DISABLE;
  hspi5.Init.NSSPolarity = SPI_NSS_POLARITY_LOW;
  hspi5.Init.FifoThreshold = SPI_FIFO_THRESHOLD_01DATA;
  hspi5.Init.MasterSSIdleness = SPI_MASTER_SS_IDLENESS_00CYCLE;
  hspi5.Init.MasterInterDataIdleness = SPI_MASTER_INTERDATA_IDLENESS_00CYCLE;
  hspi5.Init.MasterReceiverAutoSusp = SPI_MASTER_RX_AUTOSUSP_DISABLE;
  hspi5.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_ENABLE;
  hspi5.Init.IOSwap = SPI_IO_SWAP_DISABLE;
  hspi5.Init.ReadyMasterManagement = SPI_RDY_MASTER_MANAGEMENT_INTERNALLY;
  hspi5.Init.ReadyPolarity = SPI_RDY_POLARITY_HIGH;

 

Thank you for your feedback

Regards

Louis

Hi Louis!

Thanks for the lead, I've updated the X-CUBE and the coprocessor binary to the latest versions and I've set the SPI5 as you've described, with one caveat - it's working

As it was referenced in few topics here, SPI_BAUDRATEPRESCALER_2 tends to give sem_if_ready errors, which was occuring for me. When I've set it to 8, the communication seems to work without errors.

But I've found additional error on the second devkit set (the same parts): for some reason, we're getting corrupted data to the receive buffer registered in W6X_Ble_Init(). On the first set this issue starts happening when prescaler is high (f.e. 64), on the second it's always happening. I'm assuming there might be some HW issue in terms of SPI either on N6570-DK or ST67 nucleo. 

But, if there would be any software solution to this problem, I'd really appreciate it!

Best regards