EmbDev.net

Forum: ARM programming with GCC/GNU tools winarm error


von Ranjeeth P. (ranjeeth)


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

von Tilo (Guest)


Rate this post
useful
not useful
First your code:

you try to write into IODIR0 and IOCLR0 which are no local variables and 
therefore not writeable.

There are a lot of tutorials like:
http://lmgtfy.com/?q=gnu+arm+tutorial

You should start with a tutorial matching to your testboard or buy 
another testboard for learning.

von Tilo (Guest)


Rate this post
useful
not useful
Forget about what I've written about local variables. Of course you want 
to write to some MMRs, sorry about that ;)

von Clifford S. (clifford)


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.

von Ranjeeth P. (ranjeeth)


Rate this post
useful
not useful
no rule to make target
error no:2



this is the error what i get
what should i do.


          OR


Atleast somesay how to compile the above code and get .hex file????

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
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.

von Clifford S. (clifford)


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

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.