This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

spi for flash

Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137

dear e2e ,

We are working on   tms570ls3137  processor for one of our project , ide we are using is ccs v 6.0 , also  halcogen v 4.4.0 for configuration

We are trying to communicate with flash ic( IS25CQ032 )  using spi communication .

 We have enabled  SPI2 and N2HET1 in halcogen , where N2HET1 which are used as GPIO  for chip select of SPI . We  have configured  TMS as master and flash as slave with the baud rate  2MHZ. and  8 bit charter length.

We are writing, reading and erasing the flash in tight loop .  i have attached file which contains the function which i am using., Here by using this i am Earsing the flash followed by Writing in to the flash and reading the flash , When we are reading  flash continuously  after few successful read we are getting wrong data from flash . as it is in continuous loop again it starts reading correct values from flash.

i wanted to the reason for this , as this is very critical for our project .

Awaiting for a quick reply.

Thank You. 

7563.flash_code.docx

  • Hello Chethan,

    Given that you are successfully able to erase, write, and read from the flash I don't anticipate that there are any issues with your code.

    There are, however, a couple of things you can do to debug and determine where the problem lies. First, I would recommend you get a scope capture of the corrupted reads to insure that the data from the slave is correct on the transmission line. If the data is correct on the transmission line, I would suggest you look at it in reference to the SPICLK to see if there is a sampling/timing issue.

    Also, when the interface starts returning correct data again, can you try reading the same address locations that you received the incorrect data from to see if the same incorrect data is received? This could be an issue with the data that has been written.

    Finally, it might be worth including a small delay between SPI transmissions in order to give the slave time to act on the received instructions/data. i.e., it may take the slave some time to retrieve the data from its memory and copy it to its SPI Tx register.