RodeX27
Posts: 2
Joined: Thu May 23, 2019 2:56 pm

Any Tutorial to Create a Cross Compiler for ARM? Rpi3

Thu May 23, 2019 3:17 pm

As the title says Some tutorial or documentation to do the cross compiler to program without operating system the Raspberry pi 3 which is x64, what happens is that I am developing hardware similar to the Raspberry pi board but in this case I use an ARM Cortex A53 Like the raspberry pi 3

then as the raspberry pi is already a done board, I wanted to develop in the small kernel that does basic functions such as printing text on the screen and reading a keyboard (only tests)

Can you give me a guide to start?


I wanted to write this kernel for this board to make sure it works
BCM2837

In another case that I can not get it I will be designing with one of them:
x64 cortex A72

https://www.digikey.com/product-detail/ ... ND/8344025
or microprocessor from texas instrument am3558 (who has it BeagleBoard from Texas instrument)
this 32 bits
https://www.digikey.com/product-detail/ ... ND/4073874

LdB
Posts: 1108
Joined: Wed Dec 07, 2016 2:29 pm

Re: Any Tutorial to Create a Cross Compiler for ARM? Rpi3

Thu May 23, 2019 4:44 pm

Little bit confused if you are trying to build AARCh32 or AARCH64 so I will give you both for the Cortex8A families

AARCH32 CROSS COMPILER:
https://developer.arm.com/open-source/g ... downloads
Has versions for Windows, Mac and 64bit versions of Linux.

AARCH64 CROSS COMPILER
https://releases.linaro.org/components/ ... rch64-elf/
Versions for Windows and linux but working out which from name is fun :-)
Windows version is gcc-linaro-7.4.1-2019.02-i686-mingw32_aarch64-elf.tar.xz

There is a sticky for baremetal resources
viewtopic.php?f=72&t=72260

RodeX27
Posts: 2
Joined: Thu May 23, 2019 2:56 pm

Re: Any Tutorial to Create a Cross Compiler for ARM? Rpi3

Fri May 24, 2019 1:03 pm

Good morning! :)
thanks for answering, the computer where I will be compiling is x64, is not it a problem if I install 32bit compiler versions?

another question :!:
for now I just want to compile to run it on the raspberry pi 3 B (BCM2837) x64 It would be correct to use your source, right? since I researched and I think I'm a bit lost since others download other packages. hehe Excuse my english I'm Spanish speaking :D ..

jahboater
Posts: 4197
Joined: Wed Feb 04, 2015 6:38 pm

Re: Any Tutorial to Create a Cross Compiler for ARM? Rpi3

Fri May 24, 2019 2:29 pm

RodeX27 wrote:
Fri May 24, 2019 1:03 pm
Good morning! :)
thanks for answering, the computer where I will be compiling is x64, is not it a problem if I install 32bit compiler versions?

another question :!:
for now I just want to compile to run it on the raspberry pi 3 B (BCM2837) x64 It would be correct to use your source, right? since I researched and I think I'm a bit lost since others download other packages. hehe Excuse my english I'm Spanish speaking :D ..
It is "aarch64", not "x64" on the Pi by the way.

Most OS's on the Pi have an excellent C/C++ compiler included - and all the usual development tools, so you may find you don't need to cross-compile (I never do).

LdB
Posts: 1108
Joined: Wed Dec 07, 2016 2:29 pm

Re: Any Tutorial to Create a Cross Compiler for ARM? Rpi3

Fri May 24, 2019 3:16 pm

Not sure that is an option jahboater he wants a small kernel which I assume means no linux on the Pi and he obviously wants to compile on a PC.

Anyhow RodeX27 yes the 32bit windows executable works fine on x64 windows versions .. I personally have Windows10 64 bit.
It is a command line compiler on windows, you just use any IDE to edit your files and just have a command prompt open to compile.

For a windows make executable which saves having to install cygwin junk
https://sourceforge.net/projects/ezwinports/files/
download "make-4.2.1-without-guile-w32-bin.zip" and set the extracted executable on the command line enviroment path

If you want to test if it all works here is an example to try. Just download, extract and then Edit the makefile with a text editor and change the path to match the directory where you put GCC compiler. Then type "make Pi3-64" on the command line in the directory ... without the " " characters obviously :-)
https://github.com/LdB-ECM/Raspberry-Pi-Multicore

dwelch67
Posts: 954
Joined: Sat May 26, 2012 5:32 pm

Re: Any Tutorial to Create a Cross Compiler for ARM? Rpi3

Fri Jun 14, 2019 3:20 pm

https://github.com/dwelch67/build_gcc I have scripts to build arm (aarch32) and aarch64 cross compilers on linux. I used to maintain them for windows as well but dont boot windows but once every few years. would use mingw32 back then, cygwin would have worked, but now windows has some bash thing dont know how good it is or what it does.

if for linux then if you have the right tools to build gnu stuff in the first place then you can build a cross compiler.

mine are for bare metal which is what you sound like you are doing initially. and I try to keep up with the cutting edge of gcc and binutils.

if you look at my pi tutorials you can also use an aarch64-linux-.... build for bare metal by avoiding the operating system dependencies. which means if nothing else you can run linux on one pi to not-cross-compile but natively compile for another board under test, or do the sd card dance with one pi. 32 bit or 64 bit.

Return to “Bare metal, Assembly language”