CN107861726A - A kind of instantiation method of the document handling system based on NandFlash - Google Patents

A kind of instantiation method of the document handling system based on NandFlash Download PDF

Info

Publication number
CN107861726A
CN107861726A CN201711343802.2A CN201711343802A CN107861726A CN 107861726 A CN107861726 A CN 107861726A CN 201711343802 A CN201711343802 A CN 201711343802A CN 107861726 A CN107861726 A CN 107861726A
Authority
CN
China
Prior art keywords
file
storage device
nandflash
handling system
document handling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711343802.2A
Other languages
Chinese (zh)
Inventor
章剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Coffee Coffee System Technology Co Ltd
Original Assignee
Suzhou Coffee Coffee System Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Coffee Coffee System Technology Co Ltd filed Critical Suzhou Coffee Coffee System Technology Co Ltd
Priority to CN201711343802.2A priority Critical patent/CN107861726A/en
Publication of CN107861726A publication Critical patent/CN107861726A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4441Reducing the execution time required by the program code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of instantiation method of the document handling system based on NandFlash, it may be implemented on MCU and NandFlash examples be melted into by the communication with NandFlash the file system of FAT16/FAT32 forms, the file system of instantiation is supported to identify multiple storage devices and can carry out multiple subregions, and can realize the synchronous carry and unloading operation of storage device;It can realize when storing picture, text and be modified in the NandFlash file system for being directly dragged to instantiation from PC ends, the operation such as display, be can be used directly without picture or file are compiled into source code, the portability and the speed of service of Optimized code.

Description

A kind of instantiation method of the document handling system based on NandFlash
Technical field
The invention belongs to the technical field of document handling system, more particularly to a kind of file process based on NandFlash The instantiation method of system.
Background technology
Existing MCU is using the display of picture, and using directly by picture or text volume during calling text data Translate into source code, opening up internal memory in RAM during code call is used for caching image data and file content, aobvious when needing Corresponding image data or file data is called to realize LCD display from RAM when diagram piece or reading content of text.This side The defects of case:1) realized by the way of above in image data or text data preservation, the modularization of code can be destroyed, it is special It is not that code can more too fat to move waste ram space when the data volume of picture or text is big;2)Can not be convenient in mode above The replacement of picture is realized, is changed, increase, the flexibility of code is influenceed, has no idea to accomplish real content customizable;3) It is big that program transplants difficulty in different type of machines, is unfavorable for company's multi-model exploitation.
The content of the invention
The present invention solves the technical problem of provide a kind of instantiation of the document handling system based on NandFlash Method, it may be implemented on MCU and NandFlash examples be melted into by the communication with NandFlash the text of FAT16/FAT32 forms Part system, the file system of instantiation is supported to identify multiple storage devices and can carry out multiple subregions, and can realize that storage is set Standby synchronous carry and unloading operation;It can be realized when storing picture, text and directly be dragged to instantiation from PC ends Modified in NandFlash file system, the operation such as display can be direct without picture or file are compiled into source code Use, the portability and the speed of service of Optimized code.
In order to solve the above technical problems, one aspect of the present invention is:Provide one kind and be based on NandFlash Document handling system instantiation method, including step in detail below:
A, the operation initialized first in document handling system to storage device, the essential information of storage device is read, Count the amount of capacity of storage device;
B, according to customized subregion amount of capacity to storage device space format device, the residual capacity of storage device is judged Size simultaneously provides prompt message at PC ends;
C, storage device is mounted in the form of a file among document handling system and supplies routine call picture or file content;
D, all pictures or file content out of the operation of PC ends storage device;
E, source code program and operation picture or content of text separate, realize content customizable and functional module can Transplantingization.
In a preferred embodiment of the present invention, NandFlash examples are melted into FAT16/ by described document handling system The file system of FAT32 forms.
The beneficial effects of the invention are as follows:The instantiation method of the document handling system based on NANDFLASH of the present invention, can The file system for NandFlash examples being melted into by the communication with NandFlash on MCU FAT16/FAT32 forms is realized, The file system of instantiation is supported to identify multiple storage devices and can carry out multiple subregions, and can realize the synchronization of storage device Carry and unloading operation;The NandFlash files system that instantiation is directly dragged to from PC ends can be realized when storing picture, text Modify, the operation such as display, can be used directly without picture or file are compiled into source code in system, Optimized code The portable and speed of service.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, make required in being described below to embodiment Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, it can also be obtained according to these accompanying drawings other Accompanying drawing, wherein:
Fig. 1 is the flow of the preferred embodiment of instantiation method one of the document handling system based on NandFlash in the prior art Figure.
Embodiment
The technical scheme in the embodiment of the present invention will be clearly and completely described below, it is clear that described implementation Example is only the part of the embodiment of the present invention, rather than whole embodiments.It is common based on the embodiment in the present invention, this area All other embodiment that technical staff is obtained under the premise of creative work is not made, belong to the model that the present invention protects Enclose.
As shown in figure 1, the embodiment of the present invention includes:
A kind of instantiation method of the document handling system based on NandFlash, including step in detail below:
A, the operation initialized first in document handling system to storage device, the essential information of storage device is read, Count the amount of capacity of storage device;
B, according to customized subregion amount of capacity to storage device space format device, the residual capacity of storage device is judged Size simultaneously provides prompt message at PC ends;
C, storage device is mounted in the form of a file among document handling system and supplies routine call picture or file content;
D, all pictures or file content out of the operation of PC ends storage device;
E, source code program and operation picture or content of text separate, realize content customizable and functional module can Transplantingization.
/*******************
Operation of the file system to content in storage device.
******************/
typedef struct file_op_S
{
// open file
INT (* fopen) (FILE_T *, CHAR *, CHAR *);
// read file data
INT (* fread) (FILE_T *, UINT8 *, INT, INT *);
// write data to file
INT (* fwrite) (FILE_T *, UINT8 *, INT, INT*);
// close file
INT INT(*fclose)(FILE_T *);
// modification file size
INT (* fsizing) (FILE_T *, INT64);
// file pointer position is set
INT 64 (* fseek) (FILE_T *, INT64);
// obtain file status
INT (* fget_stat) (FILE_T *, FILE_STAT_T *);
// device file state
INT (* fset_stat) (FILE_T *, FILE_STAT_T *);
File in // search storage device
INT (* find_first) (FILE_T *, FILE_FIND_T *);
The next file of // search
INT (* find_next) (FILE_T *, FILE_FIND_T *);
// terminate search
INT (* find_close) (FILE_T *, FILE_FIND_T *);
// file system special operational
INT (* fioctl) (FILE_T *, INT, VOID *);
}。
In above-mentioned, described document handling system is melted into NandFlash examples the file system of FAT16/FAT32 forms System.
It is an object of the present invention to provide other contents point such as a kind of source code for performing operation and image data and text data Storage is opened, so that the efficiency that code performs greatly improves, the scalability of code and flexibility can also improve a lot, The content of picture and text can modify at any time, the advantages that replacement operation.
To reach above-mentioned purpose, the software code that the present invention uses is as follows:
/**********************
The structure of common nand storage devices operation
***********************/
struct ndrv_t gnand_disk_driver = {
nandInit0,
nandpread0,
nandpwrite0,
nand_is_page_dirty0,
nand_is_valid_block0,
nand_ioctl,
nand_block_erase0,
nand_chip_erase0,
0
};
// ///runs function
INT initalize_file_system_gnand_usb(void)
{
The space size of // block device
UINT block_size,
Space size workable for // storage device
UINT free_size,
The space size of // subregion
UINT disk_size;
The space size altogether of // storage device
UINT INT total_size,
The clock of // memory device communication
UINT pll_out_Hz,
The clock source of // outside
UINT extern_freq;
// system obtains external clock reference
extern_freq = sysGetExternalClock();
// the UPLL according to CPU obtains the clock being currently needed for
pll_out_Hz = sysGetPLLOutputKhz(eSYS_UPLL, extern_freq);
// initialization files system
initalize_file_system();
// speedy storage equipment interface kernel clock is set
set_FMI_engine_clock(SIC_SET_CLOCK, pll_out_Hz);
// initialization quick storage interface equipment
initlalize_FMI_device();
The common nand equipment of // initialization
if(initalize_gnand_device(&gnand_disk_driver, &gnand_info) < 0)
{
Redirected after // initialization failure
goto nandboot_halt;
}
Nand equipment after // initialization is mounted to file system
if(mount_nand_disk(&gnand_info) < 0)
{
The failure of // carry then redirects
goto nandboot_halt;
}
// identify and count the amount of capacity of storage device
total_size = (UINT32)((UINT64)gnand_info.nZone* gnand_info.nLBPerZone* gnand_info.nPagePerBlock*gnand_info.nPageSize/1024);
// // judges amount of capacity workable for character C equipment
if ((get_disk_free_space( 'C', &block_size, &free_size, &disk_size) < 0) ||
// judge amount of capacity workable for character D equipment
(get_disk_free_space( 'D', &block_size, &free_size, &disk_size) < 0)) {
// judge the remaining amount of capacity of storage device, come if there is no capacity according to customized partition space size Format storage device.
if(fsTwoPartAndFormatAll((PDISK_T *)gnand_info.pDisk,NAND1_1_SIZE* 1024,(total_size- NAND1_1_SIZE*1024)) < 0)
Redirecting after { // format storage device failure
goto nandboot_halt;
}
// character C equipment renamings are shown on OS
set_volume_label('C', "NAND1-1\n", strlen("NAND1-1\n"));
// character D equipment renamings are shown on OS
set_volume_label('D', "NAND1-2\n", strlen("NAND1-1\n"));
}
// delay operation
sysDelay(5);
// judge, if USB device is inserted into this file system, to identify USB and in PC display interface information
if(udcIsAttached())
{ // on PC shows the storing device information and interface of file by USB
mass(&gnand_info, NULL, NULL, NULL, NULL, NULL, 0);
}
// return success
return Successful;
// unsuccessfully redirect configuration processor
nandboot_halt:
// simultaneously type information is waited always
sysprINTf("systen exit\n");
while(1);
}。
In summary, the instantiation method of the document handling system of the invention based on NandFlash, may be implemented in MCU On by the communication with NandFlash NandFlash examples be melted into FAT16/FAT32 forms file system, instantiation File system is supported to identify multiple storage devices and can carry out multiple subregions, and the synchronous carry of storage device can be realized with unloading Carry operation;It can realize directly to be dragged to from PC ends in the NandFlash file system of instantiation when storing picture, text and carry out The operation such as modification, display, can be used directly, the portability of Optimized code without picture or file are compiled into source code And the speed of service.
Embodiments of the invention are the foregoing is only, are not intended to limit the scope of the invention, it is every to utilize this hair The equivalent structure or equivalent flow conversion that bright description is made, or directly or indirectly it is used in other related technology necks Domain, it is included within the scope of the present invention.

Claims (2)

  1. A kind of 1. instantiation method of the document handling system based on NandFlash, it is characterised in that including walking in detail below Suddenly:
    A, the operation initialized first in document handling system to storage device, the essential information of storage device is read, Count the amount of capacity of storage device;
    B, according to customized subregion amount of capacity to storage device space format device, the residual capacity of storage device is judged Size simultaneously provides prompt message at PC ends;
    C, storage device is mounted in the form of a file among document handling system and supplies routine call picture or file content;
    D, all pictures or file content out of the operation of PC ends storage device;
    E, source code program and operation picture or content of text separate, realize content customizable and functional module can Transplantingization.
  2. 2. the instantiation method of the document handling system according to claim 1 based on NandFlash, it is characterised in that Described document handling system is melted into NandFlash examples the file system of FAT16/FAT32 forms.
CN201711343802.2A 2017-12-15 2017-12-15 A kind of instantiation method of the document handling system based on NandFlash Pending CN107861726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711343802.2A CN107861726A (en) 2017-12-15 2017-12-15 A kind of instantiation method of the document handling system based on NandFlash

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711343802.2A CN107861726A (en) 2017-12-15 2017-12-15 A kind of instantiation method of the document handling system based on NandFlash

Publications (1)

Publication Number Publication Date
CN107861726A true CN107861726A (en) 2018-03-30

Family

ID=61706591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711343802.2A Pending CN107861726A (en) 2017-12-15 2017-12-15 A kind of instantiation method of the document handling system based on NandFlash

Country Status (1)

Country Link
CN (1) CN107861726A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183337A (en) * 2007-12-12 2008-05-21 中兴通讯股份有限公司 Space management techniques based on NAND FLASH mobile terminal storage medium
US20090248963A1 (en) * 2008-03-28 2009-10-01 Takafumi Ito Memory controller and memory system including the same
CN104081391A (en) * 2012-01-25 2014-10-01 株式会社日立制作所 Single instantiation method using file clone and file storage system utilizing the same

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183337A (en) * 2007-12-12 2008-05-21 中兴通讯股份有限公司 Space management techniques based on NAND FLASH mobile terminal storage medium
US20090248963A1 (en) * 2008-03-28 2009-10-01 Takafumi Ito Memory controller and memory system including the same
CN104081391A (en) * 2012-01-25 2014-10-01 株式会社日立制作所 Single instantiation method using file clone and file storage system utilizing the same

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
野火_FIREGE: "第25章 串行FLASH文件系统FatFs—零死角玩转STM32-F429系列", 《CSDN博客,HTTPS://BLOG.CSDN.NET/FLYLEAF91/ARTICLE/DETAILS/52325515》 *

Similar Documents

Publication Publication Date Title
Rawassizadeh et al. UbiqLog: a generic mobile phone-based life-log framework
CN102541572B (en) A kind of method, system and device realizing operating system nucleus and guide
US9098303B2 (en) Portable computing device providing operating system for host devices
US9128893B2 (en) Remote direct memory access socket aggregation
EP0930567A2 (en) Method and apparatus for extending security model to native code
US20030233501A1 (en) Device for transferring from a memory card interface to a universal serial bus interface
CN100365576C (en) Memory mirror starting optimization of built-in operation system
CN104572411A (en) Log data processing method and device
CN104205050A (en) Accessing a device on a remote machine
CN103092654B (en) A kind of WebOS method and system of sing on web Kit
CN107807827A (en) A kind of method for supporting multi-core CPU multiple operating system
CN105573910B (en) Application program debugging method of protected system and intelligent terminal
US8489860B1 (en) Mobile electronic device having a host processor system capable of dynamically canging tasks performed by a coprocessor in the device
RU2616164C9 (en) Methods and device for browser engine work
CN201571108U (en) Embedded type mobile terminal operation platform
CN105677418B (en) The method and system of multiple and different voice protocols are realized in access device
CN107861726A (en) A kind of instantiation method of the document handling system based on NandFlash
CN116662270B (en) File analysis method and related device
CN109495910A (en) WIFI starts connection processing method, mobile terminal and storage medium
CN107025068B (en) Asynchronously copying data in memory
WO2022111664A1 (en) Patching method, related apparatus, and system
CN103699524A (en) Word segmentation method and mobile terminal
WO2021238376A1 (en) Function pack loading method and apparatus, and server and electronic device
CN112765070A (en) Data transmission debugging method and system, electronic equipment and storage medium
US20140089601A1 (en) Managing a region cache

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180330

RJ01 Rejection of invention patent application after publication