AnsweredAssumed Answered

SPI DUART driver -- are ioctl/fread/fwrite calls ISR-safe?

Question asked by David Rodgers on Jul 12, 2010
Latest reply on Jul 13, 2010 by David Rodgers

I'm using CW 7.2.1 and MQX 3.6.0 with the M52259EVB, and writing a driver for the SC16IS752 SPI-based dual UART.  The DUART has an IRQ* output which I've attached to IRQ7.  SPI is connected normally to the QSPI port (CS0).  No other devices are on the QSPI port.


Looking at the SPI memory access example (mqx\examples\spi), one uses ioctl(), fread(), fwrite(), and fflush() to manipulate the QSPI port.  I need to implement an ISR for the DUART, and that ISR will need to perform reads and writes to the QSPI port to access the DUART chip.


My question is, if I use the polled-mode SPI driver ("spi0:"), is it safe to make ioctl/fread/fwrite() calls from within the IRQ7 ISR?  Or do I need to figure out some other way to do this and move all QSPI operations out of the ISR?  Has someone ever done something similar (i.e. implement an ISR for a device connected via SPI/I2C/etc)?  Thanks.