0
\$\begingroup\$

I would like to be able to design my own Linux board the way I design my own micro-controller boards. The complexity is obviously going to be higher from PCB design and assembly point of view, but I can manage that.

What I don't understand is the software part. What all does it take to get a get Linux running on a CPU. Are there some choices that make your life easy?. Such as choosing a processors where manufacturer provides XYZ software components.

Actually, to begin with I don't even wan't to be able to go full-custom with processor choice. I am happy to stick to one processor (or its variants) as long as I can put it on a custom board I design.

\$\endgroup\$
5
  • \$\begingroup\$ Is this for a commercial project or just for fun? \$\endgroup\$
    – DiBosco
    Commented Jan 25, 2018 at 12:36
  • \$\begingroup\$ Your question is like saying you have an engine so how do I get an engine working in a car. It's far too broad. \$\endgroup\$
    – Rob
    Commented Jan 25, 2018 at 12:49
  • \$\begingroup\$ Have you looked at projects like the PocketBeagle? github.com/beagleboard/pocketbeagle \$\endgroup\$ Commented Jan 25, 2018 at 13:54
  • \$\begingroup\$ Just for fun as of now. But if I like how it turns out, I could use it in commercial projects. \$\endgroup\$
    – Dojo
    Commented Jan 26, 2018 at 6:58
  • \$\begingroup\$ @SolveEtCoagula07 I had come across that SoM last year. It is very convenient, but it is a module. I wan't to learn how to put together processor, ram, storage and software to build a working computer. With a SOM, I won't learn most of that. Plus I like how you can find these multi GHz ARM CPUs on for a few dollars on Aliexpress. Someday I'd like to put them to use. \$\endgroup\$
    – Dojo
    Commented Jan 26, 2018 at 7:05

4 Answers 4

4
\$\begingroup\$

I understand that you want to know how to make a processor work with Linux without having so much trouble. I will give you an answer based on my experience, but that has always worked so far, since I believe it could be useful for you. Therefore, it is quite specific for one particular case, that you can copy or take as a reference for a different processor. If it is not what you look for, it is no problem :-)

When it comes to the software part, as some colleagues suggested, you would need a Linux Kernel that supports the chosen microprocessor or architecture, a way to Boot (like U-Boot) for the system and the file system. I will refer to the whole thing just as kernel from now on.

First of all, I recommend to use a tool that would automatically give you all the kernel to make it easy. I recommend Buildroot or Yocto/Poky. The following image shows a full kernel mapped into a Flash, so you get an idea. Instead of having to get each of the layers one by one, these tools give the complete stack at once for the chosen architecture.

enter image description here

If you can choose your microprocessor (of course it has to support Linux). I recommend to go with the AT91 family. It includes all the SAMA5Dx boards as well as AT91SAM9x5. They are some of the simplest processors that can run Linux. In this link you can see step by step how to get your full kernel with Buildroot. Remember that you can decide to boot the kernel from a Flash or from a SD card (or micro SD). Both methods are explained in the guide.

Furthermore, these boards have an evaluation kit where you can check that your kernel works and you learn how to implement it in advance. You will have the schematics of the evaluation kit and PCB design guide to make it easier. Finally, as some others said, you would need enough RAM, but that is also shown in the schematics.

I do not know if the answer would be useful for you, but I thought it might be. You can always look for similar guides from other manufacturers or try to go with Buildroot for a specific processor from the beginning. Best of luck!

Sources:

AT91 Linux4SAM

Buildroot

Yocto/Poky

\$\endgroup\$
1
  • \$\begingroup\$ Thanks, your answer helps a lot. While I am looking forward to using faster processors, this one looks like a perfect stepping stone before I get there. \$\endgroup\$
    – Dojo
    Commented Jan 26, 2018 at 6:54
2
\$\begingroup\$

The CPU isn't going to be the hard part – you just set up a cross-compiling toolchain for it, that's it –, it's the peripherals built into the chip which give you a headache.

You need a proper device tree for that and this is going to be hard, manual work. I recommend to make this device tree as simple as possible. Some RAM and Flash definitions, a means for a serial console, nothing more. So you are able to see kernel messages as it boots.

Another hard obstacle is having a boot loader supporting the SoC you use. It's basically the same thing again but less flexible than the Linux kernel. Again, you have to tweak an existing boot loader so it has the right settings for RAM, Flash and a serial console.

If you want to make your life simple, choose an SoC for which a Linux development environment already exists. Look up the OpenWRT project, it has dozens of SoC to choose from. Some may be freely available.

As soon your kernel boots, you can continue with the next, tedious work. Compile libc and all the software you want to use for the target CPU. While its compiling, think about additional device drivers you need.

\$\endgroup\$
2
  • \$\begingroup\$ Since many of these processors are SoCs which have many peripherials built-in, do the processor manufacturers provide the "device tree" for built in peripherals? \$\endgroup\$
    – Dojo
    Commented Jan 26, 2018 at 7:15
  • \$\begingroup\$ Some may provide a device tree, but it's a two-sided thing. The hardware definitions should be fine, how they are mapped into a tree representation may be doubtful. \$\endgroup\$
    – Janka
    Commented Jan 26, 2018 at 9:31
1
\$\begingroup\$

You need:

  • A kernel built to support the target architecture, including endianness
  • A means of actually booting the kernel on the target platform (e.g. U-Boot)
  • Drivers included in the boot kernel or kernel initrd for required hardware (e.g. serial console; see also "device tree")

The hardware itself needs to have sufficient RAM to run Linux. It's not a particularly simple project. It might be best to start from someone else's design, e.g. https://www.olimex.com/Products/OLinuXino/open-source-hardware

\$\endgroup\$
1
  • \$\begingroup\$ I'm not sure you're saying anything that he doesn't already know. \$\endgroup\$
    – Rob
    Commented Jan 25, 2018 at 12:48
-1
\$\begingroup\$

What's basically needed for an embedded Linux platform, is a board support package. The benefit of an OTS board is that this usually comes with the hardware.

You can have a standard and supported processor, but for running Linux you'll need peripherals, flash and ram just to name a few. The configuration of all that, place where your bootloader runs and much more all need to be defined. It's just a lot of work and you need to know what you're doing or it will fail.

You could also search for supported distro's of a particular processor and copy the design it's built for (if it's abailable and open).

Nothing compared (complexity wise) to configuring port and peripheral configuration of a microcontroller.

\$\endgroup\$
1
  • \$\begingroup\$ Nothing you said answers the question or states anything he says he already knows. \$\endgroup\$
    – Rob
    Commented Jan 25, 2018 at 12:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.