Skip to main content
Ark1
Associate III
September 13, 2018
Question

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

  • September 13, 2018
  • 9 replies
  • 1340 views

..

    This topic has been closed for replies.

    9 replies

    Tesla DeLorean
    Guru
    September 13, 2018

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Ark1
    Ark1Author
    Associate III
    September 13, 2018

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

    Tesla DeLorean
    Guru
    September 13, 2018

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

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    David Littell
    Senior II
    September 13, 2018

    Clearly the problem is on line 37. ;)

    Tesla DeLorean
    Guru
    September 13, 2018

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Ark1
    Ark1Author
    Associate III
    September 14, 2018

    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
    Super User
    September 14, 2018

    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

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Ark1
    Ark1Author
    Associate III
    September 14, 2018

    thank you @Andrew Neil​ 

    Tesla DeLorean
    Guru
    September 14, 2018

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..