Problem in FatFS using Chan's lib

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

Problem in FatFS using Chan's lib

869 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by viswanath on Sat Apr 13 13:45:26 MST 2013

HI,


Need help in FatFS in SD card using LPC4350 controller. file system is mounting with f_mount, but not able to open any file with f_open.


as per the application note by chans library: <a href="http://elm-chan.org/fsw/ff/en/appnote.html#port">http://elm-chan.org/fsw/ff/en/appnote.html#port</a>,


need to use disk_initialize() for intilization. in the sample prjts directly used f_mount to mount the file system.


f_mount is called at the time of sysinit(). am need to call <span style="background-color: #ffffff; font-family: Consolas, 'Courier New', monospace; font-size: 14px; line-height: 17.671875px;">disk_initialize().</span><span style="background-color: #ffffff; font-family: Consolas, 'Courier New', monospace; font-size: 14px; line-height: 17.671875px;">disk_status(),</span><span style="background-color: #ffffff; font-family: Consolas, 'Courier New', monospace; font-size: 14px; line-height: 17.671875px;">disk_read() before to f_mount.</span>


 


Please sugest me where i did mistake.


regards,


Viswanath K.

标签 (1)
0 项奖励
回复
1 回复

812 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Sun Apr 14 23:57:04 MST 2013

Viswanath,


sysinit() is NOT for such complex functions as f_mount is!


At sysinit() time, the C runtime library is NOT initialized! All C variables have not been set up! C++ global constructors are not called.


So, please move any complex code to the beginning of main()!

0 项奖励
回复