Difference between revisions of "RockpiE/dev/Debian"
(→Troubleshooting) |
|||
Line 158: | Line 158: | ||
== Troubleshooting == | == Troubleshooting == | ||
− | Check [[RockpiE/FAQs |ROCK Pi E FAQs]] first, if it doesn't help, start a new post on the forum https://forum.radxa.com/c/ | + | Check [[RockpiE/FAQs |ROCK Pi E FAQs]] first, if it doesn't help, start a new post on the forum https://forum.radxa.com/c/rockpie |
Revision as of 02:27, 28 May 2020
ROCK Pi E > Development > Build Debian
Contents
Rockchip Debian SDK
Below is the instructions of how to build image for ROCK Pi E on a HOST PC.
Get the source code
You need Git to get multiple git repositories to build the image.
Install Git if you don't have it.
sudo apt-get update sudo apt-get install git
Clone the source code
git clone -b stable-4.4-rockpie https://github.com/radxa/rockchip-bsp.git cd rockchip-bsp git submodule init git submodule update
You will get
build kernel README.md rkbin rootfs u-boot
Directories usage introductions:
- build:
- Some script files and configuration files for building u-boot, kernel and rootfs.
- kernel:
- kernel source code, current version is 4.4.154.
- rkbin:
- Prebuilt Rockchip binaries, include first stage loader and ATF(Arm Trustzone Firmware).
- rootfs:
- Bootstrap a Debian based rootfs, support architechture armhf and arm64, support Debian Jessie and Stretch.
- u-boot:
- u-boot as the second stage bootloader
Update the source code
cd rockchip-bsp git checkout stable-4.4-rockpie git fetch origin git rebase origin/stable-4.4-rockpie git submodule update
Install toolchain and other build tools
sudo apt-get install gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools sudo apt-get install bc python dosfstools
Build u-boot
Need to checkout branch to stable-4.4-rockpie.
Build u-boot with default rock-pi-e-rk3328_defconfig.
./build/mk-uboot.sh rockpie #For ROCK Pi E
The generated images will be copied to out/u-boot folder
ls out/u-boot/ idbloader.img rk3328_loader_ddr333_v1.16.250.bin trust.img uboot.img
Build kernel
Need to checkout branch to stable-4.4-rockpie.
Build kernel with default rockchip_linux_defconfig.
./build/mk-kernel.sh rockpie #For ROCK Pi E
Change kernel config(optional)
Optionally, if you want to change the default kernel config
cd kernel export ARCH=arm64 export CROSS_COMPILE=aarch64-linux-gnu- make rockchip_linux_defconfig make menuconfig cd .. ./build/mk-kernel.sh rockpie #For ROCK Pi E
You will get the kernel image and dtb file
ls out/kernel/ Image rk3328-rock-pi-e.dtb
Make rootfs image
To build 32bit rootfs:
export ARCH=armhf
To build 64bit rootfs:
export ARCH=arm64
Building a base debian system by ubuntu-build-service from linaro.
cd rootfs sudo apt-get install binfmt-support qemu-user-static cpio gdisk sudo dpkg -i ubuntu-build-service/packages/* # ignore the broken dependencies, we will fix it next step sudo apt-get install -f RELEASE=stretch TARGET=desktop ARCH=$ARCH ./mk-base-debian.sh
This will bootstrap a Debian stretch image, you will get a rootfs tarball named linaro-stretch-alip-xxxx.tar.gz.
Building the rk-debain rootfs with debug:
VERSION=debug ARCH=$ARCH ./mk-rootfs-stretch.sh && ./mk-image.sh
This will install Rockchip specified packages and hooks on the standard Debian rootfs and generate an ext4 format rootfs image at rootfs/linaro-rootfs.img.
Combine everything into one image
build/mk-image.sh -c rk3328 -t system -r rootfs/linaro-rootfs.img
This will combine u-boot, kernel and rootfs into one image and generate GPT partition table. Output is
out/system.img
Flash the image
When install system image, system.img to uSD card, need APP Etcher or tool dd.
FAQs
1.With an USB to TTL serial cable connected with UART2 pins (pin#10, pin#8, ping#6 on 40-PIN Header) on ROCK Pi E, system log is shown as follows.
[ 0.001996] Console: colour dummy device 80x25 [ 0.002413] console [tty0] enabled [ 0.002743] bootconsole [uart0] disabled
In fact the system starts up with no system log information shown on screen. If your ROCK Pi E system supports Ethernet/WiFi and SSH, you can access ROCK Pi E by SSH.
The FIQ Debugger is disabled by default. If you want to use debugger console, you can modify ROCK Pi E device tree, rk3328-rock-pi-e.dts to enable fiq_debugger node.
fiq_debugger: fiq-debugger { compatible = "rockchip,fiq-debugger"; rockchip,serial-id = <2>; rockchip,signal-irq = <159>; rockchip,wake-irq = <0>; /* If enable uart uses irq instead of fiq */ rockchip,irq-mode-enable = <0>; rockchip,baudrate = <1500000>; /* Only 115200 and 1500000 */ interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_LOW>; status = "okay"; };
Troubleshooting
Check ROCK Pi E FAQs first, if it doesn't help, start a new post on the forum https://forum.radxa.com/c/rockpie