• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Development Tools » TI C/C++ Compiler » TI C/C++ Compiler - Forum » Packed attribute working on TMS470 4.7.1 but not in 4.9.1
Share
TI C/C++ Compiler
  • Forum
Options
  • Subscribe via RSS

Forums

Packed attribute working on TMS470 4.7.1 but not in 4.9.1

This question is answered
Angelo Joseph
Posted by Angelo Joseph
on Apr 13 2012 08:51 AM
Expert1140 points

I am using the Cortex A8 core on the OMAP3530. I am using the -gcc option and the packed struct attribute in my code. The code compiles without any problems in version 4.7.1 of the TMS compiler but it complains in 4.9.1. Could someone please point out why this was removed in a later version.

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • AartiG
    Posted by AartiG
    on Apr 13 2012 09:11 AM
    Guru68895 points

    The packed attribute is still supported in compiler 4.9.x. Could you please post the full set of compile options used, as well as the complete error message output by the compiler? If possible, could you also attach the source file that generates the error so we can reproduce it? A preprocessed version of the source file would be best as it would pull in all the necessary includes.


    If a post answers your question please mark it with the "Verify Answer" button

    Search the wikis for common questions: CGT, BIOS,  CCSv3, CCSv4
    Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Angelo Joseph
    Posted by Angelo Joseph
    on Apr 13 2012 14:13 PM
    Expert1140 points

    Hello Aarti...Thx for the prompt reply.

    Following is the command used to compile this file

    'Building file: C:/Documents and Settings/ajjosep9.CCANET/cc4projects/gnss/outputmessages/binarymessage.cpp'

    'Invoking: Compiler'

    "C:/Documents and Settings/ajjosep9.CCANET/CC4/ccsv4/tools/compiler/TMS470 Code Generation Tools 4.9.1/bin/cl470" -mv7A8 --code_state=32 --float_support=VFPv3 --abi=eabi -me -O4 --opt_for_speed=5 -g --include_path="C:/Documents and Settings/ajjosep9.CCANET/CC4/ccsv4/tools/compiler/TMS470 Code Generation Tools 4.9.1/include" --include_path="C:/Documents and Settings/ajjosep9.CCANET/cc4projects/gnss" --fp_mode=strict --cpp_default --gcc --diag_warning=225 --enum_type=int --neon --preproc_with_compile --preproc_dependency="binarymessage.pp" "C:/Documents and Settings/ajjosep9.CCANET/cc4projects/gnss/outputmessages/binarymessage.cpp"

    "C:/Documents and Settings/ajjosep9.CCANET/cc4projects/gnss/outputmessages\binarymessage.hpp", line 77: error: invalid attribute for "BinaryMessage::CompositeNavMessageHeaderStruct"

    "C:/Documents and Settings/ajjosep9.CCANET/cc4projects/gnss/outputmessages\binarymessage.hpp", line 101: error: invalid attribute for "BinaryMessage::CompositeNavMessagePerObsStruct"

    "C:/Documents and Settings/ajjosep9.CCANET/cc4projects/gnss/outputmessages\binarymessage.hpp", line 144: error: invalid attribute for "BinaryMessage::CompositeNavMessageHeaderStruct_v1"

    "C:/Documents and Settings/ajjosep9.CCANET/cc4projects/gnss/outputmessages\binarymessage.hpp", line 183: error: invalid attribute for "BinaryMessage::CompositeNavMessagePerObsStruct_v1"

    "C:/Documents and Settings/ajjosep9.CCANET/cc4projects/gnss/outputmessages\binarymessage.hpp", line 227: error: invalid attribute for "BinaryMessage::CompositeNavMessageHeaderStruct_v2"

    "C:/Documents and Settings/ajjosep9.CCANET/cc4projects/gnss/outputmessages\binarymessage.hpp", line 268: error: invalid attribute for "BinaryMessage::CompositeNavMessagePerObsStruct_v2"

    6 errors detected in the compilation of "C:/Documents and Settings/ajjosep9.CCANET/cc4projects/gnss/outputmessages/binarymessage.cpp".

    >> Compilation failure

    gmake: *** [binarymessage.obj] Error 1

    Build complete for project gnssengineomap3525arm

    Following is the header file where the compiler complains

     

    #define PACKSTRUCT __attribute__ ((__packed__))

     

    class

    BinaryMessage

    {

    public:

    static const Uint32 CRC_SIZE = 4; //In bytes;

    static const Uint16 CompositeNavMessageId = 0xF001;

    static const Uint16 AcqInfoMessageId = 0xF002;

    struct HeaderStruct

    {

    Uint8 Preamble[4];

    Uint16 HeaderLength;

    //Includes Preamble and Checksum

    Uint16 MessageId;

    Uint32 MessageLen;

    // Excludes Header, but includes 32-bit CRC at the end

    Uint8 MsgVersion;

    Uint8 Reserved[2];

    Uint8 CheckSum;

    }PACKSTRUCT;

    typedef struct HeaderStruct Header;

    //CompositeNavMessage version 0

    struct CompositeNavMessageHeaderStruct

    {

    Uint32 GpsWeek;

    Uint32 GpsMs;

    Uint32 NumObs;

    ReceiverTypes::NavStateEnum NavState;

    ReceiverTypes::TripletStruct EcefPos;

    ReceiverTypes::TripletStruct LlhPos;

    double RxClockBias;

    ReceiverTypes::TripletStruct SmoothedEcefPos;

    ReceiverTypes::TripletStruct SmoothedLlhPos;

    double SmoothedRxClockBias;

    float HeightMsl;

    float SmoothedHeightMsl;

    ReceiverTypes::TripletStruct EcefVel;

    Uint16 AgcData[NUM_AD_BINS];

    }PACKSTRUCT;

    typedef struct CompositeNavMessageHeaderStruct CompositeNavMessageHeader;

    struct CompositeNavMessagePerObsStruct

    {

    ReceiverTypes::SvId sv;

    ReceiverTypes::SatChan svChan;

    ReceiverTypes::TripletStruct satPos;

    ReceiverTypes::TripletStruct satVel;

    double satClockCorr;

    double psr;

    double ddr;

    double smoothPsr;

    double adr;

    float lockTime;

    float cnoDbHz;

    float azimuth;

    float elevation;

    float ionoCorr;

    float tropoCorr;

    float dllError;

    float pllError;

    ReceiverTypes::ChannelStateEnum state;

    Uint32 reserved;

    }PACKSTRUCT;

    typedef struct CompositeNavMessagePerObsStruct CompositeNavMessagePerObs;

     

     

     

    //version 1

    struct CompositeNavMessageHeaderStruct_v1

    {

    Uint32 GpsWeek;

    Uint32 GpsMs;

    Uint32 NumObs;

    ReceiverTypes::NavStateEnum NavState;

    ReceiverTypes::TripletStruct EcefPos;

    ReceiverTypes::TripletStruct LlhPos;

    double RxClockBias;

    ReceiverTypes::TripletStruct SmoothedEcefPos;

    ReceiverTypes::TripletStruct SmoothedLlhPos;

    double SmoothedRxClockBias;

    float HeightMsl;

    float SmoothedHeightMsl;

    ReceiverTypes::TripletStruct EcefVel;

    Uint16 AgcData[NUM_AD_BINS];

    double gpsHpl;

    double gpsVpl;

    double raimTestStat;

    ReceiverTypes::RaimStatus raimStatus;

    Uint32 maxFiqTimeUs;

    Uint32 maxFiqPeriodUs;

    Uint32 fiqHitCount;

    float aveFiqTime;

    Uint32 maxFpgaHandlerTimeUs;

    Uint32 maxSignalChannelTimeUs;

    Uint32 maxSatelliteChannelTimeUs;

    Uint32 maxChanMeasProcTimeUs;

    Uint32 maxNavProcTimeUs;

    float pdop;

    float hdop;

    float vdop;

    Uint32 buildId;

    FpgaConfigStruct fpgaConfig;

    //Uint32 reserved[2];

    }PACKSTRUCT;

    typedef struct CompositeNavMessageHeaderStruct_v1 CompositeNavMessageHeader_v1;

    struct CompositeNavMessagePerObsStruct_v1

    {

    ReceiverTypes::SvId sv;

    ReceiverTypes::SatChan svChan;

    ReceiverTypes::TripletStruct satPos;

    ReceiverTypes::TripletStruct satVel;

    double satClockCorr;

    double psr;

    double ddr;

    double smoothPsr;

    double adr;

    double rangeResidual;

    float lockTime;

    float cnoDbHz;

    float azimuth;

    float elevation;

    float unAugmentedIonoCorrection;

    float unAugmentedTropoCorrection;

    float dllError;

    float pllError;

    ReceiverTypes::ChannelStateEnum state;

    Uint32 reserved;

    float unAugmentedIonoVariance;

    float unAugmentedTropoVariance;

    float unAugmentedAirborneVariance;

    float unAugmentedClockEphemVariance;

    float sbasIonoCorrection;

    float sbasIonoVariance;

    float fastCorrValue;

    float fastCorrDegradation;

    float rangeRateCorrValue;

    float rangeRateCorrDegradation;

    float longTermCorrClockTimeError;

    float longTermCorrPosErrorX;

    float longTermCorrPosErrorY;

    float longTermCorrPosErrorZ;

    }PACKSTRUCT;

    typedef struct CompositeNavMessagePerObsStruct_v1 CompositeNavMessagePerObs_v1;

     

    struct CompositeNavMessageHeaderStruct_v2

    {

    Uint32 GpsWeek;

    Uint32 GpsMs;

    Uint32 NumObs;

    ReceiverTypes::NavStateEnum NavState;

    ReceiverTypes::TripletStruct EcefPos;

    ReceiverTypes::TripletStruct LlhPos;

    double RxClockBias;

    ReceiverTypes::TripletStruct SmoothedEcefPos;

    ReceiverTypes::TripletStruct SmoothedLlhPos;

    double SmoothedRxClockBias;

    float HeightMsl;

    float SmoothedHeightMsl;

    ReceiverTypes::TripletStruct EcefVel;

    Uint16 AgcData[NUM_AD_BINS];

    double gpsHpl;

    double gpsVpl;

    double raimTestStat;

    ReceiverTypes::RaimStatus raimStatus;

    Uint32 maxFiqTimeUs;

    Uint32 maxFiqPeriodUs;

    Uint32 fiqHitCount;

    float aveFiqTime;

    Uint32 maxFpgaHandlerTimeUs;

    Uint32 maxSignalChannelTimeUs;

    Uint32 maxSatelliteChannelTimeUs;

    Uint32 maxChanMeasProcTimeUs;

    Uint32 maxNavProcTimeUs;

    float pdop;

    float hdop;

    float vdop;

    Uint32 buildId;

    FpgaConfigStruct fpgaConfig;

    double sbasHpl;

    double sbasVpl;

    double hul;

    double vul;

    double hfom;

    double vfom;

    }PACKSTRUCT;

    typedef struct CompositeNavMessageHeaderStruct_v2 CompositeNavMessageHeader_v2;

    struct CompositeNavMessagePerObsStruct_v2

    {

    ReceiverTypes::SvId sv;

    ReceiverTypes::SatChan svChan;

    ReceiverTypes::TripletStruct satPos;

    ReceiverTypes::TripletStruct satVel;

    double satClockCorr;

    double psr;

    double ddr;

    double smoothPsr;

    double adr;

    double rangeResidual;

    float lockTime;

    float cnoDbHz;

    float azimuth;

    float elevation;

    float unAugmentedIonoCorrection;

    float unAugmentedTropoCorrection;

    float dllError;

    float pllError;

    ReceiverTypes::ChannelStateEnum state;

    Uint32 reserved;

    float unAugmentedIonoVariance;

    float unAugmentedTropoVariance;

    float unAugmentedAirborneVariance;

    float unAugmentedClockEphemVariance;

    float sbasIonoCorrection;

    float sbasIonoVariance;

    float fastCorrValue;

    float fastCorrDegradation;

    float rangeRateCorrValue;

    float rangeRateCorrDegradation;

    float longTermCorrClockTimeError;

    float longTermCorrPosErrorX;

    float longTermCorrPosErrorY;

    float longTermCorrPosErrorZ;

    float totalDegradation;

    float rsvd;

    }PACKSTRUCT;

    typedef struct CompositeNavMessagePerObsStruct_v2 CompositeNavMessagePerObs_v2;

    //AcqInfo Message

    struct AcqInfoMessageStruct

    {

    ReceiverTypes::SvId sv;

    ReceiverTypes::AcqInfoEnum acqInfoState;

    }PACKSTRUCT;

    typedef struct AcqInfoMessageStruct AcqInfoMessage;

    //All conversion routines

    // return the number of bytes used by this message

    // If the input buffer is less than the required number of bytes

    // then the function just returns with zero bytes

    // Conversion routines

    static Uint32 GenerateCompositeNavMessage(Uint8* buf,

    Uint32 bufSize,

    NavDataOutMsg* msg);

     

    static Uint32 GenerateAcqInfoMessage(Uint8* buf,

    Uint32 bufSize,

    AcqInfoMsg* msg);

     

    private:

    static void FillPreamble(Header* header);

    static void FillHeader(Header* header,

    Uint16 messageId,

    Uint32 messageLen,

    Uint8 version);

    static Uint32 GenerateCompositeNavMessage_v0(Uint8* buf,

    Uint32 bufSize,

    NavDataOutMsg* msg);

    static Uint32 GenerateCompositeNavMessage_v1(Uint8* buf,

    Uint32 bufSize,

    NavDataOutMsg* msg);

     

    static Uint32 GenerateCompositeNavMessage_v2(Uint8* buf,

    Uint32 bufSize,

    NavDataOutMsg* msg);

    };

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • AartiG
    Posted by AartiG
    on Apr 13 2012 16:04 PM
    Verified Answer
    Verified by George Mock
    Guru68895 points

    Angelo,

    Please see this related thread which explains the reason for the error. Currently only up to 32-bit data sizes are supported with the packed attribute and your structures have some 64-bit types. This will be supported in the next compiler release scheduled for later this year. My guess is that CGT 4.6.x simply ignored the attribute and did not catch the error.


    If a post answers your question please mark it with the "Verify Answer" button

    Search the wikis for common questions: CGT, BIOS,  CCSv3, CCSv4
    Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use