Moxa W325A-LX [61/74] Before programming your embedded system

Moxa W325A-LX [61/74] Before programming your embedded system
W315A/325A Linux User's Manual Programmer's Guide
6-2
Before Programming Your Embedded System
Caution Required when Using File Systems
We recommend that you only store your programs on the onboard NOR Flash. The log data generated by your
programs should be stored in an external storage device, such as an SD card or Network File System. Note that
a Network File System will generally provide the largest amount of storage space. In addition, it is easier to
replace a full or damaged SD card than an onboard NOR Flash.
A NOR Flash has a life cycle of 100,000 write operations in the block (128 KB) level, but does not support BBM
(Bad Block Management). An SD card also has a life cycle, but most SD cards are made from a NAND Flash, for
which the hardware controllers implement BBM. This feature allows FAT to skip bad blocks if they exist.
Furthermore, the memory space of an SD card is much larger than that of the NOR Flash. Cautiously utilizing
this space will ensure that its life cycle will not be exceeded. When creating a file for storing log data, we
suggest setting up your program to create a large empty file (e.g., 30 MB), and then write data evenly over the
space. When reaching the end of the space, the program rewinds the write operations. As a result, the number
of write operations on each block will be reduced.
Using a RAM File System instead of a Flash File System
Although data in the RAM file system will be wiped out after a power off, this file system has several advantages
over a Flash file system. The RAM file system includes faster read/write access, and has no life cycle issues.
For timely and/or important applications that relay data directly back to the host, you should write the
necessary log data to the RAM file system. After the host accesses the data, the application will erase the data
to free up the space for further uses.
The embedded computer has limited resources, and for this reason, designers should determine if storing data
in a file system is really necessary. If it is necessary, then be sure to choose the most appropriate file system
for your application.
Flash Memory Map
Partition sizes are hard coded into the kernel binary. To change the partition sizes, you will need to rebuild the
kernel. The flash memory map is shown in the following table.
Address Size Contents
0x000000000x0003FFFF 256 KB Boot LoaderRead ONLY
0x00040000 0x001FFFFF 1.8 MB Kernel object codeRead ONLY
0x00200000 0x009FFFFF 8 MB Root file system (JFFS2) —Read ONLY
0x00A00000 0x00FFFFFF 6 MB User directory (JFFS2) Read/Write
Device API
The W315A/325A supports control devices with the ioctl system API. You will need to
include
<moxadevice.h
>
, and use the following ioctl function.
int ioctl(int d, int request,…);
Input: int d - open device node return file handle
int request – argument in or out
Use the desktop Linuxs man page for detailed documentation:
#man ioctl

Содержание

Похожие устройства

Скачать