Beginer questions: Setting up the Linux development environment for the DragonBoard


#1

This is my first st on the subject, I’ll try to avoid silly questions. That means I’ll do my homework first. Got several good books “Mastering Embedded Linux Programming” by Chris Simmonds seems to be a good one and has a reference to 96Boards in there.
First a recap of what I have so far:

  • Grabbed a fresh DragonBoard 410C and installed latest Debian distribution.
    It took me a while to figure out which one of all these is the correct one (a readme file explaining what are those files would be great):
    image
    Downloaded the full install (non developer) version for SD installation and burned the image into SD card. The first attempt to load it didn’t work, I got some errors and command line but not GUI. I try to reload it but it seems that SD card image gets destroyed during the OS installation and needs to be reloaded before each install. So, I burned it again in the SD from the downloaded image and the second time I got the graphical environment. The target is ready needing only some libs but I found help on how to do that in this forum.

Development Host

I downloaded the latest distro of Fedora and loaded it into VMWare virtual machine. It worked as a charm out of the box. now I need to install the toolchain there.
First question:
Can someone tell me what I need from all this and how to install it in Fedora?
image

again a README file explaining what is the purpose of the contents in each of those directories would go a long way.

That’s all for now.
Thanks!


#2

The information you need should be in the release notes
http://releases.linaro.org/96boards/dragonboard410c/linaro/debian/latest/

For the toolchain, the link is also in the release notes (search for “Linaro GCC cross compiler”)

Hope it helps


#3

I went throw the release notes in both cases, but they delve into specific topics, like building a custom kernel. This is advanced material that assumes that the reader has a lot of background knowledge. What is missing here is a step by step, assume nothing, guide. I’ll keep looking.

Thanks!

Guillermo


#4

The usual toolchain convention is arch-[vendor]-os-abi

  • arch is the CPU architecture, the dragonboard-410c has a 64-bit ARMv8 SoC, it’s aarch64
  • os is the operating system (none, linux,…), you’re db410c run debian, so you run a linux os
  • abi is the application binary interface which mainly defines a convention to generate code and data (data alignment, function call, syscall, etc…)

So in your case, you want the aarch64-linux-gnu toolchain.
Since you are going to build from a different architecture (your PC/VMWare) you need to cross-compile from your host (I assume intel PC) for the target (db410c). So you want to use the x86_64 prefixed toolchain:
e.g. gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz

Once you have downloaded the toolchain, you can extract it.
Optionally, you can add toolchains binaries directory to your Linux PATH environment variable:
e.g.

export PATH=/home/myuser/Workspace/Toolchains/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/:$PATH

You should now be able to run e.g. aarch64-linux-gnu-gcc to build C source.

Now, how to use it depends on the project build tool/facility (IDE, configure script, Makefile…).
For example, to cross compile a Linux kernel you mainly need to set the ARCH and CROSS_COMPILE env variables. Simple Makefiles usually uses the $(CC) variable to invoke the C compiler …

Interesting old wiki:
http://processors.wiki.ti.com/index.php/Linux_Training:Introduction_to_Cross_Compiling


#5

I’m afraid I’d have to start by asking how did you arrive at this part of the fileserver? This server is not really intended to be navigated by hand so the absence of README is pretty much expected so depending on context the fault might be with the document that referred you here rather than on the fileserver.

If you arrived from https://linaro.org/downloads then the summary is on the site you navigated away from to read the release notes (as is the information that for gcc-8 and upwards you should obtain the toolset from Arm instead: https://developer.arm.com/open-source/gnu-toolchain/gnu-a ).

PS I do think we need to make the notice about getting the toolset from Arm a little more prominent though!


#6

Daniel, Loic,
Thank you both for the extensive guidance. I’ll read through both in detail later.
I’m now finishing configuring two VMs (less tool chain). One is Fedora and the other is Ubuntu, afterI realized that Fedora is a different distribution. It may not be a major issue as a development machine but it is an interesting exercise to setup two parallel environments. “Linux is a religion with many gods, and it is complicated to please them all”.

I’ll report later what steps I took to setup the environments.

Regards,
Guillermo


#7

Daniel,
For the firmware image I arrived drilling down through the linaro.org download page:
http://releases.linaro.org/96boards/dragonboard410c/linaro/debian/18.01/

same for the toolchain, and then up a couple of directories and down to the highest available because “Latest” shows just a list of files without notes:
https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/

Best regards,
Guillermo


#8

I see.

Yes, the release notes record what compiler was used for the
release rather than as a suggestion about what should be used
for own development.

If you are starting out its probably best to adopt the latest compilers
from Arm (links from the binaries/ directory as gcc-8 ).


#9

Hi guys, here are a few easy ones, I think:

  1. How do I change the default host name, and user name?

  2. How I make the host name visible to the router and Windows (SMB) networks?

  3. Where do I change the system wide PATH?
    (logged as su, edited PATH= in “/etc/profile” but that is not the right place). The environment I see in QTerminal with “set” is not that one.

Any book recommendation that follows more closely the conventions of this Debian distribution?
I have Linux Bible but this one is centered in Red Hat and Fedora.

Thanks,
Guillermo


#10

Changing hostname:
https://wiki.debian.org/HowTo/ChangeHostname

For the username, you can add and user with ‘useradd’ (cf useradd -h)
Or in root (sudo su), you can use usermode to change user properties:

usermod -l newname oldname

AFAIK you also need to update the associated home directory:

usermod -d /home/newhome -m newname

(so probably better to simply add an user and remove the linaro one if necessary)

You mostly need mdns (https://wiki.debian.org/ZeroConf).
This can be achieved via avahi daemon (https://linux.die.net/man/5/avahi-daemon.conf).
AFAIR, you need to enable publishing in config (/etc/avahi-daemon.config).

disable-publishing = no

Samba: https://wiki.debian.org/SambaServerSimple

I think ‘/etc/environment’ is what you’re looking for.

Maybe look at https://www.debian.org/doc/books

Debian is mostly a collection of packages/tools sitting on top of a regular Linux.
I would tend to say RTFM ;-), (Linux ‘man’ is really helpful when you know what you want to use).


#11

Thanks a lot Loic,

Coming from 35+ years of programming in X86 assembly, C/C++ MSDOS, C++ Windows, and the last 5 C# .NET, most of the time I know what I should do, the problem is where to find the information I need or what is the command line that does what I need. Searching consumes now 90% of the time in my learning curve.

Best regards,
Guillermo