Hi TI experts,
I have a question about SPI. I have two RM44L920 board and connected each other for SPI communicaton.
The SPI communication between Master <-> Slave is well.
But there is a problem using break point and function call sequence.
A. break point problem
The purpose of this question is to know exact time when SPI received the data from Master. because spiEndNotification() recalls 2 times during execution.
I use spiTransmitAndReceiveData() on Master and spiSendAndGetData() on Slave.
This is the slave code for reference.
if I use break point at spiEndNotification(), the if statement condition can be passed. and doneSPI3=0; is set.
//if(spi==spiREG3 && ((spiREG3->FLG & 0x00000100U) == 0x00000100U))
// if((spiREG3->INT0 & 0x00000100U) == 0x00000100U)
// if((spiREG3->FLG & 0x00000100U) == 0x00000100U)
but if I release break point, the doneSPI3=0; doesn't seem to executed.
it is stopped when I click "suspend" on CCS. the while(doneSPI3); in main function is executing.
Even though the RX Buffer successfully received the data, it doesn't proceed the rest "printf" in main(),
If I eliminate the If statement, it works well.
Is there any problem to use this if statement in spiEndNotification()? How should I do to know when the data received?
2. mibspi3HighInterruptLevel(void) calling sequence.
I connected all the vector into FIQ and mibspi3HighInterruptLevel() is executed.
I just track the calling sequence but there's something I don't understand.
This is the first execution of spiEndNotification() break point in if statement.
and the if statement is true and go to doneSPI3=0;
But it is returned to 964 line which case of 0x28U /* Transmit Buffer Empty Interrupt*/
I expect case of 0x24U /*receive Buffer Full Interrupt*/ becasue spiEndNotification() if statement is passed.
then it stops spiEndNotification() with different reg value.
And it doesn't go into if statement which already executed.
but it returns to 0x24U /*receive buffer full interrupt*/
What I don't understand is this sequence.
I just exepect this sequence
A. case 0x24 in spi.c calls spiEndNotifiication with proper register setting
B. if state ( true) set the doneSPI3 in spiEndNotificaton
C. case 0x28 in spi.c calls spiEndNotifiication
D. if state ( false ) in spiEndNotificaton
But actual sequence is
C -> B -> A ->D
Even at "B" stages already seems to filled all the RX received data.
Please advice me for better understanding.
Best Regards,
Jay.