LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 09-28-2015, 02:03 PM   #1
dpeterson3
Member
 
Registered: Jun 2008
Distribution: Debian
Posts: 164

Rep: Reputation: 16
Cross Compiling for Yocto


My lab recently acquired some of these (http://www.quanser.com/products/qbot2). I need to use them with network broadcasting, but there is a bug in their matlab driver that prevents it from sending and receiving in broadcast mode simultaneously, and they aren't going to fix it anytime soon. The company's real-time OS that runs the matlab code is running on top of a Yocto linux build, and the main CPU board is a gumstix duovero. I've written a small program to take in data on localhost through tcp and pump it out over broadcast to the main network. It also listens for broadcast messages and sends them back through the TCP pipe. It works well between my two debian boxes. Now for my problem. The Yocto build they used is stripped down, so no gcc or g++, so I have to cross compile it. I'm new to the whole embedded linux deal. I tried following the instructions here to cross compile,
https://github.com/gumstix/yocto-man...with-Yocto-SDK,
but I just get a nice error message from the shell saying "File Not Found."

Output of file command on Debian
[code]
$ file udp_stream.o
udp_stream.o: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=0549ad77bdcf21a72dc7bed7dddd4ec9f45999c9, not stripped
[\code]

The kernel on the gumstix is 3.3.17, so I don't know if the hangup is the kernel, or the fact that I seem to be using an old SDK or what. Any suggestions?
 
Old 09-28-2015, 02:14 PM   #2
Rinndalir
Member
 
Registered: Sep 2015
Posts: 733

Rep: Reputation: Disabled
Can you get the cross compiling environment they used to build their version?
 
Old 09-28-2015, 03:00 PM   #3
dpeterson3
Member
 
Registered: Jun 2008
Distribution: Debian
Posts: 164

Original Poster
Rep: Reputation: 16
I don't think so. I asked a few months ago, and just got told they used a fresh yocto build(whatever was current at the time I assume) and put their stuff in. In fact, all they sent me was that explanation and a link to the yocto github page, which isn't particularly helpful. I think they build whole images when they do it. My goal is to not mess with the OS as much as possible for fear of breaking things.
 
Old 09-29-2015, 09:41 PM   #4
Rinndalir
Member
 
Registered: Sep 2015
Posts: 733

Rep: Reputation: Disabled
Then you will need to build a cross-compiler env from yocto. There's no other way to accomplish what you are asking. Can't offer anymore help since you haven't said what you've done and where things went wrong.
 
Old 09-30-2015, 02:13 PM   #5
dpeterson3
Member
 
Registered: Jun 2008
Distribution: Debian
Posts: 164

Original Poster
Rep: Reputation: 16
I'm not entirely sure where I went wrong. I tried following the instructions at this link (https://github.com/gumstix/yocto-man...with-Yocto-SDK) to set up what I thought was a build environment for yocto. My program builds just fine, but when I transfer it over to the gumstix and try to execute it, it get an error saying "no such file or directory". From reading, it seems like the most likely cause is an architecture mismatch, which is entirely possible. I tried changing the build settings in the sdk script for an arm9 instead of an arm7 processor, but no luck. I'm not sure how to set up a build environment then. Know any good tutorials on this? I would like to avoid eclipse if possible.
 
Old 10-01-2015, 03:19 PM   #6
Rinndalir
Member
 
Registered: Sep 2015
Posts: 733

Rep: Reputation: Disabled
So you're trying to replace the udp_stream.o on the target system with the one you've built?
Maybe LD_PRELOAD will work?
 
Old 10-02-2015, 01:53 PM   #7
dpeterson3
Member
 
Registered: Jun 2008
Distribution: Debian
Posts: 164

Original Poster
Rep: Reputation: 16
On the gumstix, there is no program upd_stream. I wrote this program. All it does it take in a TCP stream on localhost and spit it out as a UDP broadcast socket on eth0. I'm trying to get it compile for the gumstix. Using the sdk at the link, it will compile. However, it doesn't want to run on the gumstix board. It gives the error I mentioned.
 
Old 10-09-2015, 11:26 AM   #8
Rinndalir
Member
 
Registered: Sep 2015
Posts: 733

Rep: Reputation: Disabled
Make it a static executable then.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross compiling Mike Davies Linux - Kernel 5 02-23-2018 11:30 AM
learning cross compiling-compiling library from soruce brianmay27 Linux - Software 1 12-31-2012 05:28 AM
Cross Compiling jayadhanesh Linux - Newbie 2 05-25-2009 11:48 PM
Cross-compiling v/s cross-building kushalkoolwal Programming 3 05-13-2009 05:49 AM
cross compiling cerin Linux - Software 1 02-11-2006 10:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration