How to work with microSD on kl25

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

How to work with microSD on kl25

2,314 Views
gamma
Contributor I

Hello!

i'm working with a FRDM KL25Z, and i need to write on a MicroSD card... but the tutorials that i followed doesn't work, and they are made in a previous version of KDS, so, i cant find the components, or they doesn't look the same way like the tutorial... Please, I need someone who recently work with SD module on this board.

 

I'm using a FRDM KL25Z, with KDS 3.20, and a Sparkfun Level Shifting MicroSD breakout.

 

 

Thank you!

Labels (1)
0 Kudos
18 Replies

1,508 Views
BlackNight
NXP Employee
NXP Employee

I'm using the Adafruit breakout board, see  https://mcuoneclipse.com/2016/07/09/fatfs-with-adafruit-microsd-breakout-board-and-nxp-frdm-kl25z/

and the attached project.

Adadfruit MicroSD Card Breakout Board.jpg

I hope this helps,

Erich

0 Kudos

1,508 Views
gamma
Contributor I

look, this is my SPI communication parameters.

Captura de pantalla 2016-07-08 a las 11.49.12 a.m..png

it was on rising or falling edge, i change it to only rising edge. but i still have the same answer, the command diskinfo doesn`t give me any info

0 Kudos

1,508 Views
BlackNight
NXP Employee
NXP Employee

Can you checked your SPI communication parameters?

- MSB first

- shift clock low if idle

- clock edge: risinig edge

?

Erich

0 Kudos

1,508 Views
gamma
Contributor I

13588956_1068179373256551_1328338264_o.jpg

This is the connection that i have right now. thanks for check it!

0 Kudos

1,508 Views
BlackNight
NXP Employee
NXP Employee

That picture does not help much. Can you check with a logic analyzer that you see the proper signals?

It is not clear if you really have used 5V to power the level shifters on the card adapter.

Erich

0 Kudos

1,508 Views
gamma
Contributor I

HI Erich! i'm having a little issue when i download the example code that you gave me, the code works fine, but the FRDM doesn`t see with the SD...

when i type the command diskinfo it gave me this answer.

Captura de pantalla 2016-07-08 a las 9.25.40 a.m..png

i need to know how to connect the FRDM KL25 to this SD reader https://www.sparkfun.com/products/13743

could you help me with this connections please?

0 Kudos

1,508 Views
BlackNight
NXP Employee
NXP Employee

Have a look at the tutorials on FreeRTOS.org: FreeRTOS - Quick start guide

0 Kudos

1,508 Views
BlackNight
NXP Employee
NXP Employee

Hi Gamaliel,

the RTOS is not needed, but makes thing simpler and scalable. So you can you it without.

As for LDD and non-LDD components: have a read here: https://mcuoneclipse.com/2015/10/18/overview-processor-expert/

In a nutshell, the LDD are newer and more powerful, but more difficult to use.

Erich

0 Kudos

1,508 Views
gamma
Contributor I

Excelent!

but in your tutorial is not explained how i can add the RTOS, do you have some tutorial , or would you explain me how I should configure the RTOS in my project? thanks!

0 Kudos

1,508 Views
BlackNight
NXP Employee
NXP Employee

Hi Gamaliel,

it is very simple: just don't use the RTOS. I have a bare metal (BM) example with FatFS without RTOS (for CodeWarrior) here:

mcuoneclipse/Examples/CodeWarrior/TRW-K60N512/TWR-K60N512_FatFS_BM at master · ErichStyger/mcuonecli...

I hope this helps,

Erich

0 Kudos

1,508 Views
gamma
Contributor I

Excelent!, i checked it, and it's a little bit easy to understand, but, my new doubt is at the time of generate the processor expert code, because in my project, in the FATfs file system, it ask about a shell, should i add it to my project? . If I add it, how should I configure it?  I saw that it could be add a RTOS in these section, is that what you do? I add my code in this message, i was wondering if you could check it and tell me what I'm forgetting to configure. thanks!

Dropbox - kl25z_sdrw_v01.zip

0 Kudos

1,508 Views
BlackNight
NXP Employee
NXP Employee

The shell component provides a command line (shell) interface for various components, including the FatFS. If you don't need that, you don't have to add it. But if you add it, it makes sense to add the RTOS too. Because then you can run the shell parser in its own thread/task.

Erich

0 Kudos

1,508 Views
gamma
Contributor I

thanks Erich! do you have any tutorial which explain the basic use os RTOS? in which explain how to make threads/tasks for diferent components? it would be helpful for the project that i'm working.

0 Kudos

1,508 Views
BlackNight
NXP Employee
NXP Employee

Hi Gamaliel,

Have you configured it to use a list of values (https://mcuoneclipse.files.wordpress.com/2012/11/timing-dialog.png?w=584&h=381 )?

Or can you share your project?

Erich

0 Kudos

1,508 Views
gamma
Contributor I

Hi Erich!, first of all, thanks for your help.  I look into your proyect, and i see that you're using a Spimaster_LDD instead a SPI_SynchroMaster, is there any difference between each one?

tell me, is really necessary use of RTOS? i'm looking for a simple read/write .txt files on the sd_card.

Thanks!

let me complete a little bit more my project and I share to you

Gamaliel.

Thanks!

0 Kudos

1,508 Views
BlackNight
NXP Employee
NXP Employee

Hi Gamaliel,

if using a normal SD card or micro-SD really does not matter.

I have a tutorial for the KL25Z here: https://mcuoneclipse.com/2012/11/18/arduino-data-logger-shield-with-the-frdm-kl25z-board/

The code is on GitHub (KDS v3.2) here: mcuoneclipse/Examples/KDS/FRDM-KL25Z/FRDM-KL25Z_FatFs at master · ErichStyger/mcuoneclipse · GitHub

I have attached the project as well.

I hope this helps,

Erich

0 Kudos

1,508 Views
gamma
Contributor I

Erich, the SDcard communication is by SPI?

and here is my first doubt, i'm working with kds, which provides me a SynchroMaster template that doesn´t let me change some attributes, i add the images of the attributes that I can`t change , I hope you can help me. it says that the method is disabled by the template, how do you change that?

Captura de pantalla 2016-05-27 a las 2.13.14 p.m..png

that's the image of your proyect, and here is mine

Captura de pantalla 2016-05-27 a las 2.15.47 p.m..png

Thanks!

0 Kudos

1,508 Views
gamma
Contributor I

Thank you Erich! let me follow your tutorial, and if i have some doubt, i would ask to you in this post, thanks!

0 Kudos