This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am335x祼机spi例程



由于刚入手,看到Demo中提供的关于spi的示例,具体操作如下:

 McSPI0ModuleClkConfig();

 McSPIPinMuxSetup(0);

McSPI0CSPinMuxSetup(0);

IntMasterIRQEnable();

McSPI0AintcConfigure();

McSPISetUp();

WriteEnable();

while(FALSE == retVal)     {        

      retVal = IsWriteSuccess();  

   }

.....

问题就在于 IsWriteSuccess();  ,它去判断接收到的是否为02,但是我收到的却是0xff,所以就一直卡在这里,可否指出可能的问题在哪里,谢谢。

 

 

static unsigned int IsWriteSuccess(void) {  

   unsigned int retVal = FALSE;

    txBuffer[0] = FLASH_READ_STAT_REG1;   

   txBuffer[1] = FLASH_DUMMY_BYTE;

    length = 2;

    McSPITransfer();

    if(0x02 == rxBuffer[1])     {      

            retVal = TRUE;    

 }

    return retVal; }