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
Location: Milano

Re: Simple DataLogger for STM32F4-Discovery

Postby Fede » Wed Jan 09, 2013 2:50 pm

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 444 times

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Simple DataLogger for STM32F4-Discovery

Postby Tectu » Wed Jan 09, 2013 3:00 pm

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
Location: Milano

Re: Simple DataLogger for STM32F4-Discovery

Postby Fede » Wed Jan 09, 2013 8:39 pm

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: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Simple DataLogger for STM32F4-Discovery

Postby Tectu » Wed Jan 09, 2013 8:41 pm

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

Postby benwynne » Sun May 22, 2016 7:10 pm

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


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 6 guests