cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
smazzux
Adventurer
Adventurer
12,725 Views
Registered: ‎03-19-2008

Cross compiling application for BlueCat Linux

Hi everybody,

I wish to use the BlueCat Linux distribution on a Spartan3 1600E evaluation board using the "UG258: MicroBlaze Development Kit BlueCat linux Reference System" as reference.

I downloaded the BlueCat image via jtag, got to the console and was able to transfer files via ftp.

 

Now my problem is:

how can I cross-compile an application to be run on the BlueCat Linux target?

where do I get the correct toolchains?

 

If I issue a 'file' on a binary file included in the BlueCat distribution I get:

ELF 32-bit MSB executable, version 1 (SYSV), for GNU/Linux 2.0.0, statically linked, for GNU/Linux 2.0.0, stripped

 

I could not compile a compatible executable with mb-gcc.

 

From the Board Support Guide for Xilinx Spartan-3E 1600 Boards I read:

 

BlueCat Linux Cross-Development Tools
BlueCat Linux release 5.4.2 utilizes the following versions of the GNU toolchain:
     •  gcc version 4.1.1
     •  binutils version 2.16

 

but I still miss something.

 

I hope some of you could spread some light on my issue.

I would like to try a simple application before buying the whole system.

 

Many thanks for yout time and support.

Giulio Mazzoleni

0 Kudos
14 Replies
nkzhangzx
Contributor
Contributor
12,700 Views
Registered: ‎04-16-2008

Hello

Could you give me a hand on ftp establishing? I am using petalinux on sparton3e starter kit. I also wanted to cross compiling applications for petalinux, but I haven't even establish the ftp. Could you give me some reference on how to establish the ftp? Could you send them to my email, I will be gratefull for your help.

My email address is nkzhangzx@163.com

Thank you.

Message Edited by nkzhangzx on 11-19-2008 10:26 PM
0 Kudos
smazzux
Adventurer
Adventurer
12,697 Views
Registered: ‎03-19-2008

At first I tried to use the ftp server loaded on the board, but since I could not find the correct password I simply decided to upload my file to an external (PC) ftp server.

Then I simply ran 'ftp myserver' from the board and download the file of interest (binary - cd dir - get file - bye).

 

Please make sure to assing a correct ip address to the board just after having reached the serial console.

ifconfig eth0 192.xxx.xxx.xxx

 

Then you can try to telnet to the board with telnet 192.xxx.xxx.xxx

username is root with no password.

 

Hope this helps.

Giulio

0 Kudos
nkzhangzx
Contributor
Contributor
12,693 Views
Registered: ‎04-16-2008

Thank you.

Now I meet the same problem of yours. I reffer to the website below:

http://www.itee.uq.edu.au/~jwilliams/phpwiki-1.3.7/index.php/OutOfTreeCompile?redirectfrom=OutTreeCompile

I write a  simple "hello world" source file, and compile it using the makefile it offers. Then I copy the binary file into petalinux using ftp. But it still cannot be executed. Petalinux reports the error as below:

./hello cannot execute

 

Maybe you can try it.

Hope it helps. If it could work, please tell me how do you get it.

Message Edited by nkzhangzx on 11-20-2008 05:19 AM
0 Kudos
smazzux
Adventurer
Adventurer
12,687 Views
Registered: ‎03-19-2008

PetaLinux and BlueCat Linux are two different distributions.

In PetaLinux you use microblaze-uclinux-gcc to cross compile your application. The easiest way is to use their makefile (as you did).

You should get a file of type "BFLT executable - version 4 ram" (use the 'file' command to get those info).

Please remember to chmod +x (or chmod 755) the file before trying to execute it.

In PetaLinux the ftp server is working quite well (usr: root - pwd: root - can be changed during kernel configuration).

Message Edited by smazzux on 11-20-2008 06:13 AM
0 Kudos
nkzhangzx
Contributor
Contributor
12,677 Views
Registered: ‎04-16-2008

Oh, thank you. I have solved the problem. It is indeed the problem of privilege. It works after the chomd command.

Thank you!

0 Kudos
smazzux
Adventurer
Adventurer
11,993 Views
Registered: ‎03-19-2008

It has been a while since I have posted this issue.

Just this morning I was getting back on the argument and found that it is just needed to issue a mb-linux-gcc -static to get the correct executable to be executed by BlueCat.

This toolchain has been installed by Petalinux, but it works fine with a simple hello world.

Now I'll conduct some more tests.

Best regards.

0 Kudos
narsi82
Observer
Observer
10,618 Views
Registered: ‎05-05-2009

 Hi,

 

 I am facing a issue for soft ware application elf genaration.

 

 we have installed Blucat core and sp3e BSP's, Activated the BSP's by executing ". setup.sh sp3e"

 And from EDk tool able to generate  bit fil, then add software application but not able to comiple.

 

All the above procedure is short, we did instalation by following

"Blucat linux board suppport Guide" and "Blucat user Guide"

 

While comipling Software appliction we are not getting any errors. also not getting elf/bin file.

 

 

thanks in advance.

 

regards

Narsimha 

0 Kudos
smazzux
Adventurer
Adventurer
10,614 Views
Registered: ‎03-19-2008

Hi narsi,

Are you trying to compile a software application from EDK?

It will be incapsulated in the bitstream. An elf should be indeed being generated in the folder specified under "Executable" field, but it should not matter.

Only one executable at a time should initialize block ram.

Did you manage to get Linux console appear on serial line?

Have you got network connectivity?

If so is just a matter of compiling a hello world application with the correct toolchain.

Please note that I do not have any BlueCat Linux installed, so I am not able to help you any further.

You would be better asking to Lynuxworks support.

Giulio

0 Kudos
ritanagar
Adventurer
Adventurer
7,481 Views
Registered: ‎09-20-2010

Hello,

I seen that u r trying to execute ur application from ftp .Me have the same problem , I have also cross-compile my application of hello world by cross-compiler and trasnfer using ftp.But its nt executing.

 

Error:./Hello :can't execute

 

Plz tell me hw u solve this issue?I will be very thankful to u.

My ID is :RitaNagar@gmail.com

0 Kudos
smazzux
Adventurer
Adventurer
4,724 Views
Registered: ‎03-19-2008

You probably have to chmod +x (or chmod 755) the executable file after transfer

0 Kudos
ritanagar
Adventurer
Adventurer
4,715 Views
Registered: ‎09-20-2010

hi,

thanks for your quick responce,I tried this also but its not showing correct output,it was just simple program to print "HELLO" on screen but its result is:

"SIGSEGV".

I did all work in linux system xilinx 12.2 but just becoz I dont have UART in my RHEL system I my using windows hyperterminal  and using windows only I m connect board to ethernet cable.Can this is creating problem?I just connect JTAG in linux PC

0 Kudos
smazzux
Adventurer
Adventurer
4,709 Views
Registered: ‎03-19-2008

You are using BlueCat Linux, right?

have you tried compiling it with "mb-linux-gcc -static"?

I am not using BlueCat, so I won't be of much help (only have some knowledge about PetaLinux), but I recall something based on little past experience.

Can you also post the result of "file <executable>"?

0 Kudos
ritanagar
Adventurer
Adventurer
4,694 Views
Registered: ‎09-20-2010

Hi,

thanks again.Im using Reh Hat Linux 5 .using "Montavista linux " in OS configuration.I select linux_2.6 as OS support in Xilinx 12.2 .I result is same as I wrote.

I m crosscompiling my application with ELDK for ppc440.like this -

<!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } -->

[root@localhost ~]# mkdir hello

[root@localhost ]# cd hello

[root@localhost hello]# cp /home/rita/Desktop/hello.c / hello

 

Build the cross compiling environment by the following command –

 

[root@localhost algo]# source /cad/eldk/eldk_init ppc_4xx

[root@localhost algo]# export ARCH=powerpc

[root@localhost algo]#ppc_4xx-gcc –static hello.c –o hello

 

 

Then transfered this hello to ramdisk using ftp.

root:> chmod +x ./hello

      root:> ./hello

     SIGSEGV

 

Plz see this I dont know why this is coming.

Also If I change ramdisk size ramdisk becomes usuable.Plz help how can I solve this.

0 Kudos
ritanagar
Adventurer
Adventurer
4,662 Views
Registered: ‎09-20-2010

hi,

thanks I got the solution, nw I am able to run any application

0 Kudos