Project

General

Profile

Using PREEMPT_RT on MitySOM 5CSX Dev Board

Added by Jared Kirschner over 7 years ago

Context: My company recently purchased some MitySOM 5CSX Development Boards and would like to use them on a current project. This project likely has the need for a real-time operating system. I want to start by using Linux with the PREEMPT_RT patch.

It looks like Altera has some SoC FPGA LTSI branches available with the PREEMPT_RT patch: https://github.com/altera-opensource/linux-socfpga/tree/socfpga-4.1.22-ltsi-rt
- 4.1.22
- 4.1
- 3.10

If possible, I'd like to use at least Kernel version 3.14 to use the SCHED_DEADLINE scheduler. (Though, this isn't critical.)

It looks like Critical Link provides kernel implementations for the MitySOM-5CSX (http://support.criticallink.com/gitweb/?p=linux-socfpga.git;a=summary) for several kernel versions, the latest of which is 3.16. Unfortunately, none of those have the PREEMPT_RT patch, and none of those kernel versions has an actively maintained PREEMPT_RT patch (https://rt.wiki.kernel.org/index.php/Main_Page).

How difficult would it be to modify the Altera Linux SoC FPGA LTSI branches (4.1.22, 4.1, or 3.10) with the PREEMPT_RT patch to work on the MitySOM-5CSX development board? What files would I need to change?

This page (https://support.criticallink.com/redmine/projects/mityarm-5cs/wiki/Linux_Kernel) makes it sound like only a "new kernel configuration file and device tree settings file" are needed... but that isn't immediately obvious to me looking at the commits to the Critical Link MitySOM 5CSX Dev Board 3.16 branch (http://support.criticallink.com/gitweb/?p=linux-socfpga.git;a=log;h=refs/heads/socfpga-3.16), which seems to have been based off the Altera 3.16 branch in Oct 2014 and then includes changes specific to said dev board as well as some changes incorporated in the Altera 3.17 branch.

I appreciate any assistance or guidance you can provide.


Replies (34)

RE: Using PREEMPT_RT on MitySOM 5CSX Dev Board - Added by Daniel Vincelette over 6 years ago

Adding poky_checkout.sh, I missed it in my past post.

My apologizes,
Dan

RE: Using PREEMPT_RT on MitySOM 5CSX Dev Board - Added by V J over 6 years ago

Hello Dan,
Thanks for the update. I have built the krogoth branch, and have now a running system!

The next step is to compile my gpio interrupt kernel module, and I have some problems.
From my previous Terasic project I have a working code which compiles when using the Linux 3.16 kernel as specified here:
https://support.criticallink.com/redmine/projects/mityarm-5cs/wiki/Linux_Kernel
and using Makefile_3_16.

When changing the KERNEL_LOCATION and CROSS_COMPILER for the krogoth branch (Makefile_4.1.22) I get a couple of errors.
Some seems to be related to the kernel source, and some to the compiler.
The kernel source for krogoth seems to be missing some files/folders compared to the 3.16 kernel.

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

and
/bin/sh: ./scripts/recordmcount: No such file or directory

These files are present when building dora or dizzy.

I also get some errors which I think is related to the compiler. The kernel is compiles wit gcc 5.3.0 (cat /proc/version). I have used:

CROSS_COMPILE=/home/user_name/projects/MitySOM-5CSx/yocto_krogoth/poky/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-

, but I suspect this is not correct.
Any clues on how to fix this?
Best regards,
Vidar

RE: Using PREEMPT_RT on MitySOM 5CSX Dev Board - Added by Daniel Vincelette over 6 years ago

Hi Vidar,

You might need to checkout the altera 4.1.22-rt instead of trying to use the source that yocto downloads as your kernel source directory. If you would like yocto to build your out of tree module then this link should help: https://www.yoctoproject.org/docs/2.0/kernel-dev/kernel-dev.html#working-with-out-of-tree-modules

Dan

RE: Using PREEMPT_RT on MitySOM 5CSX Dev Board - Added by V J over 6 years ago

Hi
Checking out the altera 4.1.22-ltsi-rt branch from git://github.com/altera-opensource/linux-socfpga, and compiling the kernel with gcc version 4.8.3 solved the problems.
Thanks!
BR
Vidar

RE: Using PREEMPT_RT on MitySOM 5CSX Dev Board - Added by V J almost 5 years ago

Hi
We have successfully built the rocko branch (https://support.criticallink.com/redmine/projects/mityarm-5cs/wiki/Yocto_for_MitySOM-5CSX), but we need the PREEMPT_RT kernel.
4.9.76-ltsi-rt seems to be the one that matches the 4.9.78-ltsi which is now default for MitySOM-5CSx.
Which steps are required to build the rocko branch with 4.9.76-ltsi-rt?
BR
VJ

RE: Using PREEMPT_RT on MitySOM 5CSX Dev Board - Added by Zachary Miller almost 5 years ago

Hi Vidar,

If you pull meta-cl-socfpga I've just added a recipe to build the 4.9.76-ltsi-rt kernel.

In meta-cl-socfpga/conf/machine/mitysom-c5.conf just change KERNEL_PROVIDER to be linux-cl-socfpga-ltsi-rt and yocto will build 4.9.76-ltsi-rt.

Zach

RE: Using PREEMPT_RT on MitySOM 5CSX Dev Board - Added by V J almost 5 years ago

Hi Zach
I started from scratch, cloned the repositories, changed KERNEL_PROVIDER and run the build script, but I got some error messages:

make[4]: *** [silentoldconfig] Error 1
| make[3]: *** [silentoldconfig] Error 2
| make[2]: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'.  Stop.
| ERROR: oe_runmake failed
| make[1]: *** [sub-make] Error 2
| make: *** [__sub-make] Error 2
| WARNING: /home/soc/projects/MitySOM-5CSx/yocto_rocko/poky/build/tmp/work/mitysom_c5-poky-linux-gnueabi/linux-cl-socfpga-ltsi-rt/4.9.76-ltsi-rt+gitAUTOINC+1318f01f91-r0/temp/run.do_compile.54798:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_compile (log file is located at /home/soc/projects/MitySOM-5CSx/yocto_rocko/poky/build/tmp/work/mitysom_c5-poky-linux-gnueabi/linux-cl-socfpga-ltsi-rt/4.9.76-ltsi-rt+gitAUTOINC+1318f01f91-r0/temp/log.do_compile.54798)
ERROR: Task (/home/soc/projects/MitySOM-5CSx/yocto_rocko/poky/build/../meta-cl-socfpga/recipes-kernel/linux/linux-cl-socfpga-ltsi-rt_4.9.76.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3447 tasks of which 3446 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
  /home/soc/projects/MitySOM-5CSx/yocto_rocko/poky/build/../meta-cl-socfpga/recipes-kernel/linux/linux-cl-socfpga-ltsi-rt_4.9.76.bb:do_compile

I did a rebuild with the default kernel and that was OK.
Any clues?
BR
VJ

RE: Using PREEMPT_RT on MitySOM 5CSX Dev Board - Added by Zachary Miller almost 5 years ago

Hi Vidar,

Looks like you may be missing some tools that need to be installed to build this branch. I tested a build in docker though and that worked fine, so I'd recommend that. From inside your poky directory, you run

docker run --rm -it -v $(pwd):/poky crops/poky --workdir=/poky

Then build as normal and close the docker with the exit command.

As a side note, be sure to do a clean build as I just pushed a new device tree from our 4.9.78 branch that was missing and is required by the build.

Zach

RE: Using PREEMPT_RT on MitySOM 5CSX Dev Board - Added by V J almost 5 years ago

Hi Zach
I cloned the repositories again, did a rebuild and now it works.
Thanks.
BR
VJ

(26-34/34) Go to top
Add picture from clipboard (Maximum size: 1 GB)