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.

Howto put global data into DDR



I thought I knew how to do this but its not happening.  In the TCF I have the statement

bios.MEM.FARSEG = prog.get("DDR");

but all of my global variables continue to go to IRAM.  Then I added

 

bios.MEM.CONSTSEG = prog.get("DDR");

bios.MEM.DATASEG = prog.get("DDR");

bios.MEM.CIOSEG = prog.get("DDR");

bios.MEM.CINITSEG = prog.get("DDR");

with no luck.  No matter what I do, global variables go to IRAM.  They are declared but not initialized.

 

I am doing this in I2CSAMPLE.TCF so that you can see what I started with.

 

  • Please see page 134 of the:

    http://www-s.ti.com/sc/techlit/spru187

    have you tried putting the bss section in DDR?

    bios.MEM.BSSSEG = prog.get("DDR");

  • Sorry, forgot to include the BSS section.  Yes, I put the BSS in the DDR.   Globals are still going to IRAM.

    I have another project, that I wrote, where the globals are going to DDR.  In that project BSS is allocated to IRAM.  Go figure.

    None of this makes any sense.

  • Kurt Jensen said:
    I have another project, that I wrote, where the globals are going to DDR.

    It would depend if the globals you are talking about are far or not.

    What processor are you using and what version of DSP/BIOS are you using?

     

  • The variables are not declared as far.  But, the MAP file shows the variables in the FAR segment. 

    How does it know?  Two variables declared immediately after are being put in the BSS segment.

    Please refer to the GLOBAL VARIABLES section of i2csample_io.c

     

    processor = c6748

    DSP/BIOS = 5.41.04.18

  • Hi Kurt,

    Are you sure you are looking at the correct map file?

    I just tried the example you mentioned. I edited the tcf file to put .bss and .far in DDR:

     

     

    Then I did a "rebuid all" on the project. In the map file I saw tha variable wBuffer in DDR:

    Can you double check for me?

    If still does not wirk, please send me the exact path to the project you are rebuilding, the path to the map file that you are looking, and the path to the tcf file you are editing.

  • Funny you should ask.  I thought I was working in my workspace which is on the E: drive on another hard disk.  I copied the sample then imported it .  But now I come to find out that everything I am viewing and changing is in C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\examples\evm6748\i2c\edma\.  I don't want that.  I want to work on the files in my workspace.  I'll try to figure out how to fix it at a later time.

    project path - C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\examples\evm6748\i2c\edma\build

    (AFAIK - I don't know how to check this.  None of the files in my workspace have been changed for a month so this must be it)

    map file - C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\examples\evm6748\i2c\edma\bin\Debug

    tcf file path - C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\examples\evm6748\i2c\edma\build\i2cSample\.gconf\i2cSample

     

    Also, in my MAP file, wBuffer is listed in the FAR segment, i2c_outHandle and i2c_inHandle are listed in the BSS segment.  That seems odd to me.

  • Kurt Jensen said:
    I thought I was working in my workspace which is on the E: drive on another hard disk.  I copied the sample then imported it .

    I see you mentioning workspace, are you using CCS4?

     

  • I uninstalled, deleted, and reinstalled the BIOS PSP (pspdrivers_01_30_00_05).  I deleted the i2csample from my workspace.  I added and built the i2csample. 

    I then changed FAR and BSS to DDR. 

    wBuffer is still going to FAR

    i2c_outHandle and i2c_inHandle are still going to BSS.

    Sorry but I cannot duplicate your success... :(

  • Ok, so please try to replicate exactly the steps below like I did. Import the project but do not move completely to see if it works, and we can find out what is wrong by elimination.

    I opened CCS4 and a new workspace. Then see the steps below:

     

    Did not copy it, just imported:

     Edited the tcf file:

     Rebuild all:

    looked at the file C:\Program Files\Texas Instruments\pspdrivers_01_30_00\packages\ti\pspiom\examples\evm6748\i2c\edma\bin\Release\i2cSample.map

     

     

  • Yes, that is exactly what I did the first time.  That is exactly what I did most recently.  The results are not the same as yours.

    I do not use "Rebuild All" because I have many separate projects and it rebuilds all of them.   I only want to rebuild the active project, even if no changes are made.  This is necesary because of problem s witht he compiler and linker.  I do not know why the compiler does not rebuild the active project.  But if I change something then I can fool it.

    Please understand, I "thought:" I had imported the project from the copy in my workspace.  But I did not.  I tried to do this today but there are too many compiler and linker problems.  The compiler cannot find files that are in teh same directory and the liniker creates invalid paths then complains that it cannot find the file.  Copy to my workspace is not possible because the compiler and the linker do not work correctly.

  • I do see one difference.  In the Import Projects dialog your path has an extra ccs4. 

    My path is

    C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\examples\evm6748\i2c\edma\build

    Your path is

    C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\examples\evm6748\i2c\edma\build\ccs4

    Also, my path includes i2cSample.pjt and i2cSample_xdc.pjt.  Your path does not include i2cSample_xdc.pjt.

    What version of BIOS PSP are you using?

  • Examining the retained ASM file I found

    _wBuffer: .usect ".far",4,128

    .bss _i2c_outHandle,4,4

    .bss _i2c_inHandle,4,4

    That explains what I am seeing in the MAP file.  Why would the compiler generate ".far" for _wBuffer?

     

    And, examing i2cSamplecfg.cmd I found

    SECTIONS {

        .bss: {} > DDR

        .far: {} > DDR

        etc.

    Which shows that the TCF is being translated properly.  Guess I need to go read up on the linker now.  Something appears to be broken...

  • I think I have finally found the root cause.  There is a copy of i2cSamplecfg.cmd in the ti\pspiom\examples\evm6748\i2c\edma\build directory. Apparently this is the file that the linker is using.  When I remove this file then the linker finds the file generated from the TCF.

  • Kurt Jensen said:

    C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\examples\evm6748\i2c\edma\build

    Your path is

    C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\examples\evm6748\i2c\edma\build\ccs4

    Also, my path includes i2cSample.pjt and i2cSample_xdc.pjt.  Your path does not include i2cSample_xdc.pjt.

    pjt files are only used by CCS3, not used for CCS4.

    Please use the path: C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\examples\evm6748\i2c\edma\build\ccs4

    I'm using pspdrivers_01_30_00 0 - but there should not be a difference related to the problem we are debugging.

    Kurt Jensen said:

    Examining the retained ASM file I found

     

     

     

     

    That explains what I am seeing in the MAP file.  Why would the compiler generate ".far" for _wBuffer?

     

     

    And, examing i2cSamplecfg.cmd I found

    Is is using far probably because it is a big array/pointer. You can ask that in the compiler forum, but for now I want to concentrate in the problem in hands.

    Kurt Jensen said:

    Which shows that the TCF is being translated properly.  Guess I need to go read up on the linker now.  Something appears to be broken...

    Try correcting the path including the CCS4 folder. Import it again, start from scrath. Also, it is ok to right click in the project and select "Rebuild project".

    SECTIONS {

        .bss: {} > DDR

        .far: {} > DDR

        etc.

    .bss _i2c_inHandle,4,4

    .bss _i2c_outHandle,4,4

    _wBuffer: .usect ".far",4,128

  • There is no CCS4 folder.  I installed your version.  My version does not have CCS3 or CCS 4 folders.  Only the files in the Build directory.

     Downloading pspdrivers_01_30_00_06.  Will install in the morning to see what manifestations of files that it brings...

  • Hi Kurt, so that is probably the issue, get the latest PSP, and then you will have the CCS4 project ready to go.

  • Yes, pspdrivers_01_30_00_06 does have the CCS4 folder.  But this was never the problem.

    Changing .far and .bss to DDR still does not work.  The problem is the file i2cSamplecfg.cmd in the build directory.  This file blocks changes to the TCF from taking effect.  The lnker finds the file in the build directory and does not burrow down to the ccs4\.gconf\i2cSample directory where the generated i2cSamplecfg.cmd file is found.  Changing memory segments works after one deletes the build\i2cSamplecfg.cmd file.