Hi Avinash,
In order for the the ECC to operate correctly, you must write 0x0 to every location in the memory before you enable ECC operation. If you don't zero out the memory than the ECC controller will write random data to the memory.
Regards, Bill