EmbDev.net

Forum: ARM programming with GCC/GNU tools ARM gcc cross compile in window


Author: Yee Yee (Company: Infowave) (armgcc)
Posted on:

Rate this post
0 useful
not useful
Hi,

I am using ATMEL microcontroller (ARMS 7) and using Embest IDE.

I want to use GCC to compile the source codes that have been written 
into a dll and lib files.

And can someone recommend me the relevant websites which gcc tools and 
software that I should download and the required steps...

Should I use MinGW or Cygwin since i want to do a cross compilation in 
Windows environment.

Your help is appreciated

thanks

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

Rate this post
0 useful
not useful
Yee Yee wrote:
> Hi,
>
> I am using ATMEL microcontroller (ARMS 7) and using Embest IDE.
>
> I want to use GCC to compile the source codes that have been written
> into a dll and lib files.

Is an Operation-System running on the target? It is possible to create a 
library (collection of object codes, "lib file") and later statically 
link functions from the library to an application running on 
"bare-metal" (without OS). Shared libraries and late linkage like with 
"DLL files" on MS Windows are usually provided by the OS (loader, 
filesystem, memory-management, ...).

> And can someone recommend me the relevant websites which gcc tools and
> software that I should download and the required steps...

For libraries ("lib files") the needed tools are already included in the 
usual packages of GNU cross-toolchains (gcc from the 
compiler-collection: .c->.o and ar from the binutils: *.c->.a/.lib).

> Should I use MinGW or Cygwin since i want to do a cross compilation in
> Windows environment.

There is not need for MinGW or Cygwin since ready-mode GNU 
cross-toolchains are available for MS Windows (Yagarto, DevkitARM, CS 
G++ for ARM, Ronetix...). As far as I know the Embest IDE (never used 
it) also comes with a toolchain. If you want to build your own 
cross-toolchain you may look into the SVN/CVS/git of DevkitPro and 
Yagarto on sf.net.

Author: Yee Yee (Company: Infowave) (armgcc)
Posted on:

Rate this post
0 useful
not useful
Hi, Martin, thanks for the reply.

I am at a loss about how to get this project forward as I am not 
familiar with open source Gcc programming.

An OS system will be ideal.

We need some sort of coding management. We wanted to use gcc to make 
certain standard codes modular that we wrote by creating standard 
library and then doing documentation. So, in future, the developers need 
not look at the entire coding and attach the cpp source code to the 
project. They just need to link the library file and then just call the 
function.

Embest doesn't allow us to create dll and library files.

My background is mechanical and hv done a fair bit of embedded 
programming. But in the area of creating library files, coding design, i 
am at a loss as to how i can begin the project as I am not a computing 
student.

I notice that there is also a Visual-MinGW, which is a IDE environment? 
Can it be used to compile, build and create lib files for ARMS coding?

Your help and advice is appreciated.

thanks

Martin Thomas wrote:
> Yee Yee wrote:
>> Hi,
>>
>> I am using ATMEL microcontroller (ARMS 7) and using Embest IDE.
>>
>> I want to use GCC to compile the source codes that have been written
>> into a dll and lib files.
>
> Is an Operation-System running on the target? It is possible to create a
> library (collection of object codes, "lib file") and later statically
> link functions from the library to an application running on
> "bare-metal" (without OS). Shared libraries and late linkage like with
> "DLL files" on MS Windows are usually provided by the OS (loader,
> filesystem, memory-management, ...).
>
>> And can someone recommend me the relevant websites which gcc tools and
>> software that I should download and the required steps...
>
> For libraries ("lib files") the needed tools are already included in the
> usual packages of GNU cross-toolchains (gcc from the
> compiler-collection: .c->.o and ar from the binutils: *.c->.a/.lib).
>
>> Should I use MinGW or Cygwin since i want to do a cross compilation in
>> Windows environment.
>
> There is not need for MinGW or Cygwin since ready-mode GNU
> cross-toolchains are available for MS Windows (Yagarto, DevkitARM, CS
> G++ for ARM, Ronetix...). As far as I know the Embest IDE (never used
> it) also comes with a toolchain. If you want to build your own
> cross-toolchain you may look into the SVN/CVS/git of DevkitPro and
> Yagarto on sf.net.

Author: Yee Yee (Company: Infowave) (armgcc)
Posted on:

Rate this post
0 useful
not useful
btw, what does cross-toolchain mean?

It seems like there are a couple of different gcc software... What's the 
difference? Any good websites with a good installation and get started 
tutorial?

So, u think I should use software like DevkitArm, CS G++ for ARM etc???

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

Rate this post
0 useful
not useful
Yee Yee wrote:
> Hi, Martin, thanks for the reply.
>
> I am at a loss about how to get this project forward as I am not
> familiar with open source Gcc programming.
>
> An OS system will be ideal.

Depends on the application.

> We need some sort of coding management. We wanted to use gcc to make
> certain standard codes modular that we wrote by creating standard
> library and then doing documentation. So, in future, the developers need
> not look at the entire coding and attach the cpp source code to the
> project. They just need to link the library file and then just call the
> function.

A "lib file" as a collection of object-code should be o.k. for this. The 
developers get the library file and one or more header-files (.h).

> Embest doesn't allow us to create dll and library files.

The IDE might not support the creation of library files but the tools in 
the background should. Did you ask Embest?

> My background is mechanical and hv done a fair bit of embedded
> programming. But in the area of creating library files, coding design, i
> am at a loss as to how i can begin the project as I am not a computing
> student.
> I notice that there is also a Visual-MinGW, which is a IDE environment?
> Can it be used to compile, build and create lib files for ARMS coding?

I don't know since I'm usually using Makefiles for this. How library 
files can be created from an IDE should be mentioned in the IDE's 
documentation/online-help.

The basic idea is to use the compiler to create object-code from 
source-code and the archiver to collect the object-codes into a library 
("lib-file"). When using GNU tools the usual file-extension is ".a" and 
the filename starts with "lib".

Example: 2 source-files egalA.c and egalB.c get compiled into 
object-code in files egalA.o and egalB.o. Later the object codes are 
collected into a library file libmylib.a. CS G++ used here but the 
concept is similar with other toolchains based on GNU sources. There are 
much more options and features but this should give the basic idea.
arm-none-eabi-gcc egalA.o egalA.c
arm-none-eabi-gcc egalB.o egalA.c
arm-none-eabi-ar rcs libmylib.a egalA.o egalB.o

The library can later be used by passing -lmylib as parameter when 
linking the application. An IDE should call compiler/archiver similar to 
this when selecting something like "create library" from the GUI.

Yee Yee wrote:
> btw, what does cross-toolchain mean?

There should be an official definition somewhere in the net. Basically a 
collection of programs to create applications for a target with a 
different OS and/or architecture (example ARM7 no OS) then the machine 
on which the these programs run (example MS-Windows on x86).

> It seems like there are a couple of different gcc software... What's the
> difference?

Main difference is the target. The usuage is always similar. For ARM and 
Linux OS search for an arm-*-linux toolchain, for ARM "bare metal" 
search for arm-*-elf ("old" ABI) or arm-*-eabi ("new" ABI). Go to 
gcc.gnu.org and read a little bit on GCC targets for further 
information.

> Any good websites with a good installation and get started
> tutorial?

Did you check the "sticky" post of this forum?

> So, u think I should use software like DevkitArm, CS G++ for ARM etc???

DevkitARM, Yagarto and CS G++ lite are very similar: toolchain to create 
"bare metal" applications for targets with ARM core. The IDE might 
already include a GNU toolchain and use it in the background.

Author: Yee Yee (Company: Infowave) (armgcc)
Posted on:

Rate this post
0 useful
not useful
Thanks, Martin for replying to my post.

Appreciate your help.

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.