cancel
Showing results for 
Search instead for 
Did you mean: 

RAM size is wrong.

Freedom_Neo
Senior

I am using below development tools

MCU: STM32H7B3IIT6

IDE: STM32CubeIDE Version: 1.8.0

GUI: TouchGFX Version: 4.18.1

I am using IS45S16800F-7CTLA1-TR SDRAM. I added CubeIDE interface. External SDRAM size 128Mb==16MB but Built analyzer shows 1024KB. Why does it not true?

0693W00000JQ3JMQA1.png

6 REPLIES 6
Mike_ST
ST Employee

Hello,

This is the MCU's internal RAM that you are highlighting.

You have to define the additionnal memory region in your linker.

And setup the FMC controller before attempting access to it.

I set FMC setup parameters

0693W00000JQ3YTQA1.png0693W00000JQ3g3QAD.png

I added below codes in main file

static FMC_SDRAM_CommandTypeDef Command;
  
  Command.CommandMode            = FMC_SDRAM_CMD_CLK_ENABLE;
  Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK2;
  Command.AutoRefreshNumber      = 1;
  Command.ModeRegisterDefinition = 0;
  HAL_SDRAM_SendCommand(&hsdram2, &Command, 0xfff);
 
  HAL_Delay(1);
 
  Command.CommandMode            = FMC_SDRAM_CMD_PALL;
  HAL_SDRAM_SendCommand(&hsdram2, &Command, 0xfff);
 
  Command.CommandMode            = FMC_SDRAM_CMD_AUTOREFRESH_MODE;
  Command.AutoRefreshNumber      = 2;
  HAL_SDRAM_SendCommand(&hsdram2, &Command, 0xfff);
 
  Command.CommandMode            = FMC_SDRAM_CMD_LOAD_MODE;
  Command.ModeRegisterDefinition = (uint32_t)0 | 0<<3 | 2<<4 | 0<<7 | 1<<9;
  HAL_SDRAM_SendCommand(&hsdram2, &Command, 0xfff);
 
  HAL_SDRAM_ProgramRefreshRate(&hsdram2, 1542);

This is the MCU's internal RAM that you are highlighting.

Before RAM activeted Built analyzer shows below

0693W00000JQ3f5QAD.png 

TDK
Guru

You need to add the external SDRAM region to your linker file if you want it to show up in "Memory Regions". But it doesn't really matter if it shows up there, it's still available to the chip once you configure it within your program.

If you feel a post has answered your question, please click "Accept as Solution".

This window isnt editable or based from wizards, when you add hw as sdram or qspi you need edit LD file ...

example

/* Memories definition */
MEMORY
{
  CCMRAM    (xrw)    : ORIGIN = 0x10000000,   LENGTH = 64K
  RAM    (xrw)    : ORIGIN = 0x20000000,   LENGTH = 320K
  FLASH    (rx)    : ORIGIN = 0x8000000,   LENGTH = 2048K
....
add here
  SDRAM    (xrw)    : ORIGIN = 0xD0000000,   LENGTH =16M
}

 and more edit for sections and use this memory in code, but your design will work without this if you manage and direct address this memory in code as for example in LTDC config