ELM chhn library for fat32

Thread Starter

embedded.world

Joined Feb 27, 2014
38
I am using example provided by TI located in which uses Elm chan library:

C:\ti\TivaWare_C_Series-2.0.1.11577\examples\boards\dk-tm4c129x\sd_card


1. file "ff_conf.h" contains "#define _CODE_PAGE 932". What is its use. Due to this cc932.c gets included & its has large constant data in memory. Although I have enough memory but can I remove it. Almost 30K of constant data.

I want to use long file names along with it.

2. I had make a file "file.txt", successfully crated it & read data & them I can read that file in PC also.

But on creating file "data.xlsx" , file gets created successfully in MCU, but when I transfer that file in PC, windows don't open that file & return error

"Excel cannot open the file because file format or file extension is not valid. verify that file not corrupted and that file extension matches the format of file".

Obviously there could be different format for writing excel. But I don't what it is. I want to write data in different cells.

for(bw = 0 ; bw < 512 ; bw++)
{
my_buf[bw] = 0x31; /* write 1 in ascii */
}

/* mount drive */
x = f_mount(0 , &FatFs); /* Give a work area to the default drive */

/* open/create a text file */
x = f_open(&Fil, "/file.txt", FA_WRITE | FA_OPEN_ALWAYS);
x = f_lseek(&Fil, f_size(&Fil));
x = f_write(&Fil, &my_buf[0], 512, &bw); /* Write data to the file */
x = f_close(&Fil); /* Close the file */


/* open/create a excel file */
x = f_open(&Fil, "/my_file.xlsx", FA_WRITE | FA_OPEN_ALWAYS);
x = f_lseek(&Fil, f_size(&Fil));
x = f_write(&Fil, &my_buf[0], 512, &bw); /* Write data to the file */
x = f_close(&Fil); /* Close the file */
 

ErnieM

Joined Apr 24, 2011
8,377
I am using example provided by TI located in which uses Elm chan library:

C:\ti\TivaWare_C_Series-2.0.1.11577\examples\boards\dk-tm4c129x\sd_card
When trying to link to a file on your very own C drive please provide instructions to remote log onto your computer.

1. Try Google. Or Wikipedia.

2. Creating an excel file consists of following a proprietary data format for the data inside the file itself, not just giving the file the proper extension. A much simpler format (still very useful) is the .csv or comma separated format. Excel can handle it with ease but it is basically just a text file.

Again, Google and Wikipedia are your friends here.
 

spinnaker

Joined Oct 29, 2009
7,830
I am using example provided by TI located in which uses Elm chan library:

C:\ti\TivaWare_C_Series-2.0.1.11577\examples\boards\dk-tm4c129x\sd_card


1. file "ff_conf.h" contains "#define _CODE_PAGE 932". What is its use. Due to this cc932.c gets included & its has large constant data in memory. Although I have enough memory but can I remove it. Almost 30K of constant data.

I want to use long file names along with it.

2. I had make a file "file.txt", successfully crated it & read data & them I can read that file in PC also.

But on creating file "data.xlsx" , file gets created successfully in MCU, but when I transfer that file in PC, windows don't open that file & return error

"Excel cannot open the file because file format or file extension is not valid. verify that file not corrupted and that file extension matches the format of file".

Obviously there could be different format for writing excel. But I don't what it is. I want to write data in different cells.

You would need an intimate knowledge of the xls file structure. It will be many times easier to write an XML file.
 
Top