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.
I wanted to upgrade a UBIFS rootfs image from a running application on it.
But if I have to use ubiformat, I need to detach the ubi rootfs partition using ubidetach.
This gives Device busy error as below
ubiformat /dev/mtd4 -O 2048 -f /mnt/installubi.img
ubiformat: error!: please, first detach mtd4 (/dev/mtd4) from ubi0
So I tried to detach
ubidetach -p /dev/mtd4
ubidetach: error!: cannot detach "/dev/mtd4" error 16 (Device or resource busy)
I cannot unmount my root , since I am already inside the filesystem.
Can someone tell me , how to proceed using ubiformat?
When I tried to use nandwrite, it gives the following error
UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 2:4096, read 126976 bytes
I have reservations about using nandwrite for writing ubi images into nand flash.
Can someone help?
I think you are booting your filesystem from UBIFS i.e /dev/mtd4 an dthen trying ubi format on same device. So the error is expected. To avoid such issue, boot your Filesystem from MMC or NFS and try ubi format from kernel. Alternatively you can also ry flashing ubi images from u-boot.
Please close the thread by clicking "verify answer" button, if this answers your question.
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Ravikiran HV:
same question here:
how to burn ubi (/dev/mtd4) while mounting it ???
In reply to tooyoungtoosimple:
Let me know , How much space is left on your nand device.
You can not detach it while you are on the same partion.
Let me know the exact requirements.
Before you do 'ubiformat', first you must unmount the rootfile system, after updating again mount it with out doing any read write operations, like as shown
mount -rw -o remount /
Thanks and Regards
In reply to Sreenivas Kowtharapu:
Are you able to use ubiformat by being in the same partition, is it going fine?
For me, it din't work well.
I have to do the updation from only user space, so i created another partion for updating and calling the same by changing the u-boot.min.nand. Procedure is working fine.
Booting from MMC or NFS cannot be done, since this is a production system.
Can't unmount the RFS, because the application for upgrading the image has to work. This is a production system.
In reply to Jayakrishnan:
If that is the case I can suggest you the alternatives.
1. Try formating/erasing from uboot and flash from uboot. This should be solve all your problems. But, your ecc schemes of uboot must match with that of kernel.
2. Otherwise, If you want to do it from Kernel itself, then you can also try to make 2 dedicated partition for filesystem. You can erase filesystem-1 when you are booted with filesyetem-2 and vice versa.
I'm looking at this problem from the other end right now, the Appro DM368 IPNC SDK uses (or appears to use) the "two-partition" method for remote update of the filesys, but it seems to be broken, my post is here if anyone can help:
To the subject at hand, what the Appro setup appears to do (or attempt to do) is create this partition layout:
dev: size erasesize namemtd0: 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"
And then gets/sets a flag (using fw_getenv / fw_setenv) to denote either MTD3 or MTD5 is written to by the updater (and hopefully, at (re)boot, the correct one is chosen as the "live" one).
Unfortunately, it's not quite working for several potential reasons (any suggestions welcome!) although I don't think any of them are major. I think it's using nandwrite rather than ubiformat, and fw_setenv doesn't seem to actually set the uboot args.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.