none
PADS Configuation for the AM35xx Processor RRS feed

  • Question

  • My questions are, why am I getting the following error message on the console screen after adding 14 GPIO connections to the GPIO_PADS definition in bsh_padcfg.h file?  What can I do to fix it?

    Can anyone help? What does it all mean?

    Thanks

    -----------------

        ERROR: C:\WINCE600\PLATFORM\CM_T3517_BSP\SRC\SOC\COMMON_TI_V1\COMMON_TI\SDHC\BASE\.\sdhc.cpp line 1317: SDHCInitialize:: Error requesting pads

    -----------------

    My current project requires 14 GPIO lines. Some of which need to be inputs, the others outputs.
    (In reality I'll need 8 inouts and 2 outputs, but defining all that look to be available)

    I see that the PADS configuration is defined in the file called bsp_padcfg.h file.

    What I have done is just added the 14 GPIO lines into the GPIO_PADS definition:

    From:
    #define GPIO_PADS   \
        PAD_ENTRY(UART3_RTS_SD, INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO_164 Base SMSC reset*/    \
        PAD_ENTRY(SYS_CLKOUT2,  INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 186 - LED */    \
        PAD_ENTRY(GPMC_nCS2,  INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 53 - RTC_3020 RD  */    \
        PAD_ENTRY(GPMC_nCS3,  INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 54 - DVI pwr_down  */    \
        PAD_ENTRY(GPMC_nCS6,  INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))                        /* GPIO 57 - ts penirq  */    \
        PAD_ENTRY(GPMC_nCS7,  INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 58    LCD backlight en*/    \
        PAD_ENTRY(GPMC_CLK,   INPUT_DISABLED | MUXMODE(4))                                                /* GPIO 59    SD write protect*/    \
        PAD_ENTRY(GPMC_nBE1,  INPUT_DISABLED | MUXMODE(4))                                                 /* GPIO 61 - audio out enable*/ \
        PAD_ENTRY(GPMC_WAIT3,  INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))                         /* GPIO 65 - Base ethernet IRQ*/ \
        PAD_ENTRY(UART2_CTS,  INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))                         /* GPIO 144 - SD card CD*/ \
        PAD_ENTRY(MCBSP1_FSR,  INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR |MUXMODE(4))      /* GPIO 157 - LCD reset*/ \
        PAD_ENTRY(MCBSP4_DR,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))                    /* GPIO 153 - RTC_3020 IO*/ \
        PAD_ENTRY(UART3_CTS_RCTX,    INPUT_DISABLED | MUXMODE(4))                                        /* GPIO 163 - RTC_3020 CS*/ \
        PAD_ENTRY(MCBSP_CLKS,    INPUT_DISABLED | MUXMODE(4))                                            /* GPIO 160 - RTC_3020 Access enable*/ \
        PAD_ENTRY(MCBSP4_DX,    INPUT_DISABLED | MUXMODE(4))                                            /* GPIO 154 - RTC_3020 WR*/ \
        PAD_ENTRY(UART2_TX , INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))        /* GPIO 146 - USB_PHY_RST1*/ \
        PAD_ENTRY(UART2_RX , INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))        /* GPIO 147 - USB_PHY_RST2*/ \
        PAD_ENTRY(CCDC_WEN , INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))        /* GPIO 98 - USB hub (on base) reset */\
        PAD_ENTRY(MCBSP4_CLKX , INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 152 - USB hub reset */\
        PAD_ENTRY(UART2_RTS , INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 145 - WLAN reset */\
        PAD_ENTRY(MCBSP3_DX, INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))                        /* GPIO 140 - */\
        PAD_ENTRY(HDQ_SIO,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))        

    To:

    #define GPIO_PADS   \
        PAD_ENTRY(UART1_RX,     INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_151 */ \
        PAD_ENTRY(UART1_CTS,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_150 */ \
        PAD_ENTRY(UART1_RTS,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_149 */ \
        PAD_ENTRY(UART1_TX,     INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_148 */ \
        PAD_ENTRY(MMC2_DAT7,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_139 */ \
        PAD_ENTRY(MMC2_DAT6,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_138 */ \
        PAD_ENTRY(MMC2_DAT5,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_137 */ \
        PAD_ENTRY(MMC2_DAT4,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_136 */ \
        PAD_ENTRY(MMC2_DAT0,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_132 */ \
        PAD_ENTRY(MMC1_DAT4,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_126 */ \
        PAD_ENTRY(MMC1_DAT5,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_127 */ \
        PAD_ENTRY(MMC1_DAT6,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_128 */ \
        PAD_ENTRY(MMC1_DAT7,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_129 */ \
        PAD_ENTRY(UART3_RTS_SD, INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))  /* GPIO_164 */ \
        PAD_ENTRY(SYS_CLKOUT2,INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 186 - LED */    \
        PAD_ENTRY(GPMC_nCS2,  INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 53 - RTC_3020 RD  */    \
        PAD_ENTRY(GPMC_nCS3,  INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 54 - DVI pwr_down  */    \
        PAD_ENTRY(GPMC_nCS6,  INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))                        /* GPIO 57 - ts penirq  */    \
        PAD_ENTRY(GPMC_nCS7,  INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 58    LCD backlight en*/    \
        PAD_ENTRY(GPMC_CLK,   INPUT_DISABLED | MUXMODE(4))                                                /* GPIO 59    SD write protect*/    \
        PAD_ENTRY(GPMC_nBE1,  INPUT_DISABLED | MUXMODE(4))                                                 /* GPIO 61 - audio out enable*/ \
        PAD_ENTRY(GPMC_WAIT3,  INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))                         /* GPIO 65 - Base ethernet IRQ*/ \
        PAD_ENTRY(UART2_CTS,  INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))                         /* GPIO 144 - SD card CD*/ \
        PAD_ENTRY(MCBSP1_FSR,  INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR |MUXMODE(4))      /* GPIO 157 - LCD reset*/ \
        PAD_ENTRY(MCBSP4_DR,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))                    /* GPIO 153 - RTC_3020 IO*/ \
        PAD_ENTRY(UART3_CTS_RCTX,    INPUT_DISABLED | MUXMODE(4))                                        /* GPIO 163 - RTC_3020 CS*/ \
        PAD_ENTRY(MCBSP_CLKS,    INPUT_DISABLED | MUXMODE(4))                                            /* GPIO 160 - RTC_3020 Access enable*/ \
        PAD_ENTRY(MCBSP4_DX,    INPUT_DISABLED | MUXMODE(4))                                            /* GPIO 154 - RTC_3020 WR*/ \
        PAD_ENTRY(UART2_TX , INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))        /* GPIO 146 - USB_PHY_RST1*/ \
        PAD_ENTRY(UART2_RX , INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))        /* GPIO 147 - USB_PHY_RST2*/ \
        PAD_ENTRY(CCDC_WEN , INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))        /* GPIO 98 - USB hub (on base) reset */\
        PAD_ENTRY(MCBSP4_CLKX , INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 152 - USB hub reset */\
        PAD_ENTRY(UART2_RTS , INPUT_DISABLED | PULL_RESISTOR_ENABLED | PULLUP_RESISTOR | MUXMODE(4))    /* GPIO 145 - WLAN reset */\
        PAD_ENTRY(MCBSP3_DX, INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))                        /* GPIO 140 - */\
        PAD_ENTRY(HDQ_SIO,    INPUT_ENABLED | PULL_RESISTOR_DISABLED | MUXMODE(4))        

    ---------------------------

    All I have done is add 13 Pad Entries and modified the 14th in the GPIO_PAD definition in bsp_padcfg.h .

    My problem is that when I do this I see the error message on the console screen as shown above, and few things stop working...for example I can no longer detect that a SD card was inserted or removed. Sometimes, the USB mouse pointer no longer moves.

    My questions are, why am I getting this error message by adding the 14 PADS configurations to the GPIO_PADS definition? What can I do to fix it?

    I read the following but I am not sure if I am taking these precautions or where to take these precautions:

    1. As these pads are multiplexing inputs from different controllers, it is important to keep the pad configuration centralized in one place to avoid conflicts.

    2. One must release a requested pad before being able to reconfigure this same pad.


    3. It is mandatory to check the return value of these functions and act accordingly if it returns failure.

    4.Not checking successful return value before using the pad could lead to a conflict and unpredictable results.

    5. A reservation mechanism is implemented to decrease the risk of configuring the same pad from different places in the BSP. Each pad is reserved while being configured when calling the following functions:

        RequestPad
        RequestAndConfigurePad
        RequestAndConfigurePadArray
        RequestDevicePads

    These functions will return FALSE if any of the pad requested has already been requested before. One must release a requested pad before being able to reconfigure this same pad. The following functions are used to release the pads:

        ReleasePad
        ReleasePadArray
        ReleaseDevicePads

    Any guidance is appreciated.

    Thanks

    Thursday, October 16, 2014 6:54 PM

All replies

  • To my knowledge,

    does your hardware uses 8-BIT Interface on MMC1?

    If so in your new configuration I see you are changing MMC1[7:4] are reconfigured as GPIOs.

    May be you have to check with Hardware team whether those pins can be configured as GPIOs are not.

    Regards,

    GSR

    Friday, October 17, 2014 4:19 AM
  • Hi

    You mentioned answer in your post itself " One must release a requested pad before being able to reconfigure this same pad". GPIO_PADS will be configured in OEMInit function itself. You are configured some MMC2 pins.  When SD driver is loading SDIO_PADs should be called, since MMC2 pin functionality already configured, it will return FALSE and that's reporting as error in debug console "SDHCInitialize:: Error requesting pads"

    Please clearly implement PAD configuration header file(bsp_padcfg.h).  otherwise directly use PAD configuration register by getting virtual address of that using MmMapIoSpace function. 

    • Proposed as answer by Keshava GN Friday, November 28, 2014 7:29 AM
    Friday, October 17, 2014 10:31 AM