2022-08-25 10:37 PM
I am using STM32H757I-Eval Board for our study, I created the project for STM32H757 SDRAM interface. While configuring the SDRAM through FMC. I configured SDRAM1 with Bank 2.
After that found that the pin configuration generated by the code generator there is difference in Pins interface in schematics of eval board with SDRAM interface. So I modified the a same accordingly and compiled the code.
I created variable and allocate it SDRAM Memory Address 0xD0000000 with the following statement.
uint32_t SDRAM_Buff[256] __attribute__((section(".ARM.__at_0xD0000000")));
I updated the variable with some data,.
for(Counter = 0; Counter>256; Counter++)
{
SDRAM_Buff[Counter] = Counter+1;
}
After compiling the same I checked the MAP file to verify whether the variable is allocated in SDRAM memory or not. I found below mentioned information which I thing is not correct.
Kindly assist whether i am doing correct or i am missing something. I referred the code package of STM32H747I since I am not able to find the code bundle for STM32H757I-Eval board. If possible please share the same it will be very help ful.
I am also attaching the project for reference to check and verify the same with STM32H757I-Eval board.
Kindly provide the solution for the same .
BR,
Gaurav More
2022-08-29 12:29 AM
Hello,
I did the modification by referring the below link. now I am able to see the variable allocation in SDRAM memory.
https://www.eevblog.com/forum/microcontrollers/stm32cubeide-flash-and-sdram-configuration/
Refer the below modification added in STM32H757XIHX_FLASH.ld file
/* Memories definition */
MEMORY
{
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
SDRAM (xrw) : ORIGIN = 0xD0000000, LENGTH = 8192K
}
/* Sections */
SECTIONS
{
/* external SDRAM */
.sdram (NOLOAD) :
{
. = ALIGN(4);
*(.sdram .sdram.*)
} > SDRAM
....
after doing this modification I allocated the variable mentioned below,
__attribute__((section(".sdram"))) uint32_t SDRAM_Buff[256];
After compiling I see the memory allocated in memory region under SDRAM
I have assigned values to the variable to confirm whether the memory allocated in working properly or not. There while debugging I found that it is going to hard fault handler. This happens when it execute variable allocation part.
for(Counter = 0; Counter<256; Counter++)
{
SDRAM_Buff[Counter] = Counter+1;
}
I have also attached the updated code, kindly refer the same ad revert whether i have made any mistake or missed any initialization routine. I am using STM32H757I-Eval board for this testing. There it is connected to S42S32800G-6BLI SDRAM.
Kindly check the code and provide the solution and comments for the same.
@Olivier VILLARET
BR,
Gaurav More
2022-09-05 01:56 AM
Hello,
With reference to the example code mentioned I tried to modify the code by initializing the code of SDRAM in systeminit function. but still I am not able debug the code and move further.
please let e know if i am making any mistake int he code. please refer the code attached in the earlier post in the forum in this thread.
BR
Gaurav More