download fail under pipe mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

download fail under pipe mode

1,804 Views
alex
Contributor I
I want to download image to mx28 and always is not successful. 
In UCL.xml file: Sending and writting rootfs   
The updater is complied with version Linux version 2.6.35.3-571-gcca29a0..   
Do anybody have the same issue with me?  Please give me some help.    
console print as below:  

UTP: received command 'pipe ubiformat /dev/mtd2 -y -f - -S 26738688'
UTP: sending Success
ubiformat: mtd2 (nand), size 52428800 bytes (50.0 MiB), 400 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 399 -- 100 % complete  
ubiformat: 400 eraseblocks are supposedly empty
ubiformat: flashing eraseblock 4 --  2 % complete  g_file_storage gadget: high speed config #1
ubiformat: flashing eraseblock 5 --  2 % complete  g_file_storage gadget: high speed config #1
ubiformat: flashing eraseblock 24 -- 12 % complete  g_file_storage gadget: high speed config #1
ubiformat: flashing eraseblock 26 -- 13 % complete  Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = c0004000
[00000004] *pgd=00000000
Internal error: Oops: 817 [#1]
last sysfs file: /sys/class/ubi/version
CPU: 0    Not tainted  (2.6.35.3-571-gcca29a0 #38)
PC is at fsg_main_thread+0xf28/0x1ff0
LR is at fsg_main_thread+0xeb0/0x1ff0
pc : []    lr : []    psr: 40000013
sp : c7269f50  ip : c035846c  fp : c7269fc4
r10: 00000000  r9 : c6d90940  r8 : 00090000
r7 : 00000000  r6 : c71bdcc0  r5 : c6db7578  r4 : c6db7500
r3 : 00000000  r2 : 0000000d  r1 : fff20000  r0 : c6db7500
Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: 46f20000  DAC: 00000017
Process file-storage-ga (pid: 907, stack limit = 0xc7268270)
Stack: (0xc7269f50 to 0xc726a000)
9f40:                                     c6db757c 00000017 c7c24000 00000001
9f60: c7269f84 c6db7504 c7c24000 c030811c c7269f9c c7269f80 c003b50c 00000000
9f80: c71bdcc0 c00545b8 c7269f88 c7269f88 c7269fc4 c7269fa0 c026bec0 c7c27ee8
9fa0: c0219ad8 c6db7500 00000013 00000000 00000000 0
0 Kudos
8 Replies

1,068 Views
emilmyhrman
Contributor IV

A few years late, but posting for future reference.

We had the same issue when flashing large files and I've tracked it down to being a problem with timeout (and starving of uuc) when running "frf" command. The fix is to respond with a BUSY status if the command takes longer than 5 seconds to execute.

0 Kudos

1,068 Views
LiuHui
Contributor I

 I cann't patch the patch either. Is there any updates?

0 Kudos

1,068 Views
alex
Contributor I

I can't patch your patch, for uu.c on my side is different with yours. uu.c version is uuc-10.12.01 on my side. Can you tell what's your version of uu.c? or Can you give initramfs to me? Thanks

0 Kudos

1,068 Views
StanleyLee
NXP Employee
NXP Employee

Hi Alex,

 

Please apply attached patch to create a new initramfs and use below ucl to do burning.

<CMD type="boot" body="Recovery" file="updater_ivt.sb" timeout="60" if="HabEnable">Booting update firmware.</CMD>
<CMD type="find" body="Updater" timeout="180"></CMD>

<CMD type="push" body="mknod class/mtd,mtd2,/dev/mtd2">mknod mtd2</CMD>

<CMD type="push" body="$ flash_eraseall /dev/mtd2">Erasing rootfs partition</CMD>

<CMD type="push" body="pipe ubiformat /dev/mtd2 -y -f - -S @FILESIZE" file="files/ubi.img">Sending and writting rootfs</CMD>

<CMD type="push" body="pollpipe">poll pipe command to decide when it finished</CMD>

<CMD type="push" body="frf">Finish Rootfs Partition</CMD>



alex said:

1) Yes, I apply the patch, and generate updater_ivt.sb and copy it to MX28 Linux Update\OS Firmware. Update rootfs, and

the kernel will be broken with error information as previous comment.

Target RAM:128M. the image is about 26MiB. MFGtool version is 1.6.2.032-gdd64126. Below is the part of UCL.xml:

<CMD type="boot" body="Recovery" file="updater_ivt.sb" timeout="60" if="HabEnable">Booting update firmware.</CMD>
<CMD type="find" body="Updater" timeout="180"></CMD>

<CMD type="push" body="mknod class/mtd,mtd2,/dev/mtd2">mknod mtd2</CMD>

<CMD type="push" body="$ flash_eraseall /dev/mtd2">Erasing rootfs partition</CMD>

<CMD type="push" body="pipe ubiformat /dev/mtd2 -y -f - -S @FILESIZE" file="files/ubi.img">Sending and writting rootfs</CMD>

<CMD type="push" body="frf">Finish Rootfs Partition</CMD>

 

2)I find that "echo 3 > /proc/sys/vm/drop_caches" is not help.

 

 

0 Kudos

1,068 Views
alex
Contributor I

1) Yes, I apply the patch, and generate updater_ivt.sb and copy it to MX28 Linux Update\OS Firmware. Update rootfs, and

the kernel will be broken with error information as previous comment.

Target RAM:128M. the image is about 26MiB. MFGtool version is 1.6.2.032-gdd64126. Below is the part of UCL.xml:

<CMD type="boot" body="Recovery" file="updater_ivt.sb" timeout="60" if="HabEnable">Booting update firmware.</CMD>
<CMD type="find" body="Updater" timeout="180"></CMD>

<CMD type="push" body="mknod class/mtd,mtd2,/dev/mtd2">mknod mtd2</CMD>

<CMD type="push" body="$ flash_eraseall /dev/mtd2">Erasing rootfs partition</CMD>

<CMD type="push" body="pipe ubiformat /dev/mtd2 -y -f - -S @FILESIZE" file="files/ubi.img">Sending and writting rootfs</CMD>

<CMD type="push" body="frf">Finish Rootfs Partition</CMD>

 

2)I find that "echo 3 > /proc/sys/vm/drop_caches" is not help.

0 Kudos

1,068 Views
StanleyLee
NXP Employee
NXP Employee

Did you try the solution I suggested above?

0 Kudos

1,068 Views
alex
Contributor I

Hi:

 I patched the kernel, and After creating node /dev/mtd2, the print as below:

 

cpu_id is 28
g_file_storage gadget: high speed config #1
UTP: received command 'mknod class/mtd,mtd2,/dev/mtd2'
class = 'class/mtd'
item = 'mtd2'
node = /dev/mtd2
type = (null)
UTP: running utp_mk_devnode(class/mtd,mtd2,/dev/mtd2,0x2000)
utp_mk_devnode: creating node '/dev/mtd2' with 90+6
UTP: sending Success
Unable to handle kernel NULL pointer dereference at virtual address 00000009
pgd = c0004000
[00000009] *pgd=00000000
Internal error: Oops: 17 [#1]
last sysfs file: /sys/devices/virtual/mtd/mtd3/dev
CPU: 0    Not tainted  (2.6.35.3 #4)
PC is at fsg_main_thread+0xa34/0x2188
LR is at fsg_main_thread+0xa34/0x2188
pc : [<c0217698>]    lr : [<c0217698>]    psr: 60000013
sp : c7263f50  ip : c7263f50  fp : c7263fc4
r10: c88fc000  r9 : 00000000  r8 : c0358a00
r7 : c71bdcc0  r6 : 00000000  r5 : c03589f0  r4 : c6d96600
r3 : 00000000  r2 : 00000001  r1 : c7263f7c  r0 : c0358a00
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: 472fc000  DAC: 00000017
Process file-storage-ga (pid: 905, stack limit = 0xc7262270)
Stack: (0xc7263f50 to 0xc7264000)
3f40:                                     c6d9667c 00000017 c7c24000 00000001
3f60: c7263f84 c6d96604 c7c24000 c0308434 c7263f9c c7263f80 c003b690 00000000
3f80: c71bdcc0 c00546e8 c7263f88 c7263f88 c7263fc4 c7263fa0 c026d4f8 c7c27ee8
3fa0: c0216c64 c6d96600 00000013 00000000 00000000 00000000 c7263ff4 c7263fc8
3fc0: c00541a4 c0216c74 00000000 00000000 c7263fd0 c7263fd0 00000000 c7c27ee8
3fe0: c005411c c0043120 00000000 c7263ff8 c0043120 c005412c 00000000 00000000
Backtrace:
[<c0216c64>] (fsg_main_thread+0x0/0x2188) from [<c00541a4>] (kthread+0x88/0x90)
[<c005411c>] (kthread+0x0/0x90) from [<c0043120>] (do_exit+0x0/0x5cc)
 r6:c0043120 r5:c005411c r4:c7c27ee8
Code: e2853024 e1530006 03a06000 eb015a2b (e5d62009)
---[ end trace cce4d28f6667271d ]---

0 Kudos

1,068 Views
StanleyLee
NXP Employee
NXP Employee

The error is caused by memory lack.

 

Solution:

  1. Apply the patch attached and rebuild a new uImage to replace original one in Mfgtool\Profiles\MX28 Linux Update.
  2. Split big files (say system.img) into multiple files in which each file is no more than 100MB if have.
  3. Please do follow below guide:

pipe

string
require file attribute

Execute shell command and read data from stdio pipe IN. mfg will send file to stdio pipe OUT.
It is useful for big data transfer, more than physical memory size 
<CMD type="push" body="pipe tar -xv -C /mnt/ubi0" file="files/rootfs.tar"/>
<CMD type="push" body="flush">Finish Flashing NAND</CMD>

Note: The above two commands must be combined to use

Recommend: Please add below command prior to pipe command to release some memory

<CMD type="push" body="$ echo 3 > /proc/sys/vm/drop_caches">release memory</CMD>

 

 4. Add below command to monitor memory usage situation:

<CMD type="push" body="$ cat /proc/zoneinfo">cat zone info </CMD>

0 Kudos