winarm error

OP #1244914
Rate this post
useful
not useful
i am using winarm i have run the example codes its fine.
i have written an ledblinking code

#include<stdio.h>

#define GPIO_BASE_ADDR    0xE0028000

#define IOSET0         (*(volatile unsigned long *)(GPIO_BASE_ADDR + 
0x04))

#define IODIR0         (*(volatile unsigned long *)(GPIO_BASE_ADDR + 
0x08))

#define IOCLR0         (*(volatile unsigned long *)(GPIO_BASE_ADDR + 
0x0C))

void delay()

{

  int i;

  for(i=0;i<10000;i++){}

}

main()

{

  IODIR0=0x00ff0000;

  while(1)

  {

    IOSET0=0x00ff0000;

    delay();

    IOCLR0=0x00ff0000;

  }

}



i want to run this program on my arm lpc2148???
when i use make all error comes--> no rule to make target error no:2
plz do help???
there is any tutorial from beginning i have read some but everything 
explain with the example code given
#1247074
Rate this post
useful
not useful
Ranjeeth P t wrote:

> when i use make all error comes--> no rule to make target error no:2

That is a make file error not a compiler error. Unfortunately you have 
removes all the useful information from the message. Post the whole log.


> void delay()
>
> {
>
>   int i;
>
>   for(i=0;i<10000;i++){}
>
> }

You have fallen in to teh number one most common trap in embedded 
systems. The device has hardware timers, it is better to use one of them 
for delays, however if you insist on dooing a loop delay, do it 
correctly:

 void delay()
{

  volatile int i;

  for(i=0;i<10000;i++){}

}

See: 
http://www.embedded.com/columns/beginerscorner/9900209?_requestid=224278 
for the reason why your code will break.
#1251831
Rate this post
useful
not useful
Ranjeeth P t wrote:
> no rule to make target
> error no:2
>
That is really no more information that you posted in the first place. I 
expected everything emitted to the console from the point you start the 
make file to the end. There must be other information?

If not then your make file is invalid, and perhaps you should post that.


>
> Atleast somesay how to compile the above code and get .hex file????
>
That is a different question, you have to get your make file right 
first. It has to build the code before it can generate a hex file from 
it.


> there is any tutorial from beginning i have read some but everything
> explain with the example code given
Have you looked that the "ARM-GCC development resources" thread? 
http://embdev.net/topic/129986. In particular the "Building bare-metal 
ARM with GNU" link.


Clifford

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now