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.

Compiler Warning Question

I am using CCS 5,2, why the following statements get a warnings? I believe integer is 32-bit, it should hold the assigned number. See attached files for compiler/liner options used.

int * p = (int *)0x400000;

warning #1107D: Conversion from integer to smaller pointer

unsigned int count;

count = 0x10000000;

warning: integer conversion resulted in truncation

Compiler_options.zip

 

 

  • Actually, "int" is 16 bits on C55x, but this doesn't matter because 0x400000 is of type "long" anyway.
    On C55x, pointers are 16 bits in small model and 23 bits in large model, which is smaller than the 32-bit "long," thus the warning.
  • I need to write/read the memory located in 0x400000(CE2), does this mean I need to use the larger model? If yes, is the statement below the proper way to points to that location? Thanks.

    int * p = (int *)0x400000;

    or should I declare p as a pointer

    pointers p;   //23 bits for large model

  • Unless you're prepared to call an assembly function, yes you need to use large memory model.
    Is that location some sort of peripheral? If so, you probably want to make it volatile:
    volatile int * p = (volatile int *)0x400000;
    You might consider declaring p as a normal array, and using the linker command file to place p at exactly 0x400000. Then you don't have to use any special casts.
  • 0x400000 is the starting location of the async RAM connected to the 5510DSK via the EMIF bus.
    In project properties......, CSS General, Variant: should I select DSK5510 or TMS320C5510A? I know the DSK5510 has a 5510A chip. What's the difference?
  • MARK LO said:
    should I select DSK5510 or TMS320C5510A?

    We lack the expertise to say.  From the perspective of the compiler tools, they are the same.  One possible difference is in the amount and location of external memory.  I suggest you start a new thread in the C5500 device forum.  Or, if you prefer, I can move this thread into that forum.

    Thanks and regards,

    -George

  • Mark,

    Let's leave this thread here and close it. If you want to ask a new question, start a new thread. It helps to keep each thread on a single topic and the original question.

    If you are working on the DSK5510, then select it. If you are on a custom board with the C5510A device, then select the TMS320C5510A.

    If you consider this thread closed, please mark the answer thread(s) using the green Verify Answer button. This helps us know you have your answer and it helps future readers filter through several posts to find the one that best answers the question(s) above it.

    Regards,
    RandyP