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.
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()!