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.

Converting CCSv3.3 Project to CCSv5.3, Compile Error

I am attempting to migrate a CCSv3.3 project from one of our legacy products to CCSv5.3, because I will be needing to add a few features to it over the next 6 weeks or so. Any documents you can point me to that would assist with this would be greatly appreciated.  Currently, the issue I am having is that one of the TI header files in the legacy code is not being found by CCS5.3.  It is the csl.h header file.


Got through the CSL stuff on this but now I get the following error:

INTERNAL ERROR: C:\ti\ccsv5\tools\compiler\c6000_7.4.1\bin\opt6x.exe experienced a segmentation fault while

                processing function _GetTime file C:\\Users\\chadw\\AppData\\Local\\Temp\\064042

 

This is a serious problem.  Please contact Customer

Support with this message and a copy of the input file

and help us to continue to make the tools more robust.

 

 

>> Compilation failure

gmake: *** [K:/Infrastructure_Group_Stuff/TS2_ADC/Code/TS3/3.01.19.3000/Source/DSP1/Debug/log_func.obj] Error 1

gmake: Target `all' not remade because of errors.

 

**** Build Finished ****

  • We'll need a compilable test case to analyze the problem, including the complete command-line options

  • Where do I find those pieces of information?

  • In this case we need the source file which contains the function GetTime, in preprocessed form.  We also need to know the exact compiler build options used.

    Thanks and regards,

    -George

  • 5265.log_func.c
    /******************************************************************************
     *                             Hunt Technologies
     *                             6436 County Rd 11 
     *                           Pequot Lakes, MN  56472
     *
     *        (c) Copyright 2001 - 2006, Hunt Technologies, Inc., Pequot Lakes, MN
     *
     * THIS SOURCE CODE CONTAINS CONFIDENTIAL INFORMATION THAT IS OWNED BY HUNT
     * TECHNOLOGIES, INC. AND MAY NOT BE COPIED, DISCLOSED OR OTHERWISE USED WITHOUT
     * THE EXPRESS WRITTEN CONSENT OF HUNT TECHNOLOGIES, INC. 
     *
     * File name    : log_func.c
     * Programmer(s): Sudhanand Dayalan.
     * Created      : 
     * Revisions    :
     *    Description :
     *    Date        :
     *    Author      :
     *
     ******************************************************************************/
    #include <std.h>
    #include <csl.h>
    #include <csl_pwr.h>
    #include <time.h>
    #include <mbx.h>
    #include <sem.h>
    #include "..\Common\ADC_flash.h"
    #include "..\Common\flash_log.h"
    #include "..\Common\ADC_flash_interface.h"
    #include "..\Common\fpga_regs.h"
    #include "..\DSP1\DSP_Time.h"
    #include "..\DSP1\version_dsp1.h"
    
    
    /*Lookup table for int to ASCII conversion.*/
    const Uint8 ascii_conv_tbl[] = "0123456789ABCDEF"; 
    
    /*****************************************************
     * These structures hold the block and pointer info. *
     * for each type of LOG.                             *
     *****************************************************/
    static flash_log_info err_log_info;
    
    extern SEM_Handle SEM_Flash;
    Uint32 GetGlobalTimeSetFlag(void);
    Uint40 GetMillisecSinceSet(void);
    Uint8 msString[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    Uint8 * ConvertmsToASCII(Uint40 mSec, Uint32 * numBytes, Uint8 * inputPtr);
    Uint8 * ConvertIntToASCII(Uint40 mSec, Uint32 * numBytes, Uint8 * inputPtr, Uint8 places);
    Uint8 * concat(Uint8 * input, Uint8 * add, Uint32 addSz);
    /******************************* init_log_info **********************************
    *
    * Function name: init_log_info 
    * Description  : Initailize flash_log_info structure.
    * 
    * Programmer(s): 
    * Created      : 
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :   *log_info  -  Pointer to flash_log_info structure.
    *            ping_block -  PING block allocated to logging.
    *            pong_block -  PONG block allocated to logging.
    * Outputs:   None.
    * Cycles required:  
    *******************************************************************************/
    void init_log_info(flash_log_info *log_info, Uint32 ping_block, Uint32 pong_block)
    {
    	Uint32 *ptemp;
    	
    	ptemp = (Uint32 *)(FLASH_BASE+(ping_block*FLASH_PAGE_SIZE));
    	log_info->write_ptr = 4; 
    	
    	/*Check Flag to determine active LOG page. 
    	* The active sector has the flag set to 
    	* 0xFFFFFFFF.*/
    	if (*ptemp == 0xFFFFFFFF)
    	{
    		ptemp = (Uint32*)((ping_block * FLASH_PAGE_SIZE)+FLASH_BASE+log_info->write_ptr); 
    		log_info->active_block = ping_block;
    		log_info->inactive_block = pong_block;
    	}
    	else
    	{
    		ptemp = (Uint32*)((pong_block * FLASH_PAGE_SIZE)+FLASH_BASE+log_info->write_ptr); 
    		log_info->active_block = pong_block;
    		log_info->inactive_block = ping_block;
    	}
    
        while(*ptemp != 0xFFFFFFFF)
        {
            /*increment the pointer by MAX_LOG_LEN divided by 4, since the*/
            /*pointer is a Uint32 and MAX_LOG_LEN is in bytes*/
            /*(right shifting by 2 divides the result by 4)*/
            ptemp += (MAX_LOG_LEN>>2);
            
            /*increment the write pointer by MAX_LOG_LEN (bytes)*/
            /*because the log messages are dealt with in byte widths*/
            log_info->write_ptr += MAX_LOG_LEN; 
        }
    
    }
    
    /******************************* init_log ***************************************
    *
    * Function name: init_log 
    * Description  : Initailize logging(all types) structures.
    * 
    * Programmer(s): 
    * Created      : 
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :   log_type - Log type(ERR, DS etc.) to initialize.
    * Outputs:   None.
    * Cycles required:  
    *******************************************************************************/
    void init_log(Uint32 log_type)
    {
    	switch (log_type)
    	{   
    		case ERR_LOG:
    			init_log_info(&err_log_info, ERR_LOG1_BLOCK, ERR_LOG2_BLOCK);
    			break;
    		
    		
    		default:
    			break;
    	}
    }
    
    /******************************* GetTime **************************************
    *
    * Function name: GetTime 
    * Description:  Generates a time-stamp string and returns pointer to end of 
    *               string; for pre-pending time to a log message string. If the
    *	            time has not been set by the SBC, this function returns a
    *				"Time not set" string along with either a message saying 
    *				that the DSP is currently in main (booting) or the number
    *			    of milliseconds since the processor has booted. 
    * Programmer(s): Chad Wolter
    * Created      : 27 July 2012
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :   pmsg_str - Pointer to string to be filled with time-stamp.
    *			 
    * Outputs:   pstr     - Pointer to end of the time-stamp filled string.
    *			 processedChars [passed-in] - pointer to the number of characters
    *			 being generated by this function. 
    * Cycles required:  
    *******************************************************************************/
    Uint8 *GetTime(Uint8 *pmsg_str, Uint32 *processedChars)
    {
    	Uint32 units;
    	time_t t;
    	struct tm *tt;
    	Uint8 *out_ptr;
    	Uint40 msSinceSet;
    
    	out_ptr = pmsg_str;
    
    	if(GetGlobalTimeSetFlag() == TRUE)
    	{
    		/* Get time. */
    		t = Get_Real_Time();
    		tt = localtime(&t);  
    		
    		/* Get MONTH from time. */
    		units = tt->tm_mon + 1;
    		
    		out_ptr = ConvertIntToASCII(units, processedChars, out_ptr, 2);
    		
    		*out_ptr++ = '/';
    		(*processedChars)++;
    		
    		/*Get DAY from time.*/
    		units = tt->tm_mday;
    		out_ptr = ConvertIntToASCII(units, processedChars, out_ptr, 2);
    
    		*out_ptr++ = '/';
    		(*processedChars)++;
    		
    		/*Get YEAR from time.*/
    		units = tt->tm_year;
    
    		out_ptr = ConvertIntToASCII(units, processedChars, out_ptr, 2);
    
    		*out_ptr++ = ' ';
    		(*processedChars)++;
    		
    		/*Get TIME(HOUR) from time.*/
    		units = tt->tm_hour;
    		out_ptr = ConvertIntToASCII(units, processedChars, out_ptr, 2);
    
    		*out_ptr++ = ':';
    		(*processedChars)++;
    		
    		/* Get TIME(MIN) from time. */
    		units = tt->tm_min;
    
    		out_ptr = ConvertIntToASCII(units, processedChars, out_ptr, 2);
    
    		*out_ptr++ = ':';
    		(*processedChars)++;
    
    		/* Get TIME(SEC) from time. */
    		units = tt->tm_sec;
    		out_ptr = ConvertIntToASCII(units, processedChars, out_ptr, 2);
    
    		*out_ptr++ = ' ';
    		(*processedChars)++;
    
    	}
    	else
    	{
    		/*time has not yet been set, timestamp the log with the ms since boot*/
    
    		msSinceSet = GetMillisecSinceSet();
    
    		out_ptr = concat(out_ptr, "[Time not set-", (sizeof("[Time not set-") - 1));
    		(*processedChars) += (sizeof("[Time not set-") - 1);
    
    
    		if(msSinceSet == 0)
    		{
    			out_ptr = concat(out_ptr, "currently in boot] ", (sizeof("currently in boot] ") - 1));
    			(*processedChars) += (sizeof("currently in boot] ") - 1);
    		}
    		else
    		{
    			out_ptr = concat(out_ptr, "boot +", (sizeof("boot +") - 1));
    			(*processedChars) += (sizeof("boot +") - 1);
    
    			out_ptr = ConvertmsToASCII(msSinceSet, processedChars, out_ptr);
    
    			out_ptr = concat(out_ptr, "ms] ", (sizeof("ms] ") - 1));
    			(*processedChars) += (sizeof("ms] ") - 1);
    
    		}
    	}
    	
    	return out_ptr;
    }
    
    Uint8 * ConvertmsToASCII(Uint40 mSec, Uint32 * numBytes, Uint8 * inputPtr)
    {
    	Uint8 onesSpot = 0;
    	Uint8 placeCntr = 0;
    	Int8 i;
    	Uint8 * retval;
    	
    	retval = inputPtr;
    
    	if(mSec == 0)
    	{
    		*retval++ = '0';
    		(*numBytes)++;
    	}
    	else
    	{
    		while(mSec > 0)
    		{
    			onesSpot = (Uint8) (mSec % 10);
    			mSec = mSec * 0.1;
    			msString[placeCntr++] = onesSpot + 48;
    		}
    
    		/*reverse the array and assign to pointer*/
    		for(i = (placeCntr - 1); i >= 0; i--)
    		{
    			*retval++ = msString[i];
    			(*numBytes)++;
    		}
    	}
    	
    	return retval; 
    }
    
    Uint8 * ConvertIntToASCII(Uint40 inp, Uint32 * numBytes, Uint8 * inputPtr, Uint8 places)
    {
    	Uint8 onesSpot = 0;
    	Uint8 placeCntr = 0;
    	Int8 i;
    	Uint8 * retval;
    	
    	retval = inputPtr;
    
    	if(inp == 0)
    	{
    		*retval++ = '0';
    		(*numBytes)++;
    	}
    	else
    	{
    		for(i = 0; i < places; i++)
    		{
    			onesSpot = (Uint8) (inp % 10);
    			inp = inp * 0.1;
    			msString[placeCntr++] = onesSpot + 48;
    		}
    
    		/*reverse the array and assign to pointer*/
    		for(i = (placeCntr - 1); i >= 0; i--)
    		{
    			*retval++ = msString[i];
    			(*numBytes)++;
    		}
    	}
    	
    	return retval; 
    }
    
    Uint8 * concat(Uint8 * input, Uint8 * add, Uint32 addSz)
    {
    	Uint32 i;
    	Uint8 * retval;
    
    	retval = input;
    
    	for(i=0; i<addSz; i++)
    	{
    		*retval++ =  add[i];
    	}
    
    	return retval;
    }
    /******************************* GetDSPID *************************************
    *
    * Function name: GetDSPID 
    * Description:  Generates DSP identifier string, appends it to the passed-in
    *               string, and returns pointer to end of the string. 
    * Programmer(s): 
    * Created      : 
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs : pmsg_str - Pointer to string to be filled with DSP ID.
    * Outputs: pstr     - Pointer to end of the DSP ID filled string.
    * Cycles required:  
    *******************************************************************************/
    Uint8 *GetDSPID(Uint8 *pmsg_str)
    {
      Uint8 *pstr;
      
      pstr = pmsg_str;
    
      /* append DSP identifier */
      *pstr++ = 'D';
      *pstr++ = 'S';
      *pstr++ = 'P';
      *pstr++ = (Uint8)((FPGA.DSPID & 0x07) + 0x30); /* dsp number in ascii */
      *pstr++ = ':';
      *pstr++ = ' ';
    
      return pstr;
    }
    
    /*************************** copylog2flash *************************************
    *
    * Function name: copylog2flash 
    * Description  : This routine performs the function of writing log data to
    *                flash. Two sectors are allocated in flash for logging. The 
    *                first word of each sector is used as a flag to mark the 
    *                active sector. The active sector has the flag set to 
    *                0xFFFFFFFF, and the inactive sector is set to 0x00000000.
    *
    *                NOTE:
    *                =====
    *                This routine is designed such that each Log message is 
    *                80(MAX_LOG_LEN) bytes long.
    * 
    * Programmer(s): 
    * Created      : 
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :   pwrite_info - Pointer to flash_log_info struct.
    *            word_cnt    - Number of words to write.
    *            pmsg_ptr    - Pointer to input string.
    * Outputs:   None.
    * Cycles required:  
    *******************************************************************************/
    void copylog2flash(flash_log_info *pwrite_info, Uint32 word_cnt, Uint32 *pmsg_ptr )
    {
      Uint32 clear_word=0;
      Uint32 temp_block;
      Uint32 sem_flag = 0;
      volatile error_code copy_error=SUCCESS;
    
    
    	/* Check if message will fit in current page(See NOTE in header). */
    	if((pwrite_info->write_ptr + MAX_LOG_LEN) > LOG_PAGE_LEN)
    	{
    		/* Set active page flag to inactive(0) */
    		copy_error = writeflash(&clear_word, 1, pwrite_info->active_block, 0,
    		                        UNLOCKED, 200, SEM_PEND_ONLY);
    		
    		/* Go to new block. */
    		temp_block = pwrite_info->inactive_block;
    		pwrite_info->inactive_block = pwrite_info->active_block;
    		pwrite_info->active_block = temp_block;
    		
    		/* Erase block. */
    		eraseblock(pwrite_info->active_block, UNLOCKED, 200, SEM_NONE); 
    		pwrite_info->write_ptr = 4;
    		sem_flag = 1;
    	}
    	else
    	{	
    		/*Do nothing, no need to adjust Log segment pointers*/
    	}
    	
    	/* Write LOG record to flash. */
    	if(sem_flag)  // If Semaphore is already locked.
    	{
    		if (copy_error == SUCCESS)
    		{
    			copy_error = writeflash(pmsg_ptr, word_cnt, pwrite_info->active_block,
    		         					pwrite_info->write_ptr, UNLOCKED,
    		         					200, SEM_POST_ONLY);
    		}
    		else
    		{
    			/*error; Do nothing*/
    		}
    	}
    	else   // If Semaphore is NOT locked.
    	{
    		copy_error = writeflash(pmsg_ptr, word_cnt, pwrite_info->active_block,
    	         					pwrite_info->write_ptr, UNLOCKED,
    	     						200, SEM_PEND_AND_POST);
    	}
    	
    	if(copy_error == SUCCESS)
    	{
    		pwrite_info->write_ptr += MAX_LOG_LEN;
    	}
    	else
    	{
    		/*error; do not increment Log pointer*/
    	}
    
    }
    
    /******************************* Save_Log ***************************************
    *
    * Function name: Save_Log 
    * Description  : This function is attached to the 'TSK_Log' task. It reads out
    *                the messages from the mailbox and depending on the log_type
    *                writes it to the corresponding flash block. The task suspends
    *                indefinitely if the mailbox is empty.
    * 
    * Programmer(s): 
    * Created      : 
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :   None
    * Outputs:   None.
    * Cycles required:  
    *******************************************************************************/
    void Save_Log()
    {
      mbx_data  mbx_out;
      Uint32 word_cnt;
      static Bool err_write = FALSE;
      extern far MBX_Obj MBX_Log;
      extern SEM_Handle Log_Hold_SEM;
    
      
    	/*Do forever.*/
    	for(;;)
    	{
    		
    		/*pend and post the log_hold semaphore so under normal conditions, nothing
    		will happen (i.e. the Save_Log function will execute normally).  
    		However, when the semaphore count is reset to 0 in the LC_command
    		in dsppacket.c, the semaphore will pend forever, disallowing downstream and error
    		logs from being burned to FLASH.  The semaphore will pend again when the LC command 
    		received from the SBC with the correct parameters to re-enable log burning to FLASH*/
    		
    		SEM_pend(Log_Hold_SEM, SYS_FOREVER); 
    		SEM_post(Log_Hold_SEM); //Post semaphore to allow execution under normal condtions (no LC command)
    		
    		
    		
    		MBX_pend( &MBX_Log, &mbx_out, SYS_FOREVER );
    		
    
    		word_cnt = mbx_out.char_cnt >> 2;  /* Byte count/4 = Word count */
    		
    		switch(mbx_out.log_type)
    		{
    			case ERR_LOG:
    			
    				if(err_write == FALSE)    /*If first time then unlock.*/
    				{
    					err_write = TRUE; 
    					
    					/*Unlock both log blocks.*/
    					unlockblock(err_log_info.active_block, 50, SEM_NONE);
    					unlockblock(err_log_info.inactive_block, 50, SEM_NONE);
    				}
    				
    				copylog2flash(&err_log_info, word_cnt, (Uint32 *)&mbx_out.log_record[0]);
    				
    				break;
    			
    			
    			default:
    				break;
    		}
    	}
    }
    
    /******************************* LogMsgDirect *********************************
    *
    * Function name: LogMsgDirect 
    * Description:  Write LOG Message to log file.
    *               This routine will be called from the Power Down NMI ISR.
    *               This writes directly to flash without using the MAilbox.
    *               This routine assumes the worst case scenario that a log
    *               is being written to flash when the power-down occurs.
    * 
    * Programmer(s): 
    * Created      : 
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :   pmsg_str  -  LOG message string.
    * Outputs:   None.
    * Cycles required:  
    *******************************************************************************/
    void LogMsgDirect(Uint8 *pmsg_str) 
    {
    	Uint32 units,tens;
    	time_t t;
    	struct tm *tt;
    	Uint8 log_rec[80];
    	Uint8 *pstr;
    	Uint32 char_cnt = 18;  /* Time and date take up 18 chars. */
    	Uint32 *pmsg;
    	
    	pstr = log_rec;
    	
    	/*Get time.*/
    	t = Get_Real_Time();
    	tt = localtime(&t);  
    	
    	/*Get MONTH from time.*/
    	units = tt->tm_mon + 1;
    	tens=0;
    	
    	while(units > 9)  
    	{
    		units -= 10;
    		tens++;
    	}
    	
    	*pstr++ = ascii_conv_tbl[tens];
    	*pstr++ = ascii_conv_tbl[units];
    	*pstr++ = '/';
    	
    	/* Get DAY from time. */
    	units = tt->tm_mday;
    	tens=0;
    	
    	while(units > 9)  
    	{
    		units -= 10;
    		tens++;
    	}
    	
    	*pstr++ = ascii_conv_tbl[tens];
    	*pstr++ = ascii_conv_tbl[units];
    	*pstr++ = '/';
    	
    	/* Get YEAR from time. */
    	units = tt->tm_year;
    	tens=0;
    	
    	while(units > 99)
    	{  
    		units -= 100;
    	}
    	
    	while(units > 9)  
    	{
    		units -= 10;
    		tens++;
    	}
    	
    	*pstr++ = ascii_conv_tbl[tens];
    	*pstr++ = ascii_conv_tbl[units];
    	*pstr++ = ' ';
    	
    	/* Get TIME(HOUR) from time. */
    	units = tt->tm_hour;
    	tens=0;
    	
    	while(units > 9)  
    	{
    		units -= 10;
    		tens++;
    	}
    	
    	*pstr++ = ascii_conv_tbl[tens];
    	*pstr++ = ascii_conv_tbl[units];
    	*pstr++ = ':';
    	
    	/* Get TIME(MIN) from time. */
    	units = tt->tm_min;
    	tens=0;
    	
    	while(units > 9)  
    	{
    		units -= 10;
    		tens++;
    	}
    	
    	*pstr++ = ascii_conv_tbl[tens];
    	*pstr++ = ascii_conv_tbl[units];
    	*pstr++ = ':';
    	
    	/* Get TIME(SEC) from time. */
    	units = tt->tm_sec;
    	tens=0;
    	
    	while(units > 9)  
    	{
    		units -= 10;
    		tens++;
    	}
    	*pstr++ = ascii_conv_tbl[tens];
    	*pstr++ = ascii_conv_tbl[units];
    	*pstr++ = ' ';
    	
    	
    	/* Get text message. */
    	while ((*pmsg_str != '\000') && (char_cnt < (MAX_LOG_LEN-1)))
    	{
    		*pstr++ = *pmsg_str++;
    		char_cnt++;
    	}
    	
    	/* UNPACKED */
    	/* SPACE fill to extend to 80 chars. */ 
    	while( char_cnt < (MAX_LOG_LEN-1))
    	{
    		*pstr++ = ' ';  /* SPACE fill. */
    		char_cnt++;
    	}
    	
    	*pstr = '\n';  /* Log message terminator. */
    	
    	/******************************************************************
    	* The following 2 lines of code write the error message to flash *
    	******************************************************************/
    	
    	pmsg = (unsigned int *) &log_rec[0]; /*Set log message pointer.*/
    	copylog2flash(&err_log_info, (MAX_LOG_LEN >> 2), pmsg);
    }
    
    /******************************* get_logs **************************************
    *
    * Function name: get_logs 
    * Description  : This routine is the interface function to read logs.
    * 
    * Programmer(s): 
    * Created      : 
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :  *p_log_record  - pointer to log buffer.
    *           start_rec      - Record number to start from.
    *           num_rec        - Number of records to read.
    *           flash_log_info - Structure holding the Log info.
    *
    * Outputs:  None
    * Cycles required:  
    *******************************************************************************/
    error_code get_logs(Int8 *p_log_record, Uint32 start_rec, Uint32 num_rec,
    	    	                             flash_log_info read_log_info)
    {
    	
    	Int8 *p_read_addr;
    	Int8 *page_head;
    	Int8 *p_output;
    	error_code read_error = SUCCESS;
    	
    	if(SEM_pend(SEM_Flash, 0) == TRUE)
    	{
    		p_output = p_log_record;
    		
    		/* Set top-of-page marker. */
    		page_head = (Int8 *)(FLASH_BASE + (read_log_info.active_block * FLASH_PAGE_SIZE));
    		
    		/* Set pointer to mark the 'start_rec' log record. */
    		p_read_addr = (Int8 *) (page_head + read_log_info.write_ptr - 
    		MAX_LOG_LEN - (MAX_LOG_LEN*start_rec) );
    		
    		/* If start record is out of current page. */
    		if(p_read_addr < page_head) 
    		{
    			/* Adjust for records in active page. */
    			start_rec -= ((read_log_info.write_ptr - 4)/ MAX_LOG_LEN); 
    		}
    		else   /* else If start record is in current page. */
    		{
    			
    			/* While in ACTIVE BLOCK read. */
    			while((p_read_addr>=page_head) && (num_rec>0) && (read_error == SUCCESS))
    			{
    				read_error = readflash(p_output, p_read_addr, MAX_LOG_LEN, 0, SEM_NONE);
    				p_output += MAX_LOG_LEN;   /* Increment destination pointer. */
    				p_read_addr -= MAX_LOG_LEN;/* Decrement source pointer. */
    				num_rec--;                 /* Decrement record counter. */
    			}
    			
    			start_rec = 0; /* To read from last record of next page. */
    		}
    		
    		/* Shift to Second Block. */
    		if((num_rec > 0 ) && (read_error == SUCCESS))
    		{
    			/* Set pointer to next record to read from block. */
    			p_read_addr = (Int8 *)( FLASH_BASE + 
    			(read_log_info.inactive_block*FLASH_PAGE_SIZE)+
    			TAIL_REC_IDX - (start_rec * MAX_LOG_LEN) );
    			
    			/* Set top-of-page marker. */
    			page_head = (Int8 *)(FLASH_BASE + 
    								(read_log_info.inactive_block * FLASH_PAGE_SIZE) + 4);
    			
    			while((p_read_addr>=page_head) && (num_rec>0) && (read_error == SUCCESS))
    			{
    				read_error = readflash(p_output, p_read_addr, MAX_LOG_LEN, 0, SEM_NONE);
    				p_output += MAX_LOG_LEN;     /*Increment destination pointer.*/
    				p_read_addr -= MAX_LOG_LEN;  /*Decrement source pointer.*/
    				num_rec--;                   /*Decrement record counter.*/
    			}
    			
    			/*Fill rest of the buffer with OxFF.*/
    			if((num_rec > 0) && (read_error == SUCCESS))
    			{
    				memset(p_output, 0xFF, (num_rec*MAX_LOG_LEN));
    			}
    			else
    			{
    				/*Do nothing*/
    			}
    		} 
    		
    		SEM_post(SEM_Flash);  /*Release Flash Semaphore*/
    	}
    	else
    	{
    		read_error = FAIL;
    	}
    	
    	return read_error;
    }
    
    /******************************* read_log ***************************************
    *
    * Function name: read_log 
    * Description  : Read and return log records of the specified type starting 
    *                with the latest.
    * 
    * Programmer(s): 
    * Created      : 
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :  *p_log_record - pointer to log buffer.
    *           start_rec     - Record number to start from.
    *           num_rec       - Number of records to read.
    *           log_type      - Log type to read.
    *
    * Outputs:  None
    * Cycles required:  
    *******************************************************************************/
    error_code read_logs(Int8 *p_log_record, Uint32 start_rec, Uint32 num_rec, Uint32 log_type)
    {
    	volatile error_code read_error = FAIL;
    	
    	switch (log_type)
    	{
    		case ERR_LOG:
    			read_error = get_logs(p_log_record, start_rec, num_rec, err_log_info);
    			break;
    		
    		
    		default:
    			break;
    	}
    	
    	return read_error;
    }
    
    /***************************** erase_log ***************************************
    *
    * Function name: erase_log 
    * Description  : Erase all logs blocks and reset pointers.
    * 
    * Programmer(s): 
    * Created      : 
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :  *log_info  - Pointer to flash_log_info structure.
    *           ping_block - PING block.
    *           pong_block - PONG block.
    * Outputs:  error_code - SUCCESS/FAIL.
    * Cycles required:  
    *******************************************************************************/
    error_code erase_log(flash_log_info *plog_info, Uint32 ping_block, Uint32 pong_block)
    {
    	volatile error_code erase_error = SUCCESS;
    	
    	/* Erase both log pages. */
    	erase_error = eraseblock(plog_info->inactive_block, UNLOCKED, 0, SEM_PEND_ONLY);
    	
    	if(erase_error == SUCCESS)
    	{
    		erase_error = eraseblock(plog_info->active_block, UNLOCKED, 0, SEM_POST_ONLY);
    	
    		if(erase_error == SUCCESS)
    		{
    			plog_info->write_ptr = 4; 
    			plog_info->active_block = ping_block;
    			plog_info->inactive_block = pong_block;
    		}
    	}
    	
    	return erase_error;
    }
    
    
    /***************************** clear_log ***************************************
    *
    * Function name: clear_log 
    * Description  : Clear log pages.
    * 
    * Programmer(s): 
    * Created      : 
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :  log_type  - Log type.
    * Outputs:  error_code - SUCCESS/FAIL.
    * Cycles required:  
    *******************************************************************************/
    error_code clear_log(Uint32 log_type)
    {
    	error_code clear_error=FAIL;
    	
    	switch(log_type)
    	{
    		case ERR_LOG:
    			clear_error = erase_log(&err_log_info,ERR_LOG1_BLOCK,ERR_LOG2_BLOCK);
    			break;
    		
    		default:
    			break;
    	}
    	
    	return clear_error;
    
    }
    
    
    /***************************** BytetoAscii ************************************
    *
    * Function name: BytetoAscii 
    * Description:  Converts a Uint8 to three ascii digits and returns pointer to
    *               end of string. 
    * Programmer(s): Stu Haug
    * Created      : 5/30/2006
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :   pmsg_str - Pointer to string to be filled with ascii number.
    * Outputs:   pstr     - Pointer to end of the filled string.
    * Cycles required:  
    *******************************************************************************/
    Int8 *BytetoAscii(Int8 *pmsg_str, Uint8 value)
    {
    	Uint32 units, tens, hundreds;
    	Int8 *pstr;
    	
    	pstr = pmsg_str;
    	
    	units = value;
    	tens = 0;
    	hundreds = 0;
    	
    	while(units > 99)  
    	{
    		units -= 100;
    		hundreds++;
    	}
    	
    	while(units > 9)  
    	{
    		units -= 10;
    		tens++;
    	}
    	
    	*pstr++ = ascii_conv_tbl[hundreds];
    	*pstr++ = ascii_conv_tbl[tens];
    	*pstr++ = ascii_conv_tbl[units];
    	
    	return pstr;
    }
    
    /**************************** WordtoAsciiHex **********************************
    *
    * Function name: WordtoAsciiHex 
    * Description:  Converts a Uint32 to eight ascii hex digits plus a leading "0x"
    *               and returns pointer to end of string. 
    * Programmer(s): Stu Haug
    * Created      : 5/31/2006
    * Revisions    :
    *     Description :
    *     Date        :
    *     Author      :
    *
    * Inputs :   pmsg_str - Pointer to string to be filled with ascii hex number.
    * Outputs:   pstr     - Pointer to end of the filled string.
    * Cycles required:  
    *******************************************************************************/
    Int8 *WordtoAsciiHex(Int8 *pmsg_str, Uint32 value)
    {
    	Uint32 i;
    	Int8 *pstr;
    
    	pstr = pmsg_str;
    	*pstr++ = '0';
    	*pstr++ = 'x';
    	pstr += NIBBLES_PER_WORD; /* work from ls nibble of word to ms nibble */
    
        for (i=0 ; i < NIBBLES_PER_WORD; i++)
        {
            *--pstr = ascii_conv_tbl[value & WORD_TO_NIBBLE_MASK];
            value = value >> BITS_PER_NIBBLE;
        }
    	
    	return (pstr + NIBBLES_PER_WORD);
    }
    
    
    
    
    
    
    

  • Sorry, the compiler options did not attach the first time

  • The source file you provide is not preprocessed like this, thus we cannot build it.  Also, please provide the build options in text form, and not an image.  That allows us to copy-n-paste the build options.

    Thanks and regards,

    -George

  • Build options:

    -mv6700 --abi=coffabi -O3 -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/Program Files/C6xCSL/include" --include_path="K:/Infrastructure_Group_Stuff/TS2_ADC/Code/TS3/3.01.19.3000_CCS5_test/Source/DSP1/PLEX_dsp1/Debug" --include_path="C:/ti/bios_5_42_00_07/packages/ti/bios/include" --include_path="C:/ti/bios_5_42_00_07/packages/ti/rtdx/include/c6000" --include_path="C:/ti/xdais_7_21_01_07/packages/ti/xdais" --include_path="/include" --define="_DEBUG" --define="CHIP_6713" --define=c6713 --quiet --display_error_number --issue_remarks --verbose_diagnostics --interrupt_threshold=2000 --no_bad_aliases --speculate_loads=36 --c_src_interlist --obj_directory="K:/Infrastructure_Group_Stuff/TS2_ADC/Code/TS3/3.01.19.3000/Source/DSP1/Debug" --asm_directory="K:/Infrastructure_Group_Stuff/TS2_ADC/Code/TS3/3.01.19.3000/Source/DSP1/Debug"

  • Thank you for submitting a test case.  I can reproduce this behavior.  I filed SDSCM00051207 in the SDOWP system to have this investigated.  

    Two workarounds exist.  One, you can upgrade the compiler to version 7.4.11.  Visit this page about that.  Or, you can lower the optimization level from -o3 to -o2.  Note the equivalent long form of the -o option is --opt_level.
    Thanks and regards,
    -George
  • This problem is a duplicate of SDSCM00046693, which is fixed in 7.4.3 for the 7.4.x series.

    Other workarounds include adding a FUNC_CANNOT_INLINE pragma to the concat() function, or using the library function strcat() or strncat() instead of concat(), because they do pretty much the same thing.

  • Okay, I tried this and it did resolve that error, however all that did is expose another 20 errors, including memory map errors, and suggestions that I reduce optimization levels (which I cannot do due to the hard real-time nature of our code).  I don't have time to spend debugging all of them...Its obvious to me that TI apparently did not properly think through the CCS 3.3 -> CCS 5 migration case.  I am truly disappointed with the CCS 5 product; I expected better than this from TI.  I will simply need to get an old Win XP box re-loaded with CCS 3.3 to perform the tasks I need to do and worry about "upgrading" to CCS 5 sometime later.

    Chad