• 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 » Need help with the CCS v3.3
Share
TI C/C++ Compiler
  • Forum
Options
  • Subscribe via RSS

Forums

Need help with the CCS v3.3

  • Inerys Otero
    Posted by Inerys Otero
    on Apr 02 2012 15:25 PM
    Prodigy20 points

    Hi

    I am reading a data from a file and save it to a variable.  The format of the data is something like this:

    cellIdentity:  0
    locationAreaIdentity.lac:  0
    locationAreaIdentity.plmn.mcc:  0
    locationAreaIdentity.plmn.mnc:  0

    but I have 42 like in total.

    the code takes the line, for example, cellIdentity:  0

    and save cellIdentity in a variable expOutput[element].elementName and the value 0 in the variable expOutput[element].value

    When I run the code without save the strings, example: cellIdentity, just saving the values, it works perfect.  But when I begin to save the strings the code compile without errors but when I run it, this is what happen:

    Reading the test input message
    Reading the SI3 test message from the file
    Corrupt CIO message: buffer length (8238) > buffer size (1057).
    Corrupt CIO message: buffer length (8238) > buffer size (1057).
    Corrupt CIO message: buffer length (8238) > buffer size (1057).
    Corrupt CIO message: buffer length (8238) > buffer size (1057).
    Corrupt CIO message: buffer length (8238) > buffer size (1057).
    Corrupt CIO message: buffer length (8238) > buffer size (1057).
    Corrupt CIO message: buffer length (8238) > buffer size (1057).
    Corrupt CIO message: buffer length (8238) > buffer size (1057).
    Corrupt CIO message: buffer length (8238) > buffer size (1057).
    Corrupt CIO message: buffer length (8238) > buffer size (1057).
    Corrupt CIO message: buffer length (8239) > buffer size (1057).
    Corrupt CIO message: buffer length (8239) > buffer size (1057).
    Corrupt CIO message: buffer length (8222) > buffer size (1057).
    Corrupt CIO message: buffer length (8250) > buffer size (1057).

    Corrupt CIO message: buffer length (28415) > buffer size (1057).
    Corrupt CIO message: buffer length (29951) > buffer size (1057).
    Corrupt CIO message: buffer length (8447) > buffer size (1057).
    Corrupt CIO message: buffer length (23551) > buffer size (1057).
    Corrupt CIO message: buffer length (17407) > buffer size (1057).
    Corrupt CIO message: buffer length (28900) > buffer size (1057).
    Corrupt CIO message: buffer length (8225) > buffer size (1057).

     I change the stack and the head values to 5000, 10000 and 32000, but nothing happen.  Please help me.

    this is part of the code:

    struct expectedData{

      //char* elementName;
      char elementName[MAX_NAME_LENGTH];

      int value;
     } expOutput[FILECOUNT];
     
     char str[MAX_NAME_LENGTH];
     char * token;


     //Reading the expected output data values

     puts("Reading the expected output data");
        inputMessage=fopen("gsm_si3_tc_001_expected_output.txt","rt");

     if((inputMessage)==NULL)
     {
      puts("File could not be opened");
     }

     else
     {
      for (int element = 0; element < FILECOUNT; element++)
      {
       if ( fgets (str, MAX_NAME_LENGTH, inputMessage) != NULL )
       {
        //puts(str);
                    //printf ("Splitting string \"%s\" into tokens:\n",str);

                    token = strtok (str, " :");
                    //printf ("%s\n",token);
       // expOutput[element].elementName = token;
        strcpy ((char *)&expOutput[element].elementName, token);
        //strncpy ((char *)&expOutput[element].elementName, token, MAX_NAME_LENGTH);

     


                    token = strtok (NULL, " :");
                    //printf ("%s\n",token);
                    expOutput[element].value = atoi(token);


        
       ;
       }
       
       //expOutput[element].elementName = fgets (str, 50, inputMessage);
      }
     }

     
     fclose(inputMessage);
     puts("done reading gsm_si3_tc_001_expected_output file");


     

     

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Inerys Otero
    Posted by Inerys Otero
    on Apr 02 2012 15:31 PM
    Prodigy20 points

    Ohhh I am using the TMS320C6455 DSP and the CCS v3.3 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • George Mock
    Posted by George Mock
    on Apr 02 2012 16:38 PM
    Guru51565 points

    Inerys Otero
     inputMessage=fopen("gsm_si3_tc_001_expected_output.txt","rt");

    That last argument to fopen "rt".  I've never seen that before.  What do you intend?  I suspect you should use just "r".  

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click Verify Answer on the best reply to your question.
    The Compiler Wiki answers most common questions.
    Track an issue with SDOWP. Enter your 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