Skip to main content
FPros.1
Associate II
February 26, 2024
Solved

SPC582B SPI synchronous behaviour during ISR

  • February 26, 2024
  • 1 reply
  • 1486 views

Hi all,

I am using SPC582B mcu.

The system timer is based on PIT0 CH0 (default choice) at frequency 1kHz.

In the timer IRQ handler, I need to invoke SPI spi_lld_exchange API.

 

Problem is this API doesn't complete, remaining stuck on the while

SPC5_SPI_WAIT_FOR_TXRX_COMPLETION(spip); 

 

SPI APIs are configured synchronous:

FPros1_0-1708968445444.png

 

I already activated the preemptable ISR option in the configuration:

 

FPros1_1-1708968514255.png

Since I don't know if the priority level is ascending or not, I tried both priority situations, that is: 

System timer (PIT0 CH0) priority: 4                    DSPI0 priority: 10

System timer (PIT0 CH0) priority: 10                  DSPI0 priority:4 

 

Is these some configuration flag or API to call in order to make this SPI API working?

 

Thank you all for any help or indication,

FP

This topic has been closed for replies.
Best answer by FPros.1

My routine was called inside in a critical section so I just needed to exit temporarily such region (as it was performed in the AutoDevKit SPSB081 example) in order to make the SPI synchronous APIs work.

 

Regards,

FP

1 reply

FPros.1
FPros.1AuthorBest answer
Associate II
March 3, 2024

My routine was called inside in a critical section so I just needed to exit temporarily such region (as it was performed in the AutoDevKit SPSB081 example) in order to make the SPI synchronous APIs work.

 

Regards,

FP