Hello, we are using the HalCoGen RM48L952ZWT and I am currently running out of internal RAM to execute the code and data. I need to put these code into external SDRAM.
I follow the instructions to define and put the code into external SDRAM. But when I compile the code, I received these errors below:
'Building target: BiolasePFB_ProductionBoard.out'
'Invoking: ARM Linker'
'Flags: -mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi -me -g --gcc --display_error_number --diag_warning=225 --diag_wrap=off --enum_type=packed --printf_support=nofloat -z -m"BiolasePFB_ProductionBoard.map" --heap_size=0x800 --stack_size=0x800 -i"C:/ti/ccsv6/tools/compiler/arm_5.1.6/lib" -i"C:/ti/ccsv6/tools/compiler/arm_5.1.6/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="BiolasePFB_ProductionBoard_linkInfo.xml" --rom_model'
"C:/ti/ccsv6/tools/compiler/arm_5.1.6/bin/armcl" -@"ccsLinker.opt" -o "BiolasePFB_ProductionBoard.out"
<Linking>
"../Drivers/HalCoGen/source/sys_link.cmd", line 102: error #10008-D: cannot
find file ".main_section"
"../Drivers/HalCoGen/source/sys_link.cmd", line 102: error #10021-D: expecting
filename, option, MEMORY, or SECTIONS instead of ":"
"../Drivers/HalCoGen/source/sys_link.cmd", line 104: error #10043-D: expecting
"";"" instead of "LOAD_START"
undefined first referenced
symbol in file
--------- ----------------
MainLoadStart ./Drivers/HalCoGen/source/sys_startup.obj
MainSize ./Drivers/HalCoGen/source/sys_startup.obj
MainStartAddr ./Drivers/HalCoGen/source/sys_startup.obj
error #10234-D: unresolved symbols remain
"../Drivers/HalCoGen/source/sys_link.cmd", line 102: error #10104: undefined symbol "SDRAM" used in expression
"../Drivers/HalCoGen/source/sys_link.cmd", line 102: error #10104: undefined symbol "FLASH0" used in expression
"../Drivers/HalCoGen/source/sys_link.cmd", line 102: error #10104: undefined symbol "FLASH1" used in expression
error #10010: errors encountered during linking; "BiolasePFB_ProductionBoard.out" not built
>> Compilation failure
gmake: *** [BiolasePFB_ProductionBoard.out] Error 1
gmake: Target `all' not remade because of errors.
**** Build Finished ****
_______________________________________
And here is my sys_link.cmd file's content:
/*----------------------------------------------------------------------------*/
/* sys_link.cmd */
/* */
/*
* Copyright (C) 2009-2015 Texas Instruments Incorporated - www.ti.com
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/* */
/*----------------------------------------------------------------------------*/
/* USER CODE BEGIN (0) */
/* USER CODE END */
/*----------------------------------------------------------------------------*/
/* Linker Settings */
--retain="*(.intvecs)"
/* USER CODE BEGIN (1) */
--retain="*(.main_section)"
/* USER CODE END */
/*----------------------------------------------------------------------------*/
/* Memory Map */
MEMORY
{
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH0 (RX) : origin=0x00000020 length=0x0017FFE0
FLASH1 (RX) : origin=0x00180000 length=0x00180000
STACKS (RW) : origin=0x08000000 length=0x00000900
RAM (RW) : origin=0x08000900 length=0x0003f700
/* USER CODE BEGIN (2) */
SDRAM (RWX) : origin=0x80000000 length=0x00200000
/* USER CODE END */
}
/* USER CODE BEGIN (3) */
--heap_size 0x00200000
/* USER CODE END */
/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS
{
.intvecs : {} > VECTORS
.text : {} > FLASH0 | FLASH1
.const : {} > FLASH0 | FLASH1
.cinit : {} > FLASH0 | FLASH1
.pinit : {} > FLASH0 | FLASH1
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM
FEE_TEXT_SECTION : {} > FLASH0 | FLASH1
FEE_CONST_SECTION : {} > FLASH0 | FLASH1
FEE_DATA_SECTION : {} > RAM
/* USER CODE BEGIN (4) */
//FEE_DATA_SECTION : {} > SDRAM
// .sysmem : {} > SDRAM
/* USER CODE END */
}
/* USER CODE BEGIN (5) */
.main_section : RUN = SDRAM, LOAD = FLASH0 | FLASH1
LOAD_START(MainLoadStart), LOAD_END(MainLoadEnd), LOAD_SIZE(MainSize),
RUN_START(MainStartAddr), RUN_END(MainEndAddr)
/* USER CODE END */
/*----------------------------------------------------------------------------*/
/* Misc */
/* USER CODE BEGIN (6) */
/* USER CODE END */
/*----------------------------------------------------------------------------*/
__________________________________________________
Below is how I define my main() code to be executed in external SDRAM based on the instructions:
In sys_startup.c file, I have:
/* USER CODE BEGIN (1) */
#include "emif.h"
/* USER CODE END */
/* USER CODE BEGIN (2) */
extern uint32 MainLoadStart;
extern uint32 MainLoadEnd;
extern uint32 MainSize;
extern uint32 MainStartAddr;
extern uint32 MainEndAddr;
/* USER CODE END */
/* USER CODE BEGIN (26) */
emif_SDRAMInit();
int i;
uint32 size=(uint32)&MainSize;
for(i=0;i<size;i++)
{
((char *)&MainStartAddr)[i] =((char *)&MainLoadStart)[i];
}
/* USER CODE END */
/* call the application */
/*SAFETYMCUSW 296 S MR:8.6 <APPROVED> "Startup code(library functions at block scope)" */
/*SAFETYMCUSW 326 S MR:8.2 <APPROVED> "Startup code(Declaration for main in library)" */
/*SAFETYMCUSW 60 D MR:8.8 <APPROVED> "Startup code(Declaration for main in library;Only doing an extern for the same)" */
#pragma SET_CODE_SECTION(".main_section")
main();
#pragma SET_CODE_SECTION()
/* USER CODE BEGIN (76) */
/* USER CODE END */
/*SAFETYMCUSW 122 S MR:20.11 <APPROVED> "Startup code(exit and abort need to be present)" */
exit(0);
Please help and let me know how to compile and build these code without linking, or compiling errors.
Thanks for your help!
Kenneth Lai