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 06 Oct 2007 09:54 AM by  mikee@logicpd.com
Yaffs access
 7 Replies
Sort:
You are not authorized to post a reply.
Author Messages
jdionne
New Member
New Member
Posts:


--
27 Sep 2007 07:21 AM
    Hi every one,

    Is it possible to access the yaffs from a C application created with cygwin?

    I like to be able to open a file read/write it.

    I can't find any info on this. Any info seems to talk about CE


    Thanks
    ashwinb@logicpd.com
    New Member
    New Member
    Posts:


    --
    27 Sep 2007 08:50 AM
    The application will be running under what OS? Logic provides a YAFFS driver for WinCE to export the flash as a mounted directory that can be accessed as a hard disk. In Linux we use the MTD layer with the YAFFS driver to interact with it.

    Regards
    jdionne
    New Member
    New Member
    Posts:


    --
    27 Sep 2007 09:35 AM
    This is an elf file loaded at the losh> prompt, I guess the OS would be LOLO
    paulc@logicpd.com
    New Member
    New Member
    Posts:


    --
    27 Sep 2007 09:16 PM
    If you are going to try to access a filesystem, I would recommend using an OS like WinCE or Linux or other.
    jdionne
    New Member
    New Member
    Posts:


    --
    28 Sep 2007 06:55 AM
    I need the access at low level to store boot options, by the time the OS loads its to late.
    paulc@logicpd.com
    New Member
    New Member
    Posts:


    --
    28 Sep 2007 10:48 PM
    Please explain what you mean. What boot options? Why is it too late?
    jdionne
    New Member
    New Member
    Posts:


    --
    01 Oct 2007 07:40 AM
    At boot time I would like to boot either to the OS or to a Diag application or to lolo. So I need a place to store that info so at boot I can read it.
    It needs to be in none volatile memory.

    So its too late by the time the OS loads because the diag program runs at the lolo level.
    mikee@logicpd.com
    New Member
    New Member
    Posts:


    --
    06 Oct 2007 09:54 AM
    Take a look at using a combination of; LoLo boot time script, LoLo environment variables, and LoLo shell conditional execution.

    For example, you can use LoLo's x command to read a piece of non-volatile memory (SRAM, flash, etc.) or perhaps a GPIO connected to a button.

    The x command saves what it read into the @ environment variable. You can then use LoLo's logical and conditional operators to do what you want.

    For example:
    x 0xaabbccdd ; read some address
    MY_VALUE = $@ ; save the value read into a new variable (@ will be overwritten by another command eventually)
    if ( $MY_VALUE & 0x01 ) ; see if some bit is set
    load bin my_ce_image
    else
    load elf my_diagnostic_application
    endif
    exec


    Of course, where and what you read, test for, and load is completely up to you. But this might give you some ideas.

    If you try doing raw writes and reads using NOR flash, you'll need to make sure you don't conflict with any existing file system. So I think the best application of the above method is either a GPIO, SRAM, or an internal scratch register - something that doesn't require the overhead of flash.

    Another option would be to use LoLo's YAFFS file system and a simple marker file. By marker file I mean a file that doesn't actually contain any information, rather it's mere existence indicates that some action should or should not be taken. Think of it like a UNIX lock file. In that case, you can leave a marker file in the YAFFS partition when your OS is running. When LoLo boots, a boot time script can mount the YAFFS partition and then try and cat the file. If the cat command succeeds, the ? environment variable will be 0. If the cat command fails, then the ? variable will contain the error code.

    Quickly:
    add-yaffs boot nor 0x... 0x...
    mount yaffs /boot
    cat /boot/my_marker_file
    if $?
    echo 'marker file not there - load something'
    else
    echo 'marker file there - load something else'
    endif


    Read the LogicLoader's User Manual and Command Guide for complete details.

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