-
GD32F103VC替换ST32F103VC后,SPI读出的数全是0xff
用ST芯片,SPI读取正常。换成GD芯片后,按照官方提供的GD和ST差异表,修改了程序,u8SPI_FLASH_SendByte(u8byte)返回值全是0xff,有人遇到过这种情况吗?u8SPI_FLASH_SendByte(u8byte)//{/*LoopwhileDRregisterinnotemplty*/while((SPI1->SR&SPI_I2S_FLAG_TXE)==0);/*SendbytethroughtheSPI1peripheral*/SPI1->DR=byte;/*Waittoreceiveabyte*/while((SPI1->SR&SPI_I2S_FLAG_RXNE)==0);/*ReturnthebytereadfromtheSPIbus*/returnSPI1->DR;}
2021-06-03 1