QSPI Slave Flush fifo

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lior
Level 1
Level 1
5 questions asked 10 sign-ins 5 replies posted

hello ,

i am using tricore 377.

when I work with QSPI module in slave mode and I would like to reset the tx fifo in the end of the stream. 

i tried to do qspi->GLOBALCON.B.RESETS = 1;

but after this command the data is always wrong.

what is the correct senario to do that?

LIOR

0 Likes
5 Replies
cwunder
Employee
Employee
5 likes given 50 likes received 50 solutions authored

It can take some cycles for the Reset to take effect.

cwunder_0-1677782210866.png

For example to reset the FIFOs of QSPI2

 

void QSPI2_ResetStateMachineFIFOs(void) {
  QSPI2_GLOBALCON.B.RESETS = qspi_globalcon_resets_StateMachineFifoReset; /* 0x01*/
  (void) QSPI2_GLOBALCON.B.RESETS; /*force the write */
  while (QSPI2_GLOBALCON.B.RESETS != qspi_globalcon_resets_NoResetTriggered);
}

 

 

0 Likes
lior
Level 1
Level 1
5 questions asked 10 sign-ins 5 replies posted

thanks for your answer ,

but its still not working.

when i send the data after the reset  the TX and the RX is wrong.

the only way that i succeed to reset the fifo is when i call again , to SpiSlave_initModule() ,but i dont

want to do this all the time.

have you tried to reset the firo and the data was ok after that?

lior

0 Likes
Yuva
Moderator
Moderator
Moderator
250 replies posted 250 sign-ins 100 solutions authored

Hello,

Please comment on the points below.

1. What is the expected data which gets wrong?
2. Could you check the behavior after adding software delay (eg. 100ms) after reset?
3. Do you observe any error interrupt after the reset?
4. Could you provide the QSPI register dump before and after the reset?

Thanks

0 Likes
lior
Level 1
Level 1
5 questions asked 10 sign-ins 5 replies posted

Hi,

thank you for your answer.

1. the  expected is: 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf

the wrong data is : 0xc0 0x40 0x80 0x0 0xe0 0x60 0xa0 0x20 0xd0 0x50 0x90 0x10 0xf0 

2.i check with a delay and same problem.

3.no i didnt  , is there any error or status register that i can also check?

4.I can provide dump ,but there are a lot of registers ,so maybe tell which of them you want to see?

lior

0 Likes
Yuva
Moderator
Moderator
Moderator
250 replies posted 250 sign-ins 100 solutions authored

Hello,

1. I guess this is RX data, how about the TX data? is it also wrong? Can you check the signals on the SPI lines and share the waveform?

3. You can check STATUS.ERRORFLAGS

4. Registers of the specific SPI kernel should be ok. 

Thanks

0 Likes