Don't know if my project work correctly

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
maboc_3939291
Level 1
Level 1

Hello,

I want to create a .txt file and save it on my sd card.

I using the emfile component and use his example project.

I using a PSOC 5LP097 KitProg: CY8C5868LTI,a screen, a Micro-SD card adapter from Catalex and a 4Go SD card.

I made a schema for your understanding.

So when I want to launch my project all the step look like they works but at the end, there is nothing on my SD card.

And sometimes when I create a file on the sd card from a computer, PSoC or somethings else erase him.

finally I've got another probleme, at the first step, PSoC want to know the sd card name BUT he wrote on the LCD "mmc:0:" what is it ?

Thank for your help

0 Likes
1 Solution
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

The default volume name is mmc:0:. So even if there is no card connected it will show value 0.Can you use the code snippet given below.

  

if(0 == (status_t = FS_GetVolumeInfo("mmc:0:0", pInfo)))//default volume name is mmc:0:0
        {
            /* Getting volume name succeeded so prompt it on the LCD */
            LCD_PrintString("SD card name:");
            LCD_Position(1, 0);
            LCD_PrintString("mmc:0:0");
        }

  

Can you check if this code snippet is working. Just to confirm if the connection is proper. Also can you please use a 2GB SD card and test the project. Also can you try formatting in FAT32 and use the FAT 32 library and test again.

Thanks,

Hima

View solution in original post

0 Likes
4 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

The default volume name is mmc:0:. So even if there is no card connected it will show value 0.Can you use the code snippet given below.

  

if(0 == (status_t = FS_GetVolumeInfo("mmc:0:0", pInfo)))//default volume name is mmc:0:0
        {
            /* Getting volume name succeeded so prompt it on the LCD */
            LCD_PrintString("SD card name:");
            LCD_Position(1, 0);
            LCD_PrintString("mmc:0:0");
        }

  

Can you check if this code snippet is working. Just to confirm if the connection is proper. Also can you please use a 2GB SD card and test the project. Also can you try formatting in FAT32 and use the FAT 32 library and test again.

Thanks,

Hima

0 Likes

Hello,

Thanks for your help but it not working, PSoC tell me it's an undeclared identifier, but I don't know what is his identifier.

I must include the identifier for status_t and for pInfo

I don't have a 2GB card I must buy one for try, and at least I tried to format in FAT32 and change my library and it's seems like it works.

Thanks

M.

0 Likes

Hello,

It's work I can create en write in a .txt file. But I want to return to the line at all step.

I found I must use \n but it doesn't work,  Do you have an idea for how I can do that

Thanks

M.


					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
0 Likes

Can you please elaborate the requirement. Do you want to write new line into the text file?

Thanks,

Hima

0 Likes