cancel
Showing results for 
Search instead for 
Did you mean: 

i'm unable to write more than 15 characters in fatfs file system. how to configure for a 1kb file?

Ark1
Associate II
 
9 REPLIES 9

Are we talking about length of file name, or f_write()?

The latter should just work.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Ark1
Associate II

We are talking about the length of the file . i can't able to write more than 15 characters by FATFS .

You're doing something gravely wrong, should I try to guess?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
David Littell
Senior III

Clearly the problem is on line 37. 😉

There should be dozens of working examples of FatFs under the HAL library trees, ones where I can readily write 32MB and 650MB files with no configuration or option changes.

Please present your issue in a way that allows for constructive analysis, and doesn't require us to live inside your head to understand the details.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Ark1
Associate II

i'm beginner to this, i'm learning things like to present my problems and i'm working on it. i feel your difficulty of understanding my statements. i'm not good at this, it takes time. you don't need to live inside my head, that's none of your business. if you doesn't understand my problems then leave, don't cross your limit. this is community i'm here clear my doubt's & learning things. if you are able to clear my doubt! do it. if you don't then it's not compulsion to you, just leave it as it is.:pouting_face: :pouting_face:

Andrew Neil
Evangelist

Think about it: nobody here knows anything about you, or your project, or the code you've written/copied.

So how can we possibly help you to find your problem?

It's like you saying, "My car won't go - what's wrong with it?" - how could anyone possibly answer that with no further information?

Debugging is a key skill in any form of development

How To Debug: https://www.avrfreaks.net/comment/2418156#comment-2418156

Ark1
Associate II

thank you @Andrew Neil​ 

I just need you to lay out some context and provide specifics. You're trying to describe what you see from your perspective, as only you are present.

Here's a checklist

What chip and board are you using?

How is the SD Card socket connected to the board?

What software are you building?

Is it an existing example?

What have you tried?

Show the salient code

Show the output and error/status codes

Add code so you understand what is happening, use a USART

Is the issue with the FatFs or DISKIO levels of software?

How large is the SD Card?

Can you read, write or format on a PC?

FatFs code to add more than 15 characters to a file

  if (f_open(&fil, "LOG.TXT", FA_OPEN_ALWAYS | FA_WRITE) == FR_OK)
  {
    UINT BytesWritten;
    const char string[] = "Another line gets added\r\n";
    f_lseek(&fil, f_size(&fil));
    f_write(&fil, string, strlen(string), &BytesWritten);
    f_close(&fil);
  }

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..