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.

Kernel Debug

Other Parts Discussed in Thread: OMAPL138

Hi,


I have got an issue with printing and not sure whats going on here and was wondering if anyone could shed some light on this.

In my defconfig file I have got the following enabled

CONFIG_DYNAMIC_DEBUG=y

CONFIG_DEBUG_LL=y

CONFIG_DEBUG_KERNEL=y

I have a board specific file in which on the top line I have got #define DEBUG define before #include files

My log level in prinkt.h is defined as

/* printk's without a loglevel use this.. */
#define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */

/* We show everything that is MORE important than this.. */
#define MINIMUM_CONSOLE_LOGLEVEL 1 /* Minimum loglevel we let people use */
#define DEFAULT_CONSOLE_LOGLEVEL 8 /* anything MORE serious than KERN_DEBUG */

When i print something in the board specific file using pr_debug nothing gets printed on terminal. I am not sure what I have done wrong here.

Would be great if anyone can help on this.

Regards

Ali

  • Hi Ali,

    Have you tried to use "dmesg" command ?

    Try to use simple "printk" in kernel driver or board file.

    printk("PRINT TEST\n");

  • Hi Titus,


    I have tried simple printk and that has not worked.

    I have not done the dmesg command can you guide me how to perform that.

    Regards

    Ali

  • Hi Ali,

    "dmesg" command is linux command which is used to print the messages from kernel.

    Ex:

    bash-3.2#

    bash-3.2#

    bash-3.2# dmesg
    [    0.000000] Linux version 3.2.0 (titus@Titus) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-201
    30313 - Linaro GCC 2013.03) ) #186 Mon Aug 18 19:44:18 IST 2014
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

  • Hi Titus,


    I have tried that to no avail. I have also tried the simple printk command as you mentioned but nothing seems to be printing. From the same board specific file I get other messages like

    printk(KERN_DEBUG "VAR_SOM_OM3X_enable_lcd\n");

    The above message gets printed but is defined in the subroutine which gets registered using API

    platform_add_devices(VAR_SOM_OM3X_devices, ARRAY_SIZE(VAR_SOM_OM3X_devices));

    What I have got defined is below lines at the start of my init routine

    static void __init VAR_SOM_OM3X_init(void)
    {
        printk("Board Init\n");
        printk(KERN_EMERG "Board Init KERN_EMERG\n");
        printk(KERN_ALERT "Board Init KERN_ALERT\n");
        printk(KERN_CRIT "Board Init KERN_CRIT\n");
        printk(KERN_ERR "Board Init KERN_ERR\n");
        printk(KERN_WARNING "Board Init KERN_WARNING\n");
        printk(KERN_NOTICE "Board Init KERN_NOTICE\n");
        printk(KERN_INFO "Board Init KERN_INFO\n");
        printk(KERN_DEBUG "Board Init KERN_DEBUG\n");

        omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);

    None of these get printed.

    Regards

    Ali

  • Hi Ali,

    Could you please share your complete bootup log (if you got something in console) and bootcmd & bootargs.

    Are you getting any console print messages after "uncompressing kernel" ?

    Just check your bootargs whether you are using any "silent" arg.

  • Hi Titus,


    Thanks for your reply. I have been away from office for few days hence was not able to reply quick. I think I have figured out the problem. I renamed some files and did not change my makefile and KConfig files which I have now changed. The problem was the old files were being pulled due to makefile being incorrect. Since I have changed my makefile it seems ok but the problem I now have is when I do a clean and then make of kernel I am getting error which is

    arm-eabi-ld: no machine record defined

    The only thing I have changed is the Kbuild file and defconfig file to include support for the custom board. The macro I have defined in _defconfig file is

    CONFIG_MACH_HAWKIII=y

    in place of the previous one. I have never seen this error before and kind of lost. Any help on this would be great.

    Thanks

    Ali

  • Hi Ali,

    Use "make mrproper" command then try to build kernel.

  • Hi Titus,


    I have just tried to do below but to no avail

    make ARCH=arm CROSS_COMPILE=arm-eabi- mr proper

    make ARCH=arm CROSS_COMPILE=arm-eabi- hawkIII_defconfig

    make ARCH=arm CROSS_COMPILE=arm-eabi- uImage

    Regards

    Ali

  • Sorry Typo error to above

    Hi Titus,


    I have just tried to do below but to no avail

    make ARCH=arm CROSS_COMPILE=arm-eabi- mrproper

    make ARCH=arm CROSS_COMPILE=arm-eabi- hawkIII_defconfig

    make ARCH=arm CROSS_COMPILE=arm-eabi- uImage

    Regards

    Ali

  • Hi Titus,

    On building the kernel the last few lines are before the error

      CC      lib/reciprocal_div.o
      CC      lib/rwsem-spinlock.o
      CC      lib/sha1.o
      CC      lib/show_mem.o
      CC      lib/string.o
      CC      lib/vsprintf.o
      AR      lib/lib.a
      LD      vmlinux.o
      MODPOST vmlinux.o
    WARNING: modpost: Found 3 section mismatch(es).
    To see full details build your kernel with:
    'make CONFIG_DEBUG_SECTION_MISMATCH=y'
      GEN     .version
      CHK     include/generated/compile.h
      UPD     include/generated/compile.h
      CC      init/version.o
      LD      init/built-in.o
      LD      .tmp_vmlinux1
    arm-eabi-ld: no machine record defined
    arm-eabi-ld: no machine record defined
    make: *** [.tmp_vmlinux1] Error 1

    Regards

    Ali

  • Hi Ali,

    The issue seems to be the toolchain issue.

    Have you got success before with this toolchain (arm-eabi-) for the same linux source ?

    Why don't you arago toolchain or provided by TI with SDK ?

    make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- clean

    make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- distclean

    make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- mrproper

    make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- hawkIII_defconfig

    make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- uImage

  • Hi Titus,

    yes it was working yesterday until I changed file names so I am not sure what went wrong in changing the file names. Its been working fine for the last 4 months.

    Regards

    Ali

  • Hi have just tried this and again same issue

    make ARCH=arm CROSS_COMPILE=arm-eabi- clean

    make ARCH=arm CROSS_COMPILE=arm-eabi- distclean

    make ARCH=arm CROSS_COMPILE=arm-eabi- mrproper

    make ARCH=arm CROSS_COMPILE=arm-eabi- hawkIII_defconfig

    make ARCH=arm CROSS_COMPILE=arm-eabi- uImage

     

    Regards

    Ali

  • Hi Ali,

    Okay.

    arm-eabi-ld: no machine record defined
    arm-eabi-ld: no machine record defined

    The error seems to be you have defined new BOARD and not declared properly.

    Like, Earlier you might used "omapl138_evm_defconfig"  and now you changed simply to "omapl138_titus_defconfig"

    then you might have get like  this error.

    http://en.wikipedia.org/wiki/User:WillWare/Leopardboard_DM368_hacking#Still_banging_on_GPIOs_and_LEDs

  • Hi Titus,

    Yes you are right something went seriously wrong when changing names. I followed the link you gave plus the

    http://free-electrons.com/doc/kernel-porting.pdf

    to get things back on tract again. What had happened was that when I did porting of omap3evm to our platform I just added stuff in the makefile regarding it but the issue was I also had to add stuff in Kbuild file plus the naming had to be same throughout all drives makefilefiles plus the Kbuild files.


    Thanks for your help and pointing in right direction it was really great.

    Regards

    Ali

  • Sorry Again typo. its not Kbuild its Kconfig files.

    Ali

  • Hi Ali,

    Thanks for your update.

    Good luck.