SPI SD Card interfacing without file system for MK20 using Kinetis Design Studio

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI SD Card interfacing without file system for MK20 using Kinetis Design Studio

1,078 Views
Contributor III

Hello,

I have been looking for an example code to interface to an SD card through SPI using a MK20 Kinetis microcontroller without using any file system (I do not need to use the card on a computer later, only as storage, so it would be beneficial to skip all the FatFs content).

Could you please point me to the correct example to follow in this case?

Thank you in advance

Labels (1)
0 Kudos
13 Replies

164 Views
NXP TechSupport
NXP TechSupport

Hi,

All the SD card demos that I know are with file system (SDK demoes, https://mcuxpresso.nxp.com/en/welcome ) or processor expert support.

https://mcuoneclipse.com/2014/04/09/ftf-frdm-k64f-kinetis-design-studio-and-kinetis-sdk/


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

164 Views
Contributor III

Hi ZhangJennie,

Thank you for your reply.

I see the examples not only include file system, but also are not aimed to use SPI as a communication means, but SDMMC instead.

If it is not possible to find an example without file system, could you point me to the one using SPI as communication means?

Thank you in advance.

Best Regards

0 Kudos

164 Views
NXP Employee
NXP Employee

Hi,

You can simply remove the FatFS component from a Processor Expert project, then you have access to the card without a file system:

pastedImage_1.png

There is a project for the K20DX128 available on GitHub and described by articles:

Data Logger with tinyK20 Board | MCU on Eclipse 

mcuoneclipse/Examples/KDS/tinyK20/tinyK20_DataLogger at master · ErichStyger/mcuoneclipse · GitHub 

See as well this tutorial:

FatFS with Adafruit MicroSD Breakout Board and NXP FRDM-KL25Z | MCU on Eclipse 

mcuoneclipse/Examples/KDS/FRDM-KL25Z/FRDM-KL25Z_FatFs at master · ErichStyger/mcuoneclipse · GitHub 

I hope this helps,

Erich

164 Views
Contributor III

Hi Erich,

Thanks a lot for your support and help. I was able to communicate to the SD card without using the file system and read the written data back for verification.

I did run in to a couple of problems, but all of them were documented in your forums based on previous questions of users, you have great examples and great answers to solve issues that come up!

Thanks again

Best Regards,

Ivan

0 Kudos

164 Views
Contributor III

Hi Pulsatrix

Could you help me? Im trying to use SD without File Sistem using part of drivers using on SDK for MKVF128, but I can't Init SD card Do you have any code or way to get my project working? I have use direct Sd access on Atmel Studio but I can't do it on MCUXpresso IDE.

Best Regards

0 Kudos

164 Views
NXP Employee
NXP Employee

Hi Ivan,

great! Good to hear that things are working on your end now :-).

Erich

0 Kudos

164 Views
Contributor III

Hi Erich,

After having tested the SD card I am now attempting to merge this functionality to a project that is using MCUXpresso SDK v2, with the SDK built for the MK20DX256xxx10 (although Im actually using the MK20DX256VLH7, but it has no support in MCUXpresso). 

I was wondering how to efficiently merge this SD card functionality to the project I already have built based on MCUXpresso, but keeping the functionalities I have in the project and not messing up things in the configuration. Doing some research I came across your tutorial on something similar ( Tutorial: Using Eclipse with NXP MCUXpresso SDK v2 and Processor Expert | MCU on Eclipse  ) , but I am not quite sure if this is what will solve my problem, since in this case you are aiming for using the Processor Expert on a MCU that is not supported and hence you do the trick, but I am not sure what happens if I would like to preserve the functionalities of my initial MCUXpresso project.

Could you please point me to the best alternative you know for such a merge?

Thanks in advance for your attention!

Best Regards,

Ivan

0 Kudos

164 Views
Contributor III

Hi Erich,

Thank you for your reply! I am currently working with Kinetis Design Studio. Is there an easy way for porting to KDS and also get rid of the FatFs? Or is it better then to look for specific examples developed in Kinetis Design Studio (Which seem to be scarce).

I will anyway check in detail the examples.

Thank you again for your help!

0 Kudos

164 Views
Contributor III

(And by KDS I mean KDS directly without the CodeWarrior, but with the SDK) Thanks!

0 Kudos

164 Views
NXP Employee
NXP Employee

KDS is not CodeWarrior. CodeWarrior is a completely different IDE and toolchain.

CodeWarrior is a different Eclipse IDE, with different compilers and with different debugger.

164 Views
Contributor III

Hi Erich, My mistake, I meant I was not using Processor Expert, so I was wondering the applicability of it or if any kind of adapting was needed to use it under KDS without Processor Expert, since the code I have so far works in this way directly with the SDK.

Thanks again!

Best Regards,

Ivan

0 Kudos

164 Views
Contributor III

Hi Erich,

I started checking out the examples with Processor Expert and will be able to test it soon. I see now how PE is just used for code generation and code merging to a non PE project can be easily done.

Thanks for your suggestions, very much appreciated!

Best Regards,

Ivan

0 Kudos

164 Views
NXP Employee
NXP Employee

KDS == Kinetis Design Studio, so no porting needed.

Erich