AnsweredAssumed Answered

custom ldf and custom interrupt vector codes and custom startup

Question asked by bookevg on Feb 17, 2013
Latest reply on Feb 17, 2013 by bookevg

Now I have time that I migrate from VDSP++ to CCES and I find the first problem.

I don't want to use the add-ins "Startup Code/LDF".

I removed the add-ins "Startup Code/LDF".

The first I tried to include the file "ADPS-21489.LDF" from "${CCES}\SHARC\ldf" and files "app_IVT.s" and "app_startup.s" which had been generated by add-ins.

CCES out next errors:

 

DescriptionResourcePathLocationType
cc3089: fatal error: Link failedMCS_ldf_out

C/C++ Problem
DescriptionResourcePathLocationType
make: *** [MCS_ldf_out.dxe] Error 1MCS_ldf_out

C/C++ Problem

 

The second I tried to include the file "ADPS-21489.LDF" from "${CCES}\SHARC\ldf" and files "int_vector_code_214xx.asm" and "214xx_hdr.asm" from "${CCES}\SHARC\lib\src\crt_src".

CCES out next errors:

 

DescriptionResourcePathLocationType
make: *** [Source/Projects/MCS_ldf_out/srcBSP/system/214xx_hdr.doj] Error 1MCS_ldf_out

C/C++ Problem
DescriptionResourcePathLocationType
pp0051: Failed to open '#include' file 'lib_glob.h'214xx_hdr.asm/MCS_ldf_out/Source/Projects/MCS_ldf_out/srcBSP/systemline 34C/C++ Problem

 

When I commented the line "#include "lib_glob.h" CCES out errors like the first case (cc3089) and out infos:

DescriptionResourcePathLocationType
ea2536: Replaced instruction "dm(i7,m7)=pc" with214xx_hdr.asm/MCS_ldf_out/Source/Projects/MCS_ldf_out/srcBSP/systemline 89C/C++ Problem
DescriptionResourcePathLocationType
ea2536: Replaced instruction "dm(i7,m7)=pc" with214xx_hdr.asm/MCS_ldf_out/Source/Projects/MCS_ldf_out/srcBSP/systemline 139C/C++ Problem

 

 

 

The third I tried to include the file "ADPS-21489.LDF" from "${CCES}\SHARC\ldf", but files "int_vector_code_214xx.asm" and "214xx_hdr.asm" from "${CCES}\SHARC\lib\src\crt_src" had been removed from project. CCES can compile good.

 

Now I try ro answer the question:

"Why do I want to use custom ldf and custom interrupt vector codes and custom startup?"

The first ADI custom ldr files don't include information about the address range of Long word (64). So I collect info about the address range by type before MEMORY section.

For example:

//-----------------------------------------------------------------------
//
Short word (16-bit) space. Address range 0x0010 0000 to 0x001F FFFF
//-----------------------------------------------------------------------
//Block 0
0x0010 0000 to 0x0011 FFFF  Short word(16)Space (2 Mbits ROM)
//Block 0
0x0012 4000 to 0x0013 BFFF  Short word(16)Space (1.5 Mbit RAM)
//Block 1
0x0014 0000 to 0x0015 FFFF  Short word(16)Space (2 Mbits ROM)
//Block 1
0x0016 4000 to 0x0017 BFFF  Short word(16)Space (1.5 Mbit RAM)
//Block 2
0x0018 0000 to 0x0018 FFFF  Short word(16)Space (1 Mbit RAM)
//Block 3
0x001C 0000 to 0x001C FFFF  Short word(16)Space (1 Mbit RAM)

 

 

MEMORY

{


// The SHARC 21489 has 5Mbit RAM and 4Mbit ROM in total.

// -------------------------- BLOCK 0 ----------------------------------------

//Block 0
0x0004 9000 to 0x0004 EFFF  Long word(64)Space (1.5 Mbit RAM)

//Block 0
0x0008 C000 to 0x0009 3FFF  Normal word(48)Space (1.5 Mbit RAM)

//Block 0
0x0009 2000 to 0x0009 DFFF  Normal word(32)Space (1.5 Mbit RAM)

//Block 0
0x0012 4000 to 0x0013 BFFF  Short word(16)Space (1.5 Mbit RAM)

 

The second I name variables of input section, output section and memory segmet in ldr file the different names.

For example:

MEMORY

{

          // The SHARC 21489 has 5Mbit RAM and 4Mbit ROM in total.

          // -------------------------- BLOCK 0 ----------------------------------------

          //          Block 0                    0x0004 9000 to 0x0004 EFFF  Long word          (64)          Space (1.5 Mbit RAM)

          //          Block 0                    0x0008 C000 to 0x0009 3FFF  Normal word          (48)          Space (1.5 Mbit RAM)

          //          Block 0                    0x0009 2000 to 0x0009 DFFF  Normal word          (32)          Space (1.5 Mbit RAM)

          //          Block 0                    0x0012 4000 to 0x0013 BFFF  Short word          (16)          Space (1.5 Mbit RAM)

          seg_msp_int_rth                              { TYPE(PM RAM) START(0x0008C000) END(0x0008C0FF) WIDTH(48) }

...

}

PROCESSOR p0

{

...

  SECTIONS

  {

                    seg_dxe_int_rth PM

                    {

                              NO_FORCE_CONTIGUITY

                              INPUT_SECTIONS( $OBJECTS(seg_rth) $LIBRARIES(seg_rth))

                    } > seg_msp_int_rth

...

  }

...

}

The third I like the structure of ldr files which place in "${CCES}\SHARC\ldf" because I see what change if I declare the macro.

For example

// Libraries from the command line are included in COMMAND_LINE_OBJECTS.

$LIBRARIES =

  libcc.dlb,

#ifdef _HEAP_DEBUG

  RT_LIB_NAME_EH_MT(heapdbg),

#endif

  RT_LIB_NAME_MT(c),

#ifdef __LIBIO_LITE

  RT_LIB_NAME_MT(io_lite),

#elif defined(__LIBIO_FX)

  RT_LIB_NAME_MT(iofx),

#else

  RT_LIB_NAME_MT(io),

#endif

#if !defined(_ADI_THREADS)

  libosal_noos.dlb,

#endif

  RT_LIB_NAME_MT(profile),

  libssl.dlb,

  RT_LIB_NAME_EH_MT(cpp),

  libdsp.dlb;

Outcomes