Page 2 of 2

Re: Simple DataLogger for STM32F4-Discovery

Posted: Wed Jan 09, 2013 2:50 pm
by Fede
Hi all,

Great Scott! good news! works completely!!!
I have attached the project...
now I've only one little and stupid question: how can I perform the "append" during logger?

Code: Select all

chsprintf(&string[0],"Hello world! \r\n");
rc = f_open(&Fil, "HELLO.TXT", FA_WRITE | FA_CREATE_ALWAYS);
rc = f_write(&Fil, &string[0] , strlen(&string[0]), &bw);
rc = f_close(&Fil);


I think to use f_lseek() but I don't understand how...

Thank you all!

Re: Simple DataLogger for STM32F4-Discovery

Posted: Wed Jan 09, 2013 3:00 pm
by Tectu
Good to hear that you got it working. Did you find out what exactly the problem was of all the listed points?

To append to a file you do: open, seek(to end), write, close.
Here's the documentation of f_lseek(). To append, the offset is the current size of the file.


~ Tectu

Re: Simple DataLogger for STM32F4-Discovery

Posted: Wed Jan 09, 2013 8:39 pm
by Fede
Hi Tectu,

now I understand, there were some errors in the pin configuration...
Also the "append" work fine!
Thanks a lot,
Fede

Re: Simple DataLogger for STM32F4-Discovery

Posted: Wed Jan 09, 2013 8:41 pm
by Tectu
Happy to help. Enjoy your new toy ;-)


~ Tectu

Re: Simple DataLogger for STM32F4-Discovery

Posted: Sun May 22, 2016 7:10 pm
by benwynne
Hello All,

First time posting here. I'm using the STM32F407-Discovery board and would like to get this MMC+FAT example working. Seeing as this thread is pretty old. Can anyone please point me to an example compatible with ChibiOS_16.1.4??? There are lots of compile issues / variable changes between this example and the new Chibios Release.

Thanks all.

-Ben