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.

C6000 CGTv6.1 -gcc option for Type attributes

Genius 5785 points

Hello,

I'd like to use C6000 CGTv6.1 to implement C6748 StarterWare USB. I think CGTv6.1 supports -gcc option for Type attributes in GNU extention. I hope that CGTv6.1 supports a description below because there are some descriptions in StarterWare USB.

struct __attribute__((aligned(32))) myStruct { char c1; int i; char c2; };

But I saw some following error messages during build time after rebuilding library from ELF to COFF. I think the error is caused by Type attributes.

Description Resource Path Location Type
../../../../../../../usblib/include/usblib.h invalid attribute for "struct <unnamed>" usbdesc.c /usb_host_msc_c674x_c6748_lcdkC6748 line 197 C/C++ Problem

I also refer to these documents.

C6000 Optimizing Compiler v 6.1 UG (SPRU187O)
6.12 GNU C Compiler Extensions

C6000 Optimizing Compiler v7.6 UG (SPRU187V)
6.15.1 Extensions
6.15.4 Type Attributes

Regards,
Kazu

  • I get a clean build when I use the 6.1.0 version of the C6000 compiler to compile this line ...

    Kazu Kon said:
    struct __attribute__((aligned(32))) myStruct { char c1; int i; char c2; };

    Thus, I suspect I am missing some information.  Please preprocess the file usbdesc.c and submit it, along with the exact compiler options you use.

    Thanks and regards,

    -George

  • Hello George,

    Thank you for your reply. The compiler options are below.

    -mv6740 -g --gcc --define=c6748 --define=lcdkC6748 --define=DMA_MODE --include_path="C:/ti/C6000 Code Generation Tools 6.1.23/include" --include_path="../../../../../../../third_party/fatfs/src" --include_path="../../../../../../../include" --include_path="../../../../../../../include/hw" --include_path="../../../../../../../include/c674x" --include_path="../../../../../../../include/c674x/c6748" --include_path="../../../../../../../grlib/include" --include_path="../../../../../../../usblib/include" --include_path="../../../../../../../ipclite/include" --include_path="../../../../../../../nandlib/include" --diag_warning=225

    Sorry, but I told you wrong information. The GNU compiler extention used is below. Could you get a clean build in this case?

    struct __attribute__((__packed__)) packed_struct { char c1; int i; char c2; };

    #define USBLIB_PACKED __attribute__ ((packed))

    typedef struct
    {
    unsigned char bmRequestType;
    unsigned char bRequest;
    unsigned short wValue;
    unsigned short wIndex;
    unsigned short wLength;
    }
    USBLIB_PACKED tUSBRequest;

    Regards,
    Kazu

  • The packed structure support you need is introduced in compiler version 7.2.0.  Since you are looking at upgrading from an older version 6.1.0, I recommend you upgrade all the way to the latest long term version 7.4.11.  See this wiki page for the details.

    Thanks and regards,

    -George

  • Hello George,

    Thank you for your kind reply. I think you'll recommed me to use ELF(EABI) in v7.4.11. But I'll possibly need to use COFF because I use DSP/BIOSv5 with my past firmware. I can compile this packed structure using COFF in v7.4.11. But there is a descritpion below. Do you think I can use COFF in v7.4.11 with packed structure?

    C6000 Optimizing Compiler v7.4 UG (SPRU187U)
    6.15.4 Type Attributes
    In addition, the visibility type attribute is supported for EABI mode (--abi=eabi).

    Regards,
    Kazu

  • Kazu Kon said:
    Do you think I can use COFF in v7.4.11 with packed structure?

    Yes

    Kazu Kon said:
    In addition, the visibility type attribute is supported for EABI mode (--abi=eabi).

    That says the gcc type attribute named visibility is supported only under EABI, and not COFF ABI.

    Thanks and regards,

    -George