Skip to main content
nickabrham
Associate II
August 13, 2014
Question

SRAM_DataMemory Issue

  • August 13, 2014
  • 8 replies
  • 2044 views
Posted on August 13, 2014 at 10:55

Hi,

I am unable to run the example STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\FSMC\SRAM_DataMemory on my STM3210E-EVAL Board. Although I have made the following settings

  • Project->Options for Target window, select 'RAM1'and enter 0x68000000as start address with size of 0x100000 (IRAM1 must be un-checked)
  • uncomment ''#define DATA_IN_ExtSRAM '' in the ''system_stm32f10x.c'' file

But still the code is unable to execute. Attached zip file is the complete project folder.

regards,

Nick.

    This topic has been closed for replies.

    8 replies

    zeros_and_ones1991
    Associate III
    August 13, 2014
    Posted on August 13, 2014 at 17:07

    Does The STM32F1xx series have FSMC in the first place ? ....... I do not think so .

    Tesla DeLorean
    Guru
    August 13, 2014
    Posted on August 13, 2014 at 17:24

    Does The STM32F1xx series have FSMC in the first place ? ....... I do not think so .

    High Density series of parts.

    http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/CD00200423.pdf

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    nickabrham
    Associate II
    August 13, 2014
    Posted on August 13, 2014 at 21:41

    Hi clive,

    I have gone through this document and have successfully compiled the following STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\FSMC\SRAM_DataMemory example using the MDK-ARM toolchain. But it seems the code is not running. Can anyone please look at the attached file and let me know if I am missing something?.

    Tesla DeLorean
    Guru
    August 13, 2014
    Posted on August 13, 2014 at 22:24

    Make sure your initial stack point is NOT in external memory which hasn't been configured/initialized yet.

    You need your own project localized version of startup_stm32f1_whatever.s

    ...
    __Vectors DCD 0x20002000 ; Top of Stack MUST be in valid RAM, __main will change to __initial_sp later
    DCD Reset_Handler ; Reset Handler
    DCD NMI_Handler ; NMI Handler
    DCD HardFault_Handler ; Hard Fault Handler
    DCD MemManage_Handler ; MPU Fault Handler
    DCD BusFault_Handler ; Bus Fault Handler
    DCD UsageFault_Handler ; Usage Fault Handler
    ...

    Failing this you'll need to describe ''not working'' in some CPU centric way using the debugger to identify what is actually happening. I'm not sure of the wisdom of NOT using Internal SRAM, one realistically should floor plan the memory use so the fast internal RAM is used as much as possible, and the SLOW external memory is only used for things which are too big to fit, and the performance penalty is understood. Putting the stack in external memory is a very unwise as it will significantly degrade performance of all code running.
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    jpeacock2399
    Associate III
    August 13, 2014
    Posted on August 13, 2014 at 22:50

    The 'F103 has an FSMC.  The STM3210E board has a 16 bit NOR flash, 8 bit NAND flash, 16-bit SRAM and LCD controller on the FSMC.  The NOR is a Spansion GL128P90FFIR2, 8M x 16 on the NE2 chip select, at 0x6400 0000.  It has a RDY/WAIT on PD2 to time erases.

      Jack Peacock
    nickabrham
    Associate II
    August 15, 2014
    Posted on August 15, 2014 at 08:28

    Hi clive,

    What I have observed is that the stack initial pointer is also in the external RAM. Although it should have been in the internal RAM address.

    Can you please help me out where am I going wrong. Thestack initial pointer address in

    startup_stm32f10x_hd.s file is defined at 0x20000

    Attached file contains the complete MDK-ARM code.

    ________________

    Attachments :

    STM32F10x_StdPeriph_Template.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0mS&d=%2Fa%2F0X0000000bgF%2FegaBovFr7v8hkut31DY_xl2VIIu2i2_7YsM6SsoM2Ik&asPdf=false
    Tesla DeLorean
    Guru
    August 16, 2014
    Posted on August 16, 2014 at 05:30

    The .MAP suggests the stack is still in the external memory. You can't do it with an equate, you'll need to use a scatter file which defines both internal and external memory, and direct the stack into the segment/section which is in internal RAM.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    nickabrham
    Associate II
    August 18, 2014
    Posted on August 18, 2014 at 11:57

    Hi Clive,

    I have finally achieved the result by modifying the scatter file. Now the Map file is showing that the STACK is in internal memory. Thanks for your support.

    Just one more query. I am unable to run other GPIO and UART when I use the external RAM. Whereas if I use internal RAM, then the code runs perfectly. Kindly check the attached project. I am running the code on my STM3210E-EVAL.

    regards,

    Nick

    ________________

    Attachments :

    STM32F10x_StdPeriph_Template.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0np&d=%2Fa%2F0X0000000bgC%2FpbbqxD5JfPhxbRHjDL21kPp_LHno1ikL.r0ZdhQFYiM&asPdf=false