How to start cross compiling for an arm platform [closed] - c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm completely new on the whole cross compiling scene, but I'm willing to learn. My objective right now is to compile a simple program (written in C) for an Arm M0 processor. I would like to do it as much as possible with free tools (open source or official, it does not matter). My PC runs a Debian Testing x64 operating system. My specific questions are:
1) What tools should I download? (can be console or IDE, whichever works best in your opinion)
2) Could you point me to a good tutorial that can teach me the basics? I know this is far from trivial and something hard to accomplish if you have little experience, but I want to try and I'd appreaciate a hand getting started.
Just to clarify, my objective is a program for an M0 that is not in any specific board or build. Which means I'm going to have to define where the memory is and configure the communication with the PC. So the tools need me to allowed to do that.

In Linux machine first of all you need to install arm toolchain.
sudo apt-get install gcc-arm-linux-gnueabi
Second step compile your program let say hello.c by
arm-linux-gnueabi-gcc -o hello hello.c
you can find how to cross compile toolchain,programs and library for ARM platform.
You can also check GNU Tools for ARM Embedded Processors

Related

How do I execute a program on a custom circuit board using ARM processor? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm trying to build a custom board to use LED or LCD screens using one of the ARM processors and PCB( I'm buying separate parts and soldering them on a PCB ).
I wonder how to execute a program on that board.
Do I just write a C program on my PC, compile, and upload the binary file to the board?
Or is there any other necessary program or code to execute a C program on custom ARM board?
I hope someone could show me some directions and examples. I'm lost.
Massively broad question. Yes you need a toolchain that can build programs for the arm processor. Which generally means a cross compiler, good news is that gcc and clang/llvm are free and are capable of the job, but its not that easy. Find a sandbox (someone, like the chip vendor (arm is not the chip vendor they simply made some IP that the chip vendor bought and put in their part), will have a development environment and libraries and examples) and learn from that.
And you need tools in order to get the firmware downloaded into the part. Software and hardware tools.
Start with an eval/dev/hobby board first. They are often $20 or less, there are many in the $10 range, enough to keep you busy for a long time. You can wire up displays to these boards long before it is time to start thinking about making your own PCB.

Port C Project from Windows to Linux [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am tasked with porting a massive c project from windows to linux. I have never ported anything over to linux before and am pretty new to linux. The project uses quite a bit of win32 calls. I have looked through some of it and understand what those parts do, however there are many moving parts and i feel it would take too much time to look through it all. What would be the best way to port it over? Is it foolish of me to think I can move the project over to the linux machine and work through the errors one by one?
Thank you in advanced!
Wine is a Windows Emulator for Linux, more exactly a re-implementation of the Windows API and binary interface, mainly for Unix-like OSes. It has also a builtin library named libwine, which is essentially a compatibility layer between the relevant Linux APIs (mainly: libc and X11) and the Win32.
Compiling the project with libwine, you will compile a Linux executable (binary), using the libwine as a shared lib (shared lib == dll). On this way, you can use the Windows API calls in a Linux project.
Your knowledge of the Win32 API helps a lot, most likely the compatibility isn't 100%. Probably you will have to modify the code a little bit (but not too much).

How to make executables work on OSX Mavericks [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I've been working on a school project, in C, and I plan to distribute it to students and anyone interested...
The problem here is the executable file won't run on OS X Mavericks...
is there any way they can do this without getting a simulator, or an application like wine.
( Like how you have to install Visual C/C++ & DirectX for games? )
Since C compiled code is not platform agnostic like Java, you need to compile the code for the target platform(s) you are interested in.
If you have access to OSX Mavericks, you can compile on that OS to get the executable and test. (Copy your C source code to the mac OS, or better use a source control system like git)
If you do not have access to OSX, you can look up how to build/use cross compiler. (Links to related SO questions below that address this)
The effort needed for cross-compile and test would likely be non-trivial, so if you can get access to OSX that will be your best bet.
In either case, you will have to make sure the code written is platform-agnostic.
Several similar questions on stack overflow that talk about the various cross compiling options:
Way Cross Compile C/C++ code to run on Windows, Linux, and Mac OS?
How to Compile for OS X in Linux or Windows?
Porting C++ code from Windows to the Mac

Crenshaw's "Let's Build a Compiler": Transcription to C and x86 Assembler? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am trying to work through Jack Crenshaw's excellent compiler programming tutorial "Let's Build a Compiler" and have bumped into two hurdles. First the code is written in Pascal, a great language for which I have both respect and fondness from a brief exposure to it in the mid 1980s, but which I have not touched since. I currently program mostly in C.
The other hurdle is that the generated assembler is for the Motorola 68000 line of processors. While I may be able to find a translator for it, it would be preferable if I could generate Intel x86 assembler (either Intel or AT&T style).
I can work through the code on Linux, Mac OsX or Windows 7, if it makes anything easier. I have access to all of the named operating systems.
I do not feel fully qualified to do the transcription myself. Has anybody worked this out already, or do you have other suggestions?
Any ideas, feedback or suggestions welcome.
You could run the generated code on a 68K emulator—several of the entries on that page are open-source.
It might be easier to target the JVM instead of a native processor. as for translating Pascal to C... it'shouldn't be that much of a hurdle really.

Would an ARM Processor be the way to go? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was making a little device that would have three buttons (like the ones at radioshack) and each preform its own action. These buttons and their actions would be controlled by a very small real time operating system that I would put on this device.
Would I need an ARM Processor in any way?
How would I put the real time operating system on the device?
What OS would I have to compile this on (ex. Ubuntu? Mac OS X? Windows 7?)?
Are there any examples of anyone doing this?
P.S. No prebuilt boards (ex. arduino). I would build the board myself.
Any feedback would be greatly appreciated!
Even if you don't want to use a prebuilt board in the finished product, I'd recommend getting a prebuilt board (like the Arduino), build your product, program it, test it, etc. while on the breadboard, and then simply rebuild it however you want, using the same hardware as you've been using.
That helps you out especially the next time you're building something, because you already have the prototype board and the toolchain ready to go.
Compiling your files can be done on any OS.
Enumerated version:
No, and I wouldn't even recommend using an ARM processor; but rather an Atmega328 or similar.
Using a programmer.
Any.
Probably millions, or at least hundreds of thousands of examples, yes.

Resources