Hi @Prashanth_Baradhi ,
Thanks for the additional info, it's very useful.
Because it worked normally before, the problem of hardware connection and chip failure is basically ruled out. So, we focus on the software side.
Please pay attention to the code snippet "/* Program page */":
Through two for loops, it take out 4 bytes of data from g_buffer[]:
- The outer for loop takes 4 bytes each time
- The inner for loop combines each byte bitwise into a 32-bit data
Then call SPIFI_WriteData to write combined 32-bit data. Loop until all pages of the sector are written.
When verifying, read the g_buffer[] data and compare it with the flash data. The data in the g_buffer[] has always been the test data with the count incremented. This is the whole logic of these codes. If you modify the g_buffer[] and cause previous errors, it should be that the code is not well understood. Please debug in this direction.
Wish it helps!
Best regards,
Gavin