BeagleBone Black - Building Custom Kernel

612 views
Skip to first unread message

Bharath R

unread,
Dec 19, 2015, 3:29:27 PM12/19/15
to BeagleBoard

Hello,

I'm trying to build a custom kernel for BBB using the source code from https://github.com/beagleboard/linux/tree/3.8 .

I did
1. make clean
2.
make ARCH=arm CROSS_COMPILE=arm-linux- bb.org_defconfig
3. make ARCH=arm CROSS_COMPILE=arm-linux-

using tftpboot I downloaded the Linux uImage to 0x82000000 address and run using bootm 0x82000000.

U-boot~# bootm 81000000 82000000
## Booting kernel from Legacy Image at 81000000 ...
   Image Name:   Embedded Linux-BBB
   Created:      2015-12-19  17:12:31 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    9234816 Bytes = 8.8 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK

Starting Linux kernel...

after the above message, kernel hangs. I believe the problem is due missing of debug serial port.

When I tried to configure the debug serial port i.e., UART1 in make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig
I don't find any UART here.


This particular support should've been in Kconfig but I didn't find that. Can anyone please guide me how I could build the running kernel.

Regards,
Bharath
 

Robert Nelson

unread,
Dec 19, 2015, 4:53:14 PM12/19/15
to Beagle Board, Bharath R
On Sat, Dec 19, 2015 at 2:29 PM, Bharath R <r.bhar...@gmail.com> wrote:

Hello,

I'm trying to build a custom kernel for BBB using the source code from https://github.com/beagleboard/linux/tree/3.8 .

I did
1. make clean
2.
make ARCH=arm CROSS_COMPILE=arm-linux- bb.org_defconfig
3. make ARCH=arm CROSS_COMPILE=arm-linux-

using tftpboot I downloaded the Linux uImage to 0x82000000 address and run using bootm 0x82000000.

U-boot~# bootm 81000000 82000000
## Booting kernel from Legacy Image at 81000000 ...
   Image Name:   Embedded Linux-BBB
   Created:      2015-12-19  17:12:31 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    9234816 Bytes = 8.8 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK

Starting Linux kernel...

after the above message, kernel hangs. I believe the problem is due missing of debug serial port.

and where exactly did you load the device tree blob?

This isn't exactly new, as ever since the 3.8.x kernel came out.. (2013-02-18) we've been using device tree's by DEFAULT on the beaglebone black..

So again, 

Regards,

--
Robert Nelson
https://rcn-ee.com/

Bharath R

unread,
Dec 20, 2015, 8:14:20 AM12/20/15
to BeagleBoard
Hello Robert,

Thank you for your quick reply. I'm downloading the Kernel at address 0x81000000 and fdt at address 0x82000000. I'm downloading the default dtb found under arch/arm/boot/dts/am335x-boneblack.dtb

This is log:

U-boot~# tftp 81000000 uImage
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.7; our IP address is 192.168.1.10
Filename 'uImage'.
Load address: 0x81000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #############################################
         274.4 KiB/s
done
Bytes transferred = 9234880 (8ce9c0 hex)
U-boot~# tftpboot 82000000 bb.dtb
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.7; our IP address is 192.168.1.10
Filename 'bb.dtb'.
Load address: 0x82000000
Loading: ##
         238.3 KiB/s
done
Bytes transferred = 26118 (6606 hex)
U-boot~# bootm 81000000 - 82000000

## Booting kernel from Legacy Image at 81000000 ...
   Image Name:   Embedded Linux-BBB
   Created:      2015-12-19  17:12:31 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    9234816 Bytes = 8.8 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 82000000
   Booting using the fdt blob at 0x82000000
   Loading Kernel Image ... OK
   Loading Device Tree to 8fff6000, end 8ffff605 ... OK

Starting kernel ...

after this, I don't get any log messages.

I've tried downloading the kernel at location 0x80008000 as well, but no success.
I'm expecting some log messages with Kernel panic, since I've not loaded initrd.

Regards,
Bharath

Bharath R

unread,
Dec 20, 2015, 2:26:20 PM12/20/15
to BeagleBoard
Dear Robert,

I've flash the new debian image with kernel version 3.8.13 to 4GB eMMC of BBB and retrieved the am335x-boneblack.dtb and tried to run my kernel with this .dtb but same result. when I saw the difference between the dtb that i've build and the one found in debian (eMMC), both seem to be same. Since I'm booting the kernel and fdt via tftpboot, do I've to change anything in u-boot env variables or bootargs? I'm stuck in this from past 1 week.

Please help me, so that I can jump this hurdle.

Regards,
Bharath

John Syne

unread,
Dec 20, 2015, 3:19:11 PM12/20/15
to beagl...@googlegroups.com
I’m using the ti 4.1 kernel and I use both TFTP and NFS. Robert has already setup everything you need to to do what you want. The only critical piece is the “client_ip” line to use NFS. 

Here is my uEnv.txt file

uname_r=4.1.12-ti-r25


##SERVER: sudo apt-get install tftpd-hpa
##SERVER: TFTP_DIRECTORY defined in /etc/default/tftpd-hpa
##SERVER: zImage/*.dtb need to be located here:
##SERVER: TFTP_DIRECTORY/zImage
##SERVER: TFTP_DIRECTORY/dtbs/*.dtb

#cmdline=init=/lib/systemd/systemd 
#cmdline=quiet init=/lib/systemd/systemd 
#cmdline=ftrace=function_graph trace_buffer_size=100000 FTRACE
#cmdline=init=/lib/sysvinit/init

##client_ip needs to be set for u-boot to try booting via nfs

client_ip=10.100.116.105

#u-boot defaults: uncomment and override where needed

server_ip=10.100.116.100
gw_ip=10.100.116.1
netmask=255.255.255.0
#hostname=
#device=eth0
#autoconf=off
root_dir=/home/john/targetNFS
#nfs_options=,vers=3
#nfsrootfstype=ext4 rootwait fixrtc

dtb=am335x-boneblack.dtb

Regards,
John




--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bharath R

unread,
Dec 22, 2015, 12:22:22 PM12/22/15
to BeagleBoard
hello John,

I'm using Kernel 3.8.13, and I don't want to change to other kernel version.
From u-boot, I'm able to use tftpboot and download the uImage or zImage and am335x-boneblack.dtb at 0x82000000 and 0x83000000 respectively. No issues in that.

Till now I was using the uImage and zImage created by vmlinux using following commands:

arm-linux-gnueabihf-objcopy -O binary vmlinux linux.bin
mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Embedded Linux-BBB" -d linux.bin uImage
gzip -9 linux.bin
mkimage -A arm -O linux -T kernel -C gzip -a 0x80008000 -e 0x80008000 -n "Embedded Linux-BBB" -d linux.bin.gz zImage

the above uImage(size 8.8MB) starts giving the following log and hangs when I do bootm 0x82000000 - 0x83000000
log:
Booting kernel from Legacy Image at 82000000 ...

   Image Name:   Embedded Linux-BBB
   Created:      2015-12-19  17:12:31 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    9234816 Bytes = 8.8 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK

Starting Linux kernel...

--------------------------------------------------------------------------------------------------------------------------------------

the zImage(size 4.8MB) created above gives bad magic when I do bootz 0x82000000 - 0x83000000
log:
bootz 82000000 - 83000000
Bad Linux ARM zImage magic!

--------------------------------------------------------------------------------------------------------------------------------------

But when I use the zImage(size 5.4MB) from arch/arm/boot/zImage and do bootz 0x82000000 - 0x83000000 the BBB restarts,
log:
=> bootz 82000000 - 83000000
Kernel image @ 0x82000000 [ 0x000000 - 0x54e2a0 ]
data abort
pc : [<9ff6fcc0>]          lr : [<9ff6fd1d>]
reloc pc : [<8080ecc0>]    lr : [<8080ed1d>]
sp : 9ef40cd0  ip : 0000000f     fp : 00000003
r10: 9ffa4d30  r9 : 9ef40ed8     r8 : 9ffa4d2c
r7 : 00000002  r6 : 9ef46944     r5 : 00000000  r4 : 00000000
r3 : 00000000  r2 : 9ffa4c94     r1 : 9ef46944  r0 : 00000000
Flags: nZcv  IRQs off  FIQs on  Mode SVC_32
Resetting CPU ...

resetting ...

U-Boot SPL 2015.10-dirty (Dec 21 2015 - 23:20:26)
reading u-boot.img
reading u-boot.img


U-Boot 2015.10-dirty (Dec 21 2015 - 23:20:26 +0530)

       Watchdog enabled
I2C:   ready
DRAM:  512 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Net:   cpsw, usb_ether
Hit any key to stop autoboot:  0


One notable thing is zImage which I've created using mkimage is 4.8MB but the zImage in arch/arm/boot/ is 5.4MB

This is all the info I've got. If you request for more info, I can give that.

Can anyone please help me with this? I've been stuck in this from past 2 weeks. Any inputs from anyone is highly appreciated.

With best regards,
Bharath

Robert Nelson

unread,
Dec 22, 2015, 12:29:31 PM12/22/15
to Beagle Board, Bharath R
On Tue, Dec 22, 2015 at 11:22 AM, Bharath R <r.bhar...@gmail.com> wrote:
> hello John,
>
> I'm using Kernel 3.8.13, and I don't want to change to other kernel version.
> From u-boot, I'm able to use tftpboot and download the uImage or zImage and
> am335x-boneblack.dtb at 0x82000000 and 0x83000000 respectively. No issues in
> that.
>
> Till now I was using the uImage and zImage created by vmlinux using
> following commands:

Well... "vmlinuz" = "zImage"..

Just throw away "mkimage" you don't need it..

Just boot the kernel's version of "vmlinuz", we usually rename it
"zImage" because everyone got use to the "uImage" name..

Robert Nelson

unread,
Dec 22, 2015, 12:31:39 PM12/22/15
to Beagle Board, Bharath R
and use the address's:

bootz 0x82000000 - 0x88000000

so you don't over write zImage in memory..
Reply all
Reply to author
Forward
0 new messages