[bootlin/training-materials updates] master: labs/sysdev-kernel-cross-compiling-stm32: remove, it is unused (a55bc847)

Thomas Petazzoni thomas.petazzoni at bootlin.com
Thu Sep 22 15:15:30 CEST 2022


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/a55bc847989db03c798f847066a3829f2ed54f61

>---------------------------------------------------------------

commit a55bc847989db03c798f847066a3829f2ed54f61
Author: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Date:   Thu Sep 22 15:15:30 2022 +0200

    labs/sysdev-kernel-cross-compiling-stm32: remove, it is unused
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>


>---------------------------------------------------------------

a55bc847989db03c798f847066a3829f2ed54f61
 .../sysdev-kernel-cross-compiling-stm32.tex        | 164 ---------------------
 1 file changed, 164 deletions(-)

diff --git a/labs/sysdev-kernel-cross-compiling-stm32/sysdev-kernel-cross-compiling-stm32.tex b/labs/sysdev-kernel-cross-compiling-stm32/sysdev-kernel-cross-compiling-stm32.tex
deleted file mode 100644
index 9181479e..00000000
--- a/labs/sysdev-kernel-cross-compiling-stm32/sysdev-kernel-cross-compiling-stm32.tex
+++ /dev/null
@@ -1,164 +0,0 @@
-\subchapter{Kernel - Cross-compiling}{Objective: Learn how to
-cross-compile a kernel for an ARM target platform.}
-
-After this lab, you will be able to:
-\begin{itemize}
-\item Set up a cross-compiling environment
-\item Cross compile the kernel for the STM32MP157A-DK1 Discovery kit
-\item Use U-Boot to download the kernel
-\item Check that the kernel you compiled starts the system
-\end{itemize}
-
-\section{Setup}
-
-Go to the \code{$HOME/__SESSION_NAME__-labs/kernel} directory.
-
-\section{Target system}
-
-We are going to cross-compile and boot a Linux kernel for the
-STM32MP157A-DK1 Discovery kit.
-
-\section{Kernel sources}
-
-We will re-use the kernel sources downloaded and patched in the
-previous lab.
-
-\section{Cross-compiling environment setup}
-
-To cross-compile Linux, you need to have a cross-compiling
-toolchain. We will use the cross-compiling toolchain that we
-previously produced, so we just need to make it available in the PATH:
-
-\begin{verbatim}
-export PATH=$HOME/x-tools/arm-training-linux-uclibcgnueabihf/bin:$PATH
-\end{verbatim}
-
-Also, don't forget to either:
-
-\begin{itemize}
-\item Define the value of the \code{ARCH} and \code{CROSS_COMPILE}
-  variables in your environment (using \code{export})
-\item {\bf Or} specify them on the command line at every invocation of
-  \code{make}, i.e.: \code{make ARCH=... CROSS_COMPILE=... <target>}
-\end{itemize}
-
-\section{Linux kernel configuration}
-
-We could use the \code{multi_v7_defconfig} default configuration to
-build a working kernel but to save time and compile less code, we
-provide in
-\code{$HOME/__SESSION_NAME__-labs/linux-stm32/} a minimal configuration
-file, named \code{stm32mp157_defconfig}. Copy it to \code{.config} and
-then run either \code{make olddefconfig} or \code{make oldconfig} if
-you want to get asked for all the possible choices.
-
-Don't hesitate to visualize the new settings by running
-\code{make xconfig} afterwards!
-
-In the kernel configuration, as an experiment, change the kernel
-compression from Gzip to XZ. This compression algorithm is far more
-efficient than Gzip, in terms of compression ratio, at the expense of
-a higher decompression time.
-
-\section{Cross compiling}
-
-You're now ready to cross-compile your kernel. Simply run:
-
-\begin{verbatim}
-make
-\end{verbatim}
-
-and wait a while for the kernel to compile. Don't forget to use
-\code{make -j<n>} if you have multiple cores on your machine!
-
-Look at the end of the kernel build output to see which file contains
-the kernel image. You can also see the Device Tree \code{.dtb} files
-which got compiled. The \code{.dtb} file corresponding to your
-board is still \code{stm32mp157a-dk1.dtb} (there is no
-\code{stm32mp157d-dk1.dtb} file yet).
-
-\section{Load and boot the kernel using U-Boot}
-
-As we are going to boot the Linux kernel from U-Boot,
-we need to set the \code{bootargs} environment corresponding
-to the Linux kernel command line:
-
-\begin{ubootinput}
-=> setenv bootargs console=ttyS0
-=> saveenv
-\end{ubootinput}
-
-We will use TFTP to load the kernel image on the Discovery kit:
-
-\begin{itemize}
-
-\item On your workstation, copy the \code{zImage} and DTB files to the
-  directory exposed by the TFTP server.
-
-\item On the target (in the U-Boot prompt), load \code{zImage} from
-  TFTP into RAM at address 0xc0000000:\\
-  \code{tftp 0xc0000000 zImage}
-
-\item Now, also load the DTB file into RAM at address 0xc4000000:\\
-  \code{tftp 0xc4000000 stm32mp157a-dk1.dtb}
-
-\item Boot the kernel with its device tree:\\
-  \code{bootz 0xc0000000 - 0xc4000000}
-
-\end{itemize}
-
-You should see Linux boot and finally panicking. This is expected: we
-haven't provided a working root filesystem for our device yet.
-
-You can now automate all this every time the board is booted or
-reset. Reset the board, and specify a different \code{bootcmd}:
-
-{\scriptsize
-\begin{verbatim}
-setenv bootcmd 'tftp 0xc0000000 zImage; tftp 0xc4000000 stm32mp157a-dk1.dtb; bootz 0xc0000000 - 0xc4000000'
-saveenv
-\end{verbatim}
-}
-
-\section{Writing the kernel and DTB on the SD card}
-
-In order to let the kernel boot on the board autonomously, we can
-copy the kernel image and DTB in the boot partition we created
-previously.
-
-Insert the SD card in your PC, it will get auto-mounted. Copy the
-kernel and device tree:
-\begin{verbatim}
-sudo cp arch/arm/boot/dts/stm32mp157a-dk1.dtb arch/arm/boot/zImage /media/$USER/boot/
-sudo umount /media/$USER/boot
-\end{verbatim}
-
-Insert the SD card back in the board and reset it. You should now be
-able to load the DTB and kernel image from the SD card and boot with:
-
-\begin{verbatim}
-load mmc 0:4 0xc0000000 zImage
-load mmc 0:4 0xc4000000 stm32mp157a-dk1.dtb
-bootz 0xc0000000 - 0xc4000000
-\end{verbatim}
-
-You are now ready to modify \code{bootcmd} to boot the board
-from SD card. But first, save the settings for booting from
-\code{tftp}:
-
-\begin{verbatim}
-setenv bootcmdtftp ${bootcmd}
-\end{verbatim}
-
-This will be useful to switch back to \code{tftp} booting mode
-later in the labs.
-
-Finally, using \code{editenv bootcmd}, adjust \code{bootcmd} so that
-the Discovery board starts using the kernel from the SD card.
-
-Now, reset the board to check that it boots in the same way from the
-SD card. Check that this is really your own version of the kernel
-that's running\footnote{Look at the kernel log. You will find the
-kernel version number as well as the date when it was compiled.
-That's very useful to check that you're not loading an older version
-of the kernel instead of the one that you've just compiled.}.




More information about the training-materials-updates mailing list