cancel
Showing results for 
Search instead for 
Did you mean: 

SPC582B SPI synchronous behaviour during ISR

FPros.1
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
FPros.1
Associate III

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

View solution in original post

1 REPLY 1
FPros.1
Associate III

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