Hi, every one, I'm trying to use RAM drive with RL-Flash File System on blinky example.
I use MCBSTM32E board , I follow up RL-Flash File System guide instructions.
import FS_CM3.lib, copy retarget and file File_config.c to project library.
I configured File_config.c like this,
Number of open Files :8 CPU Clock Fq :60000000
device size : 0x0000 4000 number of Sector : 32 relocate device buffer : Yes Default Drive : Yes
I modifed File_ex1 capture_file fonc. and clean all blinky tasks. Just work Task2 . I add serial output end of code too.
/*---------------------------------------------------------------------------- * Task 2 'phaseB': Phase B output *---------------------------------------------------------------------------*/ __task void phaseB (void) { for (;;) { LED_On(LED_A); os_dly_wait (50); LED_Off(LED_A); os_dly_wait (50); os_dly_wait(250); printf("Check Serial\n\r"); capture_file('a'); } } /*---------------------------------------------------------------------------- * Capture / Create File *---------------------------------------------------------------------------*/ void capture_file (char mode) { FILE *f; char *fmode; if (mode == 'C') { /* Capture file */ printf("\nCapture data to file: %s",filename); fmode = "w"; } else { /* Append file */ printf("\nAppend data to file: %s",filename); fmode = "a"; } printf("\nPress ESC to stop.\n"); f = fopen (filename,fmode); /* open a file for writing */ if (f == NULL) { printf ("\nCan not open file!\n");/* error when trying to open file */ return; } fprintf (f, "SAMPLE TEXT\n\r"); fclose (f); /* close the output file */ printf ("\nFile closed.\n"); }
Serial Out put like this,
[RX] - Check Serial<CR><LF> <CR> <CR><LF> Append data to file: R:\Dump_file.log<CR><LF> Press ESC to stop.<CR><LF> <CR><LF> Can not open file!<CR><LF> Check Serial<CR><LF> <CR> <CR><LF> Append data to file: R:\Dump_file.log<CR><LF> Press ESC to stop.<CR><LF> <CR><LF> Can not open file!<CR><LF>
I used SD card before with same board, it was sample GPS logger. I logged GPRMC data to SD file. I remembered just importing SDIO_STM32F103.c.I rememeber can easly crate and write files on SD.
I just need 16Kb data storage on RAM drive for buffer. It has to be easy as SD card example.
Did I missed some configration file, Thanks your help guidence
Best Regards.