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

AURIX™ Forum Discussions

gotthard
Level 1
Level 1
5 questions asked 5 sign-ins First reply posted

Hello,

I am using iLLD to configure QSPI in a slave mode. I have to receive 48 bits so I set the dataWidth to 8 and set the count parameter of function IfxQspi_SpiSlave_exchange to the value of 6. Communication is working fine most of the time but if it happens that 1 or more bits are missing, so that full frame is not received, QSPI slave will wait for that bit. Because of that, I specified timeout, so if QSPI stays busy for some period it will exit the loop. Otherwise, it is stuck there forever. Next time, when I try to call IfxQspi_SpiSlave_exchange, the module is still busy cause it is waiting for the missing bit. My question is, how to abort transmission from slave in case when timeout occurs so it does not wait for the missing bit(s)? 

Thank you very much in advance.

Greetings

Here is the snippet of code:

// Slave
while( (IfxQspi_SpiSlave_getStatus(&qspi0_slave) == SpiIf_Status_busy) && (rxTimeout > 0))
{
	MCU_WaitUs(10);
	rxTimeout -= 10;
}

if (rxTimeout == 0)
{
	return STATUS_COM_TIMEOUT; // <-- comes here cause slave is still busy
}

rxTimeout = RX_TIMEOUT_US;

/* Instruct the SPI Slave to receive a data stream of defined length */
IfxQspi_SpiSlave_exchange(&qspi0_slave, NULL_PTR, &rxBuf[0], 6);

IfxAsclin_Spi_exchange(&asclin1_master, &txBuf[0], NULL_PTR, 6);

while( (IfxQspi_SpiSlave_getStatus(&qspi0_slave) == SpiIf_Status_busy) && (rxTimeout > 0))
{
	MCU_WaitUs(10);
	rxTimeout -= 10;
}

if (rxTimeout == 0)
{
	return STATUS_COM_TIMEOUT;
}

 

 

 

0 Likes
1 Solution
Aiswarya
Moderator
Moderator
Moderator
25 solutions authored 50 replies posted 100 sign-ins

Hello,

Could you please try making use of the EN, RESETS bits of the GLOBALCON register?
You could  also try resetting the kernel using the Kernel Reset Register(KRST0/KRST1). 
Please refer to the register description in the AURIXTC3XX_um_part2_v2.0 User Manual to know more about the above registers.

Kind Regards,
Aiswarya.

View solution in original post

0 Likes
1 Reply
Aiswarya
Moderator
Moderator
Moderator
25 solutions authored 50 replies posted 100 sign-ins

Hello,

Could you please try making use of the EN, RESETS bits of the GLOBALCON register?
You could  also try resetting the kernel using the Kernel Reset Register(KRST0/KRST1). 
Please refer to the register description in the AURIXTC3XX_um_part2_v2.0 User Manual to know more about the above registers.

Kind Regards,
Aiswarya.

0 Likes