This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Question about the Intel flash device driver(28F320C3B) with JFFS2. Thanks a lot


Hi all:
    While I tried to use the JFFS2 with flash device driver I encounter the
following problem:

Suppose there is a flash file called: file1 already exsited in the JFFS2,
if calling the write() file I/O function to write to a file with the same
name: file2, the pointer (flash_dev_info, which pointed to the flash device
information structure) address will be changed (just check the address of
the pointer at the beginning of flash_program_buf() function).  Is anybody
aware of this? or maybe I went to the wrong way.

But when I changed the pointer declaration as the followings:

//=========== Original ========================
static const flash_dev_info_t* flash_dev_info;
static const flash_dev_info_t supported_devices[] = {
#include <cyg/io/flash_28fxxx_parts.inl>
};
//=========== Original ========================


// just get rid of the "static" for the pointer declaration
//=========== After Changing ===================
const flash_dev_info_t* flash_dev_info;
static const flash_dev_info_t supported_devices[] = {
#include <cyg/io/flash_28fxxx_parts.inl>
};
//=========== After Changing ===================

After changing it worked now.
then the pointer address retains its value even after repeat writing to the
same flash file. I guest would "static" doing something funny here?

Does anybody have any idea about this issue?

Thanks a lot.


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]