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.

Dm648 + Assembly Code + NDK

Hello

I am working on DM648 , modifying the code of helloWorld project – which placed :

C:\dvsdk_1_10_00_26_DM648\ndk_1_92_00_22_eval\packages\ti\ndk\example\network\helloWorld\evmdm648

What I like to do is add an assembly code to the existing project of helloWorld.pjt. But the cmd of this project is very odd , I not not sure how to declare the things I need :

The helloWorld cmd is:

/*

 *  Copyright 2006 by Texas Instruments Incorporated.

 *  All rights reserved. Property of Texas Instruments Incorporated.

 *  Restricted rights to use, duplicate or disclose this code are

 *  granted through contract.

 *

 *  @(#) TCP/IP_Network_Developers_Kit 1.92.00.13 11-17-2006 (ndk-b13)

 */

-levmdm648cfg.cmd

 

/*

// Specify below whether you want these NDK special memory sections to be

// placed in a specific memory section. By default they are placed in the .far space.

//

//   .far:NDK_PACKETMEM - Packet buffer memory (defined in HAL/OS libs)

//   .far:NDK_MMBUFFER   - Scatchpad memory used by mmAlloc()

//   .far:NDK_OBJMEM       - Large arrays (defined by example code only)

*/

 

 

Wht I want to add is this:

 

MEMORY

{

        L1D:     o = 00f00000h   l = 00008000h

        L1P:     o = 00e00000h   l = 00008000h

        L2:      o = 00a00000h   l = 00080000h

        DDR:     o = 0e0000000h  l = 08000000h

}

 

SECTIONS

{

    .bss        >   L2

    .cinit      >   L2

    .cio        >   L2

    .const      >   L2

    .data       >   L2

    .far        >   L2

    .stack      >   L2

    .switch     >   L2

    .sysmem     >   L2

    .text       >   L2

    .ddr2       >   DDR

}

 

Elsewhere would I declare my assembly variables and arrays . Kindly help me , in adding an assembly code to existing NDK project. If anyone can name any documents or any examples it would be very helpful.

 

Waiting for a reply

Thank you

Regards

Amna

  • Amna Rasul said:
    Wht I want to add is this:

    MEMORY
    {
            L1D:     o = 00f00000h   l = 00008000h 
            L1P:     o = 00e00000h   l = 00008000h 
            L2:      o = 00a00000h   l = 00080000h 
            DDR:     o = 0e0000000h  l = 08000000h

     
    SECTIONS
    {
        .bss        >   L2
        .cinit      >   L2
        .cio        >   L2
        .const      >   L2
        .data       >   L2
        .far        >   L2
        .stack      >   L2
        .switch     >   L2
        .sysmem     >   L2
        .text       >   L2
        .ddr2       >   DDR
    }

    This is done for you by BIOS. All the "normal" compiler sections are placed into memory segments through the BIOS configuration utility (either the GUI or the textual script depending on which you prefer to use). If using the GUI right click on the MEM module and select properties. Here you can reassign where each of these sections goes.  Note that the line -levmdm648cfg.cmd is including the BIOS-generated command file which includes all these memory and section definitions.

    Amna Rasul said:
    Elsewhere would I declare my assembly variables and arrays . Kindly help me , in adding an assembly code to existing NDK project. If anyone can name any documents or any examples it would be very helpful.

    I am not sure what you are asking here. The Linker Command File is used to tell the linker where to place the compiled code and data sections into memory. It does not care about individual assembly variables/arrays with the exception of 'linking' the symbols between files. You need to declare your assembly variables and arrays inside an assembly file. During the build process these symbols will either be placed into the appropriate sections (such as .bss and .text) or, if you specify a different section to place these in, you can add a line to the custom linker command file declaring where to place them. This should all be covered inside the C6000 Compiler Guide under chapter 5 on "Linking C/C++ Code."

     

  • Hello I am very thankful for ur reply , bec tht is wht I thought and also the .map file , it includes all the required sections I hve mentioned. The problem I am facing is tht , I added a assembly code to project , that does they compression of the incoming frames . The codes runs perfectly for 3 mins then comes to halt , n when I halt the code it ends up at this loop : E00A7808 C$L1: E00A7808 0002A120 BNOP.S1 C$L1 (PC+8 = 0xe00a7808), 5 E00A780C 00000000 NOP E00A7810 00000000 NOP E00A7814 00000000 NOP E00A7818 00000000 NOP E00A781C 00000000 NOP I remove this assembly compression scheme and rewrite the code in C and a project run perfectly and does not halts. I do not know why assembly code is halting, wht could be the reason. Kindly help me and guide me to a solution it is very important tht I write the compression scheme in assembly bec it gives better throughput and performance if it doesn’t halts. Waiting for a reply Thank you Regards Amna