2022-02-16 06:10 AM
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?
2022-02-16 06:22 AM
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.
2022-02-16 06:28 AM
I set FMC setup parameters
2022-02-16 06:29 AM
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);
2022-02-16 06:35 AM
This is the MCU's internal RAM that you are highlighting.
Before RAM activeted Built analyzer shows below
2022-02-16 07:26 AM
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.
2022-02-16 07:45 AM
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