Building kernel SM-T525

Search This thread

vanyas

Member
Dec 17, 2011
33
14
Vladivostok
Instruction to build a kernel from Samsung Sources:

1. Download and unpack source from http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=sm-t525

2. Download and upack android ndk from https://developer.android.com/tools/sdk/ndk/index.html

3. Set enviroment varibles (use gcc 4.6, not 4.8):
export CROSS_COMPILE="~/android/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-"
export ARCH="arm"

4. If you want to add loadable modules support, apply patch modules_support.patch from attach
patch -p1 < modules_support.patch

5. Create kernel config
make VARIANT_DEFCONFIG=msm8974_sec_picassoeur_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig

6. Buld kernel

7. Buld device tree image
./tools/dtbTool -o dt.img -s 2048 -p ./scripts/dtc/ ./arch/arm/boot/

8. Buld boot.img (default ramdisk image in attach)
./tools/mkbootimg --kernel ./arch/arm/boot/zImage --ramdisk ramdisk.cpio.gz --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' --base 0x00000000 --pagesize 2048 --ramdisk_offset 0x02000000 --tags_offset 0x01E00000 --dt dt.img -o boot.img

9. Create .tar.md5 to flash with Odin
tar -H ustar -c boot.img > boot.tar
md5sum -t boot.tar >> boot.tar
mv boot.tar boot.tar.md5

10. To fix Wi-Fi edit build.prop on your device, change ro.securestorage.support fron true to false
ro.securestorage.support=false

GitHub: https://github.com/vanyasvl/android_kernel_samsung_picassoeur
 
Last edited:

thornev

Senior Member
Feb 3, 2012
499
111
Hudson Valley, NY
I'm not a builder, but when wifi doesn't work that usually means a mismatch between kernel and rom.

Sent from my SM-T320 using Tapatalk
 

crpalmer

Inactive Recognized Developer
Mar 25, 2011
2,999
8,280
Hello. I'm trying to build stock Samsung kernel for Tab Pro 10.1 Sm-T525 and I have a problem:<br />
Wi-fi isn't working on builded kernel. All kernel configs are default from Samsung, bluetooth and Lte works ok.<br />
<br />
I need help with debug wifi problem.<br />
"ip a" command shows wlan0 network device, but wifi can't be enabled from configuration<br />
<br />
My steps to build kernel:<br />
Download source from http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=sm-t525<br />
unpack it to ~/android/kernel<br />
<br />
cd ~/android/kernel<br />
export CROSS_COMPILE="/home/vanyas/android/android-ndk-r9d_x64/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-"<br />
export ARCH="arm"<br />
<br />
make VARIANT_DEFCONFIG=msm8974_sec_picassoeur_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig<br />
make -j3<br />
<br />
./tools/dtbTool -o dt.img -s 2048 -p ./scripts/dtc/ ./arch/arm/boot/<br />
<br />
unpack original boot.img with split_boot to boot folder<br />
<br />
./tools/mkbootimg --kernel ./arch/arm/boot/zImage --ramdisk boot/boot.img-ramdisk.cpio.gz --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' --base 0x00000000 --pagesize 2048 --ramdisk_offset 0x02000000 --tags_offset 0x01E00000 --dt dt.img -o boot.img<br />
<br />
tar -H ustar -c boot.img > boot.tar<br />
md5sum -t boot.tar >> boot.tar<br />
mv boot.tar boot.tar.md5

For the sm-t320, the kernel is built with version checks on the modules. This is what I did to allow the wlan module to load:

https://github.com/crpalmer/android...mmit/76275b29746dfeab37efeab6c2787af9acd3394c

You'd obviously need to specify the right version string (it should be in the output of dmesg if this is why your wlan isn't working).

Also, if you plan on sharing the kernel, you should zip the .tar.md5 file as I had problems with it failing to flash after downloading when I released just a .tar.md5.
 
  • Like
Reactions: hertzschi

vanyas

Member
Dec 17, 2011
33
14
Vladivostok
For the sm-t320, the kernel is built with version checks on the modules. This is what I did to allow the wlan module to load:

https://github.com/crpalmer/android...mmit/76275b29746dfeab37efeab6c2787af9acd3394c

You'd obviously need to specify the right version string (it should be in the output of dmesg if this is why your wlan isn't working).

Also, if you plan on sharing the kernel, you should zip the .tar.md5 file as I had problems with it failing to flash after downloading when I released just a .tar.md5.
Thanks, but it is not a module load problem. SM-T525 kernel builds without modules support and wifi driver (bcm4339) compilled into the kernel.
 
Last edited:

crpalmer

Inactive Recognized Developer
Mar 25, 2011
2,999
8,280
Thanks, but it is not a module load problem. SM-T525 kernel builds without modules support and wifi driver (bcm4339) compilled into the kernel.

That's interesting. The sm-t320 is a prima chipset which is built as a module.

Do you see anything in the logcat or the dmesg related to the wlan, bcm4339, wifi, etc?
 

vanyas

Member
Dec 17, 2011
33
14
Vladivostok
There are patches for SM-T525 kernel source that resolve problem with "modules support" compilation
--- kernel_orig/arch/arm/mm/proc-syms.c 2014-04-09 12:10:04.846114000 +1100
+++ kernel/arch/arm/mm/proc-syms.c 2014-04-09 11:54:33.894114000 +1100
@@ -18,7 +18,6 @@
#ifndef MULTI_CPU
EXPORT_SYMBOL(cpu_dcache_clean_area);
EXPORT_SYMBOL(cpu_set_pte_ext);
-EXPORT_SYMBOL(cpu_tima_set_pte_ext);
#else
EXPORT_SYMBOL(processor);
#endif
--- kernel_orig/arch/arm/mach-msm/sec-switch.c 2014-01-23 15:34:20.000000000 +1100
+++ kernel/arch/arm/mach-msm/sec-switch.c 2014-04-09 11:29:26.322114000 +1100
@@ -2565,7 +2565,7 @@
pr_info("%s: Ignore Cable setting, Not LPM mode\n", __func__);
}
}
-EXPORT_SYMBOL(fsa9485_set_mhl_cable)
+EXPORT_SYMBOL(fsa9485_set_mhl_cable);

boon fsa9485_muic_is_mhl_attached(void)
{
--- kernel_orig/Makefile 2014-01-23 15:34:19.000000000 +1100
+++ kernel/Makefile 2014-04-09 20:55:48.278114000 +1100
@@ -351,7 +351,7 @@

CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void $(CF)
-CFLAGS_MODULE =
+CFLAGS_MODULE = -fno-pic
AFLAGS_MODULE =
LDFLAGS_MODULE =
CFLAGS_KERNEL =
 
Last edited:

starbright_

Senior Member
Apr 11, 2010
1,471
262
@Silkmeister1, @Scott, @vanyas, @crpalmer:

I do have a WiFi/BT issue with my (second hand) device. Wifi/BT is not to be enabled in Android. My first suspect was a broken connection, but couldn't found something obvious.
I tried to update Stock Rom and found and issue with ODIN. Stock Rom was not installable, returns with size error in hidden image. (??? what is in there ???). Installed latest LOS and checked the boot messages.
Do you think this can be a software issue? Is there anything missing (stuff in hidden partition) ?

Code:
failed to power up wifi chip, retry again (4 left) **

[    4.035535] ## wifi_remove
[    4.035538] wifi_set_power = 0
[    4.035541] ------------------------------------------------
[    4.035542] ------------------------------------------------
[    4.035544] brcm_wlan_power Enter: power off
[    4.035548] WL_REG_ON off-step : [1]
[    4.035554] WL_REG_ON off-step-2 : [0]
[    4.139482] wifi_set_carddetect = 0
[    4.139485] brcm_wifi_status:359 status 0
[    4.139487] mmc0: Slot status change detected (1 -> 0)
[    4.139870] wifi_set_power = 1
[    4.139873] ------------------------------------------------
[    4.139874] ------------------------------------------------
[    4.139876] brcm_wlan_power Enter: power on
[    4.139880] WL_REG_ON on-step : [0]
[    4.139887] WL_REG_ON on-step-2 : [1]
[    4.349477] wifi_set_carddetect = 1
[    4.349480] brcm_wifi_status:359 status 1

…

Complete bootlog can be seen here in the attachment:
https://xdaforums.com/showpost.php?p=72624259&postcount=213

Any help is welcome!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    Instruction to build a kernel from Samsung Sources:

    1. Download and unpack source from http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=sm-t525

    2. Download and upack android ndk from https://developer.android.com/tools/sdk/ndk/index.html

    3. Set enviroment varibles (use gcc 4.6, not 4.8):
    export CROSS_COMPILE="~/android/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-"
    export ARCH="arm"

    4. If you want to add loadable modules support, apply patch modules_support.patch from attach
    patch -p1 < modules_support.patch

    5. Create kernel config
    make VARIANT_DEFCONFIG=msm8974_sec_picassoeur_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig

    6. Buld kernel

    7. Buld device tree image
    ./tools/dtbTool -o dt.img -s 2048 -p ./scripts/dtc/ ./arch/arm/boot/

    8. Buld boot.img (default ramdisk image in attach)
    ./tools/mkbootimg --kernel ./arch/arm/boot/zImage --ramdisk ramdisk.cpio.gz --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' --base 0x00000000 --pagesize 2048 --ramdisk_offset 0x02000000 --tags_offset 0x01E00000 --dt dt.img -o boot.img

    9. Create .tar.md5 to flash with Odin
    tar -H ustar -c boot.img > boot.tar
    md5sum -t boot.tar >> boot.tar
    mv boot.tar boot.tar.md5

    10. To fix Wi-Fi edit build.prop on your device, change ro.securestorage.support fron true to false
    ro.securestorage.support=false

    GitHub: https://github.com/vanyasvl/android_kernel_samsung_picassoeur
    3
    There are patches for SM-T525 kernel source that resolve problem with "modules support" compilation
    --- kernel_orig/arch/arm/mm/proc-syms.c 2014-04-09 12:10:04.846114000 +1100
    +++ kernel/arch/arm/mm/proc-syms.c 2014-04-09 11:54:33.894114000 +1100
    @@ -18,7 +18,6 @@
    #ifndef MULTI_CPU
    EXPORT_SYMBOL(cpu_dcache_clean_area);
    EXPORT_SYMBOL(cpu_set_pte_ext);
    -EXPORT_SYMBOL(cpu_tima_set_pte_ext);
    #else
    EXPORT_SYMBOL(processor);
    #endif
    --- kernel_orig/arch/arm/mach-msm/sec-switch.c 2014-01-23 15:34:20.000000000 +1100
    +++ kernel/arch/arm/mach-msm/sec-switch.c 2014-04-09 11:29:26.322114000 +1100
    @@ -2565,7 +2565,7 @@
    pr_info("%s: Ignore Cable setting, Not LPM mode\n", __func__);
    }
    }
    -EXPORT_SYMBOL(fsa9485_set_mhl_cable)
    +EXPORT_SYMBOL(fsa9485_set_mhl_cable);

    boon fsa9485_muic_is_mhl_attached(void)
    {
    --- kernel_orig/Makefile 2014-01-23 15:34:19.000000000 +1100
    +++ kernel/Makefile 2014-04-09 20:55:48.278114000 +1100
    @@ -351,7 +351,7 @@

    CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
    -Wbitwise -Wno-return-void $(CF)
    -CFLAGS_MODULE =
    +CFLAGS_MODULE = -fno-pic
    AFLAGS_MODULE =
    LDFLAGS_MODULE =
    CFLAGS_KERNEL =
    2
    Yes! I did it!
    To fix wifi: ro.securestorage.support=false in build.prop
    1
    Hello. I'm trying to build stock Samsung kernel for Tab Pro 10.1 Sm-T525 and I have a problem:<br />
    Wi-fi isn't working on builded kernel. All kernel configs are default from Samsung, bluetooth and Lte works ok.<br />
    <br />
    I need help with debug wifi problem.<br />
    "ip a" command shows wlan0 network device, but wifi can't be enabled from configuration<br />
    <br />
    My steps to build kernel:<br />
    Download source from http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=sm-t525<br />
    unpack it to ~/android/kernel<br />
    <br />
    cd ~/android/kernel<br />
    export CROSS_COMPILE="/home/vanyas/android/android-ndk-r9d_x64/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-"<br />
    export ARCH="arm"<br />
    <br />
    make VARIANT_DEFCONFIG=msm8974_sec_picassoeur_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig<br />
    make -j3<br />
    <br />
    ./tools/dtbTool -o dt.img -s 2048 -p ./scripts/dtc/ ./arch/arm/boot/<br />
    <br />
    unpack original boot.img with split_boot to boot folder<br />
    <br />
    ./tools/mkbootimg --kernel ./arch/arm/boot/zImage --ramdisk boot/boot.img-ramdisk.cpio.gz --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' --base 0x00000000 --pagesize 2048 --ramdisk_offset 0x02000000 --tags_offset 0x01E00000 --dt dt.img -o boot.img<br />
    <br />
    tar -H ustar -c boot.img > boot.tar<br />
    md5sum -t boot.tar >> boot.tar<br />
    mv boot.tar boot.tar.md5

    For the sm-t320, the kernel is built with version checks on the modules. This is what I did to allow the wlan module to load:

    https://github.com/crpalmer/android...mmit/76275b29746dfeab37efeab6c2787af9acd3394c

    You'd obviously need to specify the right version string (it should be in the output of dmesg if this is why your wlan isn't working).

    Also, if you plan on sharing the kernel, you should zip the .tar.md5 file as I had problems with it failing to flash after downloading when I released just a .tar.md5.
    1
    I'm not a builder, but when wifi doesn't work that usually means a mismatch between kernel and rom.

    Sent from my SM-T320 using Tapatalk

    I am a builder and what he said is correct.

    Samsung did some crazy stuff with Knox.