Read SD card size information

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

Read SD card size information

跳至解决方案
1,287 次查看
oscar
Contributor I

I am trying to read the SD card information (4G SHDC) using IO_IOCTL_FREE_CLUSTERS and IO_IOCTL_GET_CLUSTER_SIZE. I am using MQX 3.7. The first time that I try to do that is too slow,

almost 2 minuts. The second time is immediate..

 

Any idea?

标签 (1)
标记 (1)
0 项奖励
1 解答
918 次查看
DavidS
NXP Employee
NXP Employee

Fixed in the MQX3.8.1 release per the release notes.

Regards,

David

在原帖中查看解决方案

0 项奖励
8 回复数
918 次查看
zhiyangzhang
Contributor III

I tested the IO_IOCTL_FREE_CLUSTERS with a 8G SD card on mqx 4.0. The first time it cost 8s and second 2ms. I think it is normal.The first time the the drive' information FREE_COUNT has a  signiture  of FSI_UNKNOWN indicating that work need to be done to count the free clusters. It is a normal value of 8s to count the free clusters on the SD card because as many as 2M bytes FAT need to be read on MFS. The reason why the second time call is fast is that the FREE_COUNT is available and the app can directly use the value preserved in the mfs cache without a extra compute.

0 项奖励
918 次查看
sgqo
Contributor I

Ok Zhiyang Zhang. Thank you for your information, it makes sense to me.

So I guess the only way to reduce that time would be to increase clock speed on the SD bus ?

Regards,

0 项奖励
918 次查看
sgqo
Contributor I

Hi David,

I am using a Kinetis K60 on our prototype board, running with the SDHC driver.

For your information, I manage to get rid of the unknown error: I was probably misusing the IO_IOCTL_FREE_CLUSTERS function. This piece of code is now working properly.

Still, I have the issue mentionned by Oscar when the first access is very long (something like 20+ sec.) whereas further accesses are quite fast (1-2 sec), although using MQX 4.0.

Regards,

S.

0 项奖励
918 次查看
t_k
Contributor II

I'm using the MCF54417 and we're experiencing the same issue using IO_IOCTL_FREE_SPACE.

I never bothered calling it a second time to see if it ran any faster though.

Thanks,

Travis

0 项奖励
918 次查看
DavidS
NXP Employee
NXP Employee

Hi S.,

What Kinetis device are you using?  Are you using Tower kit?

Are you accessing SD Card with SPI or SDHC controller?

Regards,

David

0 项奖励
919 次查看
DavidS
NXP Employee
NXP Employee

Fixed in the MQX3.8.1 release per the release notes.

Regards,

David

0 项奖励
918 次查看
sgqo
Contributor I

Hi David,

I am using MQX 4.0 and though, have the same issue : at first use IO_IOCTL_FREE_CLUSTERS lasts a bunch of seconds, while on the next calls, its execution is rather quick. I get the same behavior with IO_IOCTL_FREE_SPACE as well.

Besides, these functions always return "UNKNOWN ERROR !!!" so I did not manage to know the remaining space on my SD device! Any idea?

Hi Oscar,

Did you manage to have the IO_IOCTL_FREE_CLUSTERS function working?

Thank you for your help,

S.

0 项奖励
918 次查看
oscar
Contributor I

Good news!

Is it easy to import this changes to MQX 3.7.1?

Regards,

Oscar

0 项奖励