Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 23 Nov 2004 10:30 AM by  mikee@logicpd.com
Flash File system
 7 Replies
Sort:
You are not authorized to post a reply.
Author Messages
mpinton
New Member
New Member
Posts:


--
11 Oct 2004 06:50 AM
    Hi,
    If I want to create a file using the non-volatile file system(Flash FS), should this work:

    HANDLE lhFile = ::CreateFile(_T("\\NOR Flash\\testfile.txt"),
    GENERIC_READ | GENERIC_WRITE,
    FILE_SHARE_READ,
    NULL,
    OPEN_ALWAYS,
    FILE_ATTRIBUTE_NORMAL,
    NULL);
    ASSERT(lhFile != INVALID_HANDLE_VALUE);


    Prior to executing the above code (which fails) , I can see on the device through the Storage Manager that I have the approx 4.2MB partition. The .reg file for the FlashFMD has auto-format on and auto-partition. (Note, formatting from the GUI on the device always fails).

    Do I need to do anything else?

    Thanks,
    /michel
    mpinton
    New Member
    New Member
    Posts:


    --
    11 Oct 2004 07:17 AM
    BTW, here's the output from the debug log when I attempt to run my test app using the above code snippet:

    run Programs: s DriverTest
    4294904049 PID:e1be523e TID:61a72866 0x8197d000: RELFSD: Opening file DriverTest.exe from desktop
    4294904269 PID:61b4efa2 TID:61a72866 0x8197d000: >>> Loading module DriverTest.exe at address 0x12010000-0x12018000
    Loaded symbols for 'C:\WINCE420\PUBLIC\LONGITUDEMETER\RELDIR\LOCE_A400_REL_101DEBUG\DRIVERTEST.EXE'
    4294904279 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() - request runs off end of media
    4294904280 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() failed.
    4294904281 PID:e1be523e TID:61a72866 0x8197d000: FATFS!ReadWriteDisk(READ, sector 524320) failed (27)
    4294904282 PID:e1be523e TID:61a72866 0x8197d000: FATFS!ReadWriteDisk: retrying...
    4294904283 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() - request runs off end of media
    4294904284 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() failed.
    4294904285 PID:e1be523e TID:61a72866 0x8197d000: FATFS!ReadWriteDisk(READ, sector 524320) failed (27)
    4294904286 PID:e1be523e TID:61a72866 0x8197d000: FATFS!FindNext: unexpected error (27)
    4294904287 PID:e1be523e TID:61a72866 0x8197d000: FATFS!FAT_GetFileAttributesW(\testfile.txt) returned 0xffffffff (27)
    4294904289 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() - request runs off end of media
    4294904289 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() failed.
    4294904291 PID:e1be523e TID:61a72866 0x8197d000: FATFS!ReadWriteDisk(READ, sector 524320) failed (27)
    4294904291 PID:e1be523e TID:61a72866 0x8197d000: FATFS!ReadWriteDisk: retrying...
    4294904292 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() - request runs off end of media
    4294904293 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() failed.
    4294904294 PID:e1be523e TID:61a72866 0x8197d000: FATFS!ReadWriteDisk(READ, sector 524320) failed (27)
    4294904295 PID:e1be523e TID:61a72866 0x8197d000: FATFS!FindNext: unexpected error (27)
    4294904297 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() - request runs off end of media
    4294904297 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() failed.
    4294904299 PID:e1be523e TID:61a72866 0x8197d000: FATFS!ReadWriteDisk(READ, sector 524320) failed (27)
    4294904299 PID:e1be523e TID:61a72866 0x8197d000: FATFS!ReadWriteDisk: retrying...
    4294904301 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() - request runs off end of media
    4294904301 PID:21bcea82 TID:61a72866 0x8197d000: FLASHDRV.DLL:ReadFromMedia() failed.
    4294904303 PID:e1be523e TID:61a72866 0x8197d000: FATFS!ReadWriteDisk(READ, sector 524320) failed (27)
    4294904303 PID:e1be523e TID:61a72866 0x8197d000: FATFS!FAT_CreateFileW(\testfile.txt) returned 0x0 (27)
    4294904305 PID:61b4efa2 TID:61a72866 0x8197d000: Unknown: DEBUGCHK failed in file C:\work\Longitude\eVC\projects\DriverTest\DriverTest\DriverTest.cpp at line 43

    mikee@logicpd.com
    New Member
    New Member
    Posts:


    --
    12 Oct 2004 01:56 PM
    Michel,

    That should work. Can you open a file that has already been created on the partition and read it's contents?

    --mikee
    mpinton
    New Member
    New Member
    Posts:


    --
    28 Oct 2004 01:22 PM
    Forgetting about my test application, I get all sorts of errors during initialization see my long post with debug output, http://www.logicpd.com/support/tdg/viewtopic.php?t=225.

    If I bring up the remote file view and simply try to browse the \\NOR Flash directory I see a bunch of debug errors, too. Something is screwed up from the start.

    Perhaps it's what I am including in my build? Under "File Systems and Data Store" I have -
    Bit-based
    RAM and ROM File System
    RAM-based Regsitry
    Storage Manger (and under that)
    Binary Rom Image File System
    FAT File System

    In the "Device Drivers" , under Storage Devices I have the lpd_MSFLASHFMD_beta_001.

    TIA,
    /michel
    mikee@logicpd.com
    New Member
    New Member
    Posts:


    --
    28 Oct 2004 02:28 PM
    Try getting rid of the Binary ROM File System. BINFS is quite a different animal and you aren't using it.

    --mikee
    mpinton
    New Member
    New Member
    Posts:


    --
    29 Oct 2004 03:06 PM
    FYI,
    I removed the BINFS but it made no difference.
    Thanks,
    /michel
    mpinton
    New Member
    New Member
    Posts:


    --
    17 Nov 2004 07:20 AM
    Hi,
    I am getting different results on different LH7A400 boards. We have 2 development kits and a number of additional CardEngines. I don't believe I have had any success getting the Flash File System to work in any debug build (RAM-builds). I have success with Retail builds (Flash-and-decompress-to-RAM builds), but not all the time. Usually they work - I don't get all the errors and I can create a directory and a file in Flash. But sometimes they fail, or the directory create fails and the file create works.
    What can I do to try to figure this out?
    Thanks,
    /michel
    mikee@logicpd.com
    New Member
    New Member
    Posts:


    --
    23 Nov 2004 10:30 AM
    michel,

    I'm sorry that you are having so much trouble with this. I really think you need to contact Hans' group. We have several other customers using this functionality in their products and nobody else is having any trouble that I am aware of.

    I think that it must be something fundamental about what you are doing that isn't being translated well on this forum. Please give Hans and his gents a call so they can help you resolve this in a more timely manner.

    Regards,

    --mikee
    You are not authorized to post a reply.