XSpi_Transfer within interrupt context

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.

Reply to
Thomas Taranowski
Loading thread data ...

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
 Click to see the full signature
Reply to
Tim Wescott

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.