This week I finished up the flash function to erase, write & read and also added the FPGA erase and write functions. The main body of the code is done, it can now receive a command through HTTPS connection and it will execute the corresponding functions based on the sequence of the input commands.
FPGA Configuration Mode
I faced an unusual problem, when I tried to put the FPGA in configuration mode INIT_B would not follow PROGRAM_B and it refuses to go to configuration mode. I found out that the problem is caused by the TCPIP_STACK!!! somehow it interferes with putting the FPGA in configuration mode. When disabled the FPGA configuration works fine! I still need to figure out why is this happening.
There was also an other problem with NVM_READ function, I was using the same buffer to read different data and the issue was that sometimes the buffer would not contain the correct data. This problem can be fixed by either adding a delay or doubling the read function.