2022-11-29 05:41 PM
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.
2022-11-29 10:25 PM
Use transmitreceive function twice, even if one way is made of dummy data. If using DMA define a tx and rx buffer and channels.