This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/PROCESSOR-SDK-AM335X: Starter kit reboots at kernel start

Part Number: PROCESSOR-SDK-AM335X

Tool/software: Linux

Hi all,
I am working on a AM335x-SK board. SK stuck after print "Starting Kernel"
First of all, I have tried the method introduced in http://processors.wiki.ti.com/index.php/Kernel_-_Common_Problems_Booting_Linux#Problem_.231_-_No_more_output_is_seen_on_the_console_after_.22Starting_Kernel....22, chanded console to ttyO0, ttyO2, ttyS2, but it doesn’t work. 
Also, I tried with board-support/prebuilt-images/ u-boot-spl.bin.am335x-evm,  u-boot.img, zImage-am335x-evm.bin. The result is exactly the same as below. 
I download the am335-evm-SDK-3.3.0.4, and installed on Ubuntu1404 64bits, run setup.sh, (TFTP=1,NFS=1)
Nothing is changed in Rules.make.
 In am335x_evm.h, I modified the config_bootcommand as below:
#define CONFIG_BOOTCOMMAND \
    "setenv autoload no; "                    \
    "setenv serverip 10.0.0.132; "                \
    "dhcp; "                \
    "tftp 0x82000000 10.0.0.132:uImage"                \
    "bootm 0x82000000"
Also, in .config, CONFIG_DEBUG_LL=y  (but nothing printed after 'Starting kernel')
All other files are kept the same as installed. 
I enter the SDK_install_dir, use the top makefile 
> make linux    and copy the arch/arm/boot/zImage to /tftpboot, and use “mkimage -A arm -O linux -T kernel -C none -a 0x82000000 -e 0x820000000 -n "Linux kernel" -d zImage uImage ” to convert zimage to uimage.
> make u-boot-spl    and copy the u-boot.img and spl/u-boot-spl.bin to /tftpboot
I use minicom to upload spl and u-boot file through xmodem and ymodem. u-boot download the uImage from my tftp, and shows following, then stuck.
U-Boot 2016.05-00319-gcf14e63-dirty (May 25 2017 - 08:32:49 -0400)              
                                                                                
                                                                                
                                                                                
CPU  : AM335X-GP rev 1.0                                                        
                                                                                
Model: TI AM335x EVM-SK                                                         
                                                                                
       Watchdog enabled                                                         
                                                                                
DRAM:  256 MiB                                                                  
                                                                                
NAND:  0 MiB                                                                    
                                                                                
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1                                           
                                                                                
Card did not respond to voltage select!                                         
                                                                                
** Bad device mmc 0 **                                                          
                                                                                
Using default environment                                                       
                                                                                
                                                                                
                                                                                
<ethaddr> not set. Validating first E-fuse MAC                                  
                                                                                
Net:   eth0: ethernet@4a100000                                                  
                                                                                
Warning: usb_ether MAC addresses don't match:                                   
                                                                                
Address in SROM is         de:ad:be:ef:00:01                                    
                                                                                
Address in environment is  bc:6a:29:53:85:7b                                    
                                                                                
, eth1: usb_ether                                                               
                                                                                
Press SPACE to abort autoboot in 2 seconds                                      
                                                                                
link up on port 0, speed 100, full duplex                                       
                                                                                
BOOTP broadcast 1                                                               
                                                                                
BOOTP broadcast 2                                                               
                                                                                
DHCP client bound to address 10.0.0.133 (525 ms)                                
                                                                                
link up on port 0, speed 100, full duplex                                       
                                                                                
Using ethernet@4a100000 device                                                  
                                                                                
TFTP from server 10.0.0.132; our IP address is 10.0.0.133                       
                                                                                
Filename 'uImage'.                                                              
                                                                                
Load address: 0x80008000                                                        
                                                                                
Loading: #################################################################      
                                                                                
         #################################################################      
                                                                                
         #################################################################      
                                                                                
         ##########################################                             
                                                                                
         1.9 MiB/s                                                              
                                                                                
done                                                                            
                                                                                
Bytes transferred = 3474976 (350620 hex)                                        
                                                                                
## Booting kernel from Legacy Image at 80008000 ...                             
                                                                                
   Image Name:   Linux kernel                                                   
                                                                                
   Created:      2017-05-24  20:33:54 UTC                                       
                                                                                
   Image Type:   ARM Linux Kernel Image (uncompressed)                          
                                                                                
   Data Size:    3474912 Bytes = 3.3 MiB                                        
                                                                                
   Load Address: 82000000                                                       
                                                                                
   Entry Point:  82000000                                                       
                                                                                
   Verifying Checksum ... OK                                                    
                                                                                
   Loading Kernel Image ... OK                                                  
                                                                                
                                                                                
                                                                                
Starting kernel ...                                                             
                                                                                
                                                                                
                                                                                
CCCCCCCCC        
If I choose to download zImage and use bootz to run kernel, I got                                                                
                                                                 
                                                                            
Loading: #################################################################      
                                                                                
         #################################################################      
                                                                                
         #################################################################      
                                                                                
         ##########################################                             
                                                                                
         1.9 MiB/s                                                              
                                                                                
done                                                                            
                                                                                
Bytes transferred = 3474912 (3505e0 hex)                                        
                                                                                
Kernel image @ 0x80008000 [ 0x000000 - 0x3505e0 ]                               
                                                                                
                                                                                
                                                                                
Starting kernel ...                                                             
                                                                                
                                                                                
                                                                                
CCCCCCCC
Here is the printenv output
=> printenv                                                                     
arch=arm                                                                        
args_fit=setenv bootargs console=${console}                                     
args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUI
D=${uuid} rw rootfstype=${mmcrootfstype}                                        
autoload== no                                                                   
baudrate=115200                                                                 
board=am335x                                                                    
board_name=A335X_SK                                                             
board_rev=1.2B                                                                  
board_serial=53124P197458                                                       
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefi
x}${script}; source ${scriptaddr}                                               
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ef
i/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${f
dt_addr_r};elsebootefi ${kernel_addr_r} ${fdtcontroladdr};fi                    
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} 
${prefix}extlinux/extlinux.conf                                                 
boot_fdt=try                                                                    
boot_fit=0                                                                      
boot_net_usb_start=usb start                                                    
boot_prefixes=/ /boot/                                                          
boot_script_dhcp=boot.scr.uimg                                                  
boot_scripts=boot.scr.uimg boot.scr                                             
boot_targets=mmc0 legacy_mmc0 mmc1 legacy_mmc1 nand0 pxe dhcp                   
bootcmd=if test ${boot_fit} -eq 1; then run update_to_fit;fi;run findfdt; run in
it_console; run envboot; run distro_bootcmd                                     
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; 
then source ${scriptaddr}; fi                                                   
bootcmd_legacy_mmc0=setenv mmcdev 0; setenv bootpart 0:2 ; run mmcboot          
bootcmd_legacy_mmc1=setenv mmcdev 1; setenv bootpart 1:2 ; run mmcboot          
bootcmd_mmc0=setenv devnum 0; run mmc_boot                                      
bootcmd_mmc1=setenv devnum 1; run mmc_boot                                      
bootcmd_nand=run nandboot                                                       
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi         
bootcount=1                                                                     
bootdelay=2                                                                     
bootdir=/boot                                                                   
bootenvfile=uEnv.txt                                                            
bootfile=boot.scr.uimg                                                          
bootm_size=0x10000000                                                           
bootpart=1:2                                                                    
bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}    
console=ttyO0,115200n8                                                          
cpu=armv7                                                                       
devnum=1                                                                        
devtype=mmc                                                                     
dfu_alt_info_emmc=rawemmc raw 0 3751936                                         
dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x1
00;u-boot.img.raw raw 0x300 0x400;spl-os-args.raw raw 0x80 0x80;spl-os-image.raw
 raw 0x900 0x2000;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uE
nv.txt fat 0 1                                                                  
dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.bac
kup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part
 0 9                                                                            
dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramdi
sk ram 0x81000000 0x4000000                                                     
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done    
dnsip=10.0.0.55                                                                 
efi_dtb_prefixes=/ /dtb/ /dtb/current/                                          
envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmc
dev};if run loadbootscript; then run bootscript;else if run loadbootenv; then ec
ho Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then
 echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;                                 
eth1addr=bc:6a:29:53:85:7b                                                      
ethact=ethernet@4a100000                                                        
ethaddr=bc:6a:29:53:85:7a                                                       
fdt_addr_r=0x88000000                                                           
fdtaddr=0x88000000                                                              
fdtcontroladdr=8ef282f8                                                         
fdtfile=am335x-evmsk.dtb                                                        
fileaddr=82000000                                                               
filesize=351048                                                                 
findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi;
 if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; i
f test $board_name = BBG1; then setenv fdtfile am335x-bonegreen.dtb; fi; if test
 $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_
name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $board_name =
 A335_ICE; then setenv fdtfile am335x-icev2.dtb; fi; if test $fdtfile = undefine
d; then echo WARNING: Could not determine device tree to use; fi;               
finduuid=part uuid mmc ${bootpart} uuid                                         
fit_bootfile=fitImage.itb                                                       
fit_loadaddr=0x88000000                                                         
gatewayip=10.0.0.254                                                            
importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${
loadaddr} ${filesize}                                                           
init_console=if test $board_name = A335_ICE; then setenv console ttyO3,115200n8;
else setenv console ttyO0,115200n8;fi;                                          
ipaddr=10.0.0.197                                                               
kernel_addr_r=0x82000000                                                        
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix
}${efi_fdtfile}                                                                 
loadaddr=0x82000000                                                             
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}                    
loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr                          
loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}            
loadfit=run args_fit; bootm ${loadaddr}#${fdtfile};                             
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}        
loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz                             
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_pa
rt; fi                                                                          
mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; if mmc r
escan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then if test
 ${boot_fit} -eq 1; then run loadfit; else run mmcloados;fi;fi;fi;              
mmcdev=1                                                                        
mmcloados=run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; the
n if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} 
= try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;  
mmcrootfstype=ext4 rootwait                                                     
mtdids=nand0=nand.0                                                             
mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.bac
kup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.
u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)   
nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfsty
pe=${nandrootfstype}                                                            
nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-b
oot-spl-os; nand read ${loadaddr} NAND.kernel; bootz ${loadaddr} - ${fdtaddr}   
nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048                           
nandrootfstype=ubifs rootwait=1                                                 
netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${se
rverip}:${rootpath},${nfsopts} rw ip=dhcp                                       
netboot=echo Booting from network ...; setenv autoload no; dhcp; run netloadimag
e; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}                  
netloadfdt=tftp ${fdtaddr} ${fdtfile}                                           
netloadimage=tftp ${loadaddr} ${bootfile}                                       
netmask=255.255.255.0                                                           
nfsopts=nolock                                                                  
partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_
gpt_rootfs}                                                                     
pxefile_addr_r=0x80100000                                                       
ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype
=${ramrootfstype}                                                               
ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} 
${fdtaddr}                                                                      
ramdisk_addr_r=0x88080000                                                       
ramroot=/dev/ram0 rw                                                            
ramrootfstype=ext2                                                              
rdaddr=0x88080000                                                               
rootpath=/export/rootfs                                                         
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_scrip
ts; done;run scan_dev_for_efi;                                                  
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env ex
ists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fs
type ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_b
oot; fi; done                                                                   
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "$
{soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix i
n ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${p
refix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${dev
num}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable medi
a binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: contin
uing...; fi; setenv efi_fdtfile                                                 
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefi
x}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run b
oot_extlinux; echo SCRIPT FAILED: continuing...; fi                             
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${d
evnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${pr
efix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done  
scriptaddr=0x80000000                                                           
serverip=10.0.0.55                                                              
soc=am33xx                                                                      
spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype
=${spirootfstype}                                                               
spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read 
${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}                      
spibusno=0                                                                      
spiimgsize=0x362000                                                             
spiroot=/dev/mtdblock4 rw                                                       
spirootfstype=jffs2                                                             
spisrcaddr=0xe0000                                                              
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off        
stderr=serial@44e09000                                                          
stdin=serial@44e09000                                                           
stdout=serial@44e09000                                                          
update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}  
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_
for_boot_part; fi                                                               
usbnet_devaddr=de:ad:be:ef:00:01                                                
vendor=ti                                                                       
ver=U-Boot 2016.05-00319-gcf14e63-dirty (May 23 2017 - 10:40:38 -0400)          
                                                                                
Environment size: 8792/131068 bytes                                             
<am335x_evm.h>
<Rules.make>
<setup-minicom.sh>
I browsed the e2e.ti forum, none of the related posts provide a workable solution.
Could anybody help to figure out what’s the problem? If you need any other information, please let me know. Thank you very much.
  • Hi,
    I think you need to enable CONFIG_EARLY_PRINTK too along CONFIG_DEBUG_LL  and also bootargs of earlyprintk with for seeing early prints.

  • Hi,

    In addition I see:
    bootfile=boot.scr.uimg

    SDK03.03 uses zImage as a boot file... How did you build your kernel?

    Best Regards,
    Yordan
  • Hi Yordan,
    Yes, this is strange. I use the original installation package (evm sdk 3.3.0.4) and the parameters are most set by it. I manually set it to zImage in my bootcmd.
  • Hi Dwarakesh,
    In case someone else met the same problem as me , I would introduce more information about these Config parameter.
    In board_support/linux-4.4..../ running make menuconfig, I can not find Debug_LL. In fact, developer needs to enable it in board_support/linux-4.4.../arch/arm/configs/tisdk_am335x-evm_defconfig

    After I enable Debug_LL, I can see booting procedure on the touch screen, not on the minicom, so I guess it's the output port being wrong. Do you have any idea of this?

    Then I followed your instruction to enable early_printk in 'make menuconfig ', I got same result as only enable Debug_LL. It suggests that the main problem of not seeing any printing on minicom is the wrong print port.

    Also the big difference I made that cause Debug_LL to print something is the configuration in board_support/u-boot.../include/configs/am335x-evm.h. Previously, my CONFIG_BOOTCOMMAND looks like this. The bootm/bootz cause stuck at 'Starting kernel' and nothing been printed even DEBUG_LL is enable. 

    #define CONFIG_BOOTCOMMAND \

        "setenv autoload no; "                    \

        "setenv serverip 10.0.0.132; "                \

        "dhcp; "                \

        "tftp 0x81000000 10.0.0.132:uImage"                \

        "bootm 0x81000000"

    I studied the setupBoard.minicom, find out it use fdtfile and fdtaddr. So I changed the CONFIG_BOOTCOMMAND as 

    #define CONFIG_BOOTCOMMAND \

        "if test ${boot_fit} -eq 1; then "    \

            "run update_to_fit;"    \

        "fi;"    \

        "run findfdt; " \

        "run init_console; " \

        "run envboot; " \

        "dhcp;"    \ ??dhcp will change serverip to DHCP server, and cause tftp downloading from DHCP server, must be put be for set serverip

        "setenv autoload no; "    \

        "setenv boot_net_usb_start true;" \

        "setenv serverip 10.0.0.132; "    \

        "setenv rootpath '/home/xx/ti-processor-sdk-linux-am335x-evm-03.03.00.04/targetNFS';"\

        "setenv bootfile zImage;"\

        "setenv nfsopts 'nolock,v3,tcp,rsize=4096,wsize=4096';"\

        "tftp ${loadaddr} zImage;"\

        "tftp ${fdtaddr} ${fdtfile};"\

        "bootz ${loadaddr} - ${fdtaddr}"

    fdtfile(defined in u-boot/include/configs/am335x-evm.h) is u-boot/arch/arm/dts/am335x-evmsk.dtb, which won't change while rebuild u-boot-spl

    loadaddr = 0x82000000

    fdtadr = 0x88000000

    And finally I saw some printing, means bootz should not run from ${loadaddr}, but run from ${loadaddr} - ${fdtaddr}. I will look into this for an explanation later. 

  • Hi,

    Have you started getting logs in the UART from kernel boot ? Additional logs ? I don't suspect port.

    ${loadaddr} - ${fdtaddr}

    Here the zImage is loaded at loadaddr and the device tree is specified as fdtaddr. - between these two values is not minus, but it means Ramdisk image is not being used.
  • Hi,

    I didn't get any log through UART. I didn't see the "Uncompressing Linux.. ok, booting the kernel " message on minicom. What I can see is only on the touch screen when the kernel starts booting.

  • Can you telnet into the Board and check logs ?
  • Now I can get the printing on minicom, by add earlyprintk in bootargs. Previously, I only enable it in "make menuconfig". Thank you for your suggestion.