[SOLVED] emFile "stalls" - MCI (SDCard)

    • [SOLVED] emFile "stalls" - MCI (SDCard)

      Hi,

      We are using embOS and emFile on the following setup,

      1. emFile
      2. embOS
      3. LPC1787 - NXP ARM-M3
      4. SDCard (1GB - Industrial) via LPC Media Card Interface (MCI)
      5. x5 USARTs for serial communication between other devices.

      We have successfully run the x5 USARTs for quite a while now. The RX is "interrupt" driven and the TX is "DMA" driven on all USARTS. We had to resort to converting the interrupts to "zero latency" interrupts as described in the embOS manual Chapter 12. Recently we added emFile to be able to have a file system on a SDCard. We want to read a file from the SDCard and send data to one of the other device via serial communication. The other devices connected to LPC1787 with the SDCard continuously requests information from the LPC via USART. The SDCard task successfully opens the file and will sometimes successfully do 6-7 reads of the file and then fail. By fail, as far as we know and was able to track it, I mean that the SDCard task stops and keeps on waiting for a event. We tracked it down to the Filesystem actually waiting for and event (FS_X_OS_Wait event). The MCI_irq sets this event and we have seen that this event also get's set in the MCI_DMA_irq.

      For some or other reason this event never get set. The MCI_irq stalls its seems. We have disabled all serial communication, then we have no problems reading the file from the SDCard 100's of times. But the moment we enable the USARTs we have the problem again.

      The interrupt priorities outside of the RTOS:
      Highest: 0 - Lowest 6
      0 - DMA
      1 - MCI
      2 - 6 USARTS (0 - 4)

      Then interrupts used within the RTOS (Both are close to each other( 129 and 130) (low priority interrupts to call OS_Signal Functions):

      I2S - Used for all USART signals
      QEI - Used for MCI signals

      We have tried moving interrupt priorities around. We have just added one USART. The moment we add a single USART we start getting SDCard fails. The FS_Read task basically stalls waiting for the FS_X_OS_Signal event. We have used SystemView but still cannot exactly figure out where the problem exists.

      Does anyone have any ideas or similar experiences? Can someone from Segger maybe help or give an input? Even if someone can point to example or test code that I can use to test the simultaneous use of a USART and MCI with DMA enabled that would help a lot.

      Kind regards,
      Quintin van Wyngaardt

      [list]
      [/list]