Simple DataLogger for STM32F4-Discovery

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
User avatar
Fede
Posts: 37
Joined: Thu Nov 08, 2012 8:30 pm

Re: Simple DataLogger for STM32F4-Discovery

Post 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!
Attachments
STM32F407_FATFS.tgz
(32.9 KiB) Downloaded 695 times
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Simple DataLogger for STM32F4-Discovery

Post 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
User avatar
Fede
Posts: 37
Joined: Thu Nov 08, 2012 8:30 pm

Re: Simple DataLogger for STM32F4-Discovery

Post by Fede »

Hi Tectu,

now I understand, there were some errors in the pin configuration...
Also the "append" work fine!
Thanks a lot,
Fede
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Simple DataLogger for STM32F4-Discovery

Post by Tectu »

Happy to help. Enjoy your new toy ;-)


~ Tectu
benwynne
Posts: 1
Joined: Sun May 22, 2016 7:07 pm

Re: Simple DataLogger for STM32F4-Discovery

Post 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
Post Reply