The first thing I need to do is figure out how to configure my system
in PB 5 to set aside half of the flash for a file system and then make
it the root file system. I was reading the documentation and it seemed
to indicate that what I want is the ROM only file system. I am still a
little unclear because one place indicated that and another indicated
that ROM only file system means there is no place to store stuff.
The second thing is to make sure I have the registry settings right so
that the hive based registry (which I also chose for my device) will
point to the above mentioned flash area.
I guess a third question is whether this is a good idea and better
than using the RAM based system and doing some kind of backup to flash
when the user powers down the unit.
Thanks, Tony
I'm not familiar with backing the object store with some block device,
sorry. I didn't think that was even possible.
Hive-based registry is the best-supported way to save the registry, so just
following the help and setting up to write the hive to the flash filesystem
created above should handle that.
Paul T.
<to...@shatalmic.com> wrote in message
news:1181068847.8...@z28g2000prd.googlegroups.com...
Tony
The hive won't know it's on flash. It's just on a block device somewhere.
It could be a hard disk for all the hive knows. Look at the FMD driver
information in the help. This is the first step that you have to do (write
a driver for your flash to make it look like a disk device).
Once you have a disk device that is implemented with some of your flash, you
want to mount that disk as the root. Look up Storage Device Settings or
something like that in the help to see how to change your registry to mount
the flash filesystem as the root.
Finally, you want to store the hive-based registry on this disk that you've
created, so read up on hive-based registry, make sure that your mount/flags
information for the flash filesystem is in the boot hive (special tags
placed around its entries in the registry). Set the hive settings properly
to store the hive where you want it in the filesystem.
That should be it, from a high level...
Paul T.
<to...@shatalmic.com> wrote in message
news:1181070204....@d30g2000prg.googlegroups.com...
If I write (or get from the manufacturer) a driver that makes the
flash look like a drive I assume there must be something in the
configuration of that driver that will tell it to only use the flash
starting at address x because the OS image is already in the starting
part of the flash, right?
Is there anywhere in the config that I have to specific where the OS
image will be in the flash and what its max size is or do I just make
sure the file system driver starts high enough that it won't over
write the end of the OS image?
The hive stuff I think I have a handle on, thanks.
I would presume that any generic driver for the flash on your board would
work that way, yes. There's no standard requirements with respect to that
and it could be hard-coded in the source for the driver.
What you have to specify is entirely dependent on the driver. The OS could
not possibly care any less about how you've split up your linear flash (or
if there even *is* any linear flash). Obviously, you don't want to use part
of the area that contains the OS for filesystem, as that would destroy the
OS image. The driver will determine what is possible and what you have to
do to make it happen.
Paul T.
<to...@shatalmic.com> wrote in message
news:1181072326.5...@r19g2000prf.googlegroups.com...
I plug the board in. I then right click on the BSP component that is
for that board from my BSP maker (freescale). I found it in the
catalog under the third party / bsp / freescale mx21 / storage
drivers / ms flash / nand flash driver. I assume this is the one.
Once it was added to my BSP I got a new set of registry entries in my
reginit.ini file. They are:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\NandFlash]
"Dll"="nandfcd.dll"
"Order"=dword:0
"Prefix"="DSK"
"Profile"="FlashDisk"
"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
"FriendlyName"="i.MX21 NAND FLASH Driver"
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk]
"Name"="i.MX21 NAND FLASH"
"Folder"="NAND Flash"
"DefaultFileSystem"="FATFS"
"AutoMount"=dword:1
; Auto part and format disk if no partitions are present.
; WARNING! This can cause long boot times when encountering a
fresh disk.
"AutoPart"=dword:1
"AutoFormat"=dword:1
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk\FATFS]
; Override common setting to enable automatic formatting of
unformatted volumes
"Flags"=dword:00000024
There are a lot of comments as well, but I cut those out for this
posting.
I then boot my device and can see in the built in devices the above
entries when I use the remote registry editor. What I don't see is a
drive called NAND Flash as the profile indicates.
I then saw in the driver's .reg file an environment parameter called
BSP_PS_NAND and decided to set that in my platform settings. Once I
did that I got these additional entries in the reginit.ini:
[HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\Nandfcd]
"DriverPath"="Drivers\\BuiltIn\\NandFlash"
; LoadFlags 0x01 == load synchronously
"LoadFlags"=dword:1
"BootPhase"=dword:0
; Note: if BinFS is used together with PS, then should ensure
; this is loaded after BinFS by setting order to 1 and that
; BinFS autoload order is 0.
"Order"=dword:0
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk\FATFS]
; System registry in FATFS partition
"MountAsBootable"=dword:1
; To mount FAT partition as root
"MountAsRoot"=dword:1
I was hoping this would cause the NAND to be used as the main storage.
It doesn't. I am also not sure, but I seem to recall that devices that
actually get loaded are copied from the BuiltIt registry area to the
Active registry area. I didn't see the nand driver anywhere in the
Active section.
Any ideas what I am missing here?
Paul T.
<to...@shatalmic.com> wrote in message
news:1181154829.3...@z28g2000prd.googlegroups.com...
How do I tell if it is working? If I create a folder under any of the
standard places (like My Docments) the folder disappears the next time
I boot up the system. Could this be because I am loading, running and
debugging from ram instead of flashing the unit and then trying it? Is
this the right way to verify it?
I looked into the registry and I have the following entries actually
in the file system:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\NandFlash]
"Dll"="nandfcd.dll"
"Order"=dword:0
"Prefix"="DSK"
"Profile"="FlashDisk"
"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
"FriendlyName"="i.MX21 NAND FLASH Driver"
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk]
"Name"="i.MX21 NAND FLASH"
"Folder"="NAND Flash"
"DefaultFileSystem"="FATFS"
"AutoMount"=dword:1
; Auto part and format disk if no partitions are present.
; WARNING! This can cause long boot times when encountering a
fresh disk.
"AutoPart"=dword:1
"AutoFormat"=dword:1
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk\FATFS]
; Override common setting to enable automatic formatting of
unformatted volumes
"Flags"=dword:00000024
[HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\Nandfcd]
"DriverPath"="Drivers\\BuiltIn\\NandFlash"
; LoadFlags 0x01 == load synchronously
"LoadFlags"=dword:1
"BootPhase"=dword:0
; Note: if BinFS is used together with PS, then should ensure
; this is loaded after BinFS by setting order to 1 and that
; BinFS autoload order is 0.
"Order"=dword:0
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk\FATFS]
; System registry in FATFS partition
"MountAsBootable"=dword:1
; To mount FAT partition as root
"MountAsRoot"=dword:1
Notice the MoustAsRoot setting and all.
I looked through the debug log and didn't see any errors. The only
thing I saw that stood out was:
8993 PID:bfc44ee TID:bfc44ca 0x8bfc4288: >>> Loading module
fatfsd.dll at address 0x03E40000-0x03E6B000 (RW data at
0x01FF2000-0x01FF263C)
Loaded symbols for 'C:\WINCE500\PBWORKSPACES\3PLAY\RELDIR
\MX21_ARMV4I_DEBUG\FATFSD.DLL'
9005 PID:bfc44ee TID:bfc44ca 0x8bfc4288: >>> Loading module
fatutil.dll at address 0x03E10000-0x03E27000 (RW data at
0x01FED000-0x01FEE0E8)
Loaded symbols for 'C:\WINCE500\PBWORKSPACES\3PLAY\RELDIR
\MX21_ARMV4I_DEBUG\FATUTIL.DLL'
9009 PID:bfc44ee TID:bfc44ca 0x8bfc4288: FormatDisk!FormatVolume:
New extended boot sector successfully written
9508 PID:bfc44ee TID:bfc44ca 0x8bfc4288:
FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't
exist for logical sector 0x200!!!
10002 PID:bfc44ee TID:bfc44ca 0x8bfc4288:
FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't
exist for logical sector 0x400!!!
10033 PID:bfc44ee TID:bfc44ca 0x8bfc4288: FormatDisk!FormatVolume:
New FAT #0 successfully written
10034 PID:bfc44ee TID:bfc44ca 0x8bfc4288: FormatDisk!FormatVolume:
New root directory successfully written
10036 PID:bfc44ee TID:bfc44ca 0x8bfc4288: FormatDisk!FormatVolume:
New BPB successfully written
10036 PID:bfc44ee TID:bfc44ca 0x8bfc4288: FormatDisk!FormatVolume
complete.
10037 PID:bfc44ee TID:bfc44ca 0x8bfc4288: <<< Unloading module
fatutil.dll at address 0x03E10000-0x03E27000 (RW data at
0x01FED000-0x01FEE0E8)
Unloaded symbols for 'C:\WINCE500\PBWORKSPACES\3PLAY\RELDIR
\MX21_ARMV4I_DEBUG\FATUTIL.DLL'
It seems to be formatting the drive when it boots. The only thing that
doesn't make sense if that is true is that if I create a folder
directly on the drive that is created (NAND Flash) it remains. So if I
create a folder on that drive it stays, but if I create a folder in
one of the standard folders they go away when I reboot.
Help?
--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net
Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member
<to...@shatalmic.com> wrote in message
news:1181241917.3...@a26g2000pre.googlegroups.com...
Paul T.
<to...@shatalmic.com> wrote in message
news:1181241197....@x35g2000prf.googlegroups.com...
Hi there,
We are also facing very similar problem that you have. our WinCE 5.0
device is having 256MB flash memory. and our run time image is taking
18MB of that. Our bootloader is loading the NK from Flash to RAM and
executing in RAM. But we are not able to store the user data on the
flash (in short we are not able to make use of available
flash(256-18).
Whether we have to mount the remaining flash as separate drive? If so
how to do that?
thanks
Milind
Hi there,
Thanks for the quick reply. But my question is how should I confirm
that my root is mounted to flash? Becasue we are loosing data after
rebooting the device. Can I have list of catalog items that you have
added apart from those are added in Mobile handheld profile? Also you
have mentioned in the mailing thread that you added '
"MSPART.dll" explicitely.
Also I observed that when OS boots I get to see debug messages from
"FMD_Read" function and never get any calls to FMD_Write. What does
this mean? Are we missing any thing?
Thanks
Milind
b. You'll see by looking in Windows CE Explorer that there's no separate
folder for the filesystem.
c. You'll write a file or a folder to some location that would normally be
in the RAM filesystem, but it will reappear after cycling the power to the
device.
The original poster said that he had to add MSPART explicitly. Maybe you
don't have the right debug zone set to get messages from the Write function
or maybe you aren't doing any writes.
Paul T.
"Milind" <mili...@gmail.com> wrote in message
news:1181275988....@i38g2000prf.googlegroups.com...
Sorry. I don't have any other ideas, besides checking the registry
settings. I don't suppose that you have a persistent registry and, rather
than using the new settings that you've made in platform.reg or project.reg,
it's really using some old settings from some previous build (where the
separate folder mount was the way it was configured)? I'm sure that someone
with a lot of experience with mounting things as the root could take a look
at your registry and spot the problem, but I don't think I'm qualified (I've
done it, but I don't do it in production on our devices).
Paul T.
<to...@shatalmic.com> wrote in message
news:1181330284.6...@i13g2000prf.googlegroups.com...