driver_examples of SDK_2.2_LPC54608J512,sdcard-fatfs has erased other files existed in SD

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

driver_examples of SDK_2.2_LPC54608J512,sdcard-fatfs has erased other files existed in SD

跳至解决方案
1,785 次查看
zhixiangzeng
Contributor II

When I was doing this demo, I created the file in SD card,  both DIR1 and DIR2 succeeded, but wiped out all the files in my SD card. What's the reason for this? Is there a way not to erase?

标签 (1)
1 解答
1,386 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hello zhixiang,

    Just do this modification:

1. open ffconf.h

   Line 50, change _USE_MKFS to 0.

Disable f_mkfs function

pastedImage_1.png

2. New test result

  This is my test result in the SD card.

pastedImage_2.png

After point 1 modification, build and download it to the board again.

You can find the folder test and test.txt still exist.

You can try it on your side.


Have a great day,

Kerry

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

在原帖中查看解决方案

8 回复数
1,386 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hello zhixiang zeng,

    Do you use the official KSDK sd sample code directly on LPC54608 board?

   Could you give me the details steps which can reproduce your problem? Then I can check and test it on my side.


Have a great day,
Kerry

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

0 项奖励
回复
1,386 次查看
zhixiangzeng
Contributor II

Hi,there are  1 file and 1 folder  existed my SD card .When after I run the examples "SDK_2.2_LPC54608J512\boards\lpcxpresso54608\driver_examples\sdcard_fatfs",the  both DIR1 and DIR2 succeeded123.png

but  the file test and folder test have been erased.There are only the DIR_1 created by the fatfs.

fatfs创建文件夹.png

0 项奖励
回复
1,386 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Zhixiang,

   Just as I have told you, f_mkfs function will do the disc format, more details please check this link:

FatFs - f_mkfs 

Wish it helps you!


Have a great day,
Kerry

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

0 项奖励
回复
1,386 次查看
zhixiangzeng
Contributor II

How to avoid deleting other  files in my SD card ? Do you have any ideas or suggestions?

0 项奖励
回复
1,387 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hello zhixiang,

    Just do this modification:

1. open ffconf.h

   Line 50, change _USE_MKFS to 0.

Disable f_mkfs function

pastedImage_1.png

2. New test result

  This is my test result in the SD card.

pastedImage_2.png

After point 1 modification, build and download it to the board again.

You can find the folder test and test.txt still exist.

You can try it on your side.


Have a great day,

Kerry

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

1,386 次查看
zhixiangzeng
Contributor II

Hi,Kerry!

       I have solved the problem last night, and the modifications I made were the same as you mentioned. Anyway, thank you very much for your support.

0 项奖励
回复
1,386 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Zhixiang,

   You are welcome!

   If your problem is solved, please mark the correct answer to close this case, thank you and have a nice day!


Have a great day,
Kerry

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

0 项奖励
回复
1,386 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Zhixiang,

   I already reproduce your problem, and I am working on it, it needs time to process it.

  f_mkfs function will delete all the file in the SD card. I am still checking it.

   Any updated information will let you know, please wait patiently now.

   Thanks a lot for your understanding.


Have a great day,
Kerry

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

0 项奖励
回复