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.

DM36x IPNC 4.x - web update.cgi fails to write to flash?

Hardware is DM368 IPNC MT5 / LeopardBoard DM368.

Software is Appro IPNC SDK 4.x

I am hoping to use the web interface to update the kernel / root filesystem but for some reason it's not working. It seems to go through all the motions, but nothing gets updated.

So far I've only tried for root FS, can anyone help with either what I'm doing wrong or any hints as to the problem?

Using ipnc_dm368_ubifs image generated by the SDK, HTTP POSTed to update.cgi, the resulting web output (from update.cgi) looks like this (I removed a lot of repeated "gLastread.." lines:

i = 169
gLastRead : 512
    (Removed lines...)
gLastRead : 512
gLastRead : 319
File length = 22937600
File create success
Enter DoRootFileSysUpdate
File name ok
Writing data to block 0
Writing data to block 20000
      (Removed lines...)
Writing data to block 15c0000
hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
File system update success,
Firmware update success
Please Restart IPNC by Clicking on "Restart Camera" Button


However, on reboot, the filesys is not updated.  Enabling / adding some debug shows that there are problems writing the UBIFS volume:

 

Web page (update.cgi) outputs:

Enter DoRootFileSysUpdate
File name 'ipnc_dm368_ubifs' ok
CurrentImage = 1
Image = /dev/mtd3
Executing '/usr/sbin/flash_eraseall /dev/mtd3 > /tmp/tmpfile.txt '...
Fail on erase block
Unknown error

And the console log shows:

[  101.182523] UBIFS error (pid 706): ubifs_read_node: bad node type (255 but expected 1)
[  101.194401] UBIFS error (pid 706): ubifs_read_node: bad node at LEB 155:45480, LEB mapping status 1
[  101.208390] UBIFS error (pid 706): do_readpage: cannot read page 90 of inode 3099, error -22
[  101.229427] UBIFS error (pid 706): ubifs_read_node: bad node type (255 but expected 1)
[  101.242670] UBIFS error (pid 706): ubifs_read_node: bad node at LEB 155:45480, LEB mapping status 1
[  101.255841] UBIFS error (pid 706): do_readpage: cannot read page 90 of inode 3099, error -22
[  159.135896] UBIFS error (pid 606): ubifs_read_node: bad node type (255 but expected 2)
[  159.146911] UBIFS error (pid 606): ubifs_read_node: bad node at LEB 11:4360, LEB mapping status 1
[    7.886209] UBIFS error (pid 615): ubifs_read_node: bad node type (255 but expected 1)
[    7.895106] UBIFS error (pid 615): ubifs_read_node: bad node at LEB 17:32856, LEB mapping status 1
[    7.908446] UBIFS error (pid 615): do_readpage: cannot read page 123 of inode 512, error -22
[    7.929520] UBIFS error (pid 615): ubifs_read_node: bad node type (255 but expected 1)
[    7.941910] UBIFS error (pid 615): ubifs_read_node: bad node at LEB 17:32856, LEB mapping status 1
[    7.953358] UBIFS error (pid 615): do_readpage: cannot read page 123 of inode 512, error -22
[    7.982354] UBIFS error (pid 707): ubifs_read_node: bad node type (255 but expected 1)
[    7.992885] UBIFS error (pid 707): ubifs_read_node: bad node at LEB 14:11976, LEB mapping status 1
[    8.002756] UBIFS error (pid 707): do_readpage: cannot read page 0 of inode 504, error -22
INIT: cannot execute "/sbin/getty"
[    8.040568] UBIFS error (pid 708): ubifs_read_node: bad node type (255 but expected 1)
[    8.050441] UBIFS error (pid 708): ubifs_read_node: bad node at LEB 14:11976, LEB mapping status 1
[    8.062066] UBIFS error (pid 708): do_readpage: cannot read page 0 of inode 504, error -22
INIT: cannot execute "/sbin/getty"
[    8.095280] UBIFS error (pid 709): ubifs_read_node: bad node type (255 but expected 1)
[    8.107994] UBIFS error (pid 709): ubifs_read_node: bad node at LEB 14:11976, LEB mapping status 1
[    8.119239] UBIFS error (pid 709): do_readpage: cannot read page 0 of inode 504, error -22
INIT: cannot execute "/sbin/getty"
[    8.152909] UBIFS error (pid 710): ubifs_read_node: bad node type (255 but expected 1)
[    8.163071] UBIFS error (pid 710): ubifs_read_node: bad node at LEB 14:11976, LEB mapping status 1
[    8.175289] UBIFS error (pid 710): do_readpage: cannot read page 0 of inode 504, error -22
INIT: cannot execute "/sbin/getty"
[    8.208625] UBIFS error (pid 711): ubifs_read_node: bad node type (255 but expected 1)
[    8.219844] UBIFS error (pid 711): ubifs_read_node: bad node at LEB 14:11976, LEB mapping status 1
[    8.229699] UBIFS error (pid 711): do_readpage: cannot read page 0 of inode 504, error -22
INIT: cannot execute "/sbin/getty"
[    8.262127] UBIFS error (pid 712): ubifs_read_node: bad node type (255 but expected 1)
[    8.275293] UBIFS error (pid 712): ubifs_read_node: bad node at LEB 14:11976, LEB mapping status 1
[    8.286480] UBIFS error (pid 712): do_readpage: cannot read page 0 of inode 504, error -22
INIT: cannot execute "/sbin/getty"
[    8.319086] UBIFS error (pid 713): ubifs_read_node: bad node type (255 but expected 1)
[    8.329203] UBIFS error (pid 713): ubifs_read_node: bad node at LEB 14:11976, LEB mapping status 1
[    8.341298] UBIFS error (pid 713): do_readpage: cannot read page 0 of inode 504, error -22
INIT: cannot execute "/sbin/getty"
[    8.377201] UBIFS error (pid 714): ubifs_read_node: bad node type (255 but expected 1)
[    8.387091] UBIFS error (pid 714): ubifs_read_node: bad node at LEB 14:11976, LEB mapping status 1
[    8.398291] UBIFS error (pid 714): do_readpage: cannot read page 0 of inode 504, error -22
INIT: cannot execute "/sbin/getty"
[    8.436775] UBIFS error (pid 715): ubifs_read_node: bad node type (255 but expected 1)
[    8.447141] UBIFS error (pid 715): ubifs_read_node: bad node at LEB 14:11976, LEB mapping status 1
[    8.458764] UBIFS error (pid 715): do_readpage: cannot read page 0 of inode 504, error -22
INIT: cannot execute "/sbin/getty"
[    8.493521] UBIFS error (pid 716): ubifs_read_node: bad node type (255 but expected 1)
[    8.506188] UBIFS error (pid 716): ubifs_read_node: bad node at LEB 14:11976, LEB mapping status 1
[    8.516167] UBIFS error (pid 716): do_readpage: cannot read page 0 of inode 504, error -22
INIT: cannot execute "/sbin/getty"
INIT: Id "con" respawning too fast: disabled for 5 minutes
INIT: no more processes left in this runlevel

I'm wondering if this is to do with the NAND chip (Micron MT29F1G, same as Leopardboard) and the information stored in update.c about ECC layout? Or is it something like out-of-date MTDtools?

MTD Layout is:

dev:    size   erasesize  name
mtd0: 00300000 00020000 "bootloader"
mtd1: 00200000 00020000 "params"
mtd2: 00400000 00020000 "kernel"
mtd3: 02800000 00020000 "filesystem1"
mtd4: 00200000 00020000 "data1"
mtd5: 02800000 00020000 "filesystem2"
mtd6: 02500000 00020000 "data2"