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.

ERROR: Only --ptrdiff_size=32 is allowed for huge memory model

Hi, I am trying to run the dlmfast example from the TMS320C55x DSP Library. I use the C5517EVM board. When I build the project, I get the following error: Only --ptrdiff_size=32 is allowed for huge memory model. I have seen that there are similar post, but none of them helped me.

I have performed the following actions:

1. Imported Chip support library and one example runs perfectly

2. Imported the TMS320C55x DSP Library

3. Followed the installation guide from the following TI document: http://www.ti.com/lit/ug/spru422j/spru422j.pdf

a) Executed the file: Blt55xh_r3.bat

b) Placed the file 55xdsph_r3.lib in the runtime support library

4. Then I have built the dlmsfast project and got this error message in the CDT build console: ptrdiff_size=32 is allowed for huge memory model 5. I have tried to use other runtime support library files with different memory models. But maybe that is the wrong way to change the memory model? I suspect that I should use another memory model. However, which one? And how do I instruct the compiler to use another memory model?

I am quite new to this and will really appreciate some help:)

 

  • Compiler memory models are discussed in the C5500 compiler manual.  Please search for the chapter titled Run-Time Environment, and the section within that chapter titled Memory.  The most important point is that all code in the system must use the same model.  This means you must match the memory model used by all libraries in the build.  To see which memory model is used by an object module or library, run a command similar to ...

    % ofd55 name_of_file | fgrep Tag_Memory_Model

    Thanks and regards,

    -George

  • Hi,

    I have read about the different memory models in the C5500 compiler manual. But it is unclear to me how the memory model is set. Is it by some compiler options, the source code or could it be related to the target configuration?

    I received the good advice to use the command:
    % ofd55 name_of_file | fgrep Tag_Memory_Model

    Unfortunately I do not know where to apply it. Is there some command window hidden in CCS? Alternatively, should I look for some tool in the CSS installation folder?

    I seems that CSS compiler somehow uses a wrong memory model, but how do I specify the right one to the compiler? In addition, how do find out what the correct one is?

    Any help is Appreciated:)
  • Thomas Ullersted said:
    it is unclear to me how the memory model is set.

    With the compiler option --memory_model=name, where name can be one of: small, large, or huge.  Which of those three should you choose?  You have to match what is used in the libraries you link with.  To see which memory model is used by a specific library, use ofd55 like this ...

    Thomas Ullersted said:
    I received the good advice to use the command:
    % ofd55 name_of_file | fgrep Tag_Memory_Model

    Unfortunately I do not know where to apply it.

    ofd55 is a command line executable.  Open up a command shell on your system.  On a Windows machine, start a DOS shell with a menu selection similar to Start -> All Programs -> Accessories -> Command Prompt.

    Thanks and regards,

    -George

  • Hi

    Thank you for support but unfortunately there are still problems.

    I have tried to use the DOS shell command. I have navigated to the path where the .lib files  are. I enter the command. And I get the following response:

    I have tried omitting the "%" sign, I have tried executing the command when the path is set to C: and many more things to make it work. But i cannot make it work.

    Even if I was able to use the DOS command, I would not be sure which .lib file to enter as "file_name". Because there are several .lib files. One for every memory model. How do I find out which one is referenced by my project? (dlmsfast)

    I have tried compiling with small, large and huge memory models. But errors persist with every model.

    Thanks

  • Thomas Ullersted said:
    I have tried omitting the "%" sign, I have tried executing the command when the path is set to C: and many more things to make it work. But i cannot make it work.

    The % character stands for the system prompt.  It is not part of the command.  Keep in mind these posts are read by many others.  Thus I try to avoid presumptions about the host system used for developing code.

    The command ofd55 must be present in the system path the OS uses to find executables commands.  If it is not, you have to either modify the system path, or supply the complete directory path to ofd55.

    Note fgrep is a Unix command not available on DOS. Instead write: find "Tag_Memory_Model"

    Thomas Ullersted said:
    Because there are several .lib files. One for every memory model. How do I find out which one is referenced by my project? (dlmsfast)

    The library is supplied to your CCS project just like any other file.  It should appear in the list of files in the Project Explorer view.

    Thanks and regards,

    -George