Skip to content

Instantly share code, notes, and snippets.

@deepakkarki
Created May 19, 2014 03:23
Show Gist options
  • Save deepakkarki/2f19309d3bcf43bfb2ad to your computer and use it in GitHub Desktop.
Save deepakkarki/2f19309d3bcf43bfb2ad to your computer and use it in GitHub Desktop.
linker file
/****************************************************************************/
/* LNK.CMD */
/* */
/* Usage: clpru <src files...> -z -o <out file> -m <map file> lnk.cmd */
/* */
/* Description: This file is a sample command file that can be used */
/* for linking programs built with the PRU C */
/* Compiler. Use it as a guideline; you may want to change */
/* the allocation scheme according to the size of your */
/* program and the memory layout of your target system. */
/* */
/* Notes: (1) You must specify the directory in which rts.lib is */
/* located. Either add a "-i<directory>" line to this */
/* file, or use the system environment variable PRU_C_DIR to */
/* specify a search path for libraries. */
/* */
/* */
/****************************************************************************/
-cr /* LINK USING C CONVENTIONS */
-stack 0x0200 /* SOFTWARE STACK SIZE */
-heap 0x0200 /* HEAP AREA SIZE */
/*--args 0x100 */
/* SPECIFY THE SYSTEM MEMORY MAP */
/* memory map for am335x (8K data, 8K code) */
MEMORY
{
PAGE 0:
P_MEM : org = 0x00000000 len = 0x00002000
PAGE 1:
D_MEM : org = 0x00000000 len = 0x00002000
C0: o = 0x00020000 l = 0x00002000 CREGISTER=0
C1: o = 0x48040000 l = 0x00002000 CREGISTER=1
C2: o = 0x4802a000 l = 0x00002000 CREGISTER=2
C3: o = 0x00030000 l = 0x00002000 CREGISTER=3
C4: o = 0x00026000 l = 0x00002000 CREGISTER=4
C5: o = 0x48060000 l = 0x00002000 CREGISTER=5
C6: o = 0x48030000 l = 0x00002000 CREGISTER=6
C7: o = 0x00028000 l = 0x00002000 CREGISTER=7
C8: o = 0x46000000 l = 0x00002000 CREGISTER=8
C9: o = 0x4a100000 l = 0x00002000 CREGISTER=9
C10: o = 0x48318000 l = 0x00002000 CREGISTER=10
C11: o = 0x48022000 l = 0x00002000 CREGISTER=11
C12: o = 0x48024000 l = 0x00002000 CREGISTER=12
C13: o = 0x48310000 l = 0x00002000 CREGISTER=13
C14: o = 0x481cc000 l = 0x00002000 CREGISTER=14
C15: o = 0x481d0000 l = 0x00002000 CREGISTER=15
C16: o = 0x481a0000 l = 0x00002000 CREGISTER=16
C17: o = 0x4819c000 l = 0x00002000 CREGISTER=17
C18: o = 0x48300000 l = 0x00002000 CREGISTER=18
C19: o = 0x48302000 l = 0x00002000 CREGISTER=19
C20: o = 0x48304000 l = 0x00002000 CREGISTER=20
C21: o = 0x00032400 l = 0x00002000 CREGISTER=21
C22: o = 0x480c8000 l = 0x00002000 CREGISTER=22
C23: o = 0x480ca000 l = 0x00002000 CREGISTER=23
}
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
SECTIONS
{
.bss : {} > D_MEM, PAGE 1 /* GLOBAL & STATIC VARS */
.data : {} > D_MEM, PAGE 1
.sysmem : {} > D_MEM, PAGE 1 /* DYNAMIC MEMORY ALLOCATION AREA */
.stack : {} > D_MEM, PAGE 1 /* SOFTWARE SYSTEM STACK */
.cinit : {} > D_MEM, PAGE 1 /* INITIALIZATION TABLES */
.const : {} > D_MEM, PAGE 1 /* CONSTANT DATA */
.args : {} > D_MEM, PAGE 1
.init_array : {} > D_MEM, PAGE 1 /* C++ CONSTRUCTOR TABLES */
.text : {} > P_MEM, PAGE 0 /* CODE */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment