How to compile a c program to run on sama5d27 running on Linux

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am new to processors that run Linux. I have got a sama5d27-som1-ek1, from the manual I am able to run Linux and access terminal from serial port. How do I compile c programs to run in Linux.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Load gcc and compile! Or load a cross-compiler and compile on a PC running linux.
Since C has its origins with Unix, just about any C book tells you how or the many millions of tuts and blogs on the interwebs.
Hopefully the linux distribution for the sama5 has the compiler as part of the package. Then google how to compile c program on linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Or load a cross-compiler and compile on a PC running linux

The PC doesn't even need to be running Linux!

 

By definition, a Cross-Compiler is one that generates code for a target different from the Host.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Hopefully the linux distribution for the sama5 has the compiler as part of the package

Indeed, the Product Page says,

 Linux distribution and software package allows you to easily get started with your development.

 

http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=ATSAMA5D27-SOM1-EK1

 

and

To get started with software development, please visit: http://www.at91.com/linux4sam/bi...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pranaykotha wrote:
I am new to processors that run Linux

The whole point of running Linux is the the processor becomes (almost) irrelevant.

So any general Linux tutorial or book should be able to help you ...

 

So do you really mean to say that you are new to Linux?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Check out the Yocto project: https://en.wikipedia.org/wiki/Yo...

 

There is a port for the sama5d27: https://github.com/linux4sam/met...

 

And some related forums at: http://www.at91.com