SRAM IO refresh failed due to error in RT1175 CM7 core program

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SRAM IO refresh failed due to error in RT1175 CM7 core program

Jump to solution
1,013 Views
liuhailong
Contributor III

SRAMIO refresh failed due to error in RT1170 CM7 core program,Using SEMC's SDRAM official example program, add their own modified code, make it into SRAM program, SRAMIO refresh in the RT1170 CM7 core program error, run failure.The same program in cm4 core can run normally, want to ask, CM7 core should be configured?Procedural Reference Annex.

#i.MX RT  

0 Kudos
1 Solution
786 Views
liuhailong
Contributor III
0 Kudos
11 Replies
1,005 Views
liuhailong
Contributor III
0 Kudos
996 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @liuhailong ,

Here is SEMC configuration for SRAM 8bit.  If you want to use 16bit sram, just set portsize to 16. You should adjust other timing parameters according to your sram.

status_t BOARD_InitSEMC(void)
{
    semc_config_t config;
    semc_sdram_config_t sdramconfig;
    semc_sram_config_t sramconfig;
    semc_nor_config_t  norconfig;
    uint32_t clockFrq = EXAMPLE_SEMC_CLK_FREQ;

    /* Initializes the MAC configure structure to zero. */
    memset(&config, 0, sizeof(semc_config_t));
    memset(&sdramconfig, 0, sizeof(semc_sdram_config_t));

    /* Initialize SEMC. */
    SEMC_GetDefaultConfig(&config);
    config.dqsMode = kSEMC_Loopbackdqspad; /* For more accurate timing. */
    SEMC_Init(SEMC, &config);

    /* Configure SRAM */
    sramconfig.cePinMux = kSEMC_MUXRDY;
    sramconfig.address = EXAMPLE_SRAM_START_ADDRESS;
    sramconfig.memsize_kbytes = 256 * 1024;
    sramconfig.addrPortWidth = 24;
    sramconfig.advActivePolarity = kSEMC_AdvActiveLow;
    sramconfig.addrMode = kSEMC_AddrDataNonMux;
    sramconfig.burstLen = kSEMC_Nor_BurstLen4;
    sramconfig.portSize = kSEMC_PortSize8Bit;
    sramconfig.syncMode = kSEMC_AsyncMode;
    sramconfig.waitEnable = false;
    sramconfig.advLevelCtrl = kSEMC_AdvLow;
    sramconfig.tCeSetup_Ns = 20;
    sramconfig.tCeHold_Ns = 20;
    sramconfig.tCeInterval_Ns = 100;
    sramconfig.readHoldTime_Ns = 20;
    sramconfig.tAddrSetup_Ns = 20;
    sramconfig.tAddrHold_Ns = 20;
    sramconfig.tWeLow_Ns = 20;
    sramconfig.tWeHigh_Ns = 20;
    sramconfig.tReLow_Ns = 20;
    sramconfig.tReHigh_Ns = 20;
    sramconfig.tTurnAround_Ns = 20;
    sramconfig.tAddr2WriteHold_Ns = 20;
    sramconfig.tWriteSetup_Ns = 20;
    sramconfig.tWriteHold_Ns = 20;
    sramconfig.latencyCount = 2;
    sramconfig.readCycle = 2;
    sramconfig.delayChain = 2;
    sramconfig.waitSample = 1;
    sramconfig.addr27 = kSEMC_MORA27_NONE;

    if (SEMC_ConfigureSRAM(EXAMPLE_SEMC, &sramconfig, clockFrq) != kStatus_Success)
    {
        PRINTF("SEMC SRAM configuration is failed\r\n");
    }
    EXAMPLE_SEMC->IOCR = (EXAMPLE_SEMC->IOCR & ~(SEMC_IOCR_MUX_CLKX0_MASK | SEMC_IOCR_MUX_CLKX1_MASK)) |
                SEMC_IOCR_MUX_CLKX0(2) | SEMC_IOCR_MUX_CLKX1(2) | SEMC_IOCR_CLKX0_AO_MASK;
    EXAMPLE_SEMC->IOCR = (EXAMPLE_SEMC->IOCR & ~SEMC_IOCR_MUX_RDY_MASK) | SEMC_IOCR_MUX_RDY(6);

}

 

Regards,

Jing

0 Kudos
992 Views
liuhailong
Contributor III

hello thanks

According to your description, there are two questions you would like to ask.

1.

EXAMPLE_SEMC->IOCR = (EXAMPLE_SEMC->IOCR & ~(SEMC_IOCR_MUX_CLKX0_MASK | SEMC_IOCR_MUX_CLKX1_MASK)) |
                SEMC_IOCR_MUX_CLKX0(2) | SEMC_IOCR_MUX_CLKX1(2) | SEMC_IOCR_CLKX0_AO_MASK;
    EXAMPLE_SEMC->IOCR = (EXAMPLE_SEMC->IOCR & ~SEMC_IOCR_MUX_RDY_MASK) | SEMC_IOCR_MUX_RDY(6);

What parameters are configured?

   sramconfig.cePinMux = kSEMC_MUXRDY;
    sramconfig.address = EXAMPLE_SRAM_START_ADDRESS;

 Haven't the following two lines of code been configured? 

2.Do you give CM7 kernel parameters configuration for the program I write?My same code failed in CM4 core, could you tell me what's the difference between MRT1175 CM7 and CM4 core for SRAM? @jingpan 

0 Kudos
981 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @liuhailong ,

I use SEMC_RDY pin as CE#. Start address is 0x90000000. But you can set to any address from 0x80000000 to 0xe0000000.

There is no difference to CM7 and CM4. You can use cm7 to config SEMC. The result is same.

 

Regards,

Jing

0 Kudos
970 Views
liuhailong
Contributor III

liuhailong_0-1698886319161.pngliuhailong_1-1698886398657.png

SRAM can only use 0XC0000000, and is the SEMC region, I want to ask, the SEMC3 address in the figure is 0xC0000000, why I write the code, in CM7 can not achieve the results, and CM4 can, can refer to my latest attachments

 

0 Kudos
955 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @liuhailong ,

Please modify two place.

jingpan_0-1698915687562.png

 

And in board.c

jingpan_1-1698915721663.png

 

Regards,

Jing

 

0 Kudos
936 Views
liuhailong
Contributor III

hello,thanksThe first picture shows the configuration of sdram. Please ask if there is a configuration of sdram. The second picture is region 1, but I need to use region 3, SRAM's exclusive region.

0 Kudos
918 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

1. It's just a name. You can rename it to SRAM or any thing else. Please focus on address.

2. SEMC0~SEMCn belong to SEMC address range.

 

Regards,

Jing

0 Kudos
914 Views
liuhailong
Contributor III

Ok my problem solved,can you tell me the reasons that cm4 program does not need to be set,But CM7 has to board.c  and settings like that you give me the two pictures?

0 Kudos
797 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @liuhailong ,

Their MPU and control code is different.

 

Regards,

Jing

0 Kudos
787 Views
liuhailong
Contributor III

thanks a lot

0 Kudos