This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Help on M25P80 SPI c code for debug viewer

Hi , i have tried to write some code for M25P80 SPI communication using c programing. i have defined GPIO pins and chip select pin SPI functions also. But i want to make sure what are the functions should i add? Can anybody help me to complete the code for M25P80? or if anybody has written already some code then please email me at pra20008dip@homtail.com thank you.

Parents
  • You enable a timer interrupt, but there is no service routine.

    Your delay function may be optimized away. Figure out what purpose it has, ideally use a timer or systick based counter to mark actual time, rather than loop iterations.

    Your main() loop sends non-sense to the Serial NOR Flash device.

    Have you reviewed the manual/data-sheet for the M25P80?

    If you send an READ ID Command, does it return the data you expect, along with the unique id?

    You'd want to implement a command function. Use that to send READ STATUS REGISTER, READ DATA BYTES, SECTOR ERASE, WRITE ENABLE, WRITE DISABLE, PROGRAM PAGE, etc.

Reply
  • You enable a timer interrupt, but there is no service routine.

    Your delay function may be optimized away. Figure out what purpose it has, ideally use a timer or systick based counter to mark actual time, rather than loop iterations.

    Your main() loop sends non-sense to the Serial NOR Flash device.

    Have you reviewed the manual/data-sheet for the M25P80?

    If you send an READ ID Command, does it return the data you expect, along with the unique id?

    You'd want to implement a command function. Use that to send READ STATUS REGISTER, READ DATA BYTES, SECTOR ERASE, WRITE ENABLE, WRITE DISABLE, PROGRAM PAGE, etc.

Children