Skip to main content
DXinp.1
Associate
November 30, 2022
Question

When STM32G070RB SPI is received, both MOSI and MISO have returned data. The data is the same through the logic analyzer.

  • November 30, 2022
  • 1 reply
  • 1153 views

This is my test program:

uint8_t dev_test=0x00;

while(1)

{

HAL_GPIO_WritePin(DW_NSS_GPIO_Port, DW_NSS_Pin, GPIO_PIN_RESET);

HAL_SPI_Transmit(&hspi1,&dev_test,1,10);

HAL_SPI_Receive(&hspi1,test_R,4,10);

HAL_GPIO_WritePin(DW_NSS_GPIO_Port, DW_NSS_Pin, GPIO_PIN_SET);

delay_ms(100);

}

The driver chips are DW1000 and DW3000. At present, the test program sends 0x00, and DW3000 will return {DE,CA, 03,02}, but the MOSI of SPI should not change.

0693W00000WJnlHQAT.png

This topic has been closed for replies.

1 reply

S.Ma
Principal
November 30, 2022

Use transmitreceive function twice, even if one way is made of dummy data. If using DMA define a tx and rx buffer and channels.