winarm error

OP #1244914
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
Guest
Forget about what I've written about local variables. Of course you want 
to write to some MMRs, sorry about that ;)
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.
Moderator
You don't even try the suggestions that have been given here or those I 
wrote in the reply to your e-mail. Insteat you write the same question 
over and over again into forums and e-mails. Try to give more 
information. At least the complete output of make.
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

A question of your own? This thread is over 17 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.