Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Compiling a Project in Stellaris LM4f120H5QR

$
0
0

I wish to compile the following simple code in my low cost evaluation board i bought from TI

#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
int main(void)
{
int LED = 2;
SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
while(1)
{
// Turn on the LED
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, LED);
// Delay for a bit
SysCtlDelay(2000000);
// Cycle through Red, Green and Blue LEDs
if (LED == 8) {LED = 2;} else {LED = LED*2;}
}
}


In the lab workbook (opens in a new window), on page 45 and 46 the lab explains how to let the CCS 'see' where my #included libraries are. I undestand this part and I successfully finished this lab.

But this is not what I want to do.
I want to have all wanted headers/libraries *inside* my project folder. So I included

gpio.h
sysctl.h
hw_memmap.h
hw_types.h

in the project folder it self and tried to debug the project. It didnt debug. said some other header files were missing. Then I started copying the header file that it said missing in the error window to the project folder but it was going on and on and on i didnt want to do it any longer..

I wish ti simply keep the wanted files to poject to compile in the project folder it self.
And not do the steps on the workbook page numbers 45,46 . I.E. not going into include options and ARM Linker to give references to headers and libraries.


My second question is,

What is the differene between the two references we provide from ARM Linker and Include options? (page 45,46) What is the difference of a library and a header. What Am I doing here. If it costs a long explanation would you tell me how i can figure it out.


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>