Thread: Embedded Debian Linux: Use cross or native compiler?

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    4,077

    Embedded Debian Linux: Use cross or native compiler?

    I am going to be working on an "BeagleBone Black" that will be running an Debian Linux distro.

    BeagleBoard.org - latest-images
    Current plan is to use "AM3358 Debian 10.3 2020-04-06 1GB SD console"

    My questions are about the pros and cons of using an cross GCC toolchain versus an native toolchain.

    The programming language will be C.

    The pros I know about for cross compiling is that it will normally be faster build times. And, that is the only pro and con I know about.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,798
    What sort of programs do you intend to write.

    Regular user-space programs or kernel/driver hacking?
    If you're messing with the kernel at all, then a cross-compiler might be a better idea.
    You don't want some "oops" to cause you to lose both the OS and your latest code all at the same time.

    Though that could be mitigated by having all your development code on a shared drive, and keeping a cloned backup of the target with all the tools and setup just the way you like it.

    How would you get the build products onto the board from the host?
    Shared drive / scp / rsync?
    Or sneakernet?

    Do you have spare keyboards / mouse / monitor to set up the board as your development system?
    Alternatively, you could access it through remote desktop (rdp / vnc).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4,077
    Quote Originally Posted by Salem View Post

    What sort of programs do you intend to write.

    Regular user-space programs or kernel/driver hacking?
    If you're messing with the kernel at all, then a cross-compiler might be a better idea.
    You don't want some "oops" to cause you to lose both the OS and your latest code all at the same time.

    Though that could be mitigated by having all your development code on a shared drive, and keeping a cloned backup of the target with all the tools and setup just the way you like it.
    Regular user-space programs.

    At first the OS and user-space programs will all be on a microSD card.

    The long term location of the Linux OS and user-space programs is still under consideration.

    I plan to use a Debian package to install my user-space program.

    There is an on-board MMC called eMMC that I am thinking where we will put the Linux OS and user-space program.
    And, I think the data will be placed on the external microSD card or USB drive.

    Quote Originally Posted by Salem View Post
    How would you get the build products onto the board from the host?
    Shared drive / scp / rsync?
    Or sneakernet?
    I have not yet gotten the hardware; so, not really certain how it will be done.

    My guess the way I do it will differ from the way the end user will do it.

    Doing initial development I plan to use either an USB cable or cross Ethernet cable to load the user program to the embedded hardware.

    And, will be replacing the microSD card to load the Linux Debian OS.
    I will be using an downloaded Linux image to be written via windows machine to microSD card.

    Quote Originally Posted by Salem View Post
    Do you have spare keyboards / mouse / monitor to set up the board as your development system?
    Alternatively, you could access it through remote desktop (rdp / vnc).
    The embedded hardware has a web based IDE that I will start out using if it works very well. The on-line info implies some people have issues using it.
    So, I will access the web based IDE using my Windows machine.

    Tim S.
    Last edited by stahta01; 6 Days Ago at 10:12 AM.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    4,077
    From your questions I have decide I need to keep an copy of all my microSD card images.
    I already planned to do that. But, the number of different images need has gone up as result of your questions.

    A. An image with development environment
    B. An image with end user OS environment
    C. An image with end user data file folders

    Image A will have the user data file folders on that card.
    Image B will be loaded into internal MMC during final development.
    Image C will be placed on the external microSD during initial development and on an external USB during final development.

    Looks like I will have to find an USB drive that works as soon as possible.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cross platform embedded MySQL server
    By onetwoandthree in forum C++ Programming
    Replies: 1
    Last Post: 08-23-2010, 02:23 AM
  2. Debian Linux install from a 4Gb USB stick
    By mynickmynick in forum Linux Programming
    Replies: 4
    Last Post: 12-02-2008, 03:54 PM
  3. Rebuilding Debian AMD64 with ACPI/APM support, Debian DRI on XFree86
    By kawk in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 06-02-2006, 01:36 PM
  4. installing debian linux
    By X PaYnE X in forum Tech Board
    Replies: 2
    Last Post: 05-10-2005, 04:43 AM
  5. Native Compiler
    By iwod in forum C# Programming
    Replies: 1
    Last Post: 02-28-2004, 11:02 PM

Tags for this Thread