AnsweredAssumed Answered

CLEV663B + STM32 + FREERTOS  has a spi communication problem

Question asked by f lc on Jan 22, 2018

now we use CLEV663B + STM32 + FREERTOS, but there are some problem in spi communication between stm32 and rc663。( i used demo BasicDiscoveryLoop)  V05.02.00

 

spi clock 2.25Mhz    rc663 usd  blueboard v3.0  buy from nxp

 

i realy don't know why i can't  where the mistake。

 

these is spi rx/tx  data:

 

BasicDiscoveryLoop Example:
flc_Tx=0x10
flc_Tx=0x0
flc_Rx=0xff
flc_Rx=0x10

 

flc_Tx=0x51
flc_Tx=0x0
flc_Rx=0x0
flc_Rx=0x86

 

flc_Tx=0x50
flc_Tx=0x86
flc_Rx=0x40
flc_Rx=0x86

 

flc_Tx=0x7e
flc_Tx=0xc0
flc_Rx=0x86
flc_Rx=0x48

 

flc_Tx=0x80
flc_Tx=0xff
flc_Rx=0xc0
flc_Rx=0x12

 

flc_Tx=0x82
flc_Tx=0xc0
flc_Rx=0xff
flc_Rx=0x88

 

flc_Tx=0x0
flc_Tx=0x0
flc_Rx=0xc0
flc_Rx=0x40

 

flc_Tx=0x5
flc_Tx=0x0
flc_Rx=0x0
flc_Rx=0xa0

 

flc_Tx=0x4
flc_Tx=0xb0
flc_Rx=0x0
flc_Rx=0xa0


flc_Tx=0xc
flc_Tx=0x7f
flc_Rx=0xb0
flc_Rx=0x30

 

flc_Tx=0xe
flc_Tx=0x7f
flc_Rx=0x7f
flc_Rx=0x20

 

flc_Tx=0x9
flc_Tx=0x0
flc_Rx=0x7f
flc_Rx=0x0

 

flc_Tx=0xa
flc_Tx=0x0
flc_Tx=0x0
flc_Tx=0x2


flc_Rx=0x0
flc_Rx=0x0
flc_Rx=0x1
flc_Rx=0x20

 

flc_Tx=0x0       // 2094 /* start the command */ write cmd
flc_Tx=0xa
flc_Rx=0x0      //Raspberry Pi  is  0x2
flc_Rx=0x2      //Raspberry Pi  is 0x0,but this is a write cmd,dose it matter?  i don't know


WaitIrq
flc_Tx=0x11 
flc_Tx=0x0
flc_Rx=0x0
flc_Rx=0xa     // this is read irq0 , Raspberry Pi   0x0

 

flc_Tx=0x10    
flc_Tx=0x50
flc_Rx=0x0
flc_Rx=0x0

 

flc_Tx=0x12 
flc_Tx=0xc0
flc_Rx=0x0
flc_Rx=0x50


pend_while


flc_Tx=0x10
flc_Tx=0x0
flc_Rx=0x0
flc_Rx=0xc0

 

flc_Tx=0x12 
flc_Tx=0xc0
flc_Rx=0x50
flc_Rx=0x0

 

flc_Tx=0xf 
flc_Tx=0x0
flc_Rx=0xc0
flc_Rx=0xc0

 

flc_Tx=0xd 
flc_Tx=0x0
flc_Rx=0x0
flc_Rx=0x0


get_irq
flc_Tx=0x9      //this is a read cmd
flc_Tx=0x0
flc_Rx=0x30   //we should rx 0x0 and 0x02, 
flc_Rx=0x00  //it  makes code err

 

 

Outcomes