Welcome! Log In Create A New Profile

Advanced

Login to Linux system over LCD console on Raspberry Pi.

Posted by anymor1024 
Login to Linux system over LCD console on Raspberry Pi.
November 19, 2015 05:38AM
I have Raspberry Pi Model B+ V1.2.
I would like to use official Raspbian OS with U-Boot.
When Raspberry Pi turn on then U-Boot starts and run Raspbian kernel.img.
But i do not have anything kernel boot message on LCD monitor. Every messages are send to serial port (UART -> RS232) to the serial console.
After Raspbian is started, I can login to system only via serial console or ethernet. Possibility for login to system via keyboard and LCD/monitor console is missing.
How can I enable login to system over console on LCD with keyboard connected and How can I enable kernel boot message to LCD?

My procedure for usin U-Boot with Raspberry Pi Model B+ V1.2
Step 01: Download Raspbian Jessie zip file [https://downloads.raspberrypi.org/raspbian_latest] with SD card image and make SD card with this image.
Homepage for download: [https://www.raspberrypi.org/downloads/raspbian/].
Kernel version: 4.1.7+ (via uname -r)
Default boot: boot to X-Windows (Desktop autologin) - Can I change boot to console via raspi-config, but I left default settings.

Step 02: Download toolchain for cross compilation for Raspberry Pi [git clone https://github.com/raspberrypi/tools] and configure PATH.

Step 03. Download U-Boot project [git clone git://git.denx.de/u-boot.git] and compile it:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- rpi_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

Step 04: Copy compiled u-boot.bin to Raspbian Jessie SD card.
Add line kernel=u-boot.bin to end of file /boot/config.txt on Raspbian Jessie SD card.

Step 05: After restart my Raspberry Pi run U-Boot and then I print some information about device:
* Over terminal with serial console I print U-Boot environment:
U-Boot> printenv
arch=arm
baudrate=115200
board=rpi
board_name=Model B+
board_rev=0x10
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0 usb0 pxe dhcp
bootcmd=run distro_bootcmd
bootcmd_dhcp=usb start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_pxe=usb start; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=2
bootfile=boot.scr.uimg
bootfstype=fat
cpu=arm1176
devnum=0
devplist=1
devtype=mmc
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
ethact=sms0
fdt_addr_r=0x00000100
fdtfile=bcm2835-rpi-b-plus.dtb
kernel_addr_r=0x01000000
loadaddr=0x00200000
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
pxefile_addr_r=0x00100000
ramdisk_addr_r=0x02100000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev
_for_scripts; done
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}
; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.c
onf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot s
cript ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x02000000
soc=bcm283x
stderr=serial,lcd
stdin=serial,lcd
stdout=serial,lcd
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
usbethaddr=b8:27:eb:16:c4:8a
vendor=raspberrypi

Environment size: 2304/16380 bytes

* U-Boot board info structure:
U-Boot> bdinfo
arch_number = 0x00000C42
boot_params = 0x00000100
DRAM bank = 0x00000000
-> start = 0x00000000
-> size = 0x1C000000
eth0name = sms0
ethaddr = (not set)
current eth = sms0
ip_addr = <NULL>
baudrate = 115200 bps
TLB addr = 0x1BFF0000
relocaddr = 0x1BF4D000
reloc off = 0x1BF45000
irq_sp = 0x1BB48ED0
sp start = 0x1BB48EC0
FB base = 0x5E97A000

* U-Boot print console devices and information:
U-Boot> coninfo
List of available devices:
serial_pl01x 00000003 .IO
lcd 00000002 ..O stdout stderr
serial 80000003 SIO stdin

* U-Boot print header information for application image
U-Boot> iminfo

## Checking Image at 02000000 ...
Unknown image format!

Step 06: Configure some U-Boot environments:
* Setting boot only from SD card
U-Boot> setenv boot_targets "mmc0"
* Setting kernel arguments (copy from /boot/cmdline.txt from SD card)
U-Boot> setenv bootargs "dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait"
* Save U-Boot environment changes
U-Boot> saveenv
* Restart Raspberry Pi device
U-Boot> reset

Step 07: Run Raspbian Jessie kernel.img
* U-Boot start screen from serial console:
U-Boot 2015.10-00317-g446d37c (Nov 19 2015 - 09:51:55 +0100)

DRAM: 448 MiB
RPI Model B+
MMC: bcm2835_sdhci: 0
reading uboot.env
In: serial
Out: lcd
Err: lcd
Net: Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
U-Boot>

* Load kernel into the memory from serial console:
U-Boot> fatload mmc 0:1 ${kernel_addr_r} kernel.img
reading kernel.img
4056224 bytes read in 280 ms (13.8 MiB/s)

* Run Linux zImage image from memory from serial console:
U-Boot> bootz ${kernel_addr_r}

Result:
* Linux kernel boot message are shows only serial console:
Net: Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
U-Boot> fatload mmc 0:1 ${kernel_addr_r} kernel.img
reading kernel.img
4056224 bytes read in 280 ms (13.8 MiB/s)
U-Boot>
U-Boot> bootz ${kernel_addr_r}
Kernel image @ 0x1000000 [ 0x000000 - 0x3de3a8 ]

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.1.7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 201
4.03) ) #817 PREEMPT Sat Sep 19 15:25:36 BST 2015
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] Machine: BCM2708
[ 0.000000] cma: Reserved 8 MiB at 0x1b800000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 113680
[ 0.000000] Kernel command line: dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsc
k.repair=yes rootwait
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 436552K/458752K available (6132K kernel code, 490K rwdata, 1780K rodata, 348K init, 720K bss, 14008K reserved, 8192K cma-reserv
ed)
[ 0.000000] Virtual kernel memory layout:
=======> and other kernel boot messages...

* LCD monitor shows only this lines:
Net: Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
U-Boot> fatload mmc 0:1 ${kernel_addr_r} kernel.img
reading kernel.img
4056224 bytes read in 280 ms (13.8 MiB/s)
U-Boot>
U-Boot> bootz ${kernel_addr_r}
Kernel image @ 0x1000000 [ 0x000000 - 0x3de3a8 ]

Starting kernel ...
=======> no other messages

* I can login only via serial console or ethernet.

* I would like login to Raspberry device via keyboard connecetd to Raspberry device with LCD/monitor console.
But I can not login, because LCD/monitor console is missing.

How can I enable login to system over console on LCD with keyboard connected?
How can I enable kernel boot message to LCD?

I tried:
- U-Boot setenv silent 1
- U-Boot source define in u-boot/include/configs/rpi-common.h
CONFIG_SILENT_CONSOLE
CONFIG_SYS_DEVICE_NULLDEV
CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC
- U-Boot environment stderr, stdin, stdout
- I tried Stephen Warren U-Boot
I replaced [git clone git://git.denx.de/u-boot.git] from Step 03 to [git clone git://github.com/swarren/u-boot.git --branch rpi_dev]
- I tried Sunxi U-Boot
I replaced [git clone git://git.denx.de/u-boot.git] from Step 03 to [git clone https://github.com/linux-sunxi/u-boot-sunxi.git]
But still i do not console on LCD monitor.

Please help me.

Thank you very much.
Re: Login to Linux system over LCD console on Raspberry Pi.
November 19, 2015 12:21PM
anymor1024,

We are not using Raspian and we don't have support for RPi here! you might want to get helps in rPi forum. It's likely people have seen this problem.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Login to Linux system over LCD console on Raspberry Pi.
November 20, 2015 12:30AM
Excuse me.

Thank you for your information.
Re: Login to Linux system over LCD console on Raspberry Pi.
November 29, 2015 11:50PM
Solution:
=========

Changed Step 03: Download U-Boot project [git clone git://git.denx.de/u-boot.git] and compile it:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- rpi_defconfig
==> * Configure U-Boot:
==> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
==> * Enable keyboard: Device Drivers -> Enable driver model keyboard support
==> * Enable HDMI monitor: Device Drivers -> Graphics support -> Enable DisplayPort support
==> * Save changes
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

Changed Step 06: Configure some U-Boot environments:
* Setting boot only from SD card
U-Boot> setenv boot_targets "mmc0"
* Setting kernel arguments (copy from /boot/cmdline.txt from SD card)
U-Boot> setenv bootargs "dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait"
==> * Setting device tree file
setenv fdtfile "bcm2708-rpi-b-plus.dtb"
* Save U-Boot environment changes
U-Boot> saveenv
* Restart Raspberry Pi device
U-Boot> reset

Changed Step 07: Run Raspbian Jessie kernel.img
* Load kernel into the memory from serial console:
U-Boot> fatload mmc 0:1 ${kernel_addr_r} kernel.img
reading kernel.img
4056224 bytes read in 280 ms (13.8 MiB/s)

==> * Load device tree into the memory from serial console:
U-Boot> fatload mmc 0:1 ${fdt_addr_r} ${fdtfile}
reading bcm2708-rpi-b-plus.dtb
8062 bytes read in 15 ms (524.4 KiB/s)

* Run Linux zImage image from memory from serial console:
==> U-Boot> bootz ${kernel_addr_r} - ${fdt_addr_r}
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: