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.

CCS/TM4C123GH6PGE: Application interrupt and Reset Control (APINT) //Core Reset

Part Number: TM4C123GH6PGE


Tool/software: Code Composer Studio

Hi everyone,

My platform is TM4C123GH6PGE

CCS version 6.1,

 My problem occur in SD_CARD interfacing.

 my code is working Fine but after some hours my Module is automatically Restart (Like as some time after 1 hour ,some time after 2 or 3 hours).

may be this problem occur by Application interrupt  Reset or Core Reset.

My interrupt Priority is ......... 

SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL |
SYSCTL_OSC_MAIN| SYSCTL_XTAL_16MHZ);

// Set the priorities of the interrupts used by the application.

IntMasterEnable();

IntPrioritySet(INT_TIMER0A, 0x00);

IntPrioritySet(INT_PWM0_0_TM4C123, 0x05);

IntPrioritySet(INT_PWM0_1_TM4C123, 0x0A);

IntPrioritySet(INT_PWM0_2_TM4C123, 0x10);

IntPrioritySet(INT_ADC0SS0_TM4C123, 0x1A);

IntPrioritySet(INT_TIMER2A, 0x22);

IntPrioritySet(INT_TIMER1A, 0x2A);

IntPrioritySet(FAULT_SYSTICK, 0x3A);


IntPrioritySet( INT_HIBERNATE_TM4C123, 0x40);

So, please suggest me , How to resolve this problem?



Best Regards,
Satya

  • How have you established that your MCU has, 'Suffered an undesired Reset?'     That's not explained - and unless your code requires, 'Operator Intervention' - usually the MCU's Reset will restore operation to 'normal.'     ( 'masking' the detection of such 'Reset')

    There IS a register - which records the, 'Source/Cause of such Reset.'     Your search/find/review of that Register should prove helpful.

    Power supply dips may also cause such issue - your supply should be designed to meet MCU and board component specifications for long periods of operation - under (legal) temperature extremes.

    The MCU Reset line - unless driven by an 'MCU Supervisor' - should be pulled up AND employ a cap to ground - thich makes 'Reset' more resistant to potential 'nuisance Resets...'

  • Please go through this Link

     

    already Attach the Fault pic by help of CCS debugger.

    This my solar Water pump project ,,,,This project working without SD_Card features very well.

    My module operate 3 phase Ac motor by help PWM(Space Vector techniques) and GSM Features also available for pushing the data on server.

    My SD_CARD communication based on SPI protocol .My SD_card code is like as .......

    void sd_write(void)
    {
    
    
    
        sd_value2=1;
    
     //   SysCtlDelay(5000);
    
    
      iFResult = f_write(&g_sFileObject, new_line, strlen(new_line) + 1, & ui32BytesWrite);
    
      strcpy((char *)buf_rz+24,(char *)buf_sd);
    
    
      iFResult = f_write(&g_sFileObject, buf_rz , strlen((char *)buf_rz) + 1, & ui32BytesWrite);
    
    
    
      iFResult = f_write(&g_sFileObject, new_line, strlen(new_line) + 1, & ui32BytesWrite);
    
      iFResult = f_sync(&g_sFileObject);
    
    
    
     sd_value2=0;
    
    
    }
    
    
    
    
    
    
    void Timer2IntHandler(void)
    {
    
    
    	TimerIntClear(TIMER2_BASE, TIMER_TIMA_TIMEOUT);
    
    	if(sd_value==0)
    	{
    		///     ********************sdcard *************************************************
    									     			   iFResult = f_mount(0, &g_sFatFs);
    
    									     		        if(iFResult != FR_OK)
    									     		       {
    									     		      	 // UARTprintf("f_mount error: %s\n", StringFromFResult(iFResult));
    									     		    //        return(1);
    									     		       }
    
    									     		       sd_sd1='A';
    
    									     		        iFResult = f_open(&g_sFileObject, filename, FA_WRITE|FA_OPEN_ALWAYS| FA_READ);
    
    									     		        iFResult=f_lseek(&g_sFileObject, f_size(&g_sFileObject));
    			     	     	   sd_sd1='B';
    
    									     		
    
    									     			sd_sd1='C';
    
    									     		
    
    									     			sd_sd1='D';
    									     				iFResult = f_write(&g_sFileObject, new_line, sizeof(new_line) - 1, & ui32BytesWrite);
    									     				iFResult = f_sync(&g_sFileObject);
    									     								do
    									     								{
                                                                             sd_count++;
    
     									     								 iFResult = f_write(&g_sFileObject, buf1, sizeof(buf1) - 1, & ui32BytesWrite);
    									     								 iFResult = f_sync(&g_sFileObject);
    
    													     				 if(sd_count>5)
    													     				 {
    													     					 sd_count=0;
    													     					 break;
    													     				 }
    
    									     								}while(ui32BytesWrite != sizeof(buf1)-1);
    
    									     			sd_sd1='E';
    									     								iFResult = f_write(&g_sFileObject, new_line, sizeof(new_line) - 1, & ui32BytesWrite);
    									     								iFResult = f_sync(&g_sFileObject);
    
    									     	
    									     	
    									     								 clearbufrz();
    									     		sd_value3=1;
    									     	
    						       sd_sd1='F';
    
    	}
    
    
    	sd_value++;
    	if(sd_off == 1 && sd_value2==0 && sd_value>30)
    	{
    	 sd_value=1;
         sd_write();
    	}
    	else
    	{
    		if(sd_off == 0 && sd_value >= 20 )  ///// sd_value <= 20-1;
    		{
    			sd_value = sd_value - 1;
    		}
    	}
    
    
    
    }
    
    

    SD_Card Writing function is operating based timer interrupt (Timer2  IntPrioritySet(INT_TIMER2A, 0x22);).  and this interrupt trigger after every 1+ second.

    TimerConfigure(TIMER2_BASE, TIMER_CFG_A_PERIODIC);
    TimerLoadSet(TIMER2_BASE, TIMER_A, 3*SysCtlClockGet()); ////*11/3 delay count 30
    IntEnable(INT_TIMER2A);
    TimerIntEnable(TIMER2_BASE, TIMER_TIMA_TIMEOUT);

    so please suggest me how to resolve the API interrupt reset cause because here this controller is operating many more application with SD_CARD Application  so Application reset case occur .

    After Reset my code is working normal till to 1 hour or more than 1 hour after again MCU reset occur again working same like as previous but my GSM is not pushing the data on server after Reset case.

    So What will i do?,, this problem will not occur. 

    Best Regards,
    Satya

  • cb1_mobile said:
    How have you established that your MCU has, 'Suffered an undesired Reset?'

    No answer is revealed w/in your latest posting.

    cb1_mobile said:
    There IS a register - which records the, 'Source/Cause of such Reset.'     Your search/find/review of that Register should prove helpful.

    That's 'meaningful guidance' - is it not?    Again - no answer was revealed.

    Your 'diagnosis' (via adding a bombardment of peripheral features/issues) is a 'sure'  violation of 'KISS!'       And so often results in (exactly) what you are experiencing...

  • As CB1 has suggested, there is a register called Reset Cause (RESC) in the system module that identifies the source of the reset. Can you breakpoint after the unexpected reset and read the contents of this register? (I do not see an attached picture of your fault condition.)