EmbDev.net

Forum: ARM programming with GCC/GNU tools winarm error


Author: Ranjeeth P t (ranjeeth)
Posted on:

Rate this post
0 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

Author: Tilo (Guest)
Posted on:

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

Author: Tilo (Guest)
Posted on:

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

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 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/990... 
for the reason why your code will break.

Author: Ranjeeth P t (ranjeeth)
Posted on:

Rate this post
0 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????

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

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

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 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

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.