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.

CCS/CCSTUDIO: Binay files as variable storage

Part Number: CCSTUDIO

Tool/software: Code Composer Studio

Hi there,

what happen if I create a bin file containing a struct variable and then I use it on a C5517 device?

My goal is to create a bin file containing a vector, then copy the file to an EPROM and then read the vector back from a C5517 device (EMIF intarface to the EPROM).

Are there incompatibilities due to the compilator?

Let' say I have this vector:

Uint16 Buffer[10] = {0,1,2,3,4,5,6,7,8,9};

Then I create a bin file with the Buffer vector.
Once I write it to an EPROM and I point to it with EMIF, will I be able to directly read Buffer[0]?

Thanks

  • I've notified the sw team. Their feedback will be posted here.

    Best Regards,
    Yordan
  • Hi,

    So you are already using EMIF for your EPROM access ?
    If EMIF is configured for EPROM access you may be able to set-up memory sections in your project's .cmd files something like :

    MEMORY
    {
    MICROCHIP_EPROM (RIX) : origin = 0x800000, length = 0x0400000 // whatever EPROM origin address you are using, and its length etc.
    }

    then :

    SECTIONS
    {
    .text > SARAM ALIGN = 4
    .switch > SARAM
    .const > SARAM
    .cinit > SARAM

    ...
    ...
    ...

    .spxHeap > DARAM, fill = 0xBEEF
    .spxScratch > DARAM, fill = 0xABCD

    .EPROM > MICROCHIP_EPROM
    }

    you could use the following declaration or something similar :

    #pragma DATA_SECTION (Buffer[], ".MICROCHIP_EPROM"); // tell the compiler that Buffer array is MICROCHIP_EPROM data section
    Uint16 * Buffer = 0x800000; // Declare pointer to Uint16 called Buffer and set to the expected EPROM address

    you may then try to read the Buffer[] array to see if it contains the values you wrote with your EPROM programmer.

    Yoou may need to modify it slightly to your needs and read-up on the #pragma DATA_SECTION , MEMORY, SECTION directived to see what extra details you can specify to let the compiler/linker know of your intensions with respect to the memory mapping etc.

    Cannot tell if it'll work as I don't use EMIF for EPROM, but rather for SDRAM ... you may find a variation on it that does what you need though.

    Regards,
    MM
  • Hi,

    Just another thought, you may want to look into malloc() aswell for dynamically allocating the array into EPROM memory space.

    Cheers, MM