Proton24 SD FAT File System - Page 3


+ Reply to Thread
Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 46

Thread: Proton24 SD FAT File System2497 days old

  1. #31
    bugi
    Guest bugi's Avatar

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    Dear Les,

    Thank you very much indeed for your understanding and detailed information. You always think for the best.

    By the way, sorry for my basic level English, due to this reason I can not explain/ask everything absolutely detailed and meaningful. My sentences may be a little bit gauche, sorry for that. Reading is easier than writing everytime.

    Best Wishes
    Bugra

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #32
    Junior Member JimDrew's Avatar
    Join Date
    Jun 2020
    Posts
    49
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    288.60 MB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    So, I am creating code to test every function of the FAT file system (based on the info here: http://www.protonbasic.co.uk/content...AT-File-System) and found the following:

    File_RmDir does not exist. I did find a Procedure called File_DeleteDir.
    File_DirExists does not exist. I am not sure what should replace it.
    File_ChDir does not exist (the example shows ChDir instead of File_ChDir). I did find a Procedure called FAT_ChDir.
    Last edited by JimDrew; 10th June 2020 at 03:03.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #33
    Junior Member JimDrew's Avatar
    Join Date
    Jun 2020
    Posts
    49
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    288.60 MB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    By the way, since Microsoft's LFN patents have long since expired, would anyone be interested in a bounty to add LFN support? I am serious about this.

    I found FAT_DirExists to replace File_DirExits above.
    File_RenameDir is missing from the list of file commands, but it's there in the code!
    Last edited by JimDrew; 10th June 2020 at 04:17.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #34
    Prolific Poster normnet's Avatar
    Join Date
    Jul 2004
    Posts
    2,430
    Thumbs Up
    Received: 81
    Given: 48
    Total Downloaded
    1.41 GB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    Quote Originally Posted by JimDrew View Post
    By the way, since Microsoft's LFN patents have long since expired, would anyone be interested in a bounty to add LFN support? I am serious about this...
    Long filename (LFN), a FAT filename system introduced in Windows NT 3.5 and Windows 95.

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #35
    Junior Member JimDrew's Avatar
    Join Date
    Jun 2020
    Posts
    49
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    288.60 MB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    Yes, sorry.. LFN = long filename.

    I also found that File_IsFull does not exist. I did find a procedure called File_DiskFull.

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #36
    Prolific Poster normnet's Avatar
    Join Date
    Jul 2004
    Posts
    2,430
    Thumbs Up
    Received: 81
    Given: 48
    Total Downloaded
    1.41 GB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    I think Les has said in the past these programs are posted as open source for development purposes. Jim glad you are having a good look into it.

    Norm

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #37
    Junior Member JimDrew's Avatar
    Join Date
    Jun 2020
    Posts
    49
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    288.60 MB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    I now have made a real "All_Commands_Demo", that demonstrates every possible command. I understand how long filenames work, but I don't understand Proton24's BASIC enough to be able to implement it at that level. I really don't want to have to take the code and completely re-work it so it's in straight optimized assembly, and then make the changes for long filenames. That just doesn't sound like a lot of fun to me!

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #38
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,749
    Thumbs Up
    Received: 371
    Given: 177
    Total Downloaded
    2.09 GB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    The file system I wrote for teh Proton24 compiler was something I knocked together in a few days, quite a few years ago, and I know it has a few flaws in it, but I was hoping some more of the users would get into the code and make any changes that corrected the flaws that I haden't spotted. I added as much information as I could, in the time, around the code and didn't use any querky code, so it was easier understood. I did make a flaw with th size of the strings used for the file name and the was the file name was parsed, but I think I corrected that a few months ago with the included library code.

    Sorry, but since my injury, I do have some short term memory issues, so I write everything down, when I remember that I have too. LOL A decreasing circle of "I forget to remember" :-)

    Please... If you spot any flaws in the samples or libraries I supply with the compiler, inform me and I will see what I can do, or if a user can correct the flaws, please do and post the updated code on the forum for others to chack out. I will then update the code for the next compiler update.

  16. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #39
    Junior Member JimDrew's Avatar
    Join Date
    Jun 2020
    Posts
    49
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    288.60 MB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    I have found that the following functions do not work (fail):

    File_DirExists - replaced the example code for File_Exists, which works fine for files. The directory is never found.
    File_RmDir (actually called File_DeleteDir in the code) does not delete a directory.
    File_RenameDir does not rename a directory.
    File_ChDir does not change a directory.

    File_MkDir works fine. I can also list directory contents (root directory only since I can't change to a sub-directory).

    I noticed that some of the directory commands were using pFileName instead of pDirName. I changed those but that did not fix the issue. I am going to re-install Proton24 on the off chance that I killed something in the .inc file by accident.

  18. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  19. #40
    Junior Member JimDrew's Avatar
    Join Date
    Jun 2020
    Posts
    49
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    288.60 MB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    Ok, here is a good example of the File_DirExists and File_RmDir functions failing.

    Notice the defines for File_DirExists and File_RmDir functions because neither are in the FileSys24.inc.

    This code works on the Firewing board with the LCD Plus shield.

    Code:
    ' fw_test.bas - By Jim Drew
    
        Device = 24HJ128GP502
        Declare Xtal = 79.23
    '
    ' UART1 setup for Firewing
    '
        Declare Hserial_Baud = 38400
        Declare HRSOut1_Pin = PORTB.3               ' Select which pin is to be used for TX with USART1
        Declare HRSIn1_Pin = PORTB.2                ' Select which pin is to be used for RX with USART1
    
    '
    ' SD Card SPI pin definitions for Firewing w/LCD Plus shield
    
        $define SD_CLK PORTB.14                      ' SPI CLK to SD card CLK pin
        $define SD_SDO PORTB.12                      ' SPI DO to SD card DI pin
        $define SD_SDI PORTB.13                      ' SPI DI to SD card DO pin
        $define SD_CS PORTB.11                      ' SPI CS to SD card CS pin (active low)
    
        Include "FileSys24.inc"                     ' Load the FAT file system procedures into the program
    
        Dim MyDirName As String * 11
                                                     
    ' NOTE: the following lines should really be added to FileSys24.inc:
    
    $define File_DirExists(pDirName) FAT_DirExists(pDirName)
    $define File_RmDir(pDirName) FAT_Delete(pDirName, FAT_cDirectory)
       
    '----------------------------------------------------------------------------------------------------------------------------------------
    
    Main:
        PLL_Setup(43, 2, 2, $0300)                              ' Configure the Oscillator to operate the device at 79.23MHz
        PPS_Output(cOut_Pin_RP3, cOut_Fn_U1TX)                  ' Make Pin RB3 U1TX
    
        MyDirName = "test1"
    
        If FAT_Init() = cErrOK Then                             ' Can we initialise the FAT?     
            HRSOut1 "SD initialized\r\r"
        Else
            HRSOut1 "SD failed to initialize\r"                 ' send error response
            End
        EndIf
    
        If File_DirExists (MyDirName) = False Then                ' Does the directory exist?
            If File_MkDir (MyDirName) = cErrOK Then             ' no, so try to create it
                HRSOut1 "Created ",MyDirName,13,13              ' created!
            Else
                HRSOut1 "Could not create ",MyDirName,13,13     ' not created!
                End
            EndIf
        EndIf
    
        DirListing()                                            ' show directory listing
        HRSOut1 "\r\r"
    
        If File_DirExists (MyDirName) = True Then                ' Does the directory exist?
            HRSOut1 "Found ",MyDirName,13,13                    ' yes!
        Else
            HRSOut1 "Did not find ",MyDirName,13,13             ' no!
        EndIf
    
        If File_RmDir (MyDirName) = cErrOK Then                    ' was directory deleted?
            HRSOut1 "Removed ",MyDirName,13,13                  ' yes!
        Else
            HRSOut1 "Did not remove ",MyDirName,13,13             ' no!
        EndIf                
    
        DirListing()                                            ' show directory listing
        HRSOut1 "\r\r"
    
        End
        
    ;----------------------------------------------------------------------------------------------------------------------------------------
    ; Transmit the disk directory to a serial terminal
    
    Proc DirListing()
        Dim FileDirName As String * 11
    
        While
            FileDirName = File_GetDir()                     ' Look for directories
            If FileDirName_0 = 0 Then                       ' Are there any more directories?
                While                                       ' No. So...
                    FileDirName = File_GetFile()            ' Look for files
                    If FileDirName_0 = 0 Then Return        ' Exit when no more files
                    HRSOut1 FileDirName, " : ", Dec File_dSize, " bytes\r" ' Transmit the file name and its size
                Wend
            EndIf
            HRSOut1 FileDirName, 13                          ' Transmit the Directory name
        Wend
    EndProc
    
    '----------------------------------------------------------------------------------------------------------------------------------------
    ' Configure for internal 7.37MHz oscillator with PLL
    ' OSC pins are general purpose I/O
    '
        Config FBS = BWRP_WRPROTECT_OFF
        Config FSS = SWRP_WRPROTECT_OFF
        Config FGS = GWRP_OFF
        Config FOSCSEL = FNOSC_FRCPLL, IESO_OFF
        Config FOSC = POSCMD_NONE, OSCIOFNC_ON, IOL1WAY_OFF, FCKSM_CSECME
        Config FWDT = WDTPOST_PS256, WINDIS_OFF, FWDTEN_OFF
        Config FPOR = FPWRT_PWR128, ALTI2C_OFF
        Config FICD = ICS_PGD1, JTAGEN_OFF
    This code should init the SD card (which it does successfully), then create the directory TEST1 (which it does successfully), then see if directory TEST1 exists (which fails), and then delete the directory TEST1 (which also fails). Every time you run the code it creates another new TEST1 directory!

    File_RenameDir() and File_ChDir() also fail, so I am guessing there is something fundamentally wrong somewhere having to do with locating a directory.

  20. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  21. #41
    Junior Member JimDrew's Avatar
    Join Date
    Jun 2020
    Posts
    49
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    288.60 MB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    I spent several more hours looking into this. I uninstalled the latest code and re-installed the version I got in 2014. I compared that FileSys24.inc with what is available today and the only changes (besides the copyright notice) was that FAT_Dir and File_Rename both use * 12 for the string length instead of * 11.

    I tried with various size SD cards, testing both FAT16 and FAT32. The only directory related function that appears to work is File_MkDir.

  22. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  23. #42
    Junior Member JimDrew's Avatar
    Join Date
    Jun 2020
    Posts
    49
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    288.60 MB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    $250 bounty for anyone who can fix the directory commands and add support for long filenames. I would like the changes released to the public, not kept private so everyone can benefit - but I am willing to pay the bounty.


  24. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  25. #43
    Prolific Poster normnet's Avatar
    Join Date
    Jul 2004
    Posts
    2,430
    Thumbs Up
    Received: 81
    Given: 48
    Total Downloaded
    1.41 GB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    Perhaps an example program usually in C would also make this more doable as I had looked at one time with no luck. Not a serious contender.

  26. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  27. #44
    Junior Member JimDrew's Avatar
    Join Date
    Jun 2020
    Posts
    49
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    288.60 MB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    For the various directory functions that don't work, I guess I could compare the standard Proton BASIC FAT handler to the Proton24 version. That still won't give me long filenames though.

  28. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  29. #45
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,749
    Thumbs Up
    Received: 371
    Given: 177
    Total Downloaded
    2.09 GB

    0 Not allowed!

    Default Re: Proton24 SD FAT File System

    You would be better off looking at the CH376 chip Jim, so that a USB disk can be used, as well as an SD card. They have gone up in price since this Covid pandemic, but that is, unfortunately, the way of things now.... Using external influences to bump prices up for no reason other than greed. :-(

    Here's one:

    https://www.ebay.co.uk/itm/1pcs-CH37...AAAOSwpFtb~LD9

    or a PCB:

    https://www.ebay.co.uk/itm/1PCS-CH37...0AAOSwl-ddBPsY

    It means the microcontroller is not full of disk and FAT procedures that take up a lot of RAM and code space and they can be acccessed extremely fast. It also means any of the microcontrollers can use them. It would be very straightforward to implement a form of long filename with a text file to associate the names on the disk with the "real" long names, and could be made automatic when a file was created or its directory scanned and listed, or read etc... The underlying long filename mechanism uses a similar type of thing, but the names are in sectors associated with the FAT tables, not a file.

    I was sent one from a forum user last year, but I simply have not had the time to create a library for it. Good quality libraries take quite a lot of time and thought, and creating them for the forum does not bring the pennies in unfortunatley. For me.... Times have changed dramatically, so I can no longer do things for free as I used to do willingly. :-(
    Last edited by top204; 29th September 2020 at 13:12.

  30. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. [SOLVED !] SD File system 18F4550
    By Theotje in forum USART and Enhanced USART module / LIN bus support
    Replies: 3
    Last Post: 6th January 2018, 13:32
  2. Proton24 SD FAT, SD_CTIMEOUTLIMIT not found error
    By tadd in forum Absolute Beginners Section
    Replies: 8
    Last Post: 8th February 2016, 09:25
  3. Fat32 file system
    By bugi in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 11th November 2011, 00:42
  4. [SOLVED !] SD file system
    By dmTulsa in forum SWright's Feedback Forum
    Replies: 1
    Last Post: 14th March 2010, 17:59

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts