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.

  • TI Thinks Resolved

RTOS/AM3352: PRCMModuleEnable about MMC2

Intellectual 710 points

Replies: 8

Views: 225

Part Number: AM3352

Tool/software: TI-RTOS

Hi

      I want to use MMC2 instance for my test,I have use TI pinmux tools to configure MMCSD2 and do manually update the pinmux_data.c file.

on Board_pinmuxConfig function ,I add:

if(S_PASS == status)
{
status = PINMUXModuleConfig(CHIPDB_MOD_ID_MMCSD, 2U, NULL);
}

and in Board_moduleClockInit founction,I add 

if(S_PASS == status)
{
status = PRCMModuleEnable(CHIPDB_MOD_ID_MMCSD, 2U, 0U);
}

but in fouction 

int32_t PRCMModuleEnable(chipdbModuleID_t moduleId, uint32_t instNum,uint32_t isBlockingCall)

there is no instNum 2 for mmc2.only 0 and 1 for mmc0 and mmc1.

AMM3352 don't support MMC2?

if no,how can I enable PRCMModule for mmc 2?

my PKD version is pdk_am335x_1_0_13.

thansk!

  • when I modify founction PRCMModuleEnable likes:
    case CHIPDB_MOD_ID_MMCSD:
    {
    switch(instNum)
    {
    case 0:
    enableModule(SOC_CM_PER_REGS, CM_PER_MMC0_CLKCTRL,
    CM_PER_L3_CLKSTCTRL, CM_PER_L3_CLKSTCTRL_CLKACTIVITY_MMC_FCLK);
    break;
    case 1:
    enableModule(SOC_CM_PER_REGS, CM_PER_MMC1_CLKCTRL,
    CM_PER_L3_CLKSTCTRL, CM_PER_L3_CLKSTCTRL_CLKACTIVITY_MMC_FCLK);
    break;
    case 2:
    enableModule(SOC_CM_PER_REGS, CM_PER_MMC2_CLKCTRL,
    CM_PER_L3_CLKSTCTRL, CM_PER_L3_CLKSTCTRL_CLKACTIVITY_MMC_FCLK);
    break;
    }

    in my task,I use
    MMCSD_socGetInitCfg(MMCSD_INSTANCE_EMMC,&hwAttrsConfig);
    MMCSD_socSetInitCfg(MMCSD_INSTANCE_EMMC,&hwAttrsConfig);
    MMCSD_init();
    MMCSD_open(MMCSD_INSTANCE_EMMC, NULL, &handle);

    MMCSD_INSTANCE_EMMC is defined 2,when executed MMCSD_open founction, it is crashed.
    the debug log show:CortxA8:
    Unhandled ADP_Stopped exception 0x81432798
  • Guru 62440 points

    In reply to user5954100:

    Hi,

    For the SOC, AM335x has 3 MMCSD. However, several TI AM335x EVM's didn't support 3 MMCSD instances, it has 2 MMCSD the most (one for MMCSD, the other is EMMC).

    You indicated testing on MMC2, what is the hardware for this testing? Also there is a HW attribute table in pdk_am335x_1_0_14\packages\ti\drv\mmcsd\soc\am335x\MMCSD_soc.c, do you update with MMCSD instance 2 with EMMC?

    Regards, Eric
  • In reply to lding:

    Hi Eric

         the hardware is our own designedboard,and it is worked for linux,

    now we want to use RTOS for our products.

    I also update the soc config about cardType to MMCSD_CARD_EMMC  on MMCSD_soc.c .

    I modify the HW config like add uart5 for our own board.

  • Guru 62440 points

    In reply to user5954100:

    Hi,

    For your own board, please follow software-dl.ti.com/.../index_board.html to create your own board library. This includes PINMUX setting, PRCM initialization for the MMC2 instance.

    As you have Linux worked for the board, the Pinmux used in Linux would be a good reference.

    I am not sure if you also have MMC0 and MMC 1 on your board, are you able to test them with our RTOS MMCSD driver example? If yes, then we need to focus on MMC2 only. When you open the MMC2, do you still have the crash? Do you have the MMU setup in the RTOS .cfg to access the MMC2 registers? Are you able to step through the MMCSD_open call to see what functions caused the crash?

    I assume you have a CCS project for this. For easier debugging MMCSD driver issues, you can add the MMCSD_v1.c file into your CCS project then step through the functions in MMCSD_v1.c.

    Regards, Eric
  • In reply to lding:

    Hi Eric

        Thank you very much for your feedback.

    I don't creat a new board library for my own board, I just modify the bbb board library for my test,and I have build the board library when modified.

    I am sure the pinmux config is right.we only have MMC2 on my board.

    I dong't what the MMU setup in the RTOS .cfg to access the MMC2 registers, I dont' modify the .cfg,I just use the default config.

    the basic project I tested is MMCSD_bbbAM335x_armTestproject.

    I have add the MMCSD_drv.c to the project,and step it ,it is still carsh in function MMCSD_open,

    the error creat on the code :

    retVal = ((MMCSD_Config *) (MMCSD_Handle)&(MMCSD_config[index]))->fxnTablePtr->openFxn((MMCSD_Handle)&(MMCSD_config[index]), params);

  • In reply to user5954100:

    in the function PRCMModuleEnable(chipdbModuleID_t moduleId, uint32_t instNum,uint32_t isBlockingCall) in file am335x_prm.c .
    there is no instNum for MMC2,so I have add like this:

    case CHIPDB_MOD_ID_MMCSD:
    {
    switch(instNum)
    {
    case 0:
    enableModule(SOC_CM_PER_REGS, CM_PER_MMC0_CLKCTRL,
    CM_PER_L3_CLKSTCTRL, CM_PER_L3_CLKSTCTRL_CLKACTIVITY_MMC_FCLK);
    break;
    case 1:
    enableModule(SOC_CM_PER_REGS, CM_PER_MMC1_CLKCTRL,
    CM_PER_L3_CLKSTCTRL, CM_PER_L3_CLKSTCTRL_CLKACTIVITY_MMC_FCLK);
    break;
    case 2://add MMC2 instNum
    enableModule(SOC_CM_PER_REGS, CM_PER_MMC2_CLKCTRL,
    CM_PER_L3_CLKSTCTRL, CM_PER_L3_CLKSTCTRL_CLKACTIVITY_MMC_FCLK);
    break;
    }
    }
    break;

    I am not sure is right.

  • In reply to user5954100:

    Hi Eric

        Is there any update today?

  • Guru 62440 points

    In reply to user5954100:

    Hi,

    Your way for modifying the existing BBB board library (without creating a new one) should also work for this purpose. The PRCM code to enable MMC2 looks right.

    We don't have any AM335x platform with MMC2 so we can't test. You may see pdk_am335x_1_0_14\packages\ti\drv\mmcsd\soc\am335x\MMCSD_soc.c. This is our hardware definition file for AM335x, where MMC0 is MMCSD, MMC1 is EMMC and MMC2 is MMCSD. In your case, MMC2 is EMMC, you can keep the entry for MMC0 and MMC1, but modify the MMC2 in your case to EMMC. It looks you already did, but double check.

    Also, the MMC instance base address:
    /** @brief Base address of MMC memory mapped registers */
    #define SOC_MMCHS_0_REGS (0x48060000)
    #define SOC_MMCHS_1_REGS (0x481D8000)
    #define SOC_MMCHS_2_REGS (0x47810000)

    You need add an entry to setup the MMU for the MMC2, do you use pdk_am335x_1_0_14\packages\ti\drv\mmcsd\test\am335x\armv7\bios\mmcsd_bbbam335x.cfg? You need

    /* Define the base address of the 1 Meg page the peripheral resides in. */
    var peripheralBaseAddr = 0x47810000;

    /* Configure the corresponding MMU page descriptor accordingly */
    Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
    peripheralBaseAddr,
    peripheralAttrs);

    When step through the code, you can set a breakpoint at MMCSD_v1_open() first then see how the code runs and how it crashed.

    Regards, Eric

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.