This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32 SDRAM Scatter File

Hello,

i have the following problem:

I would like to access the external SDRAM on the STM32F429 Discovery. I could access the external SDRAM, that is not the main problem. The problem is, that i have to access the external SDRAM as the following:

 /* SDRAM Initialization */
  SDRAM_Init();

  /* FMC SDRAM GPIOs Configuration */
  SDRAM_GPIOConfig();

//Write SDRAM
  for (counter = 0; counter < TRANSFERS; counter++)
  {
    *(__IO uint16_t*) (SDRAM_BANK_ADDR + 2*counter) = (uint16_t)(uhWritedata_16b + counter);
  }

Here i havé to add the Address "SDRAM_BANK_ADDR" if i would like to write into the external SDRAM. Now i should configure the Scatter - File that i doesn't need that Section. How must be the changes? Is it possible to auto - configure this Section as external SDRAM?

My Scatter File looks like this:


; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x08000000 0x00200000  {    ; load region size_region
  ER_IROM1 0x08000000 0x00200000  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  RW_IRAM1 0x20000000 0x00030000  {  ; RW data
   .ANY (+RW +ZI)
  }
}


;LR_ERAM1 0xD0000000 0xD0400000 {
        ;ER_ERAM1 0xD0000000 0xD0400000  {
          ;.ANY (+RW +ZI)
        ;}
;}



Thanks for your help.

Parents
  • Try this
    http://goo.gl/XDTOdJ
    or
    Google "STM32F429DISCO EXTERNAL RAM"

    There seems to be a basic lack of comprehension. The Internal SRAM is situated at 0x20000000 and above, the external SDRAM at 0xD0000000, your can access EITHER without functions, they live in the same 4GB/32-bit memory map of the micro-processor. They are not mysteriously different.

    The define is within the same system_stm32f4xx.c source as the SystemInit() function, and the external memory configuration routine. Use "Find in File" or "Go to Definition". This is a project specific file, tailored to your hardware. There is a Keil example of this file for the STM32F429I-DISCO board at the end of the cited thread.

    The memory needs to get configured prior to use by the C compiler's run time code, as if you describe the available memory in the scatter file and put statics there, they will need to be initialized or zeroed. If the FMC hasn't been configured the system will Hard Fault.

    A lot of these concepts should be covered in "Assemblers, Compilers, Linkers, and Loaders" type books and classes.

    You want to be selective about what you put in this external memory because it's decidedly slower than internal SRAM. Like I said, you can direct specific variables into specific sections/segments, you can put the HEAP in this memory, and allocate that, or use pointers. This isn't distinctly different from any other C use of memory. You just need to be a little selective about which area of memory you want to use for different purposes. If you put the STACK in SDRAM it will make everything SLOWER.

Reply
  • Try this
    http://goo.gl/XDTOdJ
    or
    Google "STM32F429DISCO EXTERNAL RAM"

    There seems to be a basic lack of comprehension. The Internal SRAM is situated at 0x20000000 and above, the external SDRAM at 0xD0000000, your can access EITHER without functions, they live in the same 4GB/32-bit memory map of the micro-processor. They are not mysteriously different.

    The define is within the same system_stm32f4xx.c source as the SystemInit() function, and the external memory configuration routine. Use "Find in File" or "Go to Definition". This is a project specific file, tailored to your hardware. There is a Keil example of this file for the STM32F429I-DISCO board at the end of the cited thread.

    The memory needs to get configured prior to use by the C compiler's run time code, as if you describe the available memory in the scatter file and put statics there, they will need to be initialized or zeroed. If the FMC hasn't been configured the system will Hard Fault.

    A lot of these concepts should be covered in "Assemblers, Compilers, Linkers, and Loaders" type books and classes.

    You want to be selective about what you put in this external memory because it's decidedly slower than internal SRAM. Like I said, you can direct specific variables into specific sections/segments, you can put the HEAP in this memory, and allocate that, or use pointers. This isn't distinctly different from any other C use of memory. You just need to be a little selective about which area of memory you want to use for different purposes. If you put the STACK in SDRAM it will make everything SLOWER.

Children