I removed that part and tried, then too it is not upgrading. Also, I removed recent codes , then too no luck.
Buffer size for ota image is 2048 bytes which is a global variable. I tried making it local but device reboots. Is there a way to make this buffer local ?