Problem in FatFS using Chan's lib

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

Problem in FatFS using Chan's lib

453 Views
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.

Labels (1)
0 Kudos
1 Reply

396 Views
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 Kudos