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.

Stuck on Lab 4 of TM4C123G LaunchPad Workshop

Other Parts Discussed in Thread: TM4C123GH6PM

I get an error due to, seemingly, following directions in Lab 4 of the TM4C123G LaunchPad Workshop. To enable a timer0 interrupt I pasted such into tm4c123gh6pm_startup_ccs.c as directed:

My compile error is 

--preproc_dependency="tm4c123gh6pm_startup_ccs.pp"  "../tm4c123gh6pm_startup_ccs.c"
"../tm4c123gh6pm_startup_ccs.c", line 105: error #20: identifier "Timer0IntHandler" is undefined
1 error detected in the compilation of "../tm4c123gh6pm_startup_ccs.c".

which indicates that a header file is missing. Here are the header files in main.c:

#include <stdint.h>
#include <stdbool.h>
#include "inc/tm4c123gh6pm.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/sysctl.h"
#include "driverlib/interrupt.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"

while the header files in tm4c123gh6pm_startup_ccs.c is only this:

#include <stdint.h>

I have searched through .h files, but have not been able to find Timer0IntHandler, which is maybe the problem. Please advise.

  • Hi,

    At the beginning of startup_ccs.c file, after all #include declarations you must add this one:

    extern void Timer0IntHandler(void);

    and in your source file you must define also the function, extern, to be found by the linker. 

    You may compare with a similar example in Tiva, anyone which uses interrupts - e.g. your_board/interrupts example.

    Petrei