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.
2) I attached 'button PTC13 interrupt '
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.
Solved! Go to Solution.
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.
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.
-------------------------------------------------------------------------------
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.
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.
-------------------------------------------------------------------------------
Dear Robin_Shen
Thanks a lot !!!
It was work if I add below line.
"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.!