AnsweredAssumed Answered

Write external flash SPI

Question asked by ioniriondo on Oct 8, 2013
Latest reply on Nov 8, 2013 by Alberto Lubeiro

Hi,

 

I've got a module with the Kinetis PK60X256 and I need to write to an external Flash. This external flash is a Micron M25P80 Serial Flash.


To do this, I'm using an example of SPI communication for the K40x256 DMA. But I'm not sure if this is totally compatible with my MCU.


Is this example's code compatible with what I need? I ask this, because I don't get what I suppose that I should get.


And, if it is, I would need to know how to write a READ IDENTIFICATION  function to start checking things to know what could be wrong, but in the example, almost all the functions are WRITE  functions, so I don't know how to build a Read function. These are the functions that I'm using from the example commented:


//INIT

SPI_Init


//WRITE

Mem_WriteEnable

Mem_WriteSR

Mem_Set4TXDMA

DMA_Init_Tx

SPI_DMA


//READ

DMA_Init_Rx

SPI_DMA_Rx

 

Mem_EraseSector

Outcomes