XSpi_Transfer within interrupt context

T

Thomas Taranowski

Guest
I'm using the standalone bsp for a ppc440 on a Virtex 5.

I have a scenario where I have to read from an external chip over spi
in response to a gpio interrupt. The issue I run into is that when I
call XSpi_Transfer from within the context of the gpio isr, the call
just hangs, presumably dues to the fact that the xspi_l portion of the
driver is attempting to use interrupts to service it's fifo
interface. Any ideas on how to make this work? I'm suspecting there
is something I can do with interrupt priorities to make this work.
I've tried calling the XGpio_InterruptClear before calling the
XSpi_Transfer, but the call still hung.
 
On Wed, 11 Apr 2012 11:16:42 -0700, Thomas Taranowski wrote:

I'm using the standalone bsp for a ppc440 on a Virtex 5.

I have a scenario where I have to read from an external chip over spi in
response to a gpio interrupt. The issue I run into is that when I call
XSpi_Transfer from within the context of the gpio isr, the call just
hangs, presumably dues to the fact that the xspi_l portion of the driver
is attempting to use interrupts to service it's fifo interface. Any
ideas on how to make this work? I'm suspecting there is something I can
do with interrupt priorities to make this work. I've tried calling the
XGpio_InterruptClear before calling the XSpi_Transfer, but the call
still hung.
This would be a much better question for comp.arch.embedded, particularly
if you could talk about it in terms that don't rely on a detailed
knowledge of that particular BSP.

The best way to do this is to have an environment in place that allows
you to respond to events in real time without using interrupt contexts as
a poor-man's RTOS. Then, you can set a semaphore or event or flag or
whatever you want to call it in response to the GPIO event, and have the
SPI code pend on that semaphore.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
 

Welcome to EDABoard.com

Sponsor

Back
Top