tools: nand writer: fix read verify bug
[keystone-rtos/mcsdk-tools.git] / writer / nand / src / nandwriter.c
index 458796be306167549b6ef0ef762d399d86d35d6a..d520410f370deabe17be82302113300b56cf2e01 100755 (executable)
@@ -626,6 +626,8 @@ void main ()
         return;\r
     }\r
     nandWriterInfo.deviceTotalBytes = p_device->block_count * p_device->page_count * p_device->page_size;\r
         return;\r
     }\r
     nandWriterInfo.deviceTotalBytes = p_device->block_count * p_device->page_count * p_device->page_size;\r
+    if (nandWriterInfo.deviceTotalBytes > 0x40000000)\r
+        nandWriterInfo.deviceTotalBytes = 0x40000000; /* Max write size 1 GB */\r
     nandWriterInfo.blockSizeBytes   = p_device->page_count * p_device->page_size;\r
 \r
     if ((nandWriterInfo.startAddr % nandWriterInfo.blockSizeBytes) != 0)\r
     nandWriterInfo.blockSizeBytes   = p_device->page_count * p_device->page_size;\r
 \r
     if ((nandWriterInfo.startAddr % nandWriterInfo.blockSizeBytes) != 0)\r