Building Automotive Grade Linux for Raspberry Pi - raspberry-pi3

I am currently trying to run the AGL demo platform on the RaspberryPi3.
I have proceeded according to the following instructions:
Building the AGL Demo Platform for Raspberry Pi instructions
However, the output Image tmp/deploy/images/raspberrypi3/agl-demo-platform-raspberrypi2.wic.xz as specified in the link is not created when building with bitbake.
Instead only one image file is created: tmp/deploy/images/raspberrypi3/agl-demo-platform-raspberrypi3.rpi-sdimg.xz
When trying to copy the image file to the SD card (with etcher and the following command line:
sudo dd if=./<file-Name.rpi-sdimg of>=<sdCard>) the demo cannot be started. When booting the RaspberryPi only a black screen appears.
But if I use the following .wic.xz from
raspberrypi3/deploy/images/raspberrypi3 - Files
and copy it to the SD card everything works fine.
Why does the image file not work and why does "Bitbake" not create a .wic.xz, although everything is done as described in the instructions from AGL?

I had also got a similar error.
I do not know the reason but this fixed the issue.
xzcat output-img.xz | sudo dd of=[sdcard] bs=4M

Related

adding RT PRMEEPT_rt patch in imx6ullevk and building yocto rootfs using core-image-rt-sdk in yocto toaster

im using imx6ull , where i need to enable prmeept_rt patch, i have enabled
--->General setup
-->(X) Fully Preemptible Kernel (Real-Time)
in Linux kernel 5.4.3 by using patch-5.4.3-rt1.patch.xz and created kernel image and i tried to boot the board with rootfs build (poky branch is kirkstone) using core-image-minimal image recipe it was not providing me root access ,
So i tried to build another rootfs (poky branch is kirkstone) using core-image-rt-sdk image recipe in yocto toaster it is showing error. as
Nothing PROVIDES 'core-image-rt-sdk'
core-image-rt-sdk was skiped : Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it
how to build rootfs using core-image-rt-sdk image recipe .
any suggestions will be more help full

Why Xorg server fails on system created with Buildroot for Raspberry Pi4?

I am trying to create my own system for Raspberry Pi4 using Buildroot.
Target is to make custom OS with Xorg, Qt5 and OpenGLESv2 HW rendering. I create my custom Buildroot configuration, nothing specific yet. Very similar to default raspberry pi4 buildroot config but enabled Xorg/Mesa/OpenGLES. My config is that:
BR2_arm=y
BR2_cortex_a72=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_CCACHE=y
BR2_CCACHE_DIR="$(BR2_EXTERNAL_I_TREE_PATH)/../.buildroot-ccache"
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="MyHost"
BR2_TARGET_GENERIC_ISSUE="Welcome to MyHost"
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_TARGET_GENERIC_ROOT_PASSWD="4rt56gbd"
BR2_SYSTEM_DHCP="eth0"
BR2_ROOTFS_USERS_TABLES="$(BR2_EXTERNAL_I_TREE_PATH)/board/rpi4/users.txt"
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_I_TREE_PATH)/rootfs_overlay/"
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_I_TREE_PATH)/board/rpi4/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_I_TREE_PATH)/board/rpi4/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="--add-miniuart-bt-overlay"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,967d45b29ca2902f031b867809d72e3b3d623e7a)/linux-967d45b29ca2902f031b867809d72e3b3d623e7a.tar.gz"
BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2711-rpi-4-b"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_PACKAGE_GLMARK2=y
BR2_PACKAGE_MESA3D_DEMOS=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_XSERVER_XORG_SERVER=y
BR2_PACKAGE_XCB_UTIL_CURSOR=y
BR2_PACKAGE_XCB_UTIL_KEYSYMS=y
BR2_PACKAGE_XCB_UTIL_WM=y
BR2_PACKAGE_XLIB_LIBFS=y
BR2_PACKAGE_XLIB_LIBXSCRNSAVER=y
BR2_PACKAGE_XLIB_LIBXCOMPOSITE=y
BR2_PACKAGE_XLIB_LIBXFONT=y
BR2_PACKAGE_XLIB_LIBXTST=y
BR2_PACKAGE_XLIB_LIBXVMC=y
BR2_PACKAGE_XLIB_LIBXXF86DGA=y
BR2_PACKAGE_XLIB_LIBDMX=y
BR2_PACKAGE_XAPP_X11PERF=y
BR2_PACKAGE_XAPP_XCALC=y
BR2_PACKAGE_XAPP_XCLOCK=y
BR2_PACKAGE_XDRIVER_XF86_INPUT_KEYBOARD=y
BR2_PACKAGE_XDRIVER_XF86_INPUT_LIBINPUT=y
BR2_PACKAGE_XDRIVER_XF86_INPUT_MOUSE=y
BR2_PACKAGE_XDRIVER_XF86_VIDEO_FBDEV=y
BR2_PACKAGE_XDRIVER_XF86_VIDEO_FBTURBO=y
BR2_PACKAGE_XFONT_FONT_ADOBE_100DPI=y
BR2_PACKAGE_XFONT_FONT_ADOBE_75DPI=y
BR2_PACKAGE_XFONT_FONT_ADOBE_UTOPIA_100DPI=y
BR2_PACKAGE_XFONT_FONT_ADOBE_UTOPIA_75DPI=y
BR2_PACKAGE_XFONT_FONT_ADOBE_UTOPIA_TYPE1=y
BR2_PACKAGE_XFONT_FONT_ARABIC_MISC=y
BR2_PACKAGE_XFONT_FONT_BH_100DPI=y
BR2_PACKAGE_XFONT_FONT_BH_75DPI=y
BR2_PACKAGE_XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI=y
BR2_PACKAGE_XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI=y
BR2_PACKAGE_XFONT_FONT_BH_TTF=y
BR2_PACKAGE_XFONT_FONT_BH_TYPE1=y
BR2_PACKAGE_XFONT_FONT_BITSTREAM_100DPI=y
BR2_PACKAGE_XFONT_FONT_BITSTREAM_75DPI=y
BR2_PACKAGE_XFONT_FONT_BITSTREAM_TYPE1=y
BR2_PACKAGE_XFONT_FONT_CRONYX_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_DAEWOO_MISC=y
BR2_PACKAGE_XFONT_FONT_DEC_MISC=y
BR2_PACKAGE_XFONT_FONT_IBM_TYPE1=y
BR2_PACKAGE_XFONT_FONT_ISAS_MISC=y
BR2_PACKAGE_XFONT_FONT_JIS_MISC=y
BR2_PACKAGE_XFONT_FONT_MICRO_MISC=y
BR2_PACKAGE_XFONT_FONT_MISC_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_MISC_ETHIOPIC=y
BR2_PACKAGE_XFONT_FONT_MISC_MELTHO=y
BR2_PACKAGE_XFONT_FONT_MUTT_MISC=y
BR2_PACKAGE_XFONT_FONT_SCHUMACHER_MISC=y
BR2_PACKAGE_XFONT_FONT_SCREEN_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_SONY_MISC=y
BR2_PACKAGE_XFONT_FONT_SUN_MISC=y
BR2_PACKAGE_XFONT_FONT_WINITZKI_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_XFREE86_TYPE1=y
BR2_PACKAGE_XDATA_XCURSOR_THEMES=y
BR2_PACKAGE_NODM=y
BR2_PACKAGE_XTERM=y
BR2_PACKAGE_OPENBOX=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y
BR2_PACKAGE_RPI_FIRMWARE_X=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_LIBDRI2=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_S6=y
BR2_PACKAGE_S6_LINUX_UTILS=y
BR2_PACKAGE_S6_PORTABLE_UTILS=y
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
BR2_PACKAGE_UTIL_LINUX_KILL=y
BR2_PACKAGE_UTIL_LINUX_MOUNT=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
First issue comes with X server.
It starts working but very strange/ubnormal. Xorg logs show me lines:
(II) xfree86: Adding drm device (/dev/dri/card1)
(II) xfree86: Adding drm device (/dev/dri/card0)
(II) no primary bus or device found falling back to sys/devices/platform/gpu/drm/card1
But on normal Raspbian OS X server first adds card0 then card1. And makes fall back to card0. Why my Xorg starts with card1?
I think this is my main issue, because of that later GLX extension does not start. And so I cannot make OpenGLES working in my system.
In my config.txt i have line
dtoverlay=vc4-fkms-v3d
and I belive vc4 drivers start properly because I see /dev/dri/card0 /dev/dri/card1 and /dev/dri/renderD128 devices
Maybe someone had similar experience?
What I am doing wrong?
My fault in question.
I was wrong that issue was in order of /dev/dri/card? adding by Xorg.
Issue was different. xserver built in buildroot needs libglamor enabled? this should be enabled in buildroot config. If enabled then es2_info reports no issue with OpenGLES.. besides that in my case still glmark2-es2 does not work with error "Failed to open bo 1: Permission denied"

failed to add service - already in use error

I compiled SFML library and my app on Raspbian with this tutorial https://github.com/oomek/sfml-pi. After this I moved shared objects and app to buildroot system for Raspberry Pi 4. I chosed DISPMANX version, my goal was to run app without X server.
When I try to run app, I have error failed to add service - already in use?. I know that there was many similar topics, I tried this solutions:
Comment dtoverlay=vc4-kms-v3d in config.txt -> this line didn't existed in my config.
Change gpu_mem to 128 -> any improvement
My config.txt:
# Please note that this is only a sample, we recommend you to change it to fit
# your needs.
# You should override this file using a post-build script.
# See http://buildroot.org/manual.html#rootfs-custom
# and http://elinux.org/RPiconfig for a description of config.txt syntax
# We always use the same names, the real used variant is selected by
# BR2_PACKAGE_RPI_FIRMWARE_{DEFAULT,X,CD} choice
start_file=start.elf
fixup_file=fixup.dat
kernel=zImage
# To use an external initramfs file
#initramfs rootfs.cpio.gz
# Disable overscan assuming the display supports displaying the full resolution
# If the text shown on the screen disappears off the edge, comment this out
disable_overscan=1
# How much memory in MB to assign to the GPU on Pi models having
# 256, 512 or 1024 MB total memory
gpu_mem_256=128
gpu_mem_512=128
gpu_mem_1024=128
gpu_mem_1024=192
gpu_mem=128
# fixes rpi (3B, 3B+, 3A+, 4B and Zero W) ttyAMA0 serial console
dtoverlay=miniuart-bt
On buildroot I set opengl from gst1-plugins-base with dispmanx, gles2, egl and wayland. I didn't set mesa-3d.
Any idea how can I make my app working? Should I add something to my config.txt?

Programming an Attiny85

I was wondering how to upload a program I wrote using AVR Studio 4 to an ATtiny85. I was basically using this tutorial http://blog.smileymicros.com/smileys-workshop-10-moving-beyond-arduino/ except doing everything with an attiny85 instead of an atmega328. I got the pins_arduino.h from HighLow tech's ATtiny library.
I have compiled successfully in AVR Studio 4 and am now wondering how to upload to an Attiny85.
Thanks
Download the Windows-Avrdude version: http://www.mikrocontroller.net/attachment/69851/avrdude-5.10.zip
Extract the avrdude.exe files (avrdude.conf and avrdude.exe anywhere in your directories.
Now in AVR Studio, create a new tool under external tools (don't know exactly if it is called external tools) and call it 'ATtiny85'.
Paste this line in the command field: C:\Path\To\Your\avrdude.exe.
Paste this in 'Arguments': -F -v -pt85 -cstk500v1 -P com7 -b19200 -Uflash:w:"$(ProjectDir)Debug\$(ItemFileName).hex":i -C
Make sure you replace 'com7' with your com port you've attached your avrisp mkii to.
Now finish the dialog and your ready to upload. (Just click your tool in the Menu)

Programming ACR122T-E2 in linux

I have an ACS ACR122T-E2 NFC reader. I downloaded the linux driver and the ct-api library from
http://www.acs.com.hk/en/products/109/acr122t-usb-tokens-nfc-reader/ .
I have extracted the sample C program from the header given in the ct-api library archive file. I compiled it. I also created the ctacs.ini file with this content:
[CardTerminal]
CTN1=ACR122T
[ACR122T]
ICC1=ACS ACR122 25 00
When I running the compiled executable I just get:
Error: CT_init failed with error -8
where -8 is for "CT Error" based on the documentation in the header file.
Does somebody have some experience with this ACR122T-E2 and the official C API given for it?
Does anyone have some idea on what should I check for or what should I try to do?
The only one thing I guess I might be wrong with, is the ctacs.ini file. I am not really sure if the
ICC1=ACS ACR122 25 00
line is right. I used "lsusb -t" which shows:
Bus 03.Port 1: Dev 25, If 0, Class=Chip/SmartCard, Driver=pn533, 12M
Of course I already have tried
ICC1=ACS ACR122 03 01
config line, but did not help.
Does anybody have some idea, what this configuration line should be?
A after several hour of reading different posts at different sites, studying the available NFC related packages on Ubuntu, and also got a bit of help from the maintainer/developer of the official ACS driver I managed to get this example program to work.
The solution is, to unload/remove the kernel's default drivers.
modprobe -r np533
modprobe -r nfc
Then to install and run pcscd:
apt-get install pcscd
service start pcscd
Install pcsc_scan:
apt-get install pcsc-tools
Now pcsc_scan can be used to figure out the right ICC line for the ini file:
...
Reader 0: ACS ACR122U 00 00
...
Thus the right content the ini file is:
[CardTerminal]
CTN1=ACR122T
[ACR122T]
ICC1=ACS ACR122U 00 00
Now running the compiled example C program (from the ct-api library archive file downloaded from ACS) the output is:
Response: 62 00
Not much, but at least it is working now and I can continue exploring this NFC world.
I am using Windows and was struggling with the ctacs.ini file too. The trick (for me) was retrieving and using the actual CCID name. I retrieved mine by using "Springcard pcsc quick start" which shows the CCID name when the program opens. I use an ACS ACR122U-A9 with windows 8.1. The ini file below works for me.
[CardTerminal]
CTN1=ACS-ACR122-0 ;Just a name, can be an arbitrary value
[ACS-ACR122-0] ;Must correspond to name given above
ICC1=ACS ACR122 0 ;This is the actual name of the device (CCID)

Resources