Appendix D – Troubleshooting Kernel Bootup Issue

If the .dtb and the zImage size is greater than the default size, the kernel does not boot up. Example kernel log is as follows.

U-Boot 2017.03-linux4sam_5.6 (Jan 14 2019 - 15:10:15 -0700)

CPU: SAMA5D44
Crystal frequency: 12 MHz
CPU clock : 600 MHz
Master clock : 200 MHz
DRAM: 512 MiB
NAND: 512 MiB
MMC: Atmel mci: 0
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@f8020000
Hit any key to stop autoboot: 0 

NAND read: device 0 offset 0x180000, size 0x817c
33148 bytes read: OK

NAND read: device 0 offset 0x200000, size 0x3df7c8
4061128 bytes read: OK
## Flattened Device Tree blob at 21000000
Booting using the fdt blob at 0x21000000
Loading Device Tree to 3f951000, end 3f95c77d ... OK

Starting kernel ...

The procedure to edit the environment commands to fix above error is as follows.

  1. Press any key when the Hit any key to stop autoboot: command is shown to stop autoboot.

    This "=>" symbol appears if successful.

  2. Enter pri to print environment variables.
    baudrate=115200
    bootargs=console=ttyS0,115200 mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernew
    bootcmd=nand read 0x21000000 0x00180000 0x0000817C; nand read 0x22000000 0x00200000 0x003DF7C8; bootz 0x22000000 - 0x21000000
    bootdelay=1
    ethaddr=fc:c2:3d:0c:8e:e1
    fdtcontroladdr=3f95dc50
    stderr=serial
    stdin=serial
    stdout=serial
    Environment size: 468/131067 bytes
    
  3. If the dtb and zimage is bigger than the default size, use the following command to adjust the size.
    editenv bootcmd
    • Replace 0x0000817C to 0x0000a17C for bootcmd variable (dtb file size).
    • Replace 0x003DF7C8 to 0x004DF7C8 (zImage file size).
    • Enter saveenv command to save the command.
    • Enter pri to print the saved environment variables.
  4. Type boot to restart the booting process with the saved values.