FRDM-K64F--FileSystem(FatFs) on microSD through 4bit mode(SDHC)

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

FRDM-K64F--FileSystem(FatFs) on microSD through 4bit mode(SDHC)

3,550 Views
mariospelekis
Contributor III

Hello!

 

I am trying to make a TFT device system ,communicating with a microSD card through 4bit mode, so I need to use the internal SDHC module.

Additionally, I need a high level software layer to control the Chan’s FileSystem .I have already use Chan’s FatFs code in 8 bit controllers so I want  to continue work with this.

 

My installed staff:

-KDS 3.0.0 IDE

-KSDK 1.2v

-PE Components(FAT_FileSystem, FatFsMemSDHC, Timeout)-Everything is downloaded from Freescale Forum Links

-Without Operating system

 

So I create a new Kinetis project with PE enable and without KSDK. While I have properly configured the microcontroller, I add directly the FAT_Filesystem PE component.

After this step, other components ask to be added (FatFsMemSDHC,Timeout,GPIO).

Then, after I have configured all components as I want, generate the code.

 

Issue:

At the FatFsMemSDHC component I have chosen a CARD_DETECT_PIN  selection with pull-up  enabled(pull-up cannot be disabled).

If we look at the Hardware of the FRDM_K64F we can check that the CARD_DETECT_PIN is positive logic(active high) which means that I am not able to detect the card inserted in any way.

In other Evaluation board of Freescale(TWR-K60 for example), the card detect pin of the SD socket is negative logic and that’s why the default code that PE generates, enable the pull-up on the Pin.

I found a way to solve this if I delete the pull-up generated code (attached on image 5).

Except this, the Initialization of FATM1 seems not completed correctly so I cannot run FatFs functions(f_mount ,f_open, etc.)

I have attached every step of the above as well as the whole project  in order to see what I am speaking for.

 

Finally ,let me know if there is any possibility that FatFs can work on a Kinetis without OS while manage the low level SDHC drivers(4bit mode).

Untill now seems that it is possible in that way.Am I in the wrong way or I can solve the problem with some small changes to the existing project.

 

Thanks

Marios

Original Attachment has been moved to: TestK64FatFs.rar

Labels (1)
0 Kudos
Reply
3 Replies

1,204 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Marios Pelekis:

Responding to your question, yes it is possible to use FatFs in baremetal mode, but typically it's more convenient to use it with an RTOS.

The Processor Expert components you are using are custom components created by colleague Erich Styger. Please have a look at his example data logger implementation with FRDM-K64F in this tutorial:

Tutorial: Data Logger with the FRDM-K64F Board | MCU on Eclipse


Regards!,
Jorge Gonzalez

0 Kudos
Reply

1,204 Views
mariospelekis
Contributor III

Thank for your reply Jorge_Gonzales,

As i mentioned i need to use the microSD over the SDHC module on k64 because i need more data transfer/time.

The link you forwarded to me is SPI mode based on, and generally i didn't found something on FS community neither around the internet about what i need to do.

Today I got the Beans file from here which is the latest version over the internet(Code and Component inspector bugs fixed).I tried the same thing as before and project again seems not to pass over the FATM1_Init(); that is called from the FAT1_Init(); --The compiler gives an error while trying to switch gears for higher speed and finally FATM1_Init(); returns error.

Although I follow this topic on FS community ("Re: Re: KSDK 1.1 and Processor Expert adding SD card with MFS")​ in which your colleague BlackNight replies and not eventhis updated PE Component seams to work or i am not configuring this correctly.

On the other side you told me about RTOS.

Except MQX is there any example for  FRDM-K64F working FatFs on SDCH module?

Regards

Marios Pelekis

0 Kudos
Reply

1,204 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Marios Pelekis:

Have you made progress with your project?

Since you posted this question some tutorials were released about the use of SDHC module with KSDK together with FatFs. These are the links:

- Data logger with KSDK using SDHC + FatFs (no Processor Expert):

FatFs + SDHC data logger with KSDK in Kinetis Design Studio

- Similar data logger but using Processor Expert components:

FRDM K64F Data Logger using FatFs with KSDK 1.2.0 | Centaurian

If you use Processor Expert and run into issues, make sure to check this thread also:

fsl_sdhc_driver Stuck at SDHC_HAL_GetCurState()

:smileyalert: Note that in the tutorials the components you initially mentioned are not used. Instead KSDK drivers are leveraged.

Regards!

Jorge Gonzalez

0 Kudos
Reply