This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

FATFS on an SD card and the event combiner

Other Parts Discussed in Thread: SYSBIOS, OMAPL138

Our project is out of all but 1 HWI available. 

from page 112 of the PSP drivers user guide, SD card section:

The mmcsdSample.cfg file contains the BIOS configuration. The most important
lines in this file which the application may need to pull into his cfg file are as follows.
ECM.eventGroupHwiNum[0] = 7;
ECM.eventGroupHwiNum[1] = 8;
ECM.eventGroupHwiNum[2] = 9;
ECM.eventGroupHwiNum[3] = 10;

do ALL of these need to be used?  does the SD card use 4 interrupts? if so we are going to have a hard time dealing with taking 3 existing interrupts to make room for this.  is it possible to get away with just event group 0?

  • Hi Cobsonchael,

    The mmcsd application uses only two interrupts(GPIO – for card detection and SDIO). If you refer section 5.7.2 of OMAPL138, you will see a  list of events(128 events) that can generate an interrupt.

    GPIO – card detection: EVT# 54 (GPIO Bank 4 Interrupt)

    MMCSD0_INT0 : EVT# 15 (MMCSD0 MMC/SD Interrupt)

     

    An ECM is set up when you are planning to use more number of Interrupts(>14 HWIs). In the example case it was probably done to make it easier for an user to understand how to use more HWIs in the future.

     

    The event combiner can be used to combine more than one event in one HWI. That’s why you see –

    ECM.eventGroupHwiNum[0] = 7;

    ECM.eventGroupHwiNum[1] = 8;

    ECM.eventGroupHwiNum[2] = 9;

    ECM.eventGroupHwiNum[3] = 10;

    So here(group 0 combines the events for 0-31) and (group 1 combines the events for 32-63) and so on..

    Inside the driver, the function to be called by the ECM for event 54 is being configured dynamically (refer configureMmcsd0(…))

    So whenever events from 32 to 63 occur, HWI 8 which corresponds to group 1 calls the ECM_dispatch function that will call the ISR that is configured to that event (which is done by the driver). And that’s the reason you see - pioParams.BankParams[GPIO_BANK_4].hwiNum  = 8u;(group 1) and mmcsdConfig.hwiNumber = 7u;(group 0)

    Hence I guess you have to use the first two groups.

    Please refer the SYSBIOS Userguide for more information on Event Combiner Module(ECM).

    Hope this helps..

    Best Regards,

    Raghavendra 

  • Yes, i am aware of how the ECM works. i just didn't know which interrupts were required and which ECM modules were being used.  so i NEED 2 interrupts to run the SD card.

    i do not see in the documentation where it says to use GPIO bank 4 for an interrupt for card detect.  does that mean we should have run a GPIO line from bank 4 to the SD card? or does it mean that one of the SD interface pins are being used for card detect?

  • cobsonchael,

    If you refer section 11.12.1.1 of BIOSPSP_Userguide, it is mentioned that the "The configureMmcsd() function inside the platform file takes care of configuring the PINMUXes of MMCSDand GPIO (used for interrupt based detection of card insertion)". Hence please refer "mmcsd_evmInit.c" file of platforms for more details regarding which GPIO pins and bank is being used for card insertion detection. 

    Furthermore, The GPIO4[0] is connected to 'SD_INS' pin. And, the 'SD_INS' is connected to 'CD' of the 'MMC'. Whenever, we insert/eject an MMC/SD card, the signal on the SD_INS line changes to low/high. If we have enabled interrupts to be generated on both edges of the GP4[0] pin's transition, then an interrupt is generated on both insertion(falling edge)and ejection(rising edge) of the MMC/SD card(These details are obtained from the OMAPL138 board schematics)

    Best Regards,

    Raghavendra

  • ok so since i don't define the Mmcsd_GPIO_CDWP_ENABLE then the only interrupt that is being used is the SD card interrupt, is that correct?

  • Yes, absolutely.

    Regards,

    Raghavendra