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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
9,675 次查看
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 项奖励
回复
1 解答
9,448 次查看
liuhailong
Contributor III
0 项奖励
回复
11 回复数
9,667 次查看
liuhailong
Contributor III
0 项奖励
回复
9,658 次查看
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 项奖励
回复
9,654 次查看
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 项奖励
回复
9,643 次查看
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 项奖励
回复
9,628 次查看
liuhailong
Contributor III

liuhailong_0-1698886319161.pngliuhailong_0-1698886319161.pngliuhailong_1-1698886398657.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 项奖励
回复
9,613 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @liuhailong ,

Please modify two place.

jingpan_0-1698915687562.pngjingpan_0-1698915687562.png

 

And in board.c

jingpan_1-1698915721663.pngjingpan_1-1698915721663.png

 

Regards,

Jing

 

0 项奖励
回复
9,594 次查看
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 项奖励
回复
9,576 次查看
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 项奖励
回复
9,572 次查看
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 项奖励
回复
9,455 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @liuhailong ,

Their MPU and control code is different.

 

Regards,

Jing

0 项奖励
回复
9,449 次查看
liuhailong
Contributor III

thanks a lot

0 项奖励
回复