FAT32_Dir() How to save results to a file or display on TFT
FAT32_Dir() How to save results to a file or display on TFT
Hi,
I have an application where I wish to use the FAT32 Library. One of the tasks I wish to perform is display the directory contents on screen.
The FAT32 Library help file description says "Displays contents of the current directory via user-defined medium (i.e. UART module, a file on FAT32 file system). The function displays character by character".
Exactly how is the definition of the medium achieved? The FAT32_Dir() function only returns success or failure, so where does the directory list go?
The example provided with the FAT32 Library is simply
err = FAT32_Dir();
UART_Write(CR);
How does the data get into the UART buffer?
I am using mikroC PRO for ARM ver 4.5 and the EasyMX PRO v7 Development board.
Thanks for your assistance
Regards
Brett
I have an application where I wish to use the FAT32 Library. One of the tasks I wish to perform is display the directory contents on screen.
The FAT32 Library help file description says "Displays contents of the current directory via user-defined medium (i.e. UART module, a file on FAT32 file system). The function displays character by character".
Exactly how is the definition of the medium achieved? The FAT32_Dir() function only returns success or failure, so where does the directory list go?
The example provided with the FAT32 Library is simply
err = FAT32_Dir();
UART_Write(CR);
How does the data get into the UART buffer?
I am using mikroC PRO for ARM ver 4.5 and the EasyMX PRO v7 Development board.
Thanks for your assistance
Regards
Brett
- darko.minic
- Posts: 747
- Joined: 01 Dec 2014 11:10
Re: FAT32_Dir() How to save results to a file or display on
Hello,
I tried FAT32 example with my EasyMx Pro v7 with STM32F207, and I was able to read contents of directory via USART terminal.
If I understand correctly you didn't managed to successfully read contents of directory via USART terminal?
Regards,
Darko
I tried FAT32 example with my EasyMx Pro v7 with STM32F207, and I was able to read contents of directory via USART terminal.
If I understand correctly you didn't managed to successfully read contents of directory via USART terminal?
Regards,
Darko
Re: FAT32_Dir() How to save results to a file or display on
Hi Darko,
Thank you for your reply.
I was able to get the example to work.
My problem is that I wish to place the data in a file on the FAT32 file system NOT send it to the USART.
The Help File installed with the FAT32 Library says that the FAT32_Dir() function can be configured to place the results of the function (directory contents) in a file on the FAT32 file system, however there is no explanation as to how this is achieved.
How do I define the medium to which the FAT32_Dir() function will display its results?
By what form of magic does the FAT32_Dir() function place the result in the USART buffer?
Thanks again
Brett
Thank you for your reply.
I was able to get the example to work.
My problem is that I wish to place the data in a file on the FAT32 file system NOT send it to the USART.
The Help File installed with the FAT32 Library says that the FAT32_Dir() function can be configured to place the results of the function (directory contents) in a file on the FAT32 file system, however there is no explanation as to how this is achieved.
How do I define the medium to which the FAT32_Dir() function will display its results?
By what form of magic does the FAT32_Dir() function place the result in the USART buffer?
Thanks again
Brett
- darko.minic
- Posts: 747
- Joined: 01 Dec 2014 11:10
Re: FAT32_Dir() How to save results to a file or display on
Hi Brett,
I can recommend you to search our Libstock Website to see whether some user posted project which may help you.
There is plenty projects related to FAT32 library, please refer following link:
http://www.libstock.com/
Regards,
Darko
I can recommend you to search our Libstock Website to see whether some user posted project which may help you.
There is plenty projects related to FAT32 library, please refer following link:
http://www.libstock.com/
Regards,
Darko
Re: FAT32_Dir() How to save results to a file or display on
I'm sorry Darko, I don't find your response satisfactory.
I have asked a reasonable question with regard to the function of your product. The documentation on the FAT32_Dir function clearly states that it can be configures, however offers no explanation as to how. I would like to know how this is achieved.
To tell me to search libstock to see if "some user" has an example is highly unprofessional.
If you do not know how to answer my question please escalate my request to someone who does.
Brett
I have asked a reasonable question with regard to the function of your product. The documentation on the FAT32_Dir function clearly states that it can be configures, however offers no explanation as to how. I would like to know how this is achieved.
To tell me to search libstock to see if "some user" has an example is highly unprofessional.
If you do not know how to answer my question please escalate my request to someone who does.
Brett
- darko.minic
- Posts: 747
- Joined: 01 Dec 2014 11:10
Re: FAT32_Dir() How to save results to a file or display on
Hi Brett,
I mentioned Libstock because you can there find examples which can help you to understand how FAT32_Dir() function works.
I wrote some simple example how to displays contents of the current directory with FAT32_Dir() via UART:
If you want for example to displays contents of the current directory on TFT, you should adjust following lines of code in __Lib_FAT32_Driver_STM32.c:
Regards,
Darko
I mentioned Libstock because you can there find examples which can help you to understand how FAT32_Dir() function works.
I wrote some simple example how to displays contents of the current directory with FAT32_Dir() via UART:
Code: Select all
UART1_Init(115200);
Delay_100ms();
UART1_Write_Text("Test");
SPI3_Init_Advanced(_SPI_FPCLK_DIV64, _SPI_MASTER | _SPI_8_BIT |
_SPI_CLK_IDLE_LOW | _SPI_FIRST_CLK_EDGE_TRANSITION |
_SPI_MSB_FIRST | _SPI_SS_DISABLE | _SPI_SSM_ENABLE | _SPI_SSI_1,
&_GPIO_MODULE_SPI3_PC10_11_12);
Delay_100ms();
while(FAT32_Init() != 0)
;
UART_Write_Text("Init OK");
UART_Write(CR);
FAT32_Dir();
UART_Write(CR);
Code: Select all
////////////////////////////////////////////////////////////////////////////////
//
// Dev_PutChar() is used by FAT32_Dir function for printing the contents
// of the current folder, which is done 1 character at the time.
//
// User may change this function to reroute that on some other device,
// GLCD, TFT, Flash, EEPROM, or Ethernet module, to name a few.
//
// It must return Returns OK on success and ERROR on failure.
//
////////////////////////////////////////////////////////////////////////////////
int8 FAT32_Put_Char(char ch)
{
UART_Write(ch);
return OK;
}
Darko
-
- Posts: 2
- Joined: 12 Apr 2011 09:25
Re: FAT32_Dir() How to save results to a file or display on
Brett_S: Did you get the FAT32_Dir to work on the TFT?
I can help you with a solution if you still needd one.
Dennis
I can help you with a solution if you still needd one.
Dennis
-
- Posts: 4
- Joined: 02 Jul 2019 08:23
Re: FAT32_Dir() How to save results to a file or display on
Hi DennisMclean,
Can you tell me, how you used that FAT32_Dir() for displaying the directory contents.
I need all the directory contents to be displayed on UART5.
I tried
Also I tried
But nothing happened.
Will be waiting for the response.
Yousaf
Can you tell me, how you used that FAT32_Dir() for displaying the directory contents.
I need all the directory contents to be displayed on UART5.
I tried
Code: Select all
UART5_Write(FAT32_Dir());
Code: Select all
FAT32_Dir();
UART5_Write(CR);
Will be waiting for the response.
Yousaf
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: FAT32_Dir() How to save results to a file or display on
Hi Yousaf,
You can try it in this way:
Kind regards,
You can try it in this way:
Code: Select all
UART_Set_Active(&UART5_Read, &UART5_Write, &UART5_Data_Ready, &UART5_Tx_Idle);
FAT32_Dir();
UART_Write(CR);
Stefan Filipović
Re: FAT32_Dir() How to save results to a file or display on
How do I read the directory and store it (as a text file) on the card ?
Thanks
Thanks
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: FAT32_Dir() How to save results to a file or display on
Hi,
Please refer to Darko's post above.
Kind regards,
Please refer to Darko's post above.
Kind regards,
Stefan Filipović
Re: FAT32_Dir() How to save results to a file or display on
filename = "TESTFILE.txt"
FAT32_Open(@filename, FILE_WRITE_F32)
FAT32_Dir()
FAT32_Put_Char(SD_data)
FAT32_Write(0, @SD_data, 1)
FAT32_Close(0)
The above does not work.
How do you test that the Dir command has finished ?
FAT32_Open(@filename, FILE_WRITE_F32)
FAT32_Dir()
FAT32_Put_Char(SD_data)
FAT32_Write(0, @SD_data, 1)
FAT32_Close(0)
The above does not work.
How do you test that the Dir command has finished ?
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: FAT32_Dir() How to save results to a file or display on
Hi Richie,
Have you adjusted the FAT32_Put_Char function in __Lib_FAT32_Driver_STM32.c file as Darko described?
Kind regards,
Have you adjusted the FAT32_Put_Char function in __Lib_FAT32_Driver_STM32.c file as Darko described?
It will return 0 when writing on the user-defined medium was successful.How do you test that the Dir command has finished ?
Kind regards,
Stefan Filipović
-
- Posts: 1
- Joined: 04 Oct 2017 21:26
Re: FAT32_Dir() How to save results to a file or display on TFT
Hello everyone
How to display the directory of a microSD on a TFT LCD with FT810 module?
Kind regards,
How to display the directory of a microSD on a TFT LCD with FT810 module?
Kind regards,