Using extra MK40 on-board Flash and SPI Port to emulate external Serial Flash IC

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

Using extra MK40 on-board Flash and SPI Port to emulate external Serial Flash IC

Jump to solution
1,022 Views
Ellery
Contributor I

I'm designing a project, based on an MK40, that communicates with a custom peripheral "slave" chip via I2C. This peripheral chip also acts as an SPI "Master" with an external Serial Flash Memory. The MK40 has more Flash than I need for my Application, and it also has both SPI and DSPI ports and DMA Controllers that are unused. Is it possible to connect the SPI Master Port of the Peripheral to an SPI or DPSI Slave Port on the MK40 so that an unused portion of MK40 Flash can emulate the external Serial Flash; thus omitting the external Flash chip? Has anyone done this? Are there App Notes dealing with DMA and SPI Slave Ports? Anyone have some CodeWarrior 'C' Code to handle this? Thanx - Ellery

Labels (2)
0 Kudos
1 Solution
519 Views
Hui_Ma
NXP TechSupport
NXP TechSupport


Hi,

MK40 DSPI module could works as SPI slave, after receive the data from SPI bus, it could trigger a DMA transfer to move data to internal memory.

Customer can move data to the internal RAM. Then customer can program related data from RAM to internal Flash memory.

Please check attached two example codes about how to use DSPI module with DMA and another example shows how to emulate Flash memory as EEPROM.

Wish it helps.

View solution in original post

0 Kudos
2 Replies
520 Views
Hui_Ma
NXP TechSupport
NXP TechSupport


Hi,

MK40 DSPI module could works as SPI slave, after receive the data from SPI bus, it could trigger a DMA transfer to move data to internal memory.

Customer can move data to the internal RAM. Then customer can program related data from RAM to internal Flash memory.

Please check attached two example codes about how to use DSPI module with DMA and another example shows how to emulate Flash memory as EEPROM.

Wish it helps.

0 Kudos
519 Views
Ellery
Contributor I

Thank you, Hui_Ma.

Your response is targeted, specific and complete. Just what I needed.

I'm thankful for your guidance.

- Ellery

Ellery Potash, Sr.Engineer

LATHEM TIME CORP.

0 Kudos