Kernelupdate in runtime

  • Yes, that is possible.
    You need set modify the bootargs/mtdparts like that (see the access rights for Kernel) - this line is from PicoMOD7A, pls set appropriate for your PicoMOD7:

    Code
    1. mtdparts=fsnand1:256k(NBoot)ro;fsnand0:512k@256k(UBoot)ro,256k(UBootEnv)ro,4m(UserDef),3m(Kernel),-(TargetFS)


    In Buildroot you need to add tools to busybox with:

    Code
    1. make busybox-menuconfig


    and add:

    Code
    1. CONFIG_NANDWRITE and CONFIG_FLASH_ERASEALL


    Then with the new rootfs and the corresponding bootargs you can update Linux Kernel Image from the serial command line (Linux) like:

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • I have the flash_eraseall and nandwrite commands running. On /dev/mtd3 I have no write access (I removed the "ro" flag behind the Kernel definition).


    When looking to the mtdparts again I see NBoot 128k,UBoot 512k,UBootEnv 128k,UserDef 512k,Kernel 4M,TargetFS.


    Is it correct that the Kernel must be /dev/mtd4 instead of /dev/mtd3? If yes how do I create the mtd4 and mtdblock4 devices?


    Kind regards...

  • Take a look at the debug output (again this is PicoMOD7A):


    Creating 5 MTD partitions on "fsnand0":
    0x000000040000-0x0000000c0000 : "UBoot"
    0x0000000c0000-0x000000100000 : "UBootEnv"
    0x000000100000-0x000000500000 : "UserDef"
    0x000000500000-0x000000800000 : "Kernel"
    0x000000800000-0x000008000000 : "TargetFS"


    You see 0=UBoot .. 3=Kernel


    # cat /sys/class/mtd/mtd3/name
    Kernel


    Pls search for 'Kernel' and use the corresponding mtd*

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • On my device there are 6 partitions. I have an additional NBoot partition 0. So the Kernel is /dev/mtd4 but there's no mtd4 device in the /dev directory. I have created a device:

    Code
    1. mknod /dev/mtd4 c 90 8
    2. mknod mtdblock4 b 31 4


    Now I can read the Kernel:

    Code
    1. cp /dev/mtd4 /root/Kernel.dat


    but writing is not possible (even after chmod 664 /dev/mtd4)

    Code
    1. flash_eraseall: can't open '/dev/mtd4': Permission denied


    In my UBootEnv the mtdparts and bootargs are without the 'ro' flag after the Kernel definition.

  • Code
    1. # cat /sys/class/mtd/mtd4/name
    2. Kernel
    3. # ls -lah /dev/mtd4
    4. crw-rw---- 1 root root 90, 8 Jan 1 00:00 /dev/mtd4
    5. # flash_eraseall -j /dev/mtd4
    6. Erasing 128 Kibyte @ 400000 - 100% complete.Cleanmarker written at 3e0000.


    Please make sure your bootargs look like (and run 'saveenv' to save modifications):

    Code
    1. Kernel command line: console=ttySAC2,38400 mtdparts=qba8nand0:128k(NBoot)ro,512k(UBoot)ro,128k(UBootEnv)ro,512k(UserDef),4m(Kernel),-(TargetFS) init=linuxrc root=/dev/nfs rw nfsroot=/rootfs ip=10.0.0.27:10.0.0.74:10.0.0.5:255.255.255.0

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.