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/AM3359: Ti_cgt_pru_2.3.0 HexPRU --Array option

Part Number: AM3359


Tool/software: TI C/C++ Compiler

I am trying to create two -array type files for the .text and .data segments so I can load them on a bare metal machine.   

I had hoped to create C arrays, using --array option, but I haven't been able to figure out the details.  

Are there any examples of PRUHex.cmd files set up to do this?

My problem is that the .data segment start address is not included in the file.  I can fix that by getting the data segment to load into PRU DMem before the .stack and .bss segments.  I tried removing section names, but that didn't have any effect that I can see.

The other workable issue is that it seems to create two files - one for the code segment and one for the data segment.  Ideally, i would get these into one file.  

I have been through section 12 of the PRU assembly language reference yet can't get the desired output.

  • Try a hex command file like this ...

    /* hex_array.cmd */
    --array
    -image
    -o pru_page0.c
    -o pru_page1.c
    
    ROMS
    {
       PAGE 0:
          pru_page0 : o = 0x0, l = 0x1000
       PAGE 1:
          pru_page1 : o = 0x0, l = 0x1000
    }

    Invoke it similar to ...

    % hexpru file.out hex_array.cmd
    Translating to Array format...
       "file.out" .text ==> .text
       "file.out" .rodata ==> .rodata

    The beginning the file pru_page0.c is ...

    const uint32_t pru_page0[] = {
    0x00000000,
    0x00000000,
    0x240001c0,
    0x24800080,
    0x0504e0e2,
    ...

    The beginning of th efile pru_page1.c is ...

    const uint8_t pru_page1[] = {
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    ...

    Thanks and regards,

    -George

  • Thanks.  This helped a  lot.  I was close, but missing the right combination.

    It now dumps 4K of the each area as specified by the length operators.

    Is there any way to avoid output just to the end of the code segment and the end of the data area?  I can use it as-is or manually adjust the rom lengths to a smaller size.


    I appreciate the quick help.

  • Dan Beadle said:
    Is there any way to avoid output just to the end of the code segment and the end of the data area?  I can use it as-is or manually adjust the rom lengths to a smaller size.

    Sorry, but I'm confused.  Supposing you make a manual change, what exactly would you change, and how do you know what to change it to?

    Thanks and regards,

    -George