iMX7 update

I’m trying to flash Colibri-iMX7_LXDE-Image_2.7b3±20170630.tar.bz2 following the instructions provided in this link: Flashing Embedded Linux to iMX7 Modules
I’ve set up a micro SD card successfully, booted into UBoot and ran “run setupdate” successfully as well. But when I run “run update”, I get this error:

reading colibri_imx7/u-boot-nand.imx
606208 bytes read in 47 ms (12.3 MiB/s)

NAND erase.part: device 0 offset 0x80000, size 0x180000
Erasing at 0x1e0000 -- 100% complete.
OK

NAND write: device 0 offset 0x80000, size 0x94000
 606208 bytes written: OK

NAND erase.part: device 0 offset 0x200000, size 0x180000
Erasing at 0x360000 -- 100% complete.
OK

NAND write: device 0 offset 0x200000, size 0x94000
 606208 bytes written: OK
ubi0: default fastmap pool size: 200
ubi0: default fastmap WL pool size: 100
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=4", size 508 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 4060, bad PEBs: 4, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 931100525
ubi0: available PEBs: 0, total reserved PEBs: 4060, PEBs reserved for bad PEB handling: 76
Creating static volume kernel of size 8388608
Creating static volume m4firmware of size 917504
No size specified -> Using max size (0)
No space left in UBI device!
verify_mkvol_req failed 12

I don’t understand why it says that there is no space available after erasing the NAND… I’m new to this platform, didn’t find much info to help me. What am I doing wrong?

It seems that there are volumes which already occupy space (you can get a list of UBI volume using ubi part ubi && ubi info layout).

To really erase the complete UBI NAND partition use nand erase.part ubi. With that the script will recreate the required UBI volumes.

That worked. After erasing UBI NAND, I could install the firmware just fine. Thanks!