2014-05-14 12:37 AM
Hi!
I would like to use the external RAM IS42S16400 present into the demo board STM32F429DISCO to store program variables. To do that i modify the linker scriptMEMORY
{
FLASH (rx) : ORIGIN =
0x08000000
, LENGTH =2048K
RAM (xrw) : ORIGIN =
0x20000000
, LENGTH =192K
MEMORY_B
1
(rx) : ORIGIN =0x60000000
, LENGTH =0
KCCMRAM (rw) : ORIGIN =
0x10000000
, LENGTH =64K
SDRAM(xrw) : ORIGIN =
0xD0000000
, LENGTH =4096K
}
................sdram
:{
*(
.sdram
)*(
.sdram
*)*(
.sdram_rodata
)*(
.sdram_rodata
*)} >SDRAM
In the main programSDRAM_Init();
/* FMC SDRAM GPIOs Configuration */
SDRAM_GPIOConfig();
/* Disable write protection */
FMC_SDRAMWriteProtectionConfig(
FMC_Bank2_SDRAM
,DISABLE
);Up to here it seems to work correctly.Can i define a variable in this way??uint8_t my_data[1000]
__attribute__ ((section (''.sdram'')));
If i put this instruction, the compiler generates a .bin too large and the system does not work.Thanks!!! #metoo #external-ram #stm32f429disco2014-05-14 04:01 AM
The SDRAM is 8MB (64Mbit)
Unless you plan to have the loader region for the SDRAM in FLASH, and to add/manage initialization code for the C runtime, then you might want to describe the area as NOLOAD..
.sdram (NOLOAD) :
{
..
The code to initialize the SDRAM should be put into the SystemInit() function
SDRAM_Init(); // calls SDRAM_GPIOConfig()
FMC_SDRAMWriteProtectionConfig(FMC_Bank2_SDRAM,DISABLE);
2014-05-14 06:31 AM
2014-07-29 03:46 PM
Hi Gerson74,
Were you able to solve this issue? I am having quite similar problem and wonder if you could share the resolution.2014-07-29 04:12 PM
Were you able to solve this issue?I am having quite similar problem and wonder if you could share the resolution.
Some of us aren't having as many problems, perhaps you can describe YOUR failure scenario, including the development environment, and symptoms. Include a complete/concise example that demonstrates the problem. Review some of the examples for the board STM32F429I-Discovery_FW_V1.0.1\Projects\Peripheral_Examples\FMC_SDRAM\readme.txt And perhaps some start up examples which initialize external bused memories before the C run time code attempts to copy/zero statics.2014-07-30 06:14 PM
Hi Clive1,
Thank you so much for getting back to this thread.My environment.
HW: STM32F429I-DISCO MB1075B SW: STM32F429I-Discovery_FW_V1.0.1 ( I replaced system_stm32f4xx.c with the one you provided. ) Tool: Keil uVision V5.10.0.2What I'd like to do:
Use external SDRAM instead of internal SRAM or at least use external SDRAM to put ZI data. -> Is this something that is even possible?What I did:
0. I was able to run FMC_SDRAM example program. cool. 1. Activated #define DATA_IN_ExtSDRAM line in system_stm32f4xx.c 2. In uVision -> Options for Target 'FMC_SDRAM' -> Read/Write Memory Area, I wrote 0xD0000000 for RAM1 Start, 0x400000 for Size and checked 'default' option. 2.1 When I start debug session, before it goes to main(), it stucks at HardFault_Handler(). 3. From step 1 above, I did same as step 2 except checking 'default' option. (So 'default' is checked at IRAM1) Instead of checking 'default' option, I went to 'Options for File 'xxxxxx' ' and assigned RAM1 for Zero Initialized Data. 3.1 When I start debug session, result is same as 2.1. 4. I tried to use ''FMC memory mapping swap'' 4.1 Inserted below 2 lines in the beginning of SystemInit() RCC->APB2ENR |= ((uint32_t)0x00004000); SYSCFG->MEMRMP = ((uint32_t)0x00000400); 4.2 In stm32f429i_discovery_sdram.h, changed SDRAM_BANK_ADDR to 0x90000000 4.3 Repeated step 2. Of course in this time I used 0x90000000 instead of 0xD0000000. And got same result 4.4 Repeated step 3. And got same result. 5. I am stucked here for about a week.Your help will be so much appreciated.
2014-07-30 07:40 PM
Attached is a Keil uV 4.7 project that builds under
STM32F429I-Discovery_FW_V1.0.1\Projects\SDRAM-DEMO2 Debug output is output via SWV (make solder bridge SB9), with the trace set for 180 MHz, and View -> Serial Window -> Debug (printf) Viewer ________________ Attachments : SDRAM-DEMO2.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I01a&d=%2Fa%2F0X0000000bSK%2F8lZlQgoo3wkmFt_arQ1boHiBU_7uv08ZMUNaUo6BrpM&asPdf=false2014-08-07 12:49 PM
Hi Clive,
Thank you so much. I was able to do what I wanted to do. I failed to findout what was wrong though. Anyway thanks again.2014-08-07 01:21 PM
I failed to find out what was wrong though
Probably that your initial stack pointer was set to memory in the SDRAM which was not yet initialized.