Help..Regarding Initialisation of SD CARD and FileSystem with CMSIS for LPC1788

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

Help..Regarding Initialisation of SD CARD and FileSystem with CMSIS for LPC1788

1,415 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by student_463 on Mon Feb 20 04:16:31 MST 2012
I am using CMSIS library. I am little bit familiar with that lib. I have example program for MCI(sd card) initialization with CMSIS standards. With this program i am able to detect the SDCARD, but not any data transformation. And there is no file system in this example. I have to create File System. So, Please any one can help me to initialize the SDCARD properly and creating the File System (or atleast Raw data transfermation)
Labels (1)
0 Kudos
17 Replies

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by studyembedded on Tue Feb 19 03:17:22 MST 2013
Hi Pardhu, i expect you to come back after resolving all hickups, and share the code with forum. You can make somebody else life easy my friend...any how i was searching for file system for LPC1788 development board....hope will get some help...thanks!
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lien.Nguyen on Thu Mar 22 19:44:25 MST 2012
Hi Pardhu,
You can check on print_commands function. The string which user inputs must follow the format which is decribed by this function.
For example:
di 0  --> initialize disk 0 (in this example, only 0 is permited)
ds 0  --> show disk status

I attached the example description for you. Please take a look at 3.15.3. Mci_FS

Best Regards,
Lien

0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by student_463 on Thu Mar 22 03:01:32 MST 2012
Hi Lien,

What you have explained is fine. I went through these functions.

get_line(ptr, sizeof(Line));
disk_cmd_handle(ptr);
buff_cmd_handle(ptr);
file_cmd_handle(ptr);


from get_line function, we are getting inputstring from UART. We have to give the correct input to work the file system properly. In those functions, based on the letters what we are sending to them, the total process is working. So, what will be the strings we have to pass those three functions..???


Thanks
Pardhu
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lien.Nguyen on Wed Mar 21 19:34:48 MST 2012
Hi Pardhu,
get_line is used to get a line which user inputs on terminal. ptr is the pointer to the buffer which will be used to store the user inputs.
get_line use UART function to do its job through xfunc_in function pointer. You can see this in the main file. Search for the following lines:
    xfunc_out = put_char;
    xfunc_in  = get_char;


Best Regards,
Lien
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by student_463 on Wed Mar 21 00:49:18 MST 2012
Hi Lien,

I just gone through your link. I got the zip file which is having the examples. In that, i tried with MCI File system example which is using UART functions also. In that program, in main function,

get_line(ptr, sizeof(Line));

here, in UART which commands we have to pass. I mean what is the string your passing to ptr variable..?

can you please help me out for this ...?

thank you...
pardhu
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lien.Nguyen on Fri Mar 02 01:14:38 MST 2012
Hi Pardhu,
Did you OK with DMA enabled? I'm really sorry because I can't help you. I checked the code many times and all runs were ok. :(
If you found something wrong, please feedback for me.

Besides, there is an example for accessing file system resides on SD card. you can get from the link: http://sw.lpcware.com/?p=lpc177x_8x.git&a=summary
Thanks & Best Regards,
Lien
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by EReyes on Thu Feb 23 20:47:23 MST 2012
pardhu, are you using this board?

http://www.embeddedartists.com/products/kits/lpc1788_kit.php

If you are, you can get access to their examples in the support section. They have a working fatfs over MCI. I tested it with DMA enabled and had no problems with several SD cards (including HC).

The example pointed by Lien uses SPI, which is much slower.

Which compiler/toolchain are you using?
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by student_463 on Thu Feb 23 12:22:50 MST 2012
Hi Lien,
Thanks for giving that file system example and those suggestions.I am still trying to figure out, why the code is not working With MCI_DMA_ENABLED as 1.

I am playing with the delay in write and read block funcrions. As soon as i will try to fix up this one.Mean while, i may need your valuable suggestions to over come from this problem.I hope, you don't mind to suggest when you are free.


Thank you in advance,

Pardhu
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lien.Nguyen on Wed Feb 22 19:32:46 MST 2012
I've been noticed about an file system example. Please refer to the link http://ics.nxp.com/support/documents/microcontrollers/?search=File&Search.x=0&Search.y=0

Best Regards,
Lien
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by student_463 on Wed Feb 22 04:49:09 MST 2012
Thanks Lien,

I really appreciate your help. With MCI_DMA_ENABLED as 0 the code is working for write and read operations for multiple blocks. I have tried with 4 blocks.

Thank you very much.
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lien.Nguyen on Tue Feb 21 20:42:00 MST 2012
The example is only tested with some specific cards. So, maybe it doesnt work with your card. Normally, the cause is timming issue.
Could you check as following:
- Does it work when DMA is enabled/disabled? --> Set MCI_DMA_ENABLED as 0/1 to disable/enable.
- Does it work with 1 block transfering? Multi-blocks transfering? --> Set the number of blocks by WRITE_BLOCK_NUM macro.
- In case it only works with 1 block, not multi-block, please debug the example to get more information. To debug easier, you should disable DMA. Then, place a breakpoint in MCI_IRQHandler function to debug the transfering progress.

Best Regards,
Lien
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lien.Nguyen on Tue Feb 21 19:46:37 MST 2012
Oh, it's really a bad news.
I've tested the example again. It's still ok (with DMA is enabled/disabled).
Could you post what's wrong in the MCI driver?
If there are errors, we must fix them. Welcome your feedback so we can improve the code quality.

Best Regards,
Lien
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by student_463 on Tue Feb 21 08:11:59 MST 2012
Hi Lien.Nguyen,

I managed to get that sample code for raw data writing and reading into sdcard. I dumped on Embedded Artist board, but i didn't get the result. Jumpers on the board and hardware side, there is no issue.What could be the bug?

In that code i faced few problems. Data transfer/receiver end state flag is not updating.I thought that could be the problem.Still trying.

Mean while, i am also trying to get the file system example project. Is it possible to get that sample project in this community? If it is available here or some other place, please let me know...


Thanks in advance...
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Tue Feb 21 08:03:29 MST 2012
IMHO, the CMSIS MCI driver is non-functional.

FIFO mode is not practical (because of overrun/underrun), and DMA mode is not functional because the DMA channel is not set up correctly.



0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lien.Nguyen on Tue Feb 21 01:05:29 MST 2012
Please go to the link: http://sw.lpcware.com/?p=lpc177x_8x.git&a=summary.
The latest version is always available here.

Best regards,
Lien
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by student_463 on Mon Feb 20 23:18:43 MST 2012
Hi, Lien.Nguyen.
Thank u for your kind reply. I'll try to find out in which version that example is available.If you know better version to use for the current advanced projects, please suggest me.
Thank you in advance.
0 Kudos

1,265 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lien.Nguyen on Mon Feb 20 19:08:00 MST 2012
Did you get the new version of CMSIS package? There is MCI_ReadWrite example. You can try to use it for RAW data transfering.
Besides,there is USB Host example. This example operates on FAT filesystem. You can use it as a reference.

Best Regards,
Lien
0 Kudos