S32K144EVB-Q100 LPSPI communication fail in button interrupt (IRQ)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K144EVB-Q100 LPSPI communication fail in button interrupt (IRQ)

Jump to solution
1,236 Views
Kavin-Sun
Contributor II

 

LPSPI not working  in  button interrupt (IRQ) using  S32K144

 

 

Hi everyone, 

I tried SPI communication in button interrupt handler.

But, it was not working. 

Hardware :    S32K144EVB-Q100 

Software :      lpspi_transfer_s32k144  (S32DS Project Example) 

                       --> Modified SW3 button interrupt function. 

 

1) Firstly, I use S32DS sample example. 

KavinSun_0-1634616968796.png

 

2) I attached 'button PTC13 interrupt ' 

KavinSun_1-1634617000450.pngKavinSun_2-1634617016762.pngKavinSun_3-1634617033019.png

 

 

In main( ) function , it is good working.

But, after when I push button SW3 , SPI was not work interrupt function in buttonISR(void). 

I attached software source. 

Please help me!. 

Thanks very much. 

0 Kudos
1 Solution
1,215 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

By debug your project, I find that it stuck at OSIF_SemaWait. The OSIF_SemaWait using interrupt of Systick, but the interrupt of Systick was pending.

OSIF_SemaWait.png

Would you please configure the priority of PORTC(your button isr) or Systick. So that the interrupt of Systick is able to run.
For example: 
INT_SYS_SetPriority(PORTC_IRQn,1);

By the way:
The Interrupt service routing should be a small non-blocking code, but you have a master blocking transfer function in your handler.
I would recommend to use interruption, or a flag in the handler of the interrupt to signal a new transfer.

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

2 Replies
1,216 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

By debug your project, I find that it stuck at OSIF_SemaWait. The OSIF_SemaWait using interrupt of Systick, but the interrupt of Systick was pending.

OSIF_SemaWait.png

Would you please configure the priority of PORTC(your button isr) or Systick. So that the interrupt of Systick is able to run.
For example: 
INT_SYS_SetPriority(PORTC_IRQn,1);

By the way:
The Interrupt service routing should be a small non-blocking code, but you have a master blocking transfer function in your handler.
I would recommend to use interruption, or a flag in the handler of the interrupt to signal a new transfer.

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,213 Views
Kavin-Sun
Contributor II

Dear Robin_Shen

Thanks a lot !!!

It was work if I add below line. 

KavinSun_0-1634704224435.png

"I would recommend to use interruption, or a flag in the handler of the interrupt to signal a new transfer."--> I understand your recommend. I will do it. 

 

Have good day.!

0 Kudos