Cours:De0NanoSoc : Différence entre versions

De troyesGEII
Aller à : navigation, rechercher
(configurer les sources qt puis compiler)
(configurer les sources qt puis compiler)
Ligne 245 : Ligne 245 :
 
   -skip qtwebengine -no-feature-imageformat_xpm -no-xcb -no-feature-kms -no-feature-bearermanagement -skip qtmultimedia -no-sql-psql \
 
   -skip qtwebengine -no-feature-imageformat_xpm -no-xcb -no-feature-kms -no-feature-bearermanagement -skip qtmultimedia -no-sql-psql \
 
   -no-feature-vulkan -no-cups \
 
   -no-feature-vulkan -no-cups \
   -no-egl -no-freetype -no-gif -no-glib -no-icu -no-ico -no-iconv -no-kms -no-libjpeg -no-libproxy -no-openvg -no-sctp -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-system-proxies -no-use-gold-linker -nomake examples -nomake tests -no-feature-bearermanagement -no-feature-colordialog -no-feature-commandlineparser -no-feature-concurrent -no-feature-dial -no-feature-ftp -no-feature-http -no-feature-image_heuristic_mask -no-feature-keysequenceedit -no-feature-lcdnumber -no-feature-networkdiskcache -no-feature-networkproxy -no-feature-pdf -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sessionmanager -no-feature-socks5  -no-feature-statemachine -no-feature-syntaxhighlighter -no-feature-textodfwriter -no-feature-topleveldomain -no-feature-udpsocket -no-feature-undocommand -no-feature-undogroup -no-feature-undostack -no-feature-undoview -no-feature-vnc -no-feature-xml -no-gtk -no-opengles3 -no-angle -no-sqlite -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns
+
   -no-egl -no-freetype -no-gif -no-glib -no-icu -no-ico -no-iconv -no-kms -no-libjpeg -no-libproxy -no-openvg -no-sctp -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-system-proxies -no-use-gold-linker -nomake examples -nomake tests -no-feature-bearermanagement -no-feature-colordialog -no-feature-concurrent -no-feature-dial -no-feature-ftp -no-feature-http -no-feature-image_heuristic_mask -no-feature-keysequenceedit -no-feature-lcdnumber -no-feature-networkdiskcache -no-feature-networkproxy -no-feature-pdf -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sessionmanager -no-feature-socks5  -no-feature-statemachine -no-feature-syntaxhighlighter -no-feature-textodfwriter -no-feature-topleveldomain -no-feature-udpsocket -no-feature-undocommand -no-feature-undogroup -no-feature-undostack -no-feature-undoview -no-feature-vnc -no-feature-xml -no-gtk -no-opengles3 -no-angle -no-sqlite -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns
  
  

Version du 16 décembre 2025 à 01:29

installation Linux

  • créer la carte SD avec l'image :
https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=167&No=941&PartNo=4
  • modifier la partition racine
  • installer debian 10
https://rcn-ee.com/rootfs/eewiki/minfs/
  • installer debian 8
https://rocketboards.org/foswiki/pub/Projects/Debian/debian.img.gz
  • ajouter la partition racine dans le fichier fstab
/dev/mmcblk0p2  /  auto  errors=remount-ro  0  1
  • démarrer la de0 nano soc
    • configurer le reseau
    • bug :
ln -s /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyS0.service

modifier sur la Debian

apt sources list

modifier le fichier /etc/apt/sources.list avec :

deb http://archive.debian.org/debian buster main contrib non-free
#deb-src http://archive.debian.org/debian buster main contrib non-free

deb http://archive.debian.org/debian-security buster/updates main contrib non-free
#deb-src http://security.debian.org/debian-security buster/updates main contrib non-free

deb http://archive.debian.org/debian buster-updates main contrib non-free
#deb-src http://archive.debian.org/debian buster-updates main contrib non-free

#Kernel source (repos.rcn-ee.com) : https://github.com/RobertCNelson/linux-stable-rcn-ee
#
#git clone https://github.com/RobertCNelson/linux-stable-rcn-ee
#cd ./linux-stable-rcn-ee
#git checkout `uname -r` -b tmp

deb [arch=armhf signed-by=/usr/share/keyrings/rcn-ee-archive-keyring.gpg] http://repos.rcn-ee.com/debian/ buster main
#deb-src [arch=armhf signed-by=/usr/share/keyrings/rcn-ee-archive-keyring.gpg] http://repos.rcn-ee.com/debian/ buster main

installer

  • dpkg-reconfigure locales
  • apt install build-essential
  • apt install zlib1g-dev libicu-dev libdouble-conversion-dev libpcre2-dev libzstd-dev libglib2.0-0 libglib2.0-dev libpng-dev libharfbuzz-dev
  • apt install libssl-dev libkrb5-dev libudev-dev libfontconfig-dev libxkbcommon-dev libinput-dev libdbus-1-dev libdbus-1-3 libcups2-dev
  • libmd4c
wget http://ftp.fr.debian.org/debian/pool/main/m/md4c/libmd4c0_0.4.8-1_armhf.deb
wget http://ftp.fr.debian.org/debian/pool/main/m/md4c/libmd4c-dev_0.4.8-1_armhf.deb
dpkg -i *.deb


apt install libc6-dev:armhf libstdc++-armhf-cross libgcc-*-dev:armhf libfreetype6-dev:armhf libfontconfig1-dev:armhf libx11-dev:armhf libxext-dev:armhf libxi-dev:armhf libxrender-dev:armhf libxfixes-dev:armhf libxrandr-dev:armhf libjpeg-dev:armhf libpng-dev:armhf libtiff-dev:armhf libwebp-dev:armhf libegl1-mesa-dev:armhf libgles2-mesa-dev:armhf pkg-config build-essential cmake git python3

apt-get build-dep libqt5core5a

chroot

rep="monDossier"
mount -t proc /proc $rep/chroot/proc/
mount --rbind /sys $rep/chroot/sys/
mount --rbind /dev $rep/chroot/dev/
chroot $rep/chroot/
umount -l $rep/chroot/dev/
umount -l $rep/chroot/sys/
umount -l $rep/chroot/proc/

cross compilation

sysroot

rep="monDossier"
cd $rep
rsync -av chroot/lib sysroot/
rsync -av chroot/usr/include sysroot/usr/
rsync -av chroot/usr/lib sysroot/usr/
rsync -av chroot/usr/arm-linux-gnueabi rsync -av sysroot/usr/

wget https://raw.githubusercontent.com/Kukkimonsuta/rpi-buildqt/master/scripts/utils/sysroot-relativelinks.py
chmod +x sysroot-relativelinks.py
python3 sysroot-relativelinks.py sysroot

compilateur arm 8

  • ajouter au fichier /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu focal main universe
deb http://archive.ubuntu.com/ubuntu focal main universe


mkdir -p /apps/gcc/arm-8/
cp /apps/gcc/arm-8/
ln -s /usr/bin/arm-linux-gnueabihf-cpp-8 arm-linux-gnueabihf-cpp
ln -s /usr/bin/arm-linux-gnueabihf-g++-8 arm-linux-gnueabihf-g++
ln -s /usr/bin/arm-linux-gnueabihf-gcc-8 arm-linux-gnueabihf-gcc
ln -s /usr/bin/arm-linux-gnueabihf-gcc-ar-8 arm-linux-gnueabihf-ar
ln -s /usr/bin/arm-linux-gnueabihf-gcc-nm-8 arm-linux-gnueabihf-nm
ln -s /usr/bin/arm-linux-gnueabihf-gcc-ranlib-8 arm-linux-gnueabihf-ranlib
ln -s /usr/bin/arm-linux-gnueabihf-gcov-8 arm-linux-gnueabihf-gcov
ln -s /usr/bin/arm-linux-gnueabihf-gcov-dump-8 arm-linux-gnueabihf-gcov-dump
ln -s /usr/bin/arm-linux-gnueabihf-gcov-tool-8 arm-linux-gnueabihf-gcov-tool
ln -s /usr/bin/arm-linux-gnueabihf-lto-dump-8 arm-linux-gnueabihf-dump


PATH=/apps/gcc/arm-8:$PATH

compiler Qt

get qtSource

rep="monDossier"
PATH=/apps/gcc/arm-12:$PATH
arm-linux-gnueabihf-gcc --version
!! doit être 8 !!

cd $rep
mkdir qt5Source
cd qt5Source
git clone https://code.qt.io/qt/qt5.git -b 5.15
cd qt5
./init-repository --module-subset=essential
git submodule foreach --recursive "git clean -dfx"

créer les fichier "devices"

mkdir linux-cyclonev-g++
cd linux-cyclonev-g++
nano qmake.conf
//contenu

#include(../common/linux_device_pre.conf)

#DISTRO_OPTS                  += arm
#COMPILER_FLAGS               += -march=armv7-a+fp -mfloat-abi=hard

#DISTRO_OPTS += hard-float

#CONFIG += incremental cross_compile qpa
#QT_QPA_DEFAULT_PLATFORM = linuxfb


#include(../common/linux_arm_device_post.conf)


#-------------------------------------------------
# Qt mkspec for DE0-Nano-SoC (Cyclone V, ARMv7-A, hard-float)
# Cross-compilation using Linaro or Intel SoC EDS toolchain
#-------------------------------------------------

MAKEFILE_GENERATOR = UNIX
CONFIG += incremental global_init_link_order
CONFIG += cross_compile qpa

# QPA platforms
QMAKE_QPA_PLATFORM = linuxfb eglfs

#-------------------------------------------------
# Toolchain
#-------------------------------------------------
QMAKE_CC        = $$CROSS_COMPILEgcc-12
QMAKE_CXX       = $$CROSS_COMPILEg++-12
QMAKE_LINK      = $$CROSS_COMPILEg++-12
QMAKE_LINK_SHLIB= $$CROSS_COMPILEg++-12
QMAKE_AR        = $$CROSS_COMPILEar cqs
QMAKE_OBJCOPY   = $$CROSS_COMPILEobjcopy
QMAKE_STRIP     = $$CROSS_COMPILEstrip

#-------------------------------------------------
# CPU architecture flags (Cyclone V = ARMv7-A + NEON)
#-------------------------------------------------
QMAKE_CFLAGS   += -march=armv7-a -mfloat-abi=hard -mfpu=neon 
QMAKE_CXXFLAGS += -march=armv7-a -mfloat-abi=hard -mfpu=neon 

#-------------------------------------------------
# Sysroot
#-------------------------------------------------

QMAKE_INCDIR += \
    $$[QT_SYSROOT]/usr/include \
    $$[QT_SYSROOT]/usr/include/arm-linux-gnueabihf \
    $$[QT_SYSROOT]/usr/arm-linux-gnueabi/include

QMAKE_LIBDIR += \
    $$[QT_SYSROOT]/lib \
    $$[QT_SYSROOT]/lib/arm-linux-gnueabihf \
    $$[QT_SYSROOT]/usr/lib \
    $$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf


QMAKE_LIBS += -ldl
QMAKE_LIBS_PRIVATE += -ldl

# Avoid RPATH for embedded targets
QMAKE_LFLAGS_RPATH =

# Default QPA platform
QT_QPA_DEFAULT_PLATFORM = linuxfb

# EGLFS backend (requires SGX drivers)
EGLFS_DEVICE_INTEGRATION = eglfs

#-------------------------------------------------
# Common includes for embedded Linux
#-------------------------------------------------
DISTRO_OPTS += hard-float

QT_CPU_FEATURES.arm = neon

load(device_config)
include(../common/linux_device_pre.conf)
include(../common/linux_arm_device_post.conf)
load(qt_config)


nano qplatformdefs.h

//contenu
/dev/mmcblk0p2  /  auto  errors=remount-ro  0  1

configurer les sources qt puis compiler

cd $rep/qt5Source/qt5
cp -R $rep/linux-cyclonev-g++ qtbase/mkspecs/devices/

export CFLAGS="-std=gnu11"
export CXXFLAGS="-std=gnu++11"

./configure -release -device linux-cyclonev-g++ -no-eglfs \
-device-option CROSS_COMPILE=arm-linux-gnueabihf- \
-sysroot $rep/sysroot -opensource -confirm-license -make libs \
-prefix /usr/local/qt5pi -extprefix $rep/qt5_de0 -hostprefix $rep/qt5 \
-R $rep/sysroot/usr/lib/arm-linux-gnueabihf -no-gbm -no-use-gold-linker -v -no-opengl -release -shared \
-R $rep/usr/arm-linux-gnueabi/include \
-R $rep/usr/arm-linux-gnueabi/include/gnu \
  -nomake tests -nomake examples -system-sqlite\
  -skip qtwebengine -no-feature-imageformat_xpm -no-xcb -no-feature-kms -no-feature-bearermanagement -skip qtmultimedia -no-sql-psql \
  -no-feature-vulkan -no-cups \
  -no-egl -no-freetype -no-gif -no-glib -no-icu -no-ico -no-iconv -no-kms -no-libjpeg -no-libproxy -no-openvg -no-sctp -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-system-proxies -no-use-gold-linker -nomake examples -nomake tests -no-feature-bearermanagement -no-feature-colordialog -no-feature-concurrent -no-feature-dial -no-feature-ftp -no-feature-http -no-feature-image_heuristic_mask -no-feature-keysequenceedit -no-feature-lcdnumber -no-feature-networkdiskcache -no-feature-networkproxy -no-feature-pdf -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sessionmanager -no-feature-socks5  -no-feature-statemachine -no-feature-syntaxhighlighter -no-feature-textodfwriter -no-feature-topleveldomain -no-feature-udpsocket -no-feature-undocommand -no-feature-undogroup -no-feature-undostack -no-feature-undoview -no-feature-vnc -no-feature-xml -no-gtk -no-opengles3 -no-angle -no-sqlite -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns


# eventuellement modifier qtbase/src/plugins/printsupport/printsupport.pro pour le desactiver

make -j12

rm -R $rep/qt5_de0
make install -j12

Projet Quartus

Device :

  • Altera Cyclone® V
  • SE Mainstream
  • 5CSEMA4U23C6 N

positions

Nom Led7 Led6 Led5 Led4 Led3 Led2 Led1 Led0
Broche AA23 Y16 AE26 AF26 V15 V16 AA24 W15
Nom SW3 SW2 SW1 SW0
Broche H5 H6 L9 L10

Ressources