SPI driver for K60 blocks while receiving

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI driver for K60 blocks while receiving

1,766 Views
abhaysorte
Contributor I

Hello,

 

I have written SPI driver for K60 which is blocking when I use the SM1_ReceiveBlock() function. In my hardware, K60's SPI lines are connected to the SPI Flash memory.

Flash read function calls SM1_ReceiveBlock() to read flash data, but currently it's not receiving anything. I am using processor expert and k60's SPI is configured as master while flash memory as slave.

 

I am attaching the files of my project for reference. I would appreciate if anyone could tell me what things I am doing wrong in my SPI flash project.

Original Attachment has been moved to: spi_flash.zip

Labels (1)
0 Kudos
5 Replies

1,369 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Abhay,

You know only check others code is a hard to find errors .

I recommend you firstly refer to the demo code about  SPI-flash-K60

"Kinetis 100MHz Rev 2 Example Projects".

the "spi-demo" is develop on TWR-k60d100 with the TWR-MEM.

If still have question , you can describe detail about you problem , we will help you as soon as possible.

Wish it helps you!
If you still have question, please contact me!


------------------------------------------------------------------------------------------

If this post answers your question, please click the Correct Answer button.

-----------------------------------------------------------------------------------

If this post help your question, please click the helpful Answer button.

1,369 Views
abhaysorte
Contributor I

Hi Alice,

Thanks for your reply. The reference you provided was helpful. But now I have new issues with SPI flash project.

The issues are related to the SPIMaster_LDD component of processor expert. I am using code warrior 10.3 with freescale MK60DN512 microntroller and it is interfaced to the S25FL128S flash memory from the Spansion.

When I give clock rate of SPI as 1usec, the SPI receive event (SM1_OnBlockReceived) is not generated.

But when I use the lowest clock rate (4ms) from the clock rate selection window, the receive event is generated and my SPI flash code works fine.

I have checked the Spansion's datasheet wherein it is mentioned that maximum clock can be 133 Mhz.

So, my confusion here is, is there any critical issue related to SPI clock rate selection that I don't know and which anyone can explain it to me.

I am attaching the screen shots of the clock rate selection windows from my code warrior project for your reference.

0 Kudos

1,366 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Abhay,

Your attachment need password when extract .

Alice

0 Kudos

1,369 Views
abhaysorte
Contributor I

Hi Alice,

I am re-attaching the screenshots. Please have a look.

Abhay

0 Kudos

1,369 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Abhay,

In my opinion, there in on error about the clock rate,  now , you try write to 1.001 on "clock rate",

If not work well, try some of the clock rate :

32.png

Alice

0 Kudos