- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I'm trying to follow the TLF35584 data sheet (P.220) to clear IF flag.
After it triggers the NMI (ERS1), I try to use SPI during the NMI. Then, the SPI keep busy after calling "IfxQspi_SpiMaster_exchange". The iLLD library and DMA is used for SPI.
Can I use SPI with DMA during NMI? Or Is there a better way?
best regards,
leon
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Thanks for the trial & update.
NMI implementation generally may be simple like storing the necessary debug information and ensuring the safe system because of the Trap. But if an SPI exchange is necessary, check if you exit from the NMI with interrupts enabled and wait in a loop then the ISR is triggered.
But if you want to execute the entire operation in the NMI context then you may need to follow previous approach which is working.
Regards,
Prudhvi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Are Interrupts enabled after ESR1 is triggered ? The flags that are checked for the status is updated only in the ISR called either after successful exchange or an error.
Also, I think the NMI has higher priority than the normal Tasks and ISRs and after a successful SPI exchange an ISR should be triggered and as NMI execution is still in progress, I suspect that this is blocking normal execution and hence the status flags are not set. Could you please check if this is a possibility in your case?
Also, is there any configuration done for PORT Emergency Stop corresponding to SPI pins when NMI is triggered?
Regards,
Prudhvi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Yes, after triggering ESR1, the NMI is run.
It is the problem that the NMI has the highest priority. The SPI ISR cannot be triggered at the moment. Then, I try to directly call the ISR, and it works. However, it doesn't seem like a good solution.
I don't make any change for PORT Emergency Stop.
best regards,
Leon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Thanks for the trial & update.
NMI implementation generally may be simple like storing the necessary debug information and ensuring the safe system because of the Trap. But if an SPI exchange is necessary, check if you exit from the NMI with interrupts enabled and wait in a loop then the ISR is triggered.
But if you want to execute the entire operation in the NMI context then you may need to follow previous approach which is working.
Regards,
Prudhvi.