Skip to main content
kashif
Associate II
July 13, 2010
Question

interfacing external RAM with STM32F103ZET6

  • July 13, 2010
  • 4 replies
  • 863 views
Posted on July 13, 2010 at 08:32

interfacing external RAM with STM32F103ZET6

    This topic has been closed for replies.

    4 replies

    kashif
    kashifAuthor
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:58

    thanks Crossware for your reply.

    i have already done that using example code 

    C:\Program Files\Raisonance\Ride\lib\ARM\STM32Lib-v312\Project\STM32F10x_StdPeriph_Examples\FSMC\SRAM_DataMemory 

    using these files in the template project but no success. i an getting the value of TabAddr = 0xFFFFFFFF and MSPValue = 0xFFFFFFF8 , which is not correct.

    i don't know what is wrong with the project. it might be the issue of startup file....

    stforum2
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 13:58

    All in main():

    #define SRAM_BASE 0X68000000

    short ch;

    main()

    {

        // use the Wizards (see Wizards menu) to configure the on-chip peripherals

        // later or alternatively right mouse click on a source code view to access an alternative interface to the Wizards

        //{{EDS_CONFIG(PORTS)

        g_pRCC->APB2ENR |= IOPDEN;

        g_pGPIOD->CRH &= ~0XFFFFFFFF;

        g_pGPIOD->CRH |= 0XBBBBBBBB;

        g_pGPIOD->CRL &= ~0X00FF00FF;

        g_pGPIOD->CRL |= 0X00BB00BB;

        g_pRCC->APB2ENR |= IOPEEN;

        g_pGPIOE->CRH &= ~0XFFFFFFFF;

        g_pGPIOE->CRH |= 0XBBBBBBBB;

        g_pGPIOE->CRL &= ~0XF00000FF;

        g_pGPIOE->CRL |= 0XB00000BB;

        g_pRCC->APB2ENR |= IOPFEN;

        g_pGPIOF->CRH &= ~0XFFFF0000;

        g_pGPIOF->CRH |= 0XBBBB0000;

        g_pGPIOF->CRL &= ~0X00FFFFFF;

        g_pGPIOF->CRL |= 0X00BBBBBB;

        g_pRCC->APB2ENR |= IOPGEN;

        g_pGPIOG->CRH &= ~0X00000F00;

        g_pGPIOG->CRH |= 0X00000B00;

        g_pGPIOG->CRL &= ~0X00FFFFFF;

        g_pGPIOG->CRL |= 0X00BBBBBB;

          //}}EDS_CONFIG

        //{{EDS_CONFIG(FSMC)

        g_pRCC->AHBENR |= FSMCEN;

        g_pFSMC->BCR3 = WREN | MWID0;

        g_pFSMC->BCR3 |= MBKEN;

        //}}EDS_CONFIG

        short* p = (char*)SRAM_BASE;

        for (int i = 0; i < 100; i++)

        {

            *p = i;

            ch = *p;

        }

        while (1)

        {

        }

    }

    kashif
    kashifAuthor
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:58

    i am still trying to understand these examples. some confusing points are:

    1) what is the difference between ''Default startup'' and ''startup_stm32f10x_hd.s''?

    2) what is the difference between ''Default Script File'' and ''stm32f10x_flash_extsram.ld'' ?

    3) where i can find this ''Default Script File''?

    please help me with your valuable experience and expertise.

    regards.

    kashif
    kashifAuthor
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:58

    i have attached my project folder. it is a template project present in 

    C:\Program Files\Raisonance\Ride\lib\ARM\STM32Lib-v312\Project\Template\RIDE

    and i have used the example code of

    C:\Program Files\Raisonance\Ride\lib\ARM\STM32Lib-v312\Project\STM32F10x_StdPeriph_Examples\FSMC\SRAM_DataMemory

    can anybody please verify it and tell me what i am missing in this project. whereas i have successfully used other example codes with this template project.