it:linux:raspberry_pi4

Raspberry PI4

echo "force_turbo=1
over_voltage=8
arm_freq=2147
gpu_freq=750" >> /boot/config.txt

Getestet mit Matlab 2023a auf raspbian lite 64bit.

apt-get update
apt-get -y install qemu-user qemu-user-static binfmt-support debootstrap binutils
mkdir emu
debootstrap --foreign --arch amd64 bookworm emu http://deb.debian.org/debian/
cp /etc/passwd emu/etc/passwd
#!/bin/bash
set -x
dir=/home/pi/emu
mount -t sysfs /sys $dir/sys/
mount -t proc /proc $dir/proc/
mount --bind /dev $dir/dev/
#mount --bind /dev/pts $dir/dev/pts/
mount --bind /dev/shm $dir/dev/shm/
 
chroot $dir /bin/bash
./chroot.sh
apt-get update
apt-get -y install unzip gawk libgl-dev libxt6
mkdir mcr
cd mcr
wget "https://ssd.mathworks.com/supportfiles/downloads/R2023a/Release/6/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2023a_Update_6_glnxa64.zip"
unzip MATLAB_Runtime_R2023a_Update_6_glnxa64.zip
./install -agreeToLicense yes

In chroot folgendes hinzufuegen:

export LD_LIBRARY_PATH=/usr/local/MATLAB/MATLAB_Runtime/R2023a/runtime/glnxa64/:/usr/local/MATLAB/MATLAB_Runtime/R2023a/bin/glnxa64/
file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=7e3a0e581d7a55241b73ca61c144529927a9b93e, stripped
root@raspberrypi:/# ./hello 
Hello World!
  1. git clone https://github.com/raspberrypi/linux.git
    sudo apt install crossbuild-essential-armhf
  2. Hier schauen was der sinnvoll neueste RT Patch ist. Aktuell war es 5.10.90. Diesen herunterladen
  3. git log

    und dort nach „5.10.90“ suchen. Beispiel:

    commit d3e491a20d152e5fba6c02a38916d63f982d98a5
    Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Date:   Wed Jan 5 12:40:34 2022 +0100
    
        Linux 5.10.90
        
        Link: https://lore.kernel.org/r/20220103142053.466768714@linuxfoundation.org
        Tested-by: Salvatore Bonaccorso <carnil@debian.org>
        Tested-by: Guenter Roeck <linux@roeck-us.net>
        Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
        Tested-by: Jon Hunter <jonathanh@nvidia.com>
        Link: https://lore.kernel.org/r/20220104073841.681360658@linuxfoundation.org
        Tested-by: Jon Hunter <jonathanh@nvidia.com>
        Tested-by: Florian Fainelli <f.fainelli@gmail.com>
        Tested-by: Guenter Roeck <linux@roeck-us.net>
        Tested-by: Shuah Khan <skhan@linuxfoundation.org>
        Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
        Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
        Tested-by: Salvatore Bonaccorso <carnil@debian.org>
        Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    

    Datum merken.

  4. Naechsten commit suchen, der arch/arm/config/bcm2711_defconfig enthaelt suchen und den auschecken.
  5. RT Patch anwenden:
    wget "https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.10/patch-5.10.90-rt60.patch.xz"
    xzcat patch-5.10.90-rt60.patch.xz | patch -p1
  6. Konfigurieren:
    cd linux
    KERNEL=kernel7l
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2711_defconfig
  7. In menuconfig „fully preemptible“ einschalten:
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
  8. Bauen:
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs -j24
  9. Installieren:
    mkdir mnt
    mkdir mnt/fat32
    mkdir mnt/ext4
    sudo mount /dev/sdb1 mnt/fat32
    sudo mount /dev/sdb2 mnt/ext4
    sudo env PATH=$PATH make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=mnt/ext4 modules_install
    sudo cp mnt/fat32/$KERNEL.img mnt/fat32/$KERNEL-backup.img
    sudo cp arch/arm/boot/zImage mnt/fat32/$KERNEL.img
    sudo cp arch/arm/boot/dts/*.dtb mnt/fat32/
    sudo cp arch/arm/boot/dts/overlays/*.dtb* mnt/fat32/overlays/
    sudo cp arch/arm/boot/dts/overlays/README mnt/fat32/overlays/
    sudo umount mnt/fat32
    sudo umount mnt/ext4
  1. in /boot/cmdline.txt „threadirqsi“ hinzufuegen.
  2. apt-get install rtirq-init
  3. In /etc/default/rtirq
    RTIRQ_NAME_LIST="74 73"

    editieren und

    RTIRQ_RESET_ALL=1

    einschalten.

  1. in /boot/cmdline.txt „isolcpus=2,3“ hinzufuegen.
  2. Tasks bspw. mit
    taskset --cpu-list 2-3 [TASK}

    starten

  • it/linux/raspberry_pi4.txt
  • Zuletzt geändert: 2024/03/03 09:42
  • von admin