unable to login buildroot - linux-kernel

i use buildroot and compile linux kenrenl and when i run QEMU,i cann't login to builroot, because i cann't see message "Welcome to buildroot" for login,
ata2.01: NODEV after polling detection
ata2.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100
ata1.01: NODEV after polling detection
ata1.00: ATA-7: QEMU HARDDISK, 2.5+, max UDMA/100
ata1.00: 11502 sectors, multi 16: LBA48
ata1.00: configured for MWDMA2
ata2.00: configured for MWDMA2
scsi 0:0:0:0: Direct-Access ATA QEMU HARDDISK 2.5+ PQ: 0
ANSI: 5
sd 0:0:0:0: [sda] 11502 512-byte logical blocks: (5.89 MB/5.62 MiB)
scsi 1:0:0:0: CD-ROM QEMU QEMU DVD-ROM 2.5+ PQ: 0
ANSI: 5
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't
support DPO or FUA
sd 0:0:0:0: [sda] Attached SCSI disk
input: ImExPS/2 Generic Explorer Mouse as
/devices/platform/i8042/serio1/input/input3
EXT4-fs (sda): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (sda): mounting ext2 file system using the ext4 subsystem
EXT4-fs (sda): mounted filesystem without journal. Opts: (null)
VFS: Mounted root (ext2 filesystem) readonly on device 8:0.
devtmpfs: mounted
Freeing unused kernel memory: 832K (ffffffff8186e000 -
ffffffff8193e000)
Write protecting the kernel read-only data: 8192k
Freeing unused kernel memory: 1212K (ffff8800014d1000 -
ffff880001600000)
Freeing unused kernel memory: 536K (ffff88000177a000 -
ffff880001800000)
random: fast init done
EXT4-fs (sda): warning: mounting unchecked fs, running e2fsck is
recommended
EXT4-fs (sda): re-mounted. Opts:
block_validity,barrier,user_xattr,errors=remount-ro
Starting logging: OK
Initializing random number generator... done.
Starting network: OK
### here, i was unable to see message command for login,
QEMU:
qemu-system-x86_64 -hda buildroot/buildroot 2017.02.2/output/images/rootfs.ext2 -m 2G -smp 2 -nographic -kernel buildroot/buildroot-2017.02.2/output/images/bzImage -append "console=ttyS0 root=/dev/sda debug earlyprintk=serial slub_debug=QUZ"
i don't understand why i am unable to see message "Welcome to buildroot" ??

Maybe you need to modify the bootloader parameter..set the console to ttyS?
or you can modify the rootfs.tar, in the rootfs, edit the etc/inittab
for instance,change ttymxc1 to ttymxc0:
# Put a getty on the serial port
ttymxc0::respawn:/sbin/getty -L ttymxc0 0 vt100 # GENERIC_SERIAL

If you use QEMU nographic option, please check following bullet points:
BR2_TARGET_GENERIC_GETTY_PORT="ttyS0" in buildroot config file
console=ttyS0 in kernel args when run QEMU

Take the sdcard.img file in buildtoot>> output>> images>>sdcard.img
Then make it bootable using balena etcher(when using ubuntu) or rufus(when using windows).
Then flash to memory card.
Then put that card in fpga board.
It will surely work for everyone.
If any doubt: contact parthumahesh1998#gmail.com

Related

agl-sota u-boot raspberrypi3 - Card did not respond to voltage select! Device 0: unknown device

I am building an automotive-grade-linux demo image using yocto for raspberrypi3.
I am adding a layer agl-sota for OTA feature. This is where my u-boot breaks.
While booting up according to defconfig CONFIG_ENV_EXT4_DEVICE_AND_PART="0:1" u-boot takes mmc0 which is sd card that can be verified through 'mmc info' and partition 1.
Yet it shows:
U-Boot 2020.10 (Jun 29 2020 - 03:06:40 +0000)
DRAM: 768 MiB
RPI 3 Model B (0xa02082)
MMC: mmc#7e202000: 0, sdhci#7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment
In: serial
Out: vidconsole
Err: vidconsole
Net: No ethernet found.
starting USB...
Bus usb#7e980000: USB DWC2
scanning bus usb#7e980000 for devices... 3 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Card did not respond to voltage select!
Device 0: unknown device
Waiting for Ethernet connection... unable to connect.
...
...
u-boot >
'mmc info' output:
U-Boot> mmc info
Device: mmc#7e202000
Manufacturer ID: 3
OEM: 5344
Name: SU16G
Bus Speed: 50000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.8 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
What configuration issue is disallowing u-boot to boot the kernel.?
I am using raspberrypi imager for flashing the wic.xz image.

Beaglebone black uImage boot issues

I am trying to boot the beaglebone black using the uImage file that I created using the mkimage command. There is a emmc to sd image flasher package available online which has a uImage in it and also other required files (https://elinux.org/BeagleBone_Black_Extracting_eMMC_contents), I followed this website and created a flasher card of the uImage that I made using mkimage utility.
I am getting the following error during boot from SD card having that uImage:
U-Boot SPL 2016.01-00763-g3faf221 (Jan 29 2016 - 20:47:08)
Trying to boot from MMC
Card doesn't support part_switch
MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment
reading u-boot.img
reading u-boot.img
U-Boot 2016.01-00763-g3faf221 (Jan 29 2016 - 20:47:08 +0000)
Watchdog enabled
I2C: ready
DRAM: 512 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment
Net: <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
=> set sdboot 1
=> boot
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
235 bytes read in 5 ms (45.9 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc ...
Running uenvcmd ...
reading uImage
5497536 bytes read in 302 ms (17.4 MiB/s)
reading /am335x-boneblack.dtb
25926 bytes read in 8 ms (3.1 MiB/s)
## Booting kernel from Legacy Image at 82000000 ...
Image Name: Linux kernel
Created: 2015-09-07 21:47:16 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 5497472 Bytes = 5.2 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 81ff0000
Booting using the fdt blob at 0x81ff0000
Loading Kernel Image ... OK
Loading Device Tree to 8fff6000, end 8ffff545 ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
[ 0.177572] omap2_mbox_probe: platform not supported
[ 0.333923] tps65217-bl tps65217-bl: no platform data provided
[ 0.397544] bone-capemgr bone_capemgr.9: slot #0: No cape found
[ 0.434652] bone-capemgr bone_capemgr.9: slot #1: No cape found
[ 0.471760] bone-capemgr bone_capemgr.9: slot #2: No cape found
[ 0.508869] bone-capemgr bone_capemgr.9: slot #3: No cape found
[ 0.528815] omap_hsmmc mmc.5: of_parse_phandle_with_args of 'reset' failed
[ 0.591166] pinctrl-single 44e10800.pinmux: pin 44e10854 already requested by 44e10800.pinmux; cannot claim for gpio-leds.8
[ 0.602845] pinctrl-single 44e10800.pinmux: pin-21 (gpio-leds.8) status -22
[ 0.610128] pinctrl-single 44e10800.pinmux: could not request pin 21 on device pinctrl-single
[ 0.686675] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 0.695344] [<c0010f5d>] (unwind_backtrace+0x1/0x98) from [<c04994c3>] (panic+0x5b/0x158)
[ 0.703882] [<c04994c3>] (panic+0x5b/0x158) from [<c07bc94b>] (mount_block_root+0xf7/0x178)
[ 0.712595] [<c07bc94b>] (mount_block_root+0xf7/0x178) from [<c07bcb09>] (mount_root+0x95/0xb0)
[ 0.721676] [<c07bcb09>] (mount_root+0x95/0xb0) from [<c07bcbef>] (prepare_namespace+0xcb/0x11c)
[ 0.730836] [<c07bcbef>] (prepare_namespace+0xcb/0x11c) from [<c0495aff>] (kernel_init+0x7/0x98)
[ 0.740007] [<c0495aff>] (kernel_init+0x7/0x98) from [<c000c7fd>] (ret_from_fork+0x11/0x34)
Any help will be useful.
The kernel cannot find the root partition. The kernel command line is set in U-Boot via the environment variable bootargs.

Linux kernel for A20 cpu stuck at 'Starting kernel'

Linux kernel version: 4.1.8
board:cubietruck with A20 CPU.
compiled platform: os x 10.5.5
I do as follows:
First I use sunxi_defconfig as the default configuration, but 'byte_swap.h' not found error occurred. Then I use a sun7i_defconfig which offered by cubieboard, and then make -j4 ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage,make -j4 ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs.
Then I burn the Uboot and the spl to the SDCard and make to partitions: one for boot and one for root file system. I put the zImage, script.bin and the dtb file on the boot partition.
Then I create boot.cmd as below:
fatload mmc 0 0x46000000 zImage
fatload mmc 0 0x49000000 sun7i-a20-cubietruck.dtb
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
bootz 0x46000000 - 0x49000000
and then mkimage -C none -A arm -T script -d boot.cmd boot.scr.
so there's three files on the boot partition:
boot.scr
script.bin
sun7i-a20-cubietruck.dtb
zImage
the Uboot works fine.(At least I think), here is the output
U-Boot SPL 2014.04 (Sep 29 2015 - 21:36:09)
Board: Cubietruck
DRAM: 2048 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600
U-Boot 2014.04 (Sep 29 2015 - 21:36:09) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
Board: Cubietruck
I2C: ready
DRAM: 2 GiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net: dwmac.1c50000
Hit any key to stop autoboot: 0
reading uEnv.txt
** Unable to read file uEnv.txt **
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
reading boot.scr
281 bytes read in 16 ms (16.6 KiB/s)
Jumping to boot.scr
## Executing script at 44000000
reading zImage
3446280 bytes read in 192 ms (17.1 MiB/s)
reading sun7i-a20-cubietruck.dtb
26288 bytes read in 30 ms (855.5 KiB/s)
Kernel image # 0x46000000 [ 0x000000 - 0x349608 ]
## Flattened Device Tree blob at 49000000
Booting using the fdt blob at 0x49000000
Loading Device Tree to 4fff6000, end 4ffff6af ... OK
Starting kernel ...
Any one could help?

CONFIG_MMC_ATMELMCI...no devices detected

I'm trying to compile a kernel for a GESBC-9G20w from Glomation. The board is built around a AT91SAM9G20. My problem is that I can't detect an sd card with my kernel. The demo kernel they provide works, so I know the hardware's good, but I need a newer kernel version.
I can provide lot's more info, but I tried only provide the important stuff for starters.
I'm using kernel source from https://github.com/linux4sam/linux-at91
Kernel config options...
#
# AT91SAM9G20 Board Type
#
CONFIG_MACH_AT91SAM9G20EK=y
CONFIG_MACH_AT91SAM9G20EK_2MMC=y
CONFIG_MACH_CPU9G20=y
CONFIG_MACH_ACMENETUSFOXG20=y
CONFIG_MACH_PORTUXG20=y
CONFIG_MACH_STAMP9G20=y
CONFIG_MACH_PCONTROL_G20=y
CONFIG_MACH_GSIA18S=y
CONFIG_MACH_SNAPPER_9260=y
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set
# CONFIG_MMC_CLKGATE is not set
#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_MINORS=8
CONFIG_MMC_BLOCK_BOUNCE=y
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set
#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_SDHCI_PXAV3 is not set
# CONFIG_MMC_SDHCI_PXAV2 is not set
# CONFIG_MMC_AT91 is not set
CONFIG_MMC_ATMELMCI=y
# CONFIG_MMC_SPI is not set
# CONFIG_MMC_DW is not set
# CONFIG_MMC_VUB300 is not set
# CONFIG_MMC_USHC is not set
# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
Boot log...
NET: Registered protocol family 17
input: gpio-keys as /devices/platform/gpio-keys/input/input0
rtc-at91sam9 rtc-at91sam9.0: setting system clock to 1970-01-01 00:16:52 UTC (1012)
atmel_mci atmel_mci: version: 0x210
atmel_mci atmel_mci: no DMA channel available
atmel_mci atmel_mci: using PDC
atmel_mci atmel_mci: Atmel MCI controller at 0xfffa8000 irq 25, 2 slots
ALSA device list:
No soundcards found.
Waiting 5sec before mounting root device...
usb 1-1: new full-speed USB device number 2 using at91_ohci
usb 1-2: new full-speed USB device number 3 using at91_ohci
usb-storage 1-2:1.0: USB Mass Storage device detected
scsi0 : usb-storage 1-2:1.0
scsi 0:0:0:0: Direct-Access 2.0 2.0 5.00 PQ: 0 ANSI: 2
sd 0:0:0:0: [sda] 7968768 512-byte logical blocks: (4.08 GB/3.79 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk
EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
EXT4-fs (sda1): warning: mounting unchecked fs, running e2fsck is recommended
EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext3 filesystem) on device 8:1.
devtmpfs: mounted
Freeing unused kernel memory: 152K (c03ee000 - c0414000)
...but when I look in /dev, there are no mmcblk devices.
Any ideas?
Thanks!

Rootfs on SD card

I've a device on which I've a 3.10 linux kernel booting up to a busybox shell (initramfs)
When I extracted the busybox filesystem image on the SD card and when modified the root from root=/dev/ram to /dev/mmcblck0p1, it still boots up to the shell
So the busybox works fine but if I try to use any other FS the kernel would crash...
While I try to generate a rootfs using debootstrap (https://help.ubuntu.com/community/DebootstrapChroot) and have the new rootfs extracted on the SD card. I get an error saying "Failed to execute /sbin/init"
I did check if the file is present and also checked the permissions and it looks good to me.
What could be the problem?
W.R.T rootfs I'm particularly new. I was assuming that any FS on the SD card could be mounted but looks like its not the case. I'm guessing that whatever the /sbin/init will be doing is device dependent?
What I am trying to do? --->
I need to make a rootfs with a few packages and libraries (gcc python etc..) What would a normal approach? I've even tried buildroot but I couldn't get gcc on target. Is it not possible to have gcc in /bin/ within buildroot?
-- UPDATE --
I'm formatting the SD card to ext4 format and following is the output of fdisk
Disk /dev/sdb1: 7945 MB, 7945588224 bytes
255 heads, 63 sectors/track, 965 cylinders, total 15518727 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc2aa4908
Device Boot Start End Blocks Id System
And following are the kernel logs while I have a filesystem on the SD card. The memory card driver works fine I've verified that. If I have a busybox filesystem on the SD card, everything works fine. When I'm using any other file systems I get the following...
6EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
6VFS: Mounted root (ext4 filesystem) on device 179:1.
6Freeing unused kernel memory: 84K (c0f00000 - c0f15000)
3request_module: runaway loop modprobe binfmt-464c
4kworker/u2:4 (145) used greatest stack depth: 6132 bytes left
3Failed to execute /sbin/init. Attempting defaults...
3request_module: runaway loop modprobe binfmt-464c
3request_module: runaway loop modprobe binfmt-464c
0Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
When checked, there is /sbin/init with the appropriate permissions that too!
Consider this error: "request_module: runaway loop modprobe binfmt-464c"
In all probability you're trying to use 64b binaries (/sbin/init and the rest) with 32b only kernel. Either recompile your kernel to support 64b or install a 32b user space onto your sd card.
Other things to check:
Confirm that elf support is indeed enabled in your kernel (it normally is, but it is possible to disable it).
Google that error and see what sort of problems people were having with it.

Resources