4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-19 14:43:30 +08:00
rt-thread-official/bsp/tms320f28379d/2837x_RAM_lnk_cpu1.cmd
YuQi b11cb41ae7
tms320f28379d fix init (#6343)
解决 tms320f28379d bsp 启动的问题。主要改动如下。

修正context.s中汇编代码错误。在旧版的代码中,操作数为32位而汇编命令却使用了针对16位数据的命令MOV,导致程序在某些情况无法正常启动线程。
由于C28x的平台下,SP只支持16bit寻址,所以用于线程空间存放的heap以及ebss段都需要放在低16位的空间,针对这个问题修改了CMD文件。此外还增加基于CMD文件基于RAM的支持,方便调试。
新增rtdef.h中RT_SECTION,RT_USED,ALIGN和RT_WEAK的定义。旧版bsp中这些定义为空,导致INIT_EXPORT注册的函数失效。
修改程序启动代码,在程序入口直接调用原生启动代码
以上改动在LAUNCHXL-F28379D 通过了测试。
2022-08-29 15:35:23 -04:00

79 lines
2.4 KiB
Batchfile

___heap_end = 0x00F000;
MEMORY
{
PAGE 0 :
/* BEGIN is used for the "boot to SARAM" bootloader mode */
BEGIN : origin = 0x000000, length = 0x000002
RAMM0 : origin = 0x000122, length = 0x0002DE
RESET : origin = 0x3FFFC0, length = 0x000002
RAMGS8_15 : origin = 0x013000, length = 0x009000
PAGE 1 :
RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */
EBSS : origin = 0x008000, length = 0x007000 /* RAMLS0-4, 5*0x0800 */
ECONST : origin = 0x00F000, length = 0x004000 /* RAMGS0-2, 3*0x1000 */
CPU2TOCPU1RAM : origin = 0x03F800, length = 0x000400
CPU1TOCPU2RAM : origin = 0x03FC00, length = 0x000400
}
SECTIONS
{
codestart : > BEGIN, PAGE = 0
#ifdef __TI_COMPILER_VERSION__
#if __TI_COMPILER_VERSION__ >= 15009000
.TI.ramfunc : {} > RAMM0, PAGE = 0
#else
ramfuncs : > RAMM0 PAGE = 0
#endif
#endif
.text : > RAMGS8_15, PAGE = 0
.cinit : > RAMM0, PAGE = 0
.pinit : > RAMM0, PAGE = 0
.switch : > RAMM0, PAGE = 0
.reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */
.rti_fn.0.end : > RAMM1, PAGE = 1
.rti_fn.0 : > RAMM1, PAGE = 1
.rti_fn.1.end : > RAMM1, PAGE = 1
.rti_fn.6.end : > RAMM1, PAGE = 1
.rti_fn.6 : > RAMM1, PAGE = 1
.stack : > RAMM1, PAGE = 1
.esysmem : > RAMM1, PAGE = 1
.ebss : > EBSS,
LOAD_START(___ebss_start),
LOAD_END(___ebss_end),
PAGE = 1
.econst : > ECONST, PAGE = 1
/* finsh symbol table */
FSymTab : > RAMM1, PAGE = 1, ALIGN(4)
LOAD_START(___fsymtab_start)
LOAD_END(___fsymtab_end)
/* The following section definitions are required when using the IPC API Drivers */
GROUP : > CPU1TOCPU2RAM, PAGE = 1
{
PUTBUFFER
PUTWRITEIDX
GETREADIDX
}
GROUP : > CPU2TOCPU1RAM, PAGE = 1
{
GETBUFFER : TYPE = DSECT
GETWRITEIDX : TYPE = DSECT
PUTREADIDX : TYPE = DSECT
}
}
/*
//===========================================================================
// End of file.
//===========================================================================
*/