This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello Everyone,
I am using MSP432E401Y along with external SDRAM of 8MB. This external SDRAM is connected through EPI interface of MSP. When I try to build and load program through JTAG programmer, it gets failed to load program. I am unable to debug or run my program.
I think this is due to: at system startup, compiler tries to initialise global variables. So it also tries to initialise external SDRAM variable too. But at system boot up, EPI interface has not configured. So how do I achieve that? Explain with c code.
For reference see my below code:
- In main.c file I have created global variable of SDRAM
#pragma DATA_SECTION (gdTemp_Array, ".ext_ram")
uint32_t gdTemp_Array[32];
- In .cmd file I have created section for external SDRAM
MEMORY
{
FLASH (RX) : origin = 0x00000000, length = 0x00080000
SRAM (RWX) : origin = 0x20000000, length = 0x00040000
EXT_RAM (RWX) : origin = 0x60000000, length = 0x00800000
}
SECTIONS
{
#ifndef gen_crc_table
.intvecs: > 0x00000000
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
#else
.intvecs: > 0x00000000, crc_table(crc_table_for_intvecs)
.text : > FLASH, crc_table(crc_table_for_text)
.const : > FLASH, crc_table(crc_table_for_const)
.cinit : > FLASH, crc_table(crc_table_for_cinit)
.pinit : > FLASH, crc_table(crc_table_for_pinit)
.init_array : > FLASH, crc_table(crc_table_for_init_array)
.TI.crctab : > FLASH
#endif
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
.ext_ram: > EXT_RAM
}
__STACK_TOP = __stack + 512;
Hey Urvi,
Sorry for the delay. I don't think that's going to be possible initial global variables is external SRAM at programming. I'll see if I can find any examples on the forum of anyone doing this, but I can't seem to think or a way for it to be possible...
Thanks,
JD
If you are using TI compiler with a bare-metal program (i.e. without SYS/BIOS) then you can add a _system_pre_init function to your program to initialise the EPI interface for the SDRAM.URVI SHAH said:I think this is due to: at system startup, compiler tries to initialise global variables. So it also tries to initialise external SDRAM variable too. But at system boot up, EPI interface has not configured. So how do I achieve that?
The description of the _system_pre_init function from the Boot Hook Functions for System Pre-Initialization of the TI ARM compilers User's Guide is:
_system_pre_init():This function provides a place to perform application-specific initialization. It is invoked after the stack pointer is initialized but before any C/C++environment setup is performed. For targets that include MPU support, this function is called after__mpu_init(). By default, _system_pre_init() should return a non-zero value.The default C/C++ environment setup is bypassed if _system_pre_init() returns 0.
**Attention** This is a public forum