How to queue patches in Yocto - embedded-linux

Background
I have a microcontroller board which has STM32MP157 chip on it, with a development board. The manufacturer provides a Yocto BSP layer for this device and the development board and it is found on an open Github repository.
The important thing to note is that the BSP layer applies important devicetree patches to the stable release of the Linux kernel.
What I want
I would like to modify parts of the devicetree that is provided by the manufacturer's BSP layer, basically add to it.
What I have done
I have created a layer, named meta-mx-dts, put it after the manufacturer supplied layer in the build/conf/bblayers.conf file, and made it with higher priority by setting BBFILE_PRIORITY_meta-mx-dts in meta-mx-dts/conf/layer.conf (so that it applies after the manufacturer supplied layer). Finally, I made a file linux-stable_5.4.bbappend as follows:
FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
SRC_URI_append = "file://dts.patch"
and placed the dts.patch file properly.
The error I get
The error stack can be summarized by this line (from the error stack):
error: arch/arm/boot/dts/stm32mp157c-dhcom-pdk2.dts: does not exist in index
Where stm32mp157c-dhcom-pdk2.dts is the devicetree file to be created by the patches in the manufacturer's BSP layer. My patch applies to that file specifically.
What I have tried so far
I have tried different ways to append/prepend the dts.patch to the SRC_URI variable, until I got it appear after the patches directory applied by the BSP layer, by checking in the following ways in the treminal:
bitbake -e linux-stable | grep SRC_URI
bitbake -e virtual/kernel | grep SRC_URI
However, that didn't solve the issue. I also tried to make the SRC_URI append operation to be specific to the machine:
SRC_URI_append_dh-stm32mp1-dhcom-pdk2 = "file://dts.patch"
That didn't help either.
UPDATE
I have also tried to append to KERNEL_FEATURES variable and use .scc file, where I specify patches, as follows:
# The .bbappend file
KERNEL_FEATURES_append = " mx.scc "
SRC_URI_append = " file://mx.scc;type=kmeta "
with the file mx.scc being like:
define KMACHINE dh-stm32mp1-dhcom-pdk2
define KTYPE standard
define KARCH arm
branch dh-stm32mp1-dhcom-pdk2
patch dts.patch
With no effect.
Need your help
Thanks

Related

V8 : Isolate is incompatible with the embedded blob

I am trying to create custom snapshot from some Javascript file. I was able to create a snapshot using the command
mksnapshot.exe snapshot11.js --startup_blob snap.bin
but when I was trying to create an Isolate with this snap.bin file I got this message
The Isolate is incompatible with the embedded blob. This is usually caused by incorrect usage of mksnapshot. When generating custom snapshots, embedders must ensure they pass the same flags as during the V8 build process (e.g.: --turbo-instruction-scheduling).
I am guessing that I need recreate the snapshot with the proper flags but I couldn't find which flags I need to use.
My args.gn
is_component_build=true
v8_static_library=false
is_official_build=false
is_debug=true
use_custom_libcxx=false
use_custom_libcxx_for_host=false
target_cpu="x64"
use_goma=false
v8_use_external_startup_data=false
v8_enable_i18n_support = false
symbol_level=2
v8_enable_fast_mksnapshot=true
Any lead will be helpful.
10x
You can invoke ninja with -v to have it print all the commands it executes; e.g. if you compile V8 with:
ninja -v -C out/... v8_monolith
then you'll find a line for the mksnapshot invocation in the output, and can copy the flags from there. (If you have already compiled V8, ninja will say "nothing to do"; in that case you can either clean out everything, or just delete snapshot_blob.bin and libv8_monolith.so.)

Yocto, Petalinux 2017.1, SIGGEN_LOCKED_SIGS_T

I think this is a more specific Yocto problem so therefore I'm trying Stack Overflow:
During my Petalinux 2017.1 build I get the following warnings for a few packages, all of them in the recipes-core:
The init-ifupdown:do_unpack sig is computed to be cad131d20f065f81a9524376bd7d40bc, but the sig is locked to f2c445306ecd0f9936cc1b9d35a0587e in SIGGEN_LOCKEDSIGS_t-cortexa9hf-neon
These scripts are mostly used to substitute config files like /etc/network/interfaces and such. It seems these config files are not changed, so I was wondering if this warning is related.
I did not have this problem in Petalinux 2016.4, so the recipes has been given a run through before.
To resolve this warning, add the following line in plnx_proj/project-spec/meta-user/conf/petlinuxbsp.conf:
SIGGEN_UNLOCKED_RECIPES += "init-ifupdown"

Pulseaudio build issue in yocto

I am using Raspberry Pi 3 model B. I am facing build issue while building bitbake pulseaudio. Please find my configuration details:
Yocto : Jethro branch
pulseaudio.inc RDEPENDS_pulseaudio-server +=
"alsa-plugins-pulseaudio-conf"
we are using alsa-plugins_1.0.29.bb
bitbake pulseaudio
ERROR: Nothing RPROVIDES 'alsa-plugins-pulseaudio-conf' (but /home/guest/openembedded-core/meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'alsa-plugins-pulseaudio-conf' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['alsa-plugins-pulseaudio-conf']
ERROR: Required build target 'pulseaudio' has no buildable providers.
Missing or unbuildable dependency chain was: ['pulseaudio', 'alsa-plugins-pulseaudio-conf']
Based on the recipe the package alsa-plugins-pulseaudio-conf is generated if "pulseaudio" is in the alsa-plugins PACKAGECONFIG. By default that happens if your DISTRO_FEATURES includes "pulseaudio".
So check your DISTRO_FEATURES, ensure "pulseaudio" is in there (and make sure you don't modify the alsa-plugins PACKAGECONFIG in a bad way).
To see what your DISTRO_FEATURES contains:
bitbake -e pulseaudio |grep "^DISTRO_FEATURES="
To add pulseaudio if it's not there right now (you can do this in local or distro config):
DISTRO_FEATURES_append = " pulseaudio "
The whitespace preceding the feature name is required.
To check what PACKAGECONFIG is getting used for alsa-plugins (this should contain "pulseaudio"):
bitbake -e alsa-plugins|grep "^PACKAGECONFIG="

How to run gcov on test application with Nuttx OS on STM discovery board?

Setup:
Toolchain: gcc-arm-none-eabi-5_2-2015q4-20151219
Target: STM429i-disco board
I want to run gcov and get real time report generated in target as per below link:
https://mcuoneclipse.com/2014/12/26/code-coverage-for-embedded-target-with-eclipse-gcc-and-gcov/
First, sucessfully have compiled my code (POSIX compliant NUTTX OS) with -fprofile-arcs & -ftest-coverage flags & got generated the .gcno files for my src files.
second, sucesfully have linked with -fprofile-arcs flags enabled and using the libgcov.a file (part of the toolchain) and the final binary is generated.
Now, I dont know what changes are needed in my test application to invoke gcov, generate report & dump report.
Another problem is, gcov functions are with HIDDEN attribute in libgcov.a as below.
9: 00000000 4 FUNC GLOBAL HIDDEN 1 __gcov_flush
9: 00000000 4 FUNC GLOBAL HIDDEN 1 __gcov_init
so, I could not invoke as I need.
Any inputs in getting the .gcda file generated would be of great help.
Can you look for gcov_exit instead? It is similar to __gcov_flush. Typically, it's one of gcov_exit and __gcov_flush that would be there and you can use any.
In case this is not there or is also hidden, you can use this approach which I tried for one of my projects. I picked (and modified for various reasons) the implementation of gcov_exit from gcc source code (of version matching my toolchain) (available at https://github.com/reeteshranjan/libgcov-embedded) and plugged it in my project. With everything else remaining the same (the compiler flags etc.), I was able to then break into gcov_exit and follow the rest of the approach in the blog link you have mentioned.

why buildroot fails to make the .config?

I'm somehow new to buildroot makefile and I created my own configuration file for a new operating system. After typing
make menuconfig
I saw that the buildroot has made the .config file. but when I type
make
it gives the following error:
linux/linux.mk:69: *** No kernel device tree source specified, check your BR2_LINUX_KERNEL_USE_INTREE_DTS / BR2_LINUX_KERNEL_USE_CUSTOM_DTS settings. Stop.
what does it mean ? what did I forget to include in buildroot configuration menu ?
I searched the internet and didn't find anything useful ... I've looked at the build root documentation and didn't find anything neither ....
In addition to the buildroot .config, you need a linux config. You can create one by:
make linux-menuconfig
See:
How do I configure the Linux kernel within Buildroot?
http://buildroot.org/downloads/manual/manual.html#kernel-custom
Which board do you plan to run the produced image on? Which platform are you building for? Check the output of the following command:
grep ^BR2_ARCH .config
If it is i386 or x86_64, you likely do not need Device Tree support, so just disable it using make menuconfig (search for BR2_LINUX_KERNEL_USE_INTREE_DTS or BR2_LINUX_KERNEL_USE_CUSTOM_DTS by pressing /).
Also check out http://elinux.org/Device_Tree for a detailed description of Device Tree.
It means that you don't have a device tree source file set. There's several different reasons for this. The first thing to check is:
make menuconfig
Select the Kernel options. Near the bottom is the option for "Device tree source". If that's set to "Use a custom device tree file" and you don't have a good path set in the next option, "Device Tree Source file paths", then you will get this error. Alternatively, if it's set to "Use a device tree present in the kernel" and the "Device Tree Source file names" option is blank or the name(s) have .dts at the end, you may get this error.

Resources