0
\$\begingroup\$

I am trying to change and read my TM4C123G launchpad clock frequency to 80 MHZ using TIVAWARE libraries so here is my code:

#include <lm4f120h5qr.h>
#include <stdbool.h>
#include <stdint.h>
#include "driverlib/sysctl.c"
#include "driverlib/pin_map.h"

void main()
{
SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);
int x= SysCtlClockGet();
while(1){  }
}

I am facing two problems the first problem there is an error while compiling this code the error is:

Error[Li005]: no definition for "SysCtlDelay" [referenced from C:\Users\ZMK\Documents\TIVA C\IAR\TM4C FREQUENCY\Debug\Obj\main.o]

where SysCtlDelay() is a function and its definition is in the driverlib/sysctl.c included in the top. so I don't know why this is happening!!

the second problem is while debugging the code the local variable X doesn't show a value it only shows an unknown value, I tried to make it volatile but nothing changed too!!

thanks in advance.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I can't help you with the first issue. I suggest you to visit TI TIVA forum directly link, it's very responsive. Regarding your second problem: just define your variable outside of main(), i.e make it global. \$\endgroup\$ Commented Jan 7, 2016 at 9:22

1 Answer 1

2
\$\begingroup\$

for solving first problem, You should:
1. add library files (library.a for IAR) to your project. In Project window -> add group(or files) -> driverlib.a in Driverlib/ewarm folder. (Sorry, I'm using Keil or Eclipse but sure these acts looks same in different IDE)
2. in main.c include driverlib/sysctl.h instead of sysctl.c
Don't understand second issue, can you add your code?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.