WO2010103780A1 - Memory management device, data recorder, and memory area setting method - Google Patents

Memory management device, data recorder, and memory area setting method Download PDF

Info

Publication number
WO2010103780A1
WO2010103780A1 PCT/JP2010/001593 JP2010001593W WO2010103780A1 WO 2010103780 A1 WO2010103780 A1 WO 2010103780A1 JP 2010001593 W JP2010001593 W JP 2010001593W WO 2010103780 A1 WO2010103780 A1 WO 2010103780A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
area
memory
program data
program
Prior art date
Application number
PCT/JP2010/001593
Other languages
French (fr)
Japanese (ja)
Inventor
友田政明
田中基一
濱邉勝志
Original Assignee
パナソニック株式会社
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 パナソニック株式会社 filed Critical パナソニック株式会社
Priority to JP2011503699A priority Critical patent/JP5395163B2/en
Publication of WO2010103780A1 publication Critical patent/WO2010103780A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7202Allocation control and policies
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7204Capacity control, e.g. partitioning, end-of-life degradation

Definitions

  • the present invention relates to a memory management device that manages a nonvolatile memory, a data recording device including the memory management device, and a memory area setting method that sets a memory area of the nonvolatile memory.
  • flash memories which are nonvolatile memories, are frequently used in digital devices such as digital audio players, IC recorders, and digital cameras, and memory cards such as SD cards and MMC cards. Flash memory has become larger in capacity due to process evolution. In particular, as a data storage medium, a NAND flash memory suitable for increasing the capacity is frequently used.
  • the NAND flash memory is divided into, for example, 4096 physical blocks, although the size and the like vary depending on the type. This block is the minimum unit of erasure.
  • the block is composed of 128 pages.
  • a page is a basic unit of writing and reading.
  • the page includes a 2048-byte user data area and a 64-byte redundant area.
  • an application program that reads and writes data in a microcomputer or personal computer incorporated in a device often manages data in a storage medium in units of sectors (512 bytes) as a common unit.
  • the sector may be different from the page which is the basic unit of writing and reading that has been performed.
  • flash memory there is a limit to the number of times flash memory can be written (hereinafter, including erasure).
  • the limit of the number of times of writing is about 100,000 times. Therefore, if the number of times of writing exceeding the limit is performed on a certain area, the area is not guaranteed. In other words, there is a possibility that it is destroyed and cannot be read and written.
  • memory fatigue progresses not only by writing but also by reading. Therefore, when realizing a device equipped with a flash memory, in order to ensure the reliability of the device, usually, a device such as wear leveling is applied so that writing does not concentrate on a specific physical area.
  • the present invention relates to a memory management device, a data recording device, and a memory that reduce the risk of destruction of extremely important data such as program data in memory management using a flash memory or the like that has a limit on the number of times of writing and reading.
  • An object is to provide a region setting method.
  • an object of the present invention is to provide a memory management device, a data recording device, and a memory area setting method that prevent program data from being rewritten as user data is rewritten.
  • a memory management device is a memory management device including a memory control unit that controls a memory, wherein a data area of the memory is managed in units of first and second management areas, and the first management area is It is a unit for reading and writing data, the second management area is a unit for erasing data, the second management area includes a plurality of first management areas, and the data area of the memory only reads data.
  • the memory control unit includes a read-only data area and a read-write data area for writing and erasing data, and the memory control unit matches a boundary between the read-only data area and the read-write data area with a boundary between the second management areas Thus, the data area of the memory is managed.
  • the read-only data area may be provided in a continuous second management area in the memory.
  • the first management area may be a page, and the second management area may be a block.
  • the data recording device of the present invention includes the memory management device and a data recording unit that records data in a memory having an area set by the memory management device.
  • Program data for controlling the operation of the data recording apparatus may be recorded in the read-only data area, and user data may be recorded in the read / write data area.
  • the memory area setting method of the present invention is a method for setting an area of a memory, wherein the data area of the memory is managed in units of first and second management areas, and the first management area reads and writes data.
  • the second management area is a data erasing unit, the second management area includes a plurality of first management areas, and a read-only data area that only reads data in the data area of the memory; Set the read / write data area where data is written and erased, and set the memory data area so that the boundary between the read-only data area and the read / write data area matches the boundary between the second management areas To do.
  • the data area of the memory is set so that the boundary between the read-only data area and the read / write data area matches the boundary that is the least common multiple between the multiple sizes of the second management area. It may be set.
  • the read-only data area may be composed of a plurality of continuous second management areas.
  • the second management area may be a page, and the second management area may be a block.
  • program data and user data are stored in a device in which extremely important data such as program data that is read only and user data that is written and read are stored in the same flash memory.
  • FIG. 1 shows a logical block arrangement
  • FIG. 2A and 2B are diagrams showing a memory area of a flash memory, in which FIG. 1A shows a logical block arrangement
  • FIG. 4 is a diagram illustrating data rewriting, where (a) is a diagram illustrating physical block arrangement, (b) is a detailed diagram of a physical block before rewriting, and (c) is a detailed diagram of a physical block after rewriting.
  • FIG. 7 is a flowchart showing a program data writing method including a memory area setting method according to the first embodiment of the present invention
  • 2A and 2B are diagrams illustrating an example of a NAND flash memory, in which FIG. 1A is a diagram illustrating a logical block arrangement, and FIG. 2A and 2B are diagrams showing an example of a NAND flash memory, where FIG. 1A is a diagram showing a logical block arrangement, and FIG. The figure which shows the program writing apparatus of Embodiment 2 of this invention.
  • FIG. 7 It is a figure which shows block arrangement after program data and system data are written, (a) is a figure which shows logical block arrangement, (b) is a figure which shows physical block arrangement, (c) is after rearrangement Diagram showing physical block layout 7 is a flowchart showing a memory area setting method including data rearrangement according to the second embodiment of the present invention.
  • the data recording apparatus is an IC recorder that records / reproduces sound data.
  • the data recording device reads out and executes the program data stored in the program data area of the flash memory, thereby performing an operation as an IC recorder (recording / reproducing / USB connection, etc.).
  • the data recording apparatus of this embodiment includes a function as a memory management apparatus that manages the memory area of the flash memory.
  • a program data area for only reading is provided in a block different from a user data area for rewriting. That is, the memory area is managed so that the boundary between the program data area and the user data area coincides with the boundary between blocks. As a result, it is possible to prevent the program data from being rewritten with the rewriting of the user data, and to reduce the risk of the program data being destroyed.
  • FIG. 1 shows an IC recorder which is an example of the data recording apparatus of the first embodiment.
  • the data recording apparatus 100 includes a memory management unit 110 that manages a memory in the data recording apparatus 100, a display unit 104, an operation unit 105, an audio processing unit 106, a microphone 107, a speaker 108, and a communication unit 109.
  • the audio processing unit 106 includes an encoder 106e and a decoder 106d.
  • the memory management unit 110 includes a flash memory 102 that is a nonvolatile memory and a memory control unit 120 that controls the flash memory 102.
  • the memory management unit 110 has a function as a memory management device that sets an area of the flash memory 102 and a data recording unit that writes data in the set area.
  • the memory control unit 120 includes a control unit 101 (microcomputer) and a RAM 103.
  • the flash memory 102 is a NAND flash memory in this embodiment.
  • the memory area (data area) 102m of the flash memory 102 includes a program data area 102p for storing program data, a system data area 102s for storing system data, and a user data area 102y for storing user data.
  • the program data is an important program or data that, if destroyed, causes a fatal injury in the operation of the device.
  • the system data includes parameters such as resume data used for the operation of the device.
  • User data is recorded data, music files, and the like.
  • Program data is data that is not rewritten, whereas system data and user data are data that is rewritten. Therefore, the program data area 102p is managed as a read-only data area for only reading data, and the system data area 102s and the user data area 102y are managed as read / write data areas for writing and erasing data.
  • the data recording device 100 is a device for recording / reproducing sound data.
  • the data recording apparatus 100 reads part or all of the program data stored in the program data area 102p of the flash memory 102, develops it in the RAM 103, and executes the program.
  • the program manages the flash memory 102 for example, reads / writes data
  • the data recording apparatus 100 operates as an IC recorder.
  • basic operations of recording / playback / USB connection as an IC recorder will be described.
  • the microphone 107 picks up sound data.
  • the encoder 106e of the audio processing unit 106 encodes sound data picked up by the microphone 107 (for example, MP3 encoding).
  • the control unit 101 records the encoded data in the user data area 102y of the flash memory 102.
  • the encoder 106e of the audio processing unit 106 stops the MP3 encoding.
  • the control unit 101 stops recording encoded data in the flash memory 102.
  • the display unit 104 can display a list of sound data recorded in the user data area 102 y of the flash memory 102.
  • the user can select desired sound data from the list displayed on the display unit 104.
  • the control unit 101 reads desired sound data from the flash memory 102.
  • the decoder 106 d of the audio processing unit 106 decodes the read sound data (in this embodiment, MP3 decoding), and outputs sound from the speaker 108. The same applies to the case where sound is output from the inner phone instead of the speaker 108.
  • the control unit 101 transmits MP3 data or the like from a PC or the like to the user data area 102y of the flash memory 102 via a communication unit 109 in accordance with a communication interface such as USB (Universal Serial Bus) or SATA (Serial Advanced Technology Attachment). It is possible to write. At this time, the written MP3 data or the like can be reproduced.
  • a communication interface such as USB (Universal Serial Bus) or SATA (Serial Advanced Technology Attachment).
  • the control unit 101 is a microcomputer that does not have a built-in RAM and does not have a built-in NOR flash memory for storing program data.
  • the control unit 101 of this embodiment is connected to an external RAM 103 and a flash memory 102 that stores program data in a program data area 102p.
  • the control unit 101 performs part or all of the program data stored in the program data area 102p of the flash memory 102. Is loaded into the RAM 103 and the program is executed.
  • the executed program performs memory management of the flash memory 102 (specifically, data read / write), whereby the data recording apparatus 100 operates as an IC recorder.
  • FIG. 2A shows an example of the memory management unit 110 in the present embodiment.
  • FIG. 2B shows another example (memory management unit 110 ′) of the memory management unit 110.
  • 2A and 2B are diagrams illustrating the memory control unit 120 of the memory management unit 110 of FIG. 1 in another format. Specifically, it is a diagram in which the RAM 103 is incorporated in the control unit 101 and simplified in another format.
  • the memory management unit 110 can be expressed in various forms, and is not limited to FIGS. 2 (a) and 2 (b).
  • the memory management unit 110 includes a memory control unit 120 and a flash memory 102.
  • the memory control unit 120 includes an application program unit 802 and a memory controller 803.
  • the flash memory 102 includes a memory area 102m.
  • the memory management unit 110 in FIG. 2A shows an example in which the memory controller 803 is mounted on the memory control unit 120 side.
  • the memory area 102m of the flash memory 102 includes the program data area 102p shown in FIG. 1, and an application program is stored in the program data area 102p.
  • the memory control unit 120 reads an application program from the memory area 102m, and the application program unit 802 executes the application program.
  • the memory management unit 110 ′ includes a memory control unit 120 and a flash memory 102.
  • the memory control unit 120 includes an application program unit 802.
  • the flash memory 102 includes a memory controller 853 and a memory area 102m.
  • the memory management unit 110 ′ in FIG. 2B shows an example in which the memory controller 853 is mounted on the flash memory 102 side.
  • the memory area 102m of the flash memory 102 includes the program data area 102p shown in FIG. 1, and an application program is stored in the program data area 102p.
  • the memory control unit 120 reads an application program from the memory area 102m, and the application program unit 802 executes the application program.
  • FIG. 2A a case where the memory management unit 110 has a memory controller 803 mounted on the memory control unit 120 side will be described.
  • FIGS. 3A and 3B show an example of correspondence between the logical block arrangement and the physical block arrangement in the memory area 102m.
  • PBA indicates a physical block address (Physical Block Address)
  • LBA indicates a logical block address (Logical Block Address).
  • FIG. 4 shows an example of the logical-physical conversion table.
  • the logical-physical conversion table 700 of FIG. 4 is an example of a table that associates the physical address and logical address of the memory area 102m.
  • the logical block 910 (LBA0), logical block 911 (LBA1), logical block 912 (LBA2), logical block 913 (LBA3), logical block 914 (LBA4), and logical block 916 in the logical block arrangement of FIG. (LBA6) is the physical block 961 (PBA1), physical block 966 (PBA6), physical block 963 (PBA3), physical block 969 (PBA9), and physical block 971 (physical block arrangement) in the physical block arrangement of FIG. PBA11) and physical block 962 (PBA2).
  • the memory controller 803 in FIG. 2A includes the logical-physical conversion table 700 in FIG. 4 and associates physical block addresses with logical block addresses.
  • the logical-physical conversion table 700 is normally generated and managed in the memory controller 803 in many cases, but the generation and management method is not limited here.
  • the application program unit 802 in FIG. 2A performs data read / write access to a logical address instead of a physical address.
  • the memory controller 803 performs correspondence conversion between a logical address and a physical address, and controls so that writing (including erasure) to a specific physical block address is not concentrated.
  • the memory controller 803 makes full use of a wear leveling technique.
  • the wear leveling technique is a technique for appropriately changing the correspondence between logical addresses and physical addresses (here, detailed description thereof is omitted).
  • the application program unit 802 does not need to create a complicated program that does not write (including erasure) biased to a specific physical block address, and does not need to create a logical address (logical block, logical page,
  • the program can be realized by a logical sector or the like. For example, even if the system parameters stored in the flash memory are frequently rewritten and updated, an excessive number of writing (including erasing) is not performed on a specific physical block address. Therefore, the risk of memory destruction due to the memory life is reduced.
  • FIG. 5A shows an example of the physical block arrangement in the memory area 102m in FIG.
  • FIG. 5B shows a physical block at physical block address 2 (PBA2) before data rewriting.
  • FIG. 5C shows the physical block of the physical block address 4094 (PBA4094) after data rewriting.
  • PBA2 physical block address 2
  • FIGS. 5B and 5C each physical block is composed of 128 pages.
  • a page is a basic unit of writing / reading, and includes a payload part (2 Kbytes) and a redundant part (64 bytes).
  • program data A, program data B, and program data C are all pages of physical block address 0 (PBA0), all pages of physical block address 4 (PBA4), and physical block address 2, respectively. It is stored in page 0 of (PBA2). Further, system data D is stored in page 64 of physical block address 2 (PBA2). Also, the physical block address 2 (PBA2) is associated with LBA6 in the logical-physical conversion table 700 of FIG.
  • the application program unit 802 rewrites (updates) the system data stored in the page 64 of the LBA6.
  • the memory controller 803 rewrites (updates) the system data D stored in the page 64 of the PBA 2 corresponding to the LBA 6 using the logical-physical conversion table 700 shown in FIG.
  • the memory controller 803 copies the program data C stored in page 0 of PBA2 to page 0 of PBA4094 as program data E, reads the system data D stored in page 64 of PBA2, and reads the necessary part. Is updated and written as system data F in page 64 of PBA4094. If data exists in other pages, a copy operation like page 0 is performed.
  • the PBA 4094 becomes a new LBA 6 storage area.
  • PBA2 By erasing PBA2, it becomes an unused block. That is, in the logical-physical conversion table 700, the physical address corresponding to LBA6 is rewritten from PBA2 to PBA4094.
  • the entire physical block is copied (reading PBA2, writing to PBA4094, and erasing PBA2).
  • the program data area 102p for program data to be read only, the system data area 102s and the user data area 102y to be read / written are not conscious of physical block boundaries.
  • program data and system data or user data are mixedly stored in the same block.
  • the physical block address of the logical block in which all or a part of the program data is stored also moves frequently. That is, copying (reading and writing) of blocks storing program data is frequently performed. In the case of an IC recorder, recorded data is often rewritten frequently.
  • control unit 101 does not write system data and user data in the same block as program data. That is, the memory area 102m is managed so that the program data area 102p is a separate block from the system data area 102s and the user data area 102y. Thereby, the said risk is reduced.
  • Memory area setting and program writing method> A memory area setting and program data writing method (transfer method) will be described with reference to FIGS.
  • the program data is written at the time of manufacture or shipment of the IC recorder that is the data recording apparatus 100.
  • old program data is stored in the program data area 102p and new program data is written, that is, in the case of an update operation, the following description can be similarly applied.
  • the control unit 101 sets the program data area 102p based on the size of the program data stored in the temporary user data area.
  • the control unit 101 transfers the program data once placed in the temporary user data area to the program data area 102p, and erases the program data remaining in the temporary user data area. At this point, the transfer of the program data to the program data area 102p is completed, and the data recording apparatus 100 becomes operable.
  • FIG. 6 shows an example of a flowchart of a method for writing program data in the present embodiment.
  • FIG. 7 is an example of data arrangement in the memory area 102m, and shows a state after the program data is written.
  • FIG. 7A shows a logical block arrangement of the memory area 102 of the flash memory 102.
  • the memory area 102m includes a program data area, a system data area, a user data area, and a spare data area.
  • Program data A, program data B, and program data C are stored in the program data area.
  • System data D is stored in the system data area.
  • FIG. 7B shows block data of LBA 2 (logical block address 2) of the flash memory 102.
  • LBA 2 logical block address 2
  • the size of a sector which is a common minimum unit that can be handled by the control unit 101, is 512 bytes (in consideration of the affinity with the PC, it is set to 512 bytes).
  • the total size of the program data A, B, and C to be written is 525824 bytes.
  • the control unit 101 manages the sector numbers (sector 0 to sector 2097151) in all blocks with serial numbers.
  • control unit 101 first sets the memory area 102m of the flash memory 102 into a program data area 102p, a system data area 102p, and a user data area 102y (S401 to S408), and then Program data and system data are written to each set area (S409 and S410).
  • the control unit 101 determines a start sector and an end sector of the program data area 102p (S404). In the logical block arrangement of FIG. 7A, the control unit 101 sets the start sector of the program data area 102p as “the first sector of page 0 of LBA0 (ie, sector 0)” and the end sector as “the last sector of LBA2. It is determined as “the last sector of the page 127 (that is, the sector 1535)”. In the present embodiment, the control unit 101 secures the end sector of the program data area 102p not to the limit of the program data size but to the end of the block boundary.
  • the page 0 of LBA0 to page 0 of LBA2 is reserved as the program data area 102p. This prevents data to be rewritten such as user data from being written to page 1 to page 127 of LBA2.
  • the control unit 101 determines the start sector and end sector of the system data area 102s (S406). In the case of the logical block arrangement of FIG. 7A, the control unit 101 sets the start sector of the system data area 102s as “the first sector of page 0 of LBA3 (ie, sector 1536)” and the end sector as “the last sector of LBA3”. It is determined as the last sector of the page 127 (that is, the sector 2047).
  • control unit 101 secures the end sector of the system data area 102s not to the limit of the system data size but to the end of the block boundary.
  • system data is included, but it is not always necessary.
  • the user data size is a size that is secured as an area for recording sound data as an IC recorder or capturing data from a PC via USB.
  • the control unit 101 determines the start sector and end sector of the user data area 102y (S408). In the case of the logical block arrangement of FIG. 7A, the control unit 101 sets the start sector of the user data area 102y as “the first sector of LBA4 (ie, sector 2048)” and the end sector as “the last page of LBA 3999”.
  • the minimum required user data area size has been described as a multiple of the block size. However, even if the user data area size is not a multiple of the block size, the end sector is secured up to the end of the block boundary as with system data To do.
  • control unit 101 moves to a system data writing operation (S410).
  • the control unit 101 writes 512 bytes of system data in the system data area 102s. Specifically, the data is written to LBA3. Little is written after page 1 of LBA3.
  • the data recording apparatus 100 can perform the above-described recording operation, reproduction operation, and the like.
  • the program data area 102p does not coexist in the same physical block as the system data area 102s and the user data area 102y to be read / written.
  • the boundary between the program data area 102p for only reading data and the system data area 102s and user data area 102y for writing and erasing data coincide with the boundary of the physical block. Therefore, for example, in FIG. 7, when system data is frequently updated (rewritten), only the physical block copy operation corresponding to LBA3 occurs frequently, corresponding to LBA0 to LBA2 in which program data is stored. No physical block copy occurs.
  • each area may be set by the method described above.
  • each area is common at the sector number level in the plurality of flash memories. It is good to set so that. This makes it possible to share a program when realizing IC recorders having different storage capacities.
  • FIG. 8 shows an arrangement of the memory area 102m different from that in FIG.
  • the size of a sector which is a common minimum unit that can be handled by the control unit 101, is 512 bytes (in consideration of the affinity with the PC, 512 bytes), and the size of a page with 4 sectors as one page is 2 Kbytes, 64 bytes.
  • the size of a block with one page is 128 Kbytes, and the number of blocks is 8192.
  • the size of the program data is 525824 bytes.
  • the control unit 101 manages the sector numbers (sector 0 to sector 2097151) in all blocks with serial numbers.
  • FIG. 8 shows an example of data arrangement in the memory area 102m different from that in FIG. 7, and shows a state after each area is set and program data and system data are written according to the flow shown in FIG.
  • FIG. 8A shows a logical block arrangement of the memory area 102 of the flash memory 102.
  • the memory area 102m includes a program data area, a system data area, a user data area, and a spare data area.
  • Program data A, program data B, program data C, program data D, and program data E are written in the program data area.
  • System data F is written in the system data area.
  • FIG. 8B shows block data of LBA 4 (logical block address 4) of the flash memory 102.
  • the control unit 101 determines a start sector and an end sector of the program data area 102p (S404). In the logical block arrangement shown in FIG. 8A, the control unit 101 sets the start sector of the program data area 102p as “the first sector of page 0 of LBA0 (ie, sector 0)” and the end sector as “LBA5. The final sector of the page 63 that is the final page (that is, the sector 1535) is determined.
  • the control unit 101 secures the end sector of the program data area 102p not to the limit of the program data size but to the boundary end of the common block instead of the block boundary end.
  • the control unit 101 determines the start sector and end sector of the system data area 102s (S406).
  • the control unit 101 sets the start sector of the system data area 102s as “the first sector of page 0 of LBA6 (that is, sector 1536)” and the end sector as “the last sector of LBA7”. It is determined as “the last sector of the page 127 (that is, the sector 2047)” (S406).
  • the control unit 101 secures the end sector of the system data area 102s not to the limit of the system data size but to the boundary end of the common block instead of the block boundary end. Specifically, not the last sector of the page 127 that is the last page of the LBA6 (that is, the sector 1791) but the common sector is considered and the last sector of the page 127 that is the last page of the LBA7 (that is, the sector 2047) is secured. To do.
  • the control unit 101 determines the start sector and end sector of the user data area 102y (S408). In the case of the logical block arrangement of FIG. 8, the control unit 101 sets the start sector of the user data area 202y as “the first sector of LBA8 (ie, sector 2048)” and the end sector of “page 127, which is the last page of LBA7999”. The final sector (ie, sector 2047999) ”is determined.
  • the minimum required user data area size has been described as a multiple of the common block size. Secure to the end.
  • control unit 101 moves to a program data write operation (S409).
  • the control unit 101 writes 525824 bytes of program data in the program data area 102p.
  • program data is converted into program data A (131072 bytes), program data B (131072 bytes), program data C (131072 bytes), program data D (131072 bytes), and program data E (1536 bytes). Therefore, the data is written in LBA0, LBA1, LBA2, LBA3, and LBA4, respectively. None is written in page 1 and subsequent pages of LBA4 and LBA5.
  • control unit 101 moves to a system data writing operation (S410).
  • the control unit 101 writes 512 bytes of system data in the system data area 102s. Specifically, the data is written in LBA6. Little is written in page 1 and subsequent pages of LBA6 and LBA7.
  • the data recording apparatus 100 can perform the recording operation and the reproduction operation described above.
  • the physical storage locations of program data and user data are distinguished and managed in units of common blocks. It is possible to reduce the risk of program data destruction and to share application programs (increase development efficiency).
  • the sector address that divides each area can be shared, and data reading and writing are shared. Can be managed by sector address. Therefore, the program can be shared and the development efficiency can be improved.
  • the program data area 102p, the system data area 102s to be read / written, and the user data area 102y do not coexist in the same physical block.
  • the boundary between the program data area 102p for only reading data, the system data area 102s for writing and erasing data, and the user data area 102y coincides with the boundary between physical blocks. Therefore, for example, in FIG. 8, even if system data is frequently updated (rewritten), only a physical block copy operation corresponding to LBA 6 occurs. Also, for example, even if user data is frequently updated (rewritten), only physical block copy operations corresponding to LBA8 to LBA7999 occur frequently. Therefore, no physical block copy corresponding to LBA0, LBA1, LBA2, LBA3, and LBA4 in which program data is stored occurs. As a result, the risk of memory destruction can be reduced.
  • program data and user data can be stored in one memory.
  • a conventional data recording device such as an IC recorder has a memory for storing program data (for example, a NOR flash memory) and user data such as recording data in order to prevent destruction of the program data.
  • a memory for example, a NAND flash memory.
  • the program data and the user data can be prevented from being destroyed, so that one memory can be used. For example, it is not necessary to provide a dedicated memory for programs. Therefore, the cost of the data recording apparatus 100 can be reduced.
  • the data recording apparatus 100 has been described using an IC recorder that reads and writes audio data from and to the flash memory 102 that is a non-volatile storage medium.
  • the type of the data recording apparatus 100 is not limited to this embodiment.
  • the form is not limited.
  • the data recording device 100 may be any device that reads / writes user data from / to a nonvolatile storage medium.
  • the data recording device 100 may be a digital camera or a portable terminal.
  • the memory management unit 110 is a memory management apparatus. It may not be provided in the data recording apparatus 100 as part of the function.
  • the memory management device may be provided inside a device different from the data recording device 100, or the memory management device itself may function as one device.
  • the memory management device may be a part or all of the functions of a device for setting a program data area and a program writing device for producing a flash memory in which program data is written.
  • the flash memory 102 is a NAND flash memory
  • the type of the flash memory 102 is not limited to the present embodiment.
  • any other nonvolatile storage medium such as a NOR flash memory and an EEPROM may be used.
  • control unit 101 is used as a microcomputer and the RAM 103 is provided as an external RAM has been described as an example.
  • the RAM 103 may be built in the control unit 101.
  • the program data, the system data, and the user data are stored in the flash memory 102.
  • the type of data stored in the flash memory 102 is not limited to the present embodiment.
  • the present embodiment can be applied when program data and other data to be read and written (for example, user data) are stored in the same flash memory.
  • the area is set immediately before the program data is written (S409).
  • the area may be set at a timing different from the program data write (transfer process).
  • the pre-processing of S409 (including S401, S402, S403, S405, and S407) is not necessarily performed during the transfer process, and may be calculated in advance.
  • the memory management device of this embodiment is a device (program writing device) that is provided in a factory or the like and produces a large amount of flash memory in which program data is written.
  • the program writing apparatus according to the present embodiment rearranges the physical block to which program data is written, and copies the flash memory using the rearranged flash memory as a master, thereby copying a large amount of data in a short time (that is, , Production of pre-written flash memory).
  • FIG. 9 shows a program writing device which is an example of a memory management device in the present embodiment.
  • the program writing device 1000 includes a ROM writer 1001 and a personal computer (PC) 1002.
  • the ROM writer 1001 is connected to the PC 1002.
  • the ROM writer 1001 can write data stored in the PC 1002 to the blank flash memories 1004, 1005, and the like.
  • the ROM writer 1001 can read data recorded in the written flash memory 1003 from the written flash memory 1003 and save it in the PC 1002.
  • the PC 1002 can read data from the ROM writer 1001, process the read data, and write the processed data to the blank flash memories 1004 and 1005.
  • the written flash memory 1003 and the blank flash memories 1004 and 1005 are NAND flash memories.
  • FIGS. 10A and 10B show a state where program data and system data are written in the written flash memory 1003.
  • FIG. 10A shows the arrangement in the logical block
  • FIG. 10B shows the arrangement in the physical block.
  • program data A, program data B, program data C, program data D, and program data E are written in the program data area.
  • System data F is written in the system data area.
  • the physical block arrangement in FIG. 10B is obtained by rearranging the blocks in the logical block arrangement in FIG. 10A into the physical arrangement, and includes program data and system data included in the logical block arrangement.
  • FIG. 10C shows the physical block arrangement after the program data and system data included in the physical block arrangement of FIG. 10B are rearranged on the PC 1002 in this embodiment.
  • the flash memory 1003 is in a state. Specifically, program data A is stored in LBA 0, program data B is LBA 1, program data C is stored in LBA 2, program data D is stored in LBA 3, and program data E is stored in LBA 4, as shown in the logical block arrangement of FIG. As a result, the system data F is stored in the LBA 6.
  • the ROM writer 1001 writes data for 14 blocks in the physical block arrangement into the blank flash memory 1004.
  • the time required for writing at this time is a time for writing data for 14 blocks (and including verification and the like).
  • the blank flash memory 1004 is in a state in which program data and the like are written.
  • another blank flash memory 1005 is mounted on the ROM writer 1001.
  • the ROM writer 1001 writes data for 14 blocks in the physical block arrangement to the blank flash memory 1005.
  • the application program can recognize only the logical address, even if the program data is written in a continuous area in the logical block arrangement by the data recording apparatus 100 or the like of the first embodiment, it is actually shown in the physical block arrangement of FIG. Thus, it will be written at a distant position.
  • the ROM writer 1001 can access the flash memory only with a physical address. Since the ROM writer 1001 does not know where the program data is arranged in the physical block, for example, only the PBAs 1, 3, 6, 9, and 11 shown in FIG. Therefore, for example, all the physical blocks in which the program can be stored are read out from all areas of the flash memory, that is, from the first block (PBA0) of the physical block to the last block of the physical block.
  • Physical blocks (including empty blocks) are written to the blank flash memory. Therefore, the conventional memory management device cannot produce a large amount of written flash memory in a short time. Therefore, in the present embodiment, as shown below, the physical blocks of the written flash memory that is the master are rearranged.
  • FIG. 11 shows a flowchart of a program storage method including memory area setting (specifically, relocation of program data) in the second embodiment.
  • Program data is stored in the continuous areas LBA0 to LBA4 of the written flash memory 1003 as in the logical block arrangement of FIG. However, in actuality, they are arranged apart like the physical block arrangement of FIG. 10B (see the logical-physical conversion table 700 of FIG. 4). Since the ROM writer 1001 accesses the flash memory with a physical address, it cannot read only the PBAs 1, 3, 6, 9, and 11. When reading all program data and system data, if the physical block address where the data is stored is known in advance, the ROM writer 1001 reads the block data up to the final physical block (PBA). Good.
  • the ROM writer 1001 reads data for 14 blocks from PBA0 to PBA13.
  • program data A is arranged in PBA1, program data B in PBA6, program data C in PBA3, program data D in PBA9, and program data E in PBA11.
  • the system data F is arranged in PBA2.
  • the ROM writer 1001 transmits the read 14 blocks of data to the PC 1002. As a result, the read data is taken into the PC 1002.
  • the program writing apparatus 1000 rearranges physical blocks in which program data and system data are written on the PC 1002 (S1102). That is, the physical block arrangement in FIG. 10B is rearranged to the physical block arrangement in FIG. Specifically, the PC 1002 virtually creates a physical block arrangement. Next, the physical block arrangement is searched from PBA0, and the physical block PBA1 including the program data A first found is arranged in PBA0 of the physical block arrangement.
  • the physical block in which the data is stored includes a mechanism that makes it possible to identify an empty block.
  • the PC 1002 arranges the physical block PBA2 including the system data F found next in the physical block arrangement PBA1.
  • the physical block PBA3 including the program data C is allocated to the PBA2 having the physical block arrangement
  • the physical block PBA6 including the program data B is allocated to the PBA3 having the physical block arrangement
  • the physical block including the program data D is included.
  • PBA9 is arranged in PBA4 of physical block arrangement
  • physical block PBA11 including program data E is arranged in PBA5 of physical block arrangement.
  • the PC 1002 writes the completed physical block arrangement for six blocks to another blank flash memory mounted on the ROM writer 1001.
  • the physical address after rearrangement is made to correspond to the logical address by the logical physical conversion table 700.
  • the program data area 102p and the system data area 102s are set to PBA0 to PBA5. If the order of the divided program data is known in advance, rearrangement may be performed in that order.
  • This flash memory becomes the master flash ROM.
  • a flash memory in which program data is written by the program writing apparatus 1000 of the present embodiment (that is, a flash memory in which the program data area and the system data area are set to PBA0 to PBA5) is a data recording apparatus such as an IC recorder, for example. Incorporated into.
  • the system data F is arranged between the program data A and the program data C, but it is more preferable to arrange the program data and the system data separately.
  • the system data F is preferably arranged in the next block of the program data E.
  • the program data area is composed of continuous physical blocks.
  • the program data arranged in the physically distributed physical blocks is rearranged in the physically continuous physical blocks and stored in the flash memory, so that the memory described in the first embodiment While maintaining the effect of reducing the risk of destruction, it is possible to reduce the writing time in the ROM writer when the flash memory storing the program data is mass-produced with the ROM writer or the like. That is, the program data area to be read in the physical block arrangement can be reduced by rearranging the program data write destination. Therefore, the size of data to be written by a ROM writer can be reduced, and the writing time can be shortened.
  • system data and the system data are described as an example in which the ROM writer 1001 writes the written flash memory to the blank flash memory.
  • the system data does not necessarily need to be written to the blank flash memory.
  • At least the program data may be written.
  • the program data area is set to a continuous physical block by relocation of the program data.
  • the program writing apparatus 1000 including the ROM writer 1001 and the PC 1002 is described as an example of the memory management apparatus.
  • the configuration of the memory management apparatus is not limited to this embodiment. Any device capable of reading / rearranging / writing data with respect to a physical block of the flash memory 1003 (same as a physical address such as a physical sector or a physical page) can be regarded as having the same configuration as in the present embodiment. Do not exclude them because they can.
  • the flash memories 1003, 1004, and 1005 are NAND flash memories
  • the types of the flash memories 1003, 1004, and 1005 are not limited to the present embodiment.
  • any other nonvolatile storage medium such as a NOR flash memory and an EEPROM may be used.
  • program data, system data, and user data are stored in the flash memory
  • type of data stored in the flash memory is not limited to this embodiment.
  • the present embodiment can be applied when program data and other data to be read and written (for example, user data) are stored in the same flash memory.
  • the program data and the system data are written.
  • the type and number of data to be written are not limited to these. Even various combinations can be regarded as the same configuration as in the present embodiment, and thus are not excluded.
  • the present invention has the effect of reducing the risk of destruction of extremely important data such as program data that is read only, and is useful for IC recorders and semiconductor music players equipped with flash memory.
  • SYMBOLS Data recording device 101 Control part 102 Flash memory 102p Program data area 102s System data area 102y User data area 102m Memory area 103 RAM DESCRIPTION OF SYMBOLS 104 Display part 105 Operation part 106 Audio processing part 106e Encoder 106d Decoder 107 Microphone 108 Speaker 109 Communication part 110 Memory management part 120 Memory control part 700 Logical physical conversion table 802 Application program part 803 Memory controller 853 Memory controller 1000 Program writing device 1001 ROM Writer 1002 PC 1003 Pre-programmed flash memory 1004 Blank flash memory 1005 Blank flash memory

Abstract

Provided is a memory management device which reduces the risk of destructing the important data such as program data which is only read out, and also provided are a data recorder and a memory area setting method. A memory management device is equipped with a memory control unit (120) which controls a memory (102). The data area of the memory is managed in units of first and second management areas. The first management area is the read/write unit of data, the second management area is the erase unit of data and the second management area includes a plurality of first management areas. The data area of the memory includes a read-only data area (102p) where the data is only read out, and read/write data areas (102s, 102y) where the data is written and erased. The memory control unit manages the data area of the memory so that the boundary between the read-only data area and the read/write data area matches the boundary between the second management areas.

Description

メモリ管理装置、データ記録装置、及びメモリ領域設定方法MEMORY MANAGEMENT DEVICE, DATA RECORDING DEVICE, AND MEMORY AREA SETTING METHOD
 本発明は、不揮発性メモリを管理するメモリ管理装置、メモリ管理装置を備えたデータ記録装置、及び不揮発性メモリのメモリ領域を設定するメモリ領域設定方法に関する。 The present invention relates to a memory management device that manages a nonvolatile memory, a data recording device including the memory management device, and a memory area setting method that sets a memory area of the nonvolatile memory.
 近年、デジタルオーディオプレーヤ、ICレコーダ、及びデジタルカメラなどを代表とするデジタル機器や、SDカード及びMMCカードなどを代表とするメモリカード等において、不揮発性メモリであるフラッシュメモリが多用されている。フラッシュメモリは、プロセスの進化などにより、大容量化してきている。特に、データの記憶媒体としては、大容量化に向くNAND型フラッシュメモリが多用される。 In recent years, flash memories, which are nonvolatile memories, are frequently used in digital devices such as digital audio players, IC recorders, and digital cameras, and memory cards such as SD cards and MMC cards. Flash memory has become larger in capacity due to process evolution. In particular, as a data storage medium, a NAND flash memory suitable for increasing the capacity is frequently used.
 NAND型フラッシュメモリは、品種によりサイズ等は異なるが、例えば、4096個の物理的なブロックに分割されている。このブロックは消去の最小単位である。ブロックは、128個のページで構成される。ページは、書き込みおよび読み出しの基本単位である。ページは、2048バイトのユーザデータ領域と64バイトの冗長領域とを含む。 The NAND flash memory is divided into, for example, 4096 physical blocks, although the size and the like vary depending on the type. This block is the minimum unit of erasure. The block is composed of 128 pages. A page is a basic unit of writing and reading. The page includes a 2048-byte user data area and a 64-byte redundant area.
 通常、機器に組み込まれているマイコンやパソコン等において、データの読み書きを行うアプリケーションプログラムは、共通の単位としてセクタ(512バイト)単位で記憶媒体のデータを管理することが多い。セクタは、上術した書き込みおよび読み出しの基本単位であるページと異なる場合がある。 Usually, an application program that reads and writes data in a microcomputer or personal computer incorporated in a device often manages data in a storage medium in units of sectors (512 bytes) as a common unit. The sector may be different from the page which is the basic unit of writing and reading that has been performed.
 このようなフラッシュメモリにおいて、記憶されているデータを更新する際、一旦、元データを読み出して、元データと新たなデータとで構成される更新データが消去済みの未使用領域に書き込まれる(例えば、特許文献1参照)。元データが記憶されていた領域は無効領域になる。上述したように、ブロックが消去の最小単位であるため、たとえ、1バイトのデータを更新するだけであっても、ブロックレベルでの読み出し・書き込み・消去が行われる。 In such a flash memory, when updating the stored data, the original data is read once, and the update data composed of the original data and new data is written in an unused area that has been erased (for example, , See Patent Document 1). The area where the original data is stored becomes an invalid area. As described above, since a block is the minimum unit of erasure, even if only 1 byte of data is updated, reading / writing / erasing is performed at the block level.
 通常、フラッシュメモリの書き込み(以下、消去を含む。)回数には、限界がある。例えば、NAND型フラッシュメモリでは、書き込み回数の限界は10万回程度である。そのため、限界を超えた回数の書き込みが、ある領域に対して行われると、その領域は保証されなくなる。すなわち、破壊されて、読み書きできなくなる可能性がある。また、書き込みだけでなく、読み出しによっても、メモリ疲労は進む。よって、フラッシュメモリを搭載した機器を実現する際は、機器の信頼性を確保するために、通常、特定の物理領域に書き込みが集中しないようにウェアレベリングなどの工夫が施される。 Usually, there is a limit to the number of times flash memory can be written (hereinafter, including erasure). For example, in the NAND flash memory, the limit of the number of times of writing is about 100,000 times. Therefore, if the number of times of writing exceeding the limit is performed on a certain area, the area is not guaranteed. In other words, there is a possibility that it is destroyed and cannot be read and written. Moreover, memory fatigue progresses not only by writing but also by reading. Therefore, when realizing a device equipped with a flash memory, in order to ensure the reliability of the device, usually, a device such as wear leveling is applied so that writing does not concentrate on a specific physical area.
特開2000-222292号公報JP 2000-222292 A
 同一のフラッシュメモリに、極めて重要なデータ(例えば、その機器を動作させるためのプログラムデータ)とユーザデータが記録される場合、プログラムデータの一部とユーザデータの一部が同一ブロック内に記録されることが起こり得る。そのような場合、ユーザデータの頻繁な書き込み及び消去により、ユーザデータの一部と同一ブロックに記録されたプログラムデータの一部も頻繁に別のブロックに書き換えられてしまう。 When extremely important data (for example, program data for operating the device) and user data are recorded in the same flash memory, a part of the program data and a part of the user data are recorded in the same block. Can happen. In such a case, due to frequent writing and erasing of user data, part of the program data recorded in the same block as part of the user data is frequently rewritten to another block.
 しかしながら、上述したようなウェアレベリングを行って、特定領域への書き込みが集中しないようにしたとしても、書き込み/読み出し可能な回数が無限になるわけではない。そのため、ユーザデータの書き換えに伴い、同一ブロック内に格納されているプログラムデータが頻繁に書き換えられると、書き込み(消去を含む)/読み出し回数の限界などにより、プログラムデータが破壊されてしまうおそれがあった。プログラムデータが破壊されると、それ以降、機器が動作しなくなってしまうという重大問題を引き起こしてしまう。 However, even if wear leveling as described above is performed so that writing to a specific area is not concentrated, the number of times of writing / reading is not infinite. Therefore, if the program data stored in the same block is frequently rewritten as the user data is rewritten, the program data may be destroyed due to the limit of the number of writing (including erasing) / reading. It was. If the program data is destroyed, it will cause a serious problem that the device will not operate thereafter.
 本発明は、書き込みや読み出し回数に限界を有するようなフラッシュメモリなどを用いたメモリ管理において、プログラムデータのような極めて重要なデータの破壊リスクを低減する、メモリ管理装置、データ記録装置、及びメモリ領域設定方法を提供することを目的とする。具体的には、ユーザデータの書き換えに伴い、プログラムデータが書き換えられることを防ぐ、メモリ管理装置、データ記録装置、及びメモリ領域設定方法を提供することを目的とする。 The present invention relates to a memory management device, a data recording device, and a memory that reduce the risk of destruction of extremely important data such as program data in memory management using a flash memory or the like that has a limit on the number of times of writing and reading. An object is to provide a region setting method. Specifically, an object of the present invention is to provide a memory management device, a data recording device, and a memory area setting method that prevent program data from being rewritten as user data is rewritten.
 本発明のメモリ管理装置は、メモリを制御するメモリ制御部を備えたメモリ管理装置であって、メモリのデータ領域は第1及び第2の管理領域の単位で管理され、第1の管理領域はデータの読み出し及び書き込み単位であり、第2の管理領域はデータの消去単位であり、第2の管理領域は複数の第1の管理領域を含み、メモリのデータ領域は、データの読み出しのみを行うリードオンリーデータ領域と、データの書き込み、消去を行うリードライトデータ領域とを含み、メモリ制御部は、リードオンリーデータ領域とリードライトデータ領域の境界が、第2の管理領域間の境界と一致するように、メモリのデータ領域を管理する。 A memory management device according to the present invention is a memory management device including a memory control unit that controls a memory, wherein a data area of the memory is managed in units of first and second management areas, and the first management area is It is a unit for reading and writing data, the second management area is a unit for erasing data, the second management area includes a plurality of first management areas, and the data area of the memory only reads data. The memory control unit includes a read-only data area and a read-write data area for writing and erasing data, and the memory control unit matches a boundary between the read-only data area and the read-write data area with a boundary between the second management areas Thus, the data area of the memory is managed.
 リードオンリーデータ領域は、メモリ内の連続した第2の管理領域に設けられてもよい。 The read-only data area may be provided in a continuous second management area in the memory.
 第1の管理領域がページであり、第2の管理領域がブロックであってもよい。 The first management area may be a page, and the second management area may be a block.
 本発明のデータ記録装置は、上記メモリ管理装置と、メモリ管理装置により設定された領域を備えるメモリにデータを記録するデータ記録部と、を有する。 The data recording device of the present invention includes the memory management device and a data recording unit that records data in a memory having an area set by the memory management device.
 リードオンリーデータ領域にはデータ記録装置の動作を制御するためのプログラムのデータが記録され、リードライトデータ領域にはユーザデータが記録されてもよい。 Program data for controlling the operation of the data recording apparatus may be recorded in the read-only data area, and user data may be recorded in the read / write data area.
 本発明のメモリ領域設定方法は、メモリの領域を設定する方法であって、メモリのデータ領域は第1及び第2の管理領域の単位で管理され、第1の管理領域はデータの読み出し及び書き込み単位であり、第2の管理領域はデータの消去単位であり、第2の管理領域は複数の第1の管理領域を含み、メモリのデータ領域において、データの読み出しのみを行うリードオンリーデータ領域と、データの書き込み、消去を行うリードライトデータ領域とを設定し、リードオンリーデータ領域とリードライトデータ領域の境界が、第2の管理領域間の境界と一致するように、メモリのデータ領域を設定する。 The memory area setting method of the present invention is a method for setting an area of a memory, wherein the data area of the memory is managed in units of first and second management areas, and the first management area reads and writes data. The second management area is a data erasing unit, the second management area includes a plurality of first management areas, and a read-only data area that only reads data in the data area of the memory; Set the read / write data area where data is written and erased, and set the memory data area so that the boundary between the read-only data area and the read / write data area matches the boundary between the second management areas To do.
 メモリのサイズが複数種類ある場合に、リードオンリーデータ領域とリードライトデータ領域の境界が、第2の管理領域の複数のサイズ間の最小公倍数となる境界に一致するように、メモリのデータ領域を設定してもよい。 When there are multiple types of memory, the data area of the memory is set so that the boundary between the read-only data area and the read / write data area matches the boundary that is the least common multiple between the multiple sizes of the second management area. It may be set.
 リードオンリーデータ領域を、連続した複数の第2の管理領域で構成してもよい。 The read-only data area may be composed of a plurality of continuous second management areas.
 第2の管理領域がページであり、第2の管理領域がブロックであってもよい。 The second management area may be a page, and the second management area may be a block.
 本発明によれば、読み出しのみ行われるプログラムデータのような極めて重要なデータと、書き込み及び読み出しが行われるユーザデータが、同一のフラッシュメモリに格納される機器において、プログラムデータとユーザデータをそれぞれ格納するための物理記憶領域の境界がブロック間の境界と一致するようにメモリを管理することにより、ユーザデータの書き込み及び読み出しに起因するメモリ劣化によるプログラムデータへの影響を極力排除することができる。そのため、プログラムデータが破壊されるリスクを低減することが可能となる。本発明によれば、コストアップなしに簡易な方法で、重要なデータが破壊されるリスクを低減することができる。 According to the present invention, program data and user data are stored in a device in which extremely important data such as program data that is read only and user data that is written and read are stored in the same flash memory. By managing the memory so that the boundary of the physical storage area to be matched with the boundary between the blocks, it is possible to eliminate as much as possible the influence on the program data due to the memory deterioration caused by the writing and reading of the user data. Therefore, it is possible to reduce the risk that the program data is destroyed. According to the present invention, it is possible to reduce the risk that important data is destroyed by a simple method without increasing the cost.
本発明の実施形態1のデータ記録装置を示す図The figure which shows the data recording device of Embodiment 1 of this invention. (a)は図1のメモリ管理部の例を示す図、(b)は図1のメモリ管理部の他の例を示す図(A) is a diagram showing an example of the memory management unit in FIG. 1, and (b) is a diagram showing another example of the memory management unit in FIG. フラッシュメモリのメモリ領域を示す図であって、(a)は論理ブロック配置を示す図、(b)は物理ブロック配置を示す図2A and 2B are diagrams showing a memory area of a flash memory, in which FIG. 1A shows a logical block arrangement, and FIG. 論理物理変換テーブルを示す図Diagram showing logical physical conversion table データの書き換えを示す図であって、(a)は物理ブロック配置を示す図、(b)は書き換え前の物理ブロックの詳細図、(c)は書き換え後の物理ブロックの詳細図FIG. 4 is a diagram illustrating data rewriting, where (a) is a diagram illustrating physical block arrangement, (b) is a detailed diagram of a physical block before rewriting, and (c) is a detailed diagram of a physical block after rewriting. 本発明の実施形態1のメモリ領域設定方法を含むプログラムデータの書き込み方法を示すフローチャート7 is a flowchart showing a program data writing method including a memory area setting method according to the first embodiment of the present invention NANDフラッシュメモリの一例を示す図であって、(a)は論理ブロック配置を示す図、(b)はLBA2のブロックの詳細図2A and 2B are diagrams illustrating an example of a NAND flash memory, in which FIG. 1A is a diagram illustrating a logical block arrangement, and FIG. NANDフラッシュメモリの一例を示す図であって、(a)は論理ブロック配置を示す図、(b)はLBA4のブロックの詳細図2A and 2B are diagrams showing an example of a NAND flash memory, where FIG. 1A is a diagram showing a logical block arrangement, and FIG. 本発明の実施形態2のプログラム書き込み装置を示す図The figure which shows the program writing apparatus of Embodiment 2 of this invention. プログラムデータ及びシステムデータが書き込まれた後のブロック配置を示す図であって、(a)は論理ブロック配置を示す図、(b)は物理ブロック配置を示す図、(c)は再配置後の物理ブロック配置を示す図It is a figure which shows block arrangement after program data and system data are written, (a) is a figure which shows logical block arrangement, (b) is a figure which shows physical block arrangement, (c) is after rearrangement Diagram showing physical block layout 本発明の実施形態2のデータの再配置を含むメモリ領域設定方法を示すフローチャート7 is a flowchart showing a memory area setting method including data rearrangement according to the second embodiment of the present invention.
 以下、本発明のメモリ管理装置、データ記録装置、及びメモリ領域設定方法について、図面を参照して説明する。 Hereinafter, a memory management device, a data recording device, and a memory area setting method according to the present invention will be described with reference to the drawings.
《実施形態1》
 本発明の実施形態1のデータ記録装置は、音データの録音/再生を行うICレコーダである。データ記録装置は、フラッシュメモリのプログラムデータ領域に格納されたプログラムデータを読み出して実行することにより、ICレコーダとしての動作(録音・再生・USB接続等)を行う。本実施形態のデータ記録装置は、フラッシュメモリのメモリ領域を管理するメモリ管理装置としての機能を含む。このメモリ管理装置が、読み出しのみを行うプログラムデータ領域を、書き換えを行うユーザデータ領域とは別のブロックに設ける。すなわち、プログラムデータ領域とユーザデータ領域との境界がブロック間の境界と一致するようにメモリの領域を管理する。これにより、ユーザデータの書き換えに伴ってプログラムデータが書き換えられることを防ぎ、プログラムデータが破壊されるリスクを低減することを可能にする。
Embodiment 1
The data recording apparatus according to the first embodiment of the present invention is an IC recorder that records / reproduces sound data. The data recording device reads out and executes the program data stored in the program data area of the flash memory, thereby performing an operation as an IC recorder (recording / reproducing / USB connection, etc.). The data recording apparatus of this embodiment includes a function as a memory management apparatus that manages the memory area of the flash memory. In this memory management device, a program data area for only reading is provided in a block different from a user data area for rewriting. That is, the memory area is managed so that the boundary between the program data area and the user data area coincides with the boundary between blocks. As a result, it is possible to prevent the program data from being rewritten with the rewriting of the user data, and to reduce the risk of the program data being destroyed.
<1. データ記録装置の構成>
 図1に、実施形態1のデータ記録装置の一例であるICレコーダを示す。データ記録装置100は、データ記録装置100内のメモリを管理するメモリ管理部110、表示部104、操作部105、オーディオ処理部106、マイク107、スピーカ108、及び通信部109を有する。オーディオ処理部106は、エンコーダ106e及びデコーダ106dを含む。
<1. Configuration of data recording apparatus>
FIG. 1 shows an IC recorder which is an example of the data recording apparatus of the first embodiment. The data recording apparatus 100 includes a memory management unit 110 that manages a memory in the data recording apparatus 100, a display unit 104, an operation unit 105, an audio processing unit 106, a microphone 107, a speaker 108, and a communication unit 109. The audio processing unit 106 includes an encoder 106e and a decoder 106d.
 メモリ管理部110は、不揮発性メモリであるフラッシュメモリ102と、フラッシュメモリ102を制御するメモリ制御部120と、を含む。メモリ管理部110は、フラッシュメモリ102の領域を設定するメモリ管理装置と、設定された領域にデータを書き込むデータ記録部としての機能を有する。メモリ制御部120は、制御部101(マイコン)とRAM103により構成される。 The memory management unit 110 includes a flash memory 102 that is a nonvolatile memory and a memory control unit 120 that controls the flash memory 102. The memory management unit 110 has a function as a memory management device that sets an area of the flash memory 102 and a data recording unit that writes data in the set area. The memory control unit 120 includes a control unit 101 (microcomputer) and a RAM 103.
 フラッシュメモリ102は、本実施形態において、NAND型フラッシュメモリである。フラッシュメモリ102のメモリ領域(データ領域)102mは、プログラムデータを格納するためのプログラムデータ領域102pと、システムデータを格納するためのシステムデータ領域102sと、ユーザデータを格納するためのユーザデータ領域102yと、を含む。ここで、プログラムデータは、破壊されると機器の動作において致命傷に陥るような重要なプログラムやデータなどである。システムデータは、機器が動作するために利用するリジュームデータなどのパラメータ類などである。ユーザデータは、録音データ、音楽ファイルなどである。プログラムデータは書き換えが行われないデータであるのに対して、システムデータ及びユーザデータは書き替えが行われるデータである。よって、プログラムデータ領域102pは、データの読み出しのみを行うリードオンリーデータ領域として管理され、システムデータ領域102sとユーザデータ領域102yは、データの書き込み及び消去を行うリードライトデータ領域として管理される。 The flash memory 102 is a NAND flash memory in this embodiment. The memory area (data area) 102m of the flash memory 102 includes a program data area 102p for storing program data, a system data area 102s for storing system data, and a user data area 102y for storing user data. And including. Here, the program data is an important program or data that, if destroyed, causes a fatal injury in the operation of the device. The system data includes parameters such as resume data used for the operation of the device. User data is recorded data, music files, and the like. Program data is data that is not rewritten, whereas system data and user data are data that is rewritten. Therefore, the program data area 102p is managed as a read-only data area for only reading data, and the system data area 102s and the user data area 102y are managed as read / write data areas for writing and erasing data.
<2. データ記録装置の動作>
 このような構成のデータ記録装置100の動作概要について、簡単に説明する。データ記録装置100は、音データの録音/再生を行う機器である。データ記録装置100は、フラッシュメモリ102のプログラムデータ領域102pに格納されたプログラムデータの一部又は全てを読み出して、RAM103に展開して、プログラムを実行する。そのプログラムがフラッシュメモリ102を管理(例えば、データを読み出し/書き込み)することにより、データ記録装置100はICレコーダとして動作する。以下、ICレコーダとしての録音・再生・USB接続の基本動作について説明する。
<2. Operation of data recording apparatus>
An outline of the operation of the data recording apparatus 100 having such a configuration will be briefly described. The data recording device 100 is a device for recording / reproducing sound data. The data recording apparatus 100 reads part or all of the program data stored in the program data area 102p of the flash memory 102, develops it in the RAM 103, and executes the program. When the program manages the flash memory 102 (for example, reads / writes data), the data recording apparatus 100 operates as an IC recorder. Hereinafter, basic operations of recording / playback / USB connection as an IC recorder will be described.
<2.1 録音動作>
 ユーザが、操作部105の録音キーを押下すると、マイク107は音データを拾う。オーディオ処理部106のエンコーダ106eは、マイク107で拾われた音データをエンコード(例えば、MP3エンコード)する。制御部101は、フラッシュメモリ102のユーザデータ領域102yにエンコードされたデータを記録していく。一方、ユーザが、操作部105の停止キーを押下すると、オーディオ処理部106のエンコーダ106eは、MP3エンコードを停止する。制御部101は、フラッシュメモリ102へのエンコードデータの記録を停止する。
<2.1 Recording operation>
When the user presses the recording key of the operation unit 105, the microphone 107 picks up sound data. The encoder 106e of the audio processing unit 106 encodes sound data picked up by the microphone 107 (for example, MP3 encoding). The control unit 101 records the encoded data in the user data area 102y of the flash memory 102. On the other hand, when the user presses the stop key of the operation unit 105, the encoder 106e of the audio processing unit 106 stops the MP3 encoding. The control unit 101 stops recording encoded data in the flash memory 102.
<2.2 再生動作>
 表示部104は、フラッシュメモリ102のユーザデータ領域102yに記録されている音データのリストを表示可能である。ユーザは、表示部104に表示されているリストの中から所望の音データを選択することができる。ユーザが、操作部105に対して音データの選択を行って再生キーを押下すると、制御部101は、所望の音データをフラッシュメモリ102から読み出す。オーディオ処理部106のデコーダ106dは、読み出された音データをデコード(本実施形態では、MP3デコード)し、スピーカ108から音を出力する。なお、スピーカ108の代わりにインナーホンから音を出力する場合も、同様に行う。
<2.2 Playback operation>
The display unit 104 can display a list of sound data recorded in the user data area 102 y of the flash memory 102. The user can select desired sound data from the list displayed on the display unit 104. When the user selects sound data with respect to the operation unit 105 and presses the reproduction key, the control unit 101 reads desired sound data from the flash memory 102. The decoder 106 d of the audio processing unit 106 decodes the read sound data (in this embodiment, MP3 decoding), and outputs sound from the speaker 108. The same applies to the case where sound is output from the inner phone instead of the speaker 108.
<2.3 インタフェース動作>
 制御部101は、通信部109を介して、USB(Universal Serial Bus)やSATA(Serial Advanced Technology Attachment)などの通信インタフェースに準拠してPC等からフラッシュメモリ102のユーザデータ領域102yにMP3データ等を書き込むことが可能である。このとき、書き込まれたMP3データ等を再生することも可能である。
<2.3 Interface operation>
The control unit 101 transmits MP3 data or the like from a PC or the like to the user data area 102y of the flash memory 102 via a communication unit 109 in accordance with a communication interface such as USB (Universal Serial Bus) or SATA (Serial Advanced Technology Attachment). It is possible to write. At this time, the written MP3 data or the like can be reproduced.
<2.4 制御部動作-概要>
 次に、制御部101の動作について説明する。本実施形態の制御部101は、内蔵RAM非搭載、且つ、プログラムデータを格納するための内蔵NORフラッシュメモリ非搭載のマイクロコンピュータである。本実施形態の制御部101は、外付けのRAM103と、プログラムデータ領域102pにプログラムデータを格納したフラッシュメモリ102と、に接続されている。データ記録装置100がICレコーダとして動作するとき(すなわち、録音・再生・USB接続などを行うとき)、制御部101は、フラッシュメモリ102のプログラムデータ領域102pに格納されたプログラムデータの一部又は全てを読み出して、RAM103に展開して、プログラムを実行する。実行されたプログラムが、フラッシュメモリ102のメモリ管理(具体的には、データの読み出し/書き込み)を行うことにより、データ記録装置100は、ICレコーダとして動作する。
<2.4 Control unit operation-overview>
Next, the operation of the control unit 101 will be described. The control unit 101 according to the present embodiment is a microcomputer that does not have a built-in RAM and does not have a built-in NOR flash memory for storing program data. The control unit 101 of this embodiment is connected to an external RAM 103 and a flash memory 102 that stores program data in a program data area 102p. When the data recording apparatus 100 operates as an IC recorder (that is, when recording, playback, USB connection, etc.), the control unit 101 performs part or all of the program data stored in the program data area 102p of the flash memory 102. Is loaded into the RAM 103 and the program is executed. The executed program performs memory management of the flash memory 102 (specifically, data read / write), whereby the data recording apparatus 100 operates as an IC recorder.
<2.5 制御部動作-メモリコントローラ>
 図2(a)に、本実施形態におけるメモリ管理部110の一例を示す。図2(b)に、メモリ管理部110の他の例(メモリ管理部110’)を示す。図2(a)及び(b)は、図1のメモリ管理部110のメモリ制御部120を別の形式で記載した図である。具体的には、制御部101にRAM103を組み込んだ形式で、別の形式で簡略化して記載した図である。なお、メモリ管理部110は、種々の形態で表すことができるため、図2(a)及び(b)に限定するものではない。
<2.5 Controller operation-Memory controller>
FIG. 2A shows an example of the memory management unit 110 in the present embodiment. FIG. 2B shows another example (memory management unit 110 ′) of the memory management unit 110. 2A and 2B are diagrams illustrating the memory control unit 120 of the memory management unit 110 of FIG. 1 in another format. Specifically, it is a diagram in which the RAM 103 is incorporated in the control unit 101 and simplified in another format. The memory management unit 110 can be expressed in various forms, and is not limited to FIGS. 2 (a) and 2 (b).
 図2(a)において、メモリ管理部110は、メモリ制御部120と、フラッシュメモリ102と、を有する。メモリ制御部120は、アプリケーションプログラム部802とメモリコントローラ803を含む。フラッシュメモリ102は、メモリ領域102mを含む。図2(a)のメモリ管理部110は、メモリコントローラ803が、メモリ制御部120側に搭載されている例を示している。フラッシュメモリ102のメモリ領域102mは、図1に示すプログラムデータ領域102pを含み、プログラムデータ領域102pにアプリケーションプログラムが格納されている。メモリ制御部120は、メモリ領域102mからアプリケーションプログラムを読み出して、アプリケーションプログラム部802により、そのアプリケーションプログラムを実行する。 2A, the memory management unit 110 includes a memory control unit 120 and a flash memory 102. The memory control unit 120 includes an application program unit 802 and a memory controller 803. The flash memory 102 includes a memory area 102m. The memory management unit 110 in FIG. 2A shows an example in which the memory controller 803 is mounted on the memory control unit 120 side. The memory area 102m of the flash memory 102 includes the program data area 102p shown in FIG. 1, and an application program is stored in the program data area 102p. The memory control unit 120 reads an application program from the memory area 102m, and the application program unit 802 executes the application program.
 図2(b)において、メモリ管理部110’は、メモリ制御部120と、フラッシュメモリ102と、を有する。メモリ制御部120は、アプリケーションプログラム部802を含む。フラッシュメモリ102は、メモリコントローラ853とメモリ領域102mとを含む。図2(b)のメモリ管理部110’は、メモリコントローラ853が、フラッシュメモリ102側に搭載されている例を示している。フラッシュメモリ102のメモリ領域102mは、図1に示すプログラムデータ領域102pを含み、プログラムデータ領域102pにアプリケーションプログラムが格納されている。メモリ制御部120は、メモリ領域102mからアプリケーションプログラムを読み出して、アプリケーションプログラム部802により、そのアプリケーションプログラムを実行する。 In FIG. 2B, the memory management unit 110 ′ includes a memory control unit 120 and a flash memory 102. The memory control unit 120 includes an application program unit 802. The flash memory 102 includes a memory controller 853 and a memory area 102m. The memory management unit 110 ′ in FIG. 2B shows an example in which the memory controller 853 is mounted on the flash memory 102 side. The memory area 102m of the flash memory 102 includes the program data area 102p shown in FIG. 1, and an application program is stored in the program data area 102p. The memory control unit 120 reads an application program from the memory area 102m, and the application program unit 802 executes the application program.
 以下、本実施形態では、図2(a)に示すように、メモリ管理部110がメモリ制御部120側にメモリコントローラ803を搭載している場合について説明する。 Hereinafter, in the present embodiment, as shown in FIG. 2A, a case where the memory management unit 110 has a memory controller 803 mounted on the memory control unit 120 side will be described.
<2.6 制御部動作-論理ブロック配置と物理ブロック配置の関係>
 図3及び図4を用いて、フラッシュメモリにおける一般的な論理アドレスと物理アドレスの変換について説明する。図3(a)及び(b)に、メモリ領域102mの論理ブロック配置と物理ブロック配置の対応付けの一例を示す。なお、図中、PBAは物理ブロックアドレス(Physical Block Address)を示し、LBAは論理ブロックアドレス(Logical Block Address)を示している。図4に、論理物理変換テーブルの一例を示す。図4の論理物理変換テーブル700は、メモリ領域102mの物理アドレスと論理アドレスの対応付けを行う表の一例である。
<2.6 Control Unit Operation-Relationship between Logical Block Layout and Physical Block Layout>
A general logical address and physical address conversion in the flash memory will be described with reference to FIGS. 3A and 3B show an example of correspondence between the logical block arrangement and the physical block arrangement in the memory area 102m. In the figure, PBA indicates a physical block address (Physical Block Address), and LBA indicates a logical block address (Logical Block Address). FIG. 4 shows an example of the logical-physical conversion table. The logical-physical conversion table 700 of FIG. 4 is an example of a table that associates the physical address and logical address of the memory area 102m.
 図3(a)の論理ブロック配置は、図1におけるメモリ領域102mの論理ブロック配置を示し、図3(b)の物理ブロック配置は、図1におけるメモリ領域102mの物理ブロック配置を示す。図3(a)の論理ブロック配置における、論理ブロック910(LBA0)、論理ブロック911(LBA1)、論理ブロック912(LBA2)、論理ブロック913(LBA3)、論理ブロック914(LBA4)、及び論理ブロック916(LBA6)は、それぞれ、図3(b)の物理ブロック配置における、物理ブロック961(PBA1)、物理ブロック966(PBA6)、物理ブロック963(PBA3)、物理ブロック969(PBA9)、物理ブロック971(PBA11)、及び物理ブロック962(PBA2)に対応している。図2(a)のメモリコントローラ803は、図4の論理物理変換テーブル700を備え、物理ブロックアドレスと論理ブロックアドレスの対応付けを行う。なお、論理物理変換テーブル700は、通常、メモリコントローラ803において、生成及び管理されることが多いが、その生成及び管理手法については、ここで制限するものではない。 3A shows the logical block arrangement of the memory area 102m in FIG. 1, and the physical block arrangement of FIG. 3B shows the physical block arrangement of the memory area 102m in FIG. The logical block 910 (LBA0), logical block 911 (LBA1), logical block 912 (LBA2), logical block 913 (LBA3), logical block 914 (LBA4), and logical block 916 in the logical block arrangement of FIG. (LBA6) is the physical block 961 (PBA1), physical block 966 (PBA6), physical block 963 (PBA3), physical block 969 (PBA9), and physical block 971 (physical block arrangement) in the physical block arrangement of FIG. PBA11) and physical block 962 (PBA2). The memory controller 803 in FIG. 2A includes the logical-physical conversion table 700 in FIG. 4 and associates physical block addresses with logical block addresses. The logical-physical conversion table 700 is normally generated and managed in the memory controller 803 in many cases, but the generation and management method is not limited here.
 図2(a)のアプリケーションプログラム部802は、物理アドレスではなく、論理アドレスに対して、データの読み出し/書き込みのアクセスを行う。メモリコントローラ803は、論理アドレスと物理アドレスの対応付け変換を行い、特定の物理ブロックアドレスへの書き込み(消去を含む。)が集中しないように制御する。例えば、メモリコントローラ803は、ウェアレベリング技法を駆使する。ウェアレベリング技法とは、論理アドレスと物理アドレスの対応付けを適宜変更する手法である(ここでは、その詳細説明は省略する)。これにより、アプリケーションプログラム部802は、特定の物理ブロックアドレスに偏った書き込み(消去を含む。)を行わないような複雑なプログラムを作成する必要がなく、論理的なアドレス(論理ブロック、論理ページ、論理セクタなど)でプログラムを実現することが可能となる。例えば、フラッシュメモリ上に記憶したシステムパラメータなどを度々書き換え更新したとしても、特定の物理ブロックアドレスに対して過度の回数の書き込み(消去を含む。)は行われない。よって、メモリ寿命によるメモリ破壊のリスクが低減される。 The application program unit 802 in FIG. 2A performs data read / write access to a logical address instead of a physical address. The memory controller 803 performs correspondence conversion between a logical address and a physical address, and controls so that writing (including erasure) to a specific physical block address is not concentrated. For example, the memory controller 803 makes full use of a wear leveling technique. The wear leveling technique is a technique for appropriately changing the correspondence between logical addresses and physical addresses (here, detailed description thereof is omitted). Thus, the application program unit 802 does not need to create a complicated program that does not write (including erasure) biased to a specific physical block address, and does not need to create a logical address (logical block, logical page, The program can be realized by a logical sector or the like. For example, even if the system parameters stored in the flash memory are frequently rewritten and updated, an excessive number of writing (including erasing) is not performed on a specific physical block address. Therefore, the risk of memory destruction due to the memory life is reduced.
<2.7 制御部動作-データ更新>
 図5を用いて、一般的なデータの書き換えについて説明する。図5(a)の物理ブロック配置は、図1のメモリ領域102mの物理ブロック配置の一例を示す。図5(b)は、データ書き換え前の物理ブロックアドレス2(PBA2)の物理ブロックを示す。図5(c)は、データ書き換え後の物理ブロックアドレス4094(PBA4094)の物理ブロックを示す。図5(b)及び(c)に示すように、各物理ブロックは128ページにより構成される。ページは、書き込み/読み出しの基本単位であり、ペイロード部(2Kバイト)と冗長部(64バイト)とを含む。
<2.7 Control unit operation-data update>
General data rewriting will be described with reference to FIG. The physical block arrangement in FIG. 5A shows an example of the physical block arrangement in the memory area 102m in FIG. FIG. 5B shows a physical block at physical block address 2 (PBA2) before data rewriting. FIG. 5C shows the physical block of the physical block address 4094 (PBA4094) after data rewriting. As shown in FIGS. 5B and 5C, each physical block is composed of 128 pages. A page is a basic unit of writing / reading, and includes a payload part (2 Kbytes) and a redundant part (64 bytes).
 図5(a)において、プログラムデータA、プログラムデータB、及びプログラムデータCが、それぞれ、物理ブロックアドレス0(PBA0)の全ページ、物理ブロックアドレス4(PBA4)の全ページ、及び物理ブロックアドレス2(PBA2)のページ0に格納されている。また、システムデータDが物理ブロックアドレス2(PBA2)のページ64に格納されている。また、物理ブロックアドレス2(PBA2)は、図4の論理物理変換テーブル700において、LBA6に対応付けられている。 In FIG. 5A, program data A, program data B, and program data C are all pages of physical block address 0 (PBA0), all pages of physical block address 4 (PBA4), and physical block address 2, respectively. It is stored in page 0 of (PBA2). Further, system data D is stored in page 64 of physical block address 2 (PBA2). Also, the physical block address 2 (PBA2) is associated with LBA6 in the logical-physical conversion table 700 of FIG.
 この状況において、アプリケーションプログラム部802が、LBA6のページ64に格納されたシステムデータの書き換え(更新)を行うと仮定する。この場合、メモリコントローラ803は、図4に示す論理物理変換テーブル700により、LBA6に対応するPBA2のページ64に格納されたシステムデータDの書き換え(更新)を行う。例えば、メモリコントローラ803は、PBA2のページ0に格納されているプログラムデータCをPBA4094のページ0にプログラムデータEとしてコピーし、PBA2のページ64に格納されているシステムデータDを読み出して必要な箇所を更新して、PBA4094のページ64にシステムデータFとして書き込む。もし、他のページにもデータが存在する場合は、ページ0のようなコピー動作を行うこととなる。これにより、PBA4094が新たなLBA6の格納領域となる。PBA2は消去することにより、未使用ブロックとなる。すなわち、論理物理変換テーブル700において、LBA6に対応する物理アドレスがPBA2からPBA4094に書き換えられる。このように、ブロックデータの一部でもデータの更新を行う場合、物理ブロックを丸ごとコピー(PBA2の読み出し、PBA4094への書き込み、及びPBA2の消去)することになる。 In this situation, it is assumed that the application program unit 802 rewrites (updates) the system data stored in the page 64 of the LBA6. In this case, the memory controller 803 rewrites (updates) the system data D stored in the page 64 of the PBA 2 corresponding to the LBA 6 using the logical-physical conversion table 700 shown in FIG. For example, the memory controller 803 copies the program data C stored in page 0 of PBA2 to page 0 of PBA4094 as program data E, reads the system data D stored in page 64 of PBA2, and reads the necessary part. Is updated and written as system data F in page 64 of PBA4094. If data exists in other pages, a copy operation like page 0 is performed. As a result, the PBA 4094 becomes a new LBA 6 storage area. By erasing PBA2, it becomes an unused block. That is, in the logical-physical conversion table 700, the physical address corresponding to LBA6 is rewritten from PBA2 to PBA4094. As described above, when updating a part of block data, the entire physical block is copied (reading PBA2, writing to PBA4094, and erasing PBA2).
 図1に示すフラッシュメモリ102において、読み出しのみを行うプログラムデータのためのプログラムデータ領域102pと、読み出し/書き込みが行われるシステムデータ領域102s及びユーザデータ領域102yが、物理ブロックの境界を意識しない状態で配置されていると、プログラムデータと、システムデータ又はユーザデータが、同一ブロック内に混在して格納されることになる。この場合、システムデータやユーザデータが書き換えられると、全てあるいは一部のプログラムデータが格納されている論理ブロックの物理ブロックアドレスも、頻繁に移動することになる。すなわち、プログラムデータが格納されているブロックのコピー(読み出し及び書き込み)が頻繁に行われることとなってしまう。ICレコーダの場合、録音データが頻繁に書き換えられることが多い。よって、ウェアレベリング手法などで特定の物理ブロックアドレスへの偏った書き込み(消去を含む。)をある程度防いだとしても、ブロックコピー回数が増えると、メモリ劣化が進むため、データ破壊に繋がることが避けられなくなる。さらに、万一、度重なるコピー動作が失敗した場合、プログラムデータを失ってしまうことになる。これは、機器の動作において、非常に大きなリスクを負うことになる。 In the flash memory 102 shown in FIG. 1, the program data area 102p for program data to be read only, the system data area 102s and the user data area 102y to be read / written are not conscious of physical block boundaries. When arranged, program data and system data or user data are mixedly stored in the same block. In this case, when system data or user data is rewritten, the physical block address of the logical block in which all or a part of the program data is stored also moves frequently. That is, copying (reading and writing) of blocks storing program data is frequently performed. In the case of an IC recorder, recorded data is often rewritten frequently. Therefore, even if biased writing (including erasure) to a specific physical block address is prevented to some extent by a wear leveling method or the like, the memory deterioration will increase as the number of block copies increases, so it is possible to avoid data corruption. It becomes impossible. Furthermore, if repeated copy operations fail, program data will be lost. This takes a great risk in the operation of the device.
 よって、本実施形態では、以下に詳細を説明するように、制御部101は、システムデータ及びユーザデータを、プログラムデータと同一のブロックには書き込まないようにする。すなわち、プログラムデータ領域102pが、システムデータ領域102s及びユーザデータ領域102yと、別のブロックになるように、メモリ領域102mを管理する。これにより、上記リスクを低減する。 Therefore, in this embodiment, as will be described in detail below, the control unit 101 does not write system data and user data in the same block as program data. That is, the memory area 102m is managed so that the program data area 102p is a separate block from the system data area 102s and the user data area 102y. Thereby, the said risk is reduced.
<3.メモリ領域の設定及びプログラムの書き込み方法>
 図6~図8を用いて、メモリ領域の設定及びプログラムデータの書き込み方法(転送方法)について説明する。本実施形態において、プログラムデータは、データ記録装置100であるICレコーダの製造時又は出荷時に書き込まれる。しかし、古いプログラムデータがプログラムデータ領域102pに格納されていて、新しいプログラムデータを書き込む場合、つまり、アップデートの動作の場合も、以下に示す説明を同様に適用できる。
<3. Memory area setting and program writing method>
A memory area setting and program data writing method (transfer method) will be described with reference to FIGS. In the present embodiment, the program data is written at the time of manufacture or shipment of the IC recorder that is the data recording apparatus 100. However, when old program data is stored in the program data area 102p and new program data is written, that is, in the case of an update operation, the following description can be similarly applied.
<3.1 フラッシュメモリへの書き込み>
 図1のフラッシュメモリ102のメモリ領域102mに、プログラムデータ領域102pを設定し、プログラムデータ領域102pにプログラムデータが格納されていない状態からプログラムデータを書き込む動作について、まず概略を説明する。データ記録装置100用のプログラムデータ(例えば、サイズ=525824バイト)が、データ記録装置100に接続されたパソコン(PC)上にあると、データ記録装置100の制御部101は、通信部109を介して、そのパソコンからプログラムデータをテンポラリユーザデータ領域に取り込む。ここで、テンポラリユーザデータ領域とは、任意の記憶領域であって、制御部101、RAM103、及びフラッシュメモリ102のうち、いずれに存在しても構わない。テンポラリユーザデータ領域は、PCからマスストレージとして見え、PCは、マスストレージの領域に対して、プログラムデータを書き込むことができる。
<3.1 Writing to flash memory>
An outline of an operation of setting the program data area 102p in the memory area 102m of the flash memory 102 in FIG. 1 and writing the program data from a state in which no program data is stored in the program data area 102p will be described first. When program data for the data recording apparatus 100 (for example, size = 525824 bytes) is on a personal computer (PC) connected to the data recording apparatus 100, the control unit 101 of the data recording apparatus 100 passes through the communication unit 109. Program data from the personal computer into the temporary user data area. Here, the temporary user data area is an arbitrary storage area, and may exist in any of the control unit 101, the RAM 103, and the flash memory 102. The temporary user data area appears as mass storage to the PC, and the PC can write program data to the mass storage area.
 制御部101は、テンポラリユーザデータ領域に格納したプログラムデータのサイズに基づいて、プログラムデータ領域102pを設定する。制御部101は、テンポラリユーザデータ領域に一旦置いたプログラムデータを、プログラムデータ領域102pに転送し、テンポラリユーザデータ領域に残ったプログラムデータを消去する。この時点で、プログラムデータ領域102pへのプログラムデータの転送が完了し、データ記録装置100は、動作可能な状態になる。 The control unit 101 sets the program data area 102p based on the size of the program data stored in the temporary user data area. The control unit 101 transfers the program data once placed in the temporary user data area to the program data area 102p, and erases the program data remaining in the temporary user data area. At this point, the transfer of the program data to the program data area 102p is completed, and the data recording apparatus 100 becomes operable.
 具体的には、制御部101は、プログラムデータ領域102pを設定して、プログラムデータをプログラムデータ領域102pに転送するとき、図6のフローチャートに示す処理を実行する。図6は、本実施形態におけるプログラムデータの書き込み方法のフローチャートの一例を示している。 Specifically, when the control unit 101 sets the program data area 102p and transfers the program data to the program data area 102p, the control unit 101 executes the processing shown in the flowchart of FIG. FIG. 6 shows an example of a flowchart of a method for writing program data in the present embodiment.
 図7の例を用いて、図6のフローについて説明する。図7は、メモリ領域102mのデータの配置の一例であって、プログラムデータが書き込まれた後の状態を示している。図7(a)は、フラッシュメモリ102のメモリ領域102の論理ブロック配置を示している。図7(a)の論理ブロック配置において、メモリ領域102mは、プログラムデータ領域、システムデータ領域、ユーザデータ領域、及び予備データ領域を含んでいる。プログラムデータ領域には、プログラムデータA、プログラムデータB、及びプログラムデータCが格納されている。システムデータ領域には、システムデータDが格納されている。図7(b)は、フラッシュメモリ102のLBA2(論理ブロックアドレス2)のブロックデータを示している。 The flow of FIG. 6 will be described using the example of FIG. FIG. 7 is an example of data arrangement in the memory area 102m, and shows a state after the program data is written. FIG. 7A shows a logical block arrangement of the memory area 102 of the flash memory 102. In the logical block arrangement shown in FIG. 7A, the memory area 102m includes a program data area, a system data area, a user data area, and a spare data area. Program data A, program data B, and program data C are stored in the program data area. System data D is stored in the system data area. FIG. 7B shows block data of LBA 2 (logical block address 2) of the flash memory 102.
 図7において、制御部101が扱える共通最小単位であるセクタのサイズは512バイト(PCとの親和性も考慮し512バイトとしている。)、4セクタを1ページとするページのサイズは2Kバイト、128ページを1ブロックとするブロックのサイズは256Kバイト、ブロック数は4096個である。よって、1ブロックは、128×4=512セクタとなる。この例では、書き込むプログラムデータA,B,Cの合計サイズは525824バイトとする。制御部101は、全ブロックにおけるセクタ番号(セクタ0~セクタ2097151)を、通し番号で管理する。 In FIG. 7, the size of a sector, which is a common minimum unit that can be handled by the control unit 101, is 512 bytes (in consideration of the affinity with the PC, it is set to 512 bytes). The size of a block with 128 pages as one block is 256 Kbytes, and the number of blocks is 4096. Therefore, one block is 128 × 4 = 512 sectors. In this example, the total size of the program data A, B, and C to be written is 525824 bytes. The control unit 101 manages the sector numbers (sector 0 to sector 2097151) in all blocks with serial numbers.
 図6のフローチャートにおいて、制御部101は、まず、フラッシュメモリ102のメモリ領域102mを、プログラムデータ領域102p、システムデータ領域102p、及びユーザデータ領域102yに分けて設定し(S401~S408)、その後、プログラムデータやシステムデータを設定された各領域に書き込む(S409及びS410)。 In the flowchart of FIG. 6, the control unit 101 first sets the memory area 102m of the flash memory 102 into a program data area 102p, a system data area 102p, and a user data area 102y (S401 to S408), and then Program data and system data are written to each set area (S409 and S410).
<3.1.1 プログラムデータ領域の決定>
 プログラムデータの転送開始時点で、制御部101は、まず、プログラムデータサイズ(=525824バイト)を計算する(S401)。次に、フラッシュメモリ102のセクタサイズ(=512バイト)、ページサイズ(=2Kバイト)、ブロックサイズ(=256Kバイト)、及びブロック数(=4096個)を計算する(S402)。制御部101は、ステップS401及びS402の結果から、最低限必要なプログラムデータ領域サイズ(=2ブロック+1536バイト分)を計算する(S403)。
<3.1.1 Determination of program data area>
At the start of program data transfer, the control unit 101 first calculates the program data size (= 525824 bytes) (S401). Next, the sector size (= 512 bytes), page size (= 2K bytes), block size (= 256K bytes), and number of blocks (= 4096) of the flash memory 102 are calculated (S402). The control unit 101 calculates the minimum required program data area size (= 2 blocks + 1536 bytes) from the results of steps S401 and S402 (S403).
 制御部101は、プログラムデータ領域102pの開始セクタと終了セクタとを決定する(S404)。図7(a)の論理ブロック配置においては、制御部101は、プログラムデータ領域102pの開始セクタを「LBA0のページ0の1セクタ目(つまり、セクタ0)」とし、終了セクタを「LBA2の最終ページであるページ127の最終セクタ(つまり、セクタ1535)」として決定する。本実施形態において、制御部101は、プログラムデータ領域102pの終了セクタを、プログラムデータサイズぎりぎりではなく、ブロックの境界終端まで確保する。すなわち、LBA0のページ0~LBA2のページ0までをプログラムデータ領域102pとするのではなく、LBA0のページ0~LBA2のページ127までを、プログラムデータ領域102pとして確保する。これにより、LBA2のページ1~ページ127に、ユーザデータなどの書き換えを行うデータが書き込まれることを防ぐ。 The control unit 101 determines a start sector and an end sector of the program data area 102p (S404). In the logical block arrangement of FIG. 7A, the control unit 101 sets the start sector of the program data area 102p as “the first sector of page 0 of LBA0 (ie, sector 0)” and the end sector as “the last sector of LBA2. It is determined as “the last sector of the page 127 (that is, the sector 1535)”. In the present embodiment, the control unit 101 secures the end sector of the program data area 102p not to the limit of the program data size but to the end of the block boundary. That is, instead of the page 0 of LBA0 to page 0 of LBA2 as the program data area 102p, the page 0 of LBA0 to page 127 of LBA2 is reserved as the program data area 102p. This prevents data to be rewritten such as user data from being written to page 1 to page 127 of LBA2.
<3.1.2 システムデータ領域の決定>
 システムデータサイズが512バイトであるとする。制御部101は、最低限必要なシステムデータ領域サイズ(=1ページ分)を計算する(S405)。制御部101は、システムデータ領域102sの開始セクタと終了セクタを決定する(S406)。図7(a)の論理ブロック配置の場合、制御部101は、システムデータ領域102sの開始セクタを「LBA3のページ0の1セクタ目(つまり、セクタ1536)」とし、終了セクタを「LBA3の最終ページであるページ127の最終セクタ(つまり、セクタ2047)」として決定する。すなわち、制御部101は、プログラムデータ領域102pと同様に、システムデータ領域102sの終了セクタを、システムデータサイズぎりぎりではなく、ブロックの境界終端まで確保する。なお、本実施の形態では、システムデータを含んであるが、必ずしも必要ではない
<3.1.2 Determination of system data area>
Assume that the system data size is 512 bytes. The control unit 101 calculates the minimum required system data area size (= 1 page) (S405). The control unit 101 determines the start sector and end sector of the system data area 102s (S406). In the case of the logical block arrangement of FIG. 7A, the control unit 101 sets the start sector of the system data area 102s as “the first sector of page 0 of LBA3 (ie, sector 1536)” and the end sector as “the last sector of LBA3”. It is determined as the last sector of the page 127 (that is, the sector 2047). That is, similarly to the program data area 102p, the control unit 101 secures the end sector of the system data area 102s not to the limit of the system data size but to the end of the block boundary. In this embodiment, system data is included, but it is not always necessary.
<3.1.3 ユーザデータ領域の決定>
 制御部101は、ユーザデータサイズを1047265280バイトとして、最低限必要なユーザデータ領域サイズ(=3996ブロック分)を計算する(S407)。ここで、ユーザデータサイズとは、ICレコーダとして音データを録音したり、PCからUSB経由でデータを取り込んで記録しておく領域として確保するサイズである。制御部101は、ユーザデータ領域102yの開始セクタと終了セクタとを決定する(S408)。図7(a)の論理ブロック配置の場合、制御部101は、ユーザデータ領域102yの開始セクタを「LBA4の1セクタ目(つまり、セクタ2048)」とし、終了セクタを「LBA3999の最終ページであるページ127の最終セクタ(つまり、セクタ2047999)」として決定する。なお、説明の簡単化のため、最低限必要なユーザデータ領域サイズをブロックサイズの倍数として説明したが、ブロックサイズの倍数でない場合でも、システムデータと同様に、終了セクタをブロックの境界終端まで確保する。
<3.1.3 Determination of user data area>
The control unit 101 calculates the minimum required user data area size (= 3996 blocks) assuming that the user data size is 10472265280 bytes (S407). Here, the user data size is a size that is secured as an area for recording sound data as an IC recorder or capturing data from a PC via USB. The control unit 101 determines the start sector and end sector of the user data area 102y (S408). In the case of the logical block arrangement of FIG. 7A, the control unit 101 sets the start sector of the user data area 102y as “the first sector of LBA4 (ie, sector 2048)” and the end sector as “the last page of LBA 3999”. As the last sector of page 127 (ie, sector 2047999). For the sake of simplicity, the minimum required user data area size has been described as a multiple of the block size. However, even if the user data area size is not a multiple of the block size, the end sector is secured up to the end of the block boundary as with system data To do.
<3.1.4 プログラムデータの書き込み>
 以上のように各領域が設定されると、制御部101は、プログラムデータの書き込み動作に移る(S409)。制御部101は、プログラムデータ525824バイトをプログラムデータ領域102pに書き込む。具体的には、プログラムデータを、プログラムデータA(262144バイト)、プログラムデータB(262144バイト)、及びプログラムデータC(1536バイト)にわけて、それぞれ、LBA0、LBA1、LBA2に書き込む。LBA2のページ1以降には、何も書かれない。
<3.1.4 Writing program data>
When each area is set as described above, the control unit 101 moves to a program data write operation (S409). The control unit 101 writes 525824 bytes of program data in the program data area 102p. Specifically, the program data is divided into program data A (262144 bytes), program data B (262144 bytes), and program data C (1536 bytes), and written to LBA0, LBA1, and LBA2, respectively. Nothing is written after page 1 of LBA2.
<3.1.5 システムデータの書き込み>
 次に、制御部101はシステムデータの書き込み動作に移る(S410)。制御部101は、システムデータ512バイトをシステムデータ領域102sに書き込む。具体的には、LBA3に書き込む。LBA3のページ1以降は、何も書かれない。
<3.1.5 System data writing>
Next, the control unit 101 moves to a system data writing operation (S410). The control unit 101 writes 512 bytes of system data in the system data area 102s. Specifically, the data is written to LBA3. Nothing is written after page 1 of LBA3.
 以上により、プログラムデータの転送が完了する。プログラムデータがプログラムデータ領域102pに転送された後、データ記録装置100は、上述した録音動作、再生動作などを行うことができるようになる。 This completes the transfer of program data. After the program data is transferred to the program data area 102p, the data recording apparatus 100 can perform the above-described recording operation, reproduction operation, and the like.
 以上のように各領域を設定することにより、プログラムデータ領域102pは、読み出し/書き込みが行われるシステムデータ領域102s及びユーザデータ領域102yと、同じ物理ブロックに共存することがなくなる。言い換えると、データの読み出しのみを行うプログラムデータ領域102pと、データの書き込み及び消去を行うシステムデータ領域102s及びユーザデータ領域102yとの境界が、物理ブロックの境界と一致する。そのため、例えば、図7において、システムデータの更新(書き換え)を頻繁に行った場合、LBA3に対応する物理ブロックのコピー動作が頻繁に起こるだけとなり、プログラムデータが格納されているLBA0~LBA2に対応した物理ブロックのコピーは一切発生しない。また、例えば、ユーザデータの更新(書き換え)が頻繁に行われた場合、LBA4~LBA3999に対応する物理ブロックのコピー動作が頻繁に起こるだけであり、プログラムデータが格納されているLBA0~LBA2に対応した物理ブロックのコピーは一切発生しない。よって、上述したメモリ破壊のリスクを低減することが可能になる。 By setting each area as described above, the program data area 102p does not coexist in the same physical block as the system data area 102s and the user data area 102y to be read / written. In other words, the boundary between the program data area 102p for only reading data and the system data area 102s and user data area 102y for writing and erasing data coincide with the boundary of the physical block. Therefore, for example, in FIG. 7, when system data is frequently updated (rewritten), only the physical block copy operation corresponding to LBA3 occurs frequently, corresponding to LBA0 to LBA2 in which program data is stored. No physical block copy occurs. Also, for example, when user data is frequently updated (rewritten), only physical block copy operations corresponding to LBA4 to LBA3999 occur frequently, corresponding to LBA0 to LBA2 in which program data is stored. No physical block copy occurs. Therefore, it is possible to reduce the risk of memory destruction described above.
 なお、フラッシュメモリの種類が1つの場合(すなわち、複数のフラッシュメモリにおいて、1ブロック当たりのセクタ数が同一の場合)は、上述した方法により、各領域を設定すれば良い。一方、フラッシュメモリの種類が複数ある場合(すなわち、複数のフラッシュメモリにおいて、1ブロック当たりのセクタ数が異なる場合)は、以下に示すように、複数のフラッシュメモリにおいて各領域がセクタ番号レベルで共通になるように設定すると良い。これにより、記憶容量の異なるICレコーダを実現する際にプログラムを共通にすることができる。 In addition, when there is one type of flash memory (that is, when the number of sectors per block is the same in a plurality of flash memories), each area may be set by the method described above. On the other hand, when there are multiple types of flash memory (that is, when the number of sectors per block is different in a plurality of flash memories), as shown below, each area is common at the sector number level in the plurality of flash memories. It is good to set so that. This makes it possible to share a program when realizing IC recorders having different storage capacities.
<3.2 異なる種類が存在する場合のフラッシュメモリへの書き込み>
 図8に、図7と異なるメモリ領域102mの配置を示す。図8において、制御部101が扱える共通最小単位であるセクタのサイズは512バイト(PCとの親和性も考慮し512バイトとする)、4セクタを1ページとするページのサイズは2Kバイト、64ページを1ブロックとするブロックのサイズは128Kバイト、ブロック数は8192個である。1ブロックは、64×4=256セクタとなる。図8の場合、プログラムデータのサイズは525824バイトである。制御部101は、全ブロックにおけるセクタ番号(セクタ0~セクタ2097151)を通し番号で管理する。
<3.2 Writing to flash memory when different types exist>
FIG. 8 shows an arrangement of the memory area 102m different from that in FIG. In FIG. 8, the size of a sector, which is a common minimum unit that can be handled by the control unit 101, is 512 bytes (in consideration of the affinity with the PC, 512 bytes), and the size of a page with 4 sectors as one page is 2 Kbytes, 64 bytes. The size of a block with one page is 128 Kbytes, and the number of blocks is 8192. One block is 64 × 4 = 256 sectors. In the case of FIG. 8, the size of the program data is 525824 bytes. The control unit 101 manages the sector numbers (sector 0 to sector 2097151) in all blocks with serial numbers.
 図8は、図7と異なるメモリ領域102mのデータの配置の一例であって、図6に示すフローに従って各領域が設定され、プログラムデータ及びシステムデータが書き込まれた後の状態を示している。図8(a)は、フラッシュメモリ102のメモリ領域102の論理ブロック配置を示している。図8(a)の論理ブロック配置において、メモリ領域102mは、プログラムデータ領域、システムデータ領域、ユーザデータ領域、及び予備データ領域を含む。プログラムデータ領域には、プログラムデータA、プログラムデータB、プログラムデータC、プログラムデータD、及びプログラムデータEが書き込まれている。システムデータ領域には、システムデータFが書き込まれている。図8(b)は、フラッシュメモリ102のLBA4(論理ブロックアドレス4)のブロックデータを示している。 FIG. 8 shows an example of data arrangement in the memory area 102m different from that in FIG. 7, and shows a state after each area is set and program data and system data are written according to the flow shown in FIG. FIG. 8A shows a logical block arrangement of the memory area 102 of the flash memory 102. In the logical block arrangement in FIG. 8A, the memory area 102m includes a program data area, a system data area, a user data area, and a spare data area. Program data A, program data B, program data C, program data D, and program data E are written in the program data area. System data F is written in the system data area. FIG. 8B shows block data of LBA 4 (logical block address 4) of the flash memory 102.
<3.2.1 複数のフラッシュメモリに対応するためのブロック境界の共通化>
 図7と図8の1ブロックあたりのセクタ数を比較すると、図7の物理ブロック配置では、1ブロックあたり256セクタである。一方、図8の物理ブロック配置では、1ブロックあたり512セクタである。制御部101は、プログラムデータ転送及びICレコーダとしての機器動作において、セクタ単位でフラッシュメモリ102にアクセスする。そのため、複数種類のいずれかのフラッシュメモリを搭載した記憶容量の異なるICレコーダを実現する際、プログラムの共通化のために、プログラムデータ領域102p、システムデータ領域102s、及びユーザデータ領域102yを、セクタ番号レベルで共通化することが得策である。よって、例えば、図7と図8の2種類のフラッシュメモリがある場合、この2種類のフラッシュメモリのそれぞれのブロックサイズの最小公倍数である512セクタ分(すなわち、図8における2ブロック分)を共通ブロックと定義し、制御部101は、共通ブロック(2ブロック分)の単位で領域を決定する。
<3.2.1 Sharing block boundaries to support multiple flash memories>
Comparing the number of sectors per block in FIG. 7 and FIG. 8, in the physical block arrangement of FIG. 7, there are 256 sectors per block. On the other hand, in the physical block arrangement of FIG. 8, there are 512 sectors per block. The control unit 101 accesses the flash memory 102 in units of sectors in program data transfer and device operation as an IC recorder. Therefore, when realizing an IC recorder having a plurality of types of flash memories and having different storage capacities, the program data area 102p, the system data area 102s, and the user data area 102y are divided into sectors for program sharing. It is a good idea to make common at the number level. Therefore, for example, when there are two types of flash memories of FIGS. 7 and 8, 512 sectors corresponding to the least common multiple of the block sizes of these two types of flash memories (that is, two blocks in FIG. 8) are shared. It is defined as a block, and the control unit 101 determines an area in units of common blocks (for two blocks).
<3.2.2 プログラムデータ領域の決定>
 図6のフローチャートを参照して、図8におけるメモリ領域の決定及びプログラム書き込み方法を説明する。制御部101は、プログラムデータの転送開始時点で、まず、プログラムデータサイズ(=525824バイト)を計算する(S401)。次に、フラッシュメモリ102のセクタサイズ(=512バイト)、ページサイズ(=2Kバイト)、ブロックサイズ(=128Kバイト)、及びブロック数(=8192個)を計算する(S402)。制御部101は、ステップS401及びS402の結果から、最低限必要なプログラムデータ領域サイズ(=4ブロック+1536バイト分)を計算する(S403)。
<3.2.2 Determination of program data area>
With reference to the flowchart of FIG. 6, the determination of the memory area and the program writing method in FIG. 8 will be described. The control unit 101 first calculates a program data size (= 525824 bytes) at the start of program data transfer (S401). Next, the sector size (= 512 bytes), page size (= 2K bytes), block size (= 128K bytes), and number of blocks (= 8192) of the flash memory 102 are calculated (S402). The control unit 101 calculates the minimum required program data area size (= 4 blocks + 1536 bytes) from the results of steps S401 and S402 (S403).
 制御部101は、プログラムデータ領域102pの開始セクタと終了セクタとを決定する(S404)。図8(a)に示す論理ブロック配置においては、制御部101は、プログラムデータ領域102pの開始セクタを「LBA0のページ0の1セクタ目(つまり、セクタ0)」とし、終了セクタを「LBA5の最終ページであるページ63の最終セクタ(つまり、セクタ1535)」として決定する。ここで、制御部101は、プログラムデータ領域102pの終了セクタを、プログラムデータサイズぎりぎりではなく、且つ、ブロック境界終端ではなく、共通ブロックの境界終端まで確保する。すなわち、LBA4の最終ページであるページ63の最終セクタ(つまり、セクタ1279)ではなく、共通ブロックを配慮して、LBA5の最終ページであるページ63の最終セクタ(セクタ1535)まで確保する。これにより、LBA4のページ1~LBA5の最終ページに、ユーザデータなどの書き換えを行うデータが書き込まれることを防ぐ。 The control unit 101 determines a start sector and an end sector of the program data area 102p (S404). In the logical block arrangement shown in FIG. 8A, the control unit 101 sets the start sector of the program data area 102p as “the first sector of page 0 of LBA0 (ie, sector 0)” and the end sector as “LBA5. The final sector of the page 63 that is the final page (that is, the sector 1535) is determined. Here, the control unit 101 secures the end sector of the program data area 102p not to the limit of the program data size but to the boundary end of the common block instead of the block boundary end. That is, not the last sector (that is, sector 1279) of page 63 that is the last page of LBA4 but the common sector is considered, and the last sector (sector 1535) of page 63 that is the last page of LBA5 is secured. This prevents data to be rewritten such as user data from being written to the last page of LBA4 pages 1 to LBA5.
<3.2.3 システムデータ領域の決定>
 システムデータサイズが512バイトであるとする。制御部101は、最低限必要なシステムデータ領域サイズ(=1ページ分)を計算する(S405)。制御部101は、システムデータ領域102sの開始セクタと終了セクタを決定する(S406)。図8(a)の論理ブロック配置の場合、制御部101は、システムデータ領域102sの開始セクタを「LBA6のページ0の1セクタ目(つまり、セクタ1536)」とし、終了セクタを「LBA7の最終ページであるページ127の最終セクタ(つまり、セクタ2047)」として決定する(S406)。すなわち、制御部101は、プログラムデータ領域102pと同様に、システムデータ領域102sの終了セクタを、システムデータサイズぎりぎりではなく、且つ、ブロック境界終端ではなく、共通ブロックの境界終端まで確保する。具体的には、LBA6の最終ページであるページ127の最終セクタ(つまり、セクタ1791)ではなく、共通ブロックを配慮し、LBA7の最終ページであるページ127の最終セクタ(つまり、セクタ2047)まで確保する。
<3.2.3 Determination of system data area>
Assume that the system data size is 512 bytes. The control unit 101 calculates the minimum required system data area size (= 1 page) (S405). The control unit 101 determines the start sector and end sector of the system data area 102s (S406). In the case of the logical block arrangement shown in FIG. 8A, the control unit 101 sets the start sector of the system data area 102s as “the first sector of page 0 of LBA6 (that is, sector 1536)” and the end sector as “the last sector of LBA7”. It is determined as “the last sector of the page 127 (that is, the sector 2047)” (S406). That is, similarly to the program data area 102p, the control unit 101 secures the end sector of the system data area 102s not to the limit of the system data size but to the boundary end of the common block instead of the block boundary end. Specifically, not the last sector of the page 127 that is the last page of the LBA6 (that is, the sector 1791) but the common sector is considered and the last sector of the page 127 that is the last page of the LBA7 (that is, the sector 2047) is secured. To do.
<3.2.4 ユーザデータ領域の決定>
 次に、ユーザデータサイズを1047265280バイトとして、最低限必要なユーザデータ領域サイズ(=7992ブロック分)を計算する(S407)。制御部101は、ユーザデータ領域102yの開始セクタと終了セクタとを決定する(S408)。図8の論理ブロック配置の場合、制御部101は、ユーザデータ領域202yの開始セクタを「LBA8の1セクタ目(つまり、セクタ2048)」とし、終了セクタを「LBA7999の最終ページであるページ127の最終セクタ(つまり、セクタ2047999)」として決定する。なお、説明の簡単化のため、最低限必要なユーザデータ領域サイズを共通ブロックサイズの倍数として説明したが、共通ブロックサイズの倍数でない場合でも、システムデータと同様に、終了セクタを共通ブロックの境界終端まで確保する。
<3.2.4 Determination of user data area>
Next, assuming that the user data size is 10472265280 bytes, the minimum required user data area size (= 7992 blocks) is calculated (S407). The control unit 101 determines the start sector and end sector of the user data area 102y (S408). In the case of the logical block arrangement of FIG. 8, the control unit 101 sets the start sector of the user data area 202y as “the first sector of LBA8 (ie, sector 2048)” and the end sector of “page 127, which is the last page of LBA7999”. The final sector (ie, sector 2047999) ”is determined. For simplification of explanation, the minimum required user data area size has been described as a multiple of the common block size. Secure to the end.
<3.2.5 プログラムデータの書き込み>
 以上のように各領域が設定されると、制御部101は、プログラムデータの書き込み動作に移る(S409)。制御部101は、プログラムデータ525824バイトをプログラムデータ領域102pに書き込む。具体的には、プログラムデータを、プログラムデータA(131072バイト)、プログラムデータB(131072バイト)、プログラムデータC(131072バイト)、プログラムデータD(131072バイト)、及びプログラムデータE(1536バイト)にわけて、それぞれ、LBA0、LBA1、LBA2、LBA3、LBA4に書き込む。LBA4のページ1以降及びLBA5には、何も書かれない。
<3.2.5 Writing program data>
When each area is set as described above, the control unit 101 moves to a program data write operation (S409). The control unit 101 writes 525824 bytes of program data in the program data area 102p. Specifically, program data is converted into program data A (131072 bytes), program data B (131072 bytes), program data C (131072 bytes), program data D (131072 bytes), and program data E (1536 bytes). Therefore, the data is written in LBA0, LBA1, LBA2, LBA3, and LBA4, respectively. Nothing is written in page 1 and subsequent pages of LBA4 and LBA5.
<3.2.6 システムデータの書き込み>
 次に、制御部101はシステムデータの書き込み動作に移る(S410)。制御部101は、システムデータ512バイトをシステムデータ領域102sに書き込む。具体的には、LBA6に書き込む。LBA6のページ1以降及びLBA7には、何も書かれない。
<3.2.6 Writing system data>
Next, the control unit 101 moves to a system data writing operation (S410). The control unit 101 writes 512 bytes of system data in the system data area 102s. Specifically, the data is written in LBA6. Nothing is written in page 1 and subsequent pages of LBA6 and LBA7.
 以上により、プログラムデータ及びシステムデータの転送が完了する。プログラムデータがプログラムデータ領域102pに転送された後、データ記録装置100は、上述した録音動作及び再生動作などを行うことができるようになる。 This completes the transfer of program data and system data. After the program data is transferred to the program data area 102p, the data recording apparatus 100 can perform the recording operation and the reproduction operation described above.
 以上のように、異なるフラッシュメモリ(1ブロック当たりのセクタ数が異なる。)を搭載した2種類以上の機器において、プログラムデータとユーザデータの物理記憶位置を共通ブロック単位で区別して管理することにより、プログラムデータの破壊リスクを低減するとともに、アプリケーションプログラムの共用化(開発効率アップ)を図ることが可能となる。具体的には、上記のように各領域を設定することにより、フラッシュメモリの種類が異なるデータ記録装置100を構成する場合でも、各領域を区切るセクタアドレスを共通化でき、データの読み書きを共通したセクタアドレスで管理できる。よって、プログラムの共通化が可能となり、開発効率を高めることが可能となる。 As described above, in two or more types of devices equipped with different flash memories (the number of sectors per block is different), the physical storage locations of program data and user data are distinguished and managed in units of common blocks. It is possible to reduce the risk of program data destruction and to share application programs (increase development efficiency). Specifically, by setting each area as described above, even when configuring the data recording apparatus 100 with different types of flash memory, the sector address that divides each area can be shared, and data reading and writing are shared. Can be managed by sector address. Therefore, the program can be shared and the development efficiency can be improved.
 また、プログラムデータ領域102pと、読み出し/書き込みが行われるシステムデータ領域102s及びユーザデータ領域102yが、同じ物理ブロックに共存することがなくなる。言い換えると、データの読み出しのみを行うプログラムデータ領域102pと、データの書き込み及び消去を行うシステムデータ領域102s及びユーザデータ領域102yとの境界が、物理ブロック間の境界と一致する。そのため、例えば、図8において、システムデータの更新(書き換え)が頻繁に行われたとしても、LBA6に対応する物理ブロックのコピー動作が頻繁に起こるだけとなる。また、例えば、ユーザデータの更新(書き換え)が頻繁に行われたとしても、LBA8~LBA7999に対応する物理ブロックのコピー動作が頻繁に起こるだけである。よって、プログラムデータが格納されているLBA0、LBA1、LBA2、LBA3、LBA4に対応した物理ブロックのコピーは一切発生しない。これにより、メモリ破壊のリスクを低減することが可能となる。 Also, the program data area 102p, the system data area 102s to be read / written, and the user data area 102y do not coexist in the same physical block. In other words, the boundary between the program data area 102p for only reading data, the system data area 102s for writing and erasing data, and the user data area 102y coincides with the boundary between physical blocks. Therefore, for example, in FIG. 8, even if system data is frequently updated (rewritten), only a physical block copy operation corresponding to LBA 6 occurs. Also, for example, even if user data is frequently updated (rewritten), only physical block copy operations corresponding to LBA8 to LBA7999 occur frequently. Therefore, no physical block copy corresponding to LBA0, LBA1, LBA2, LBA3, and LBA4 in which program data is stored occurs. As a result, the risk of memory destruction can be reduced.
 本実施形態によれば、プログラムデータの破壊を防ぐことができるため、1つのメモリでプログラムデータとユーザデータとを格納することができる。例えば、従来のICレコーダ等のデータ記録装置は、プログラムデータの破壊を防ぐために、プログラムデータを格納するためのメモリ(例えば、NOR型フラッシュメモリ)と、録音データ等のユーザデータを格納するためのメモリ(例えば、NAND型フラッシュメモリ)とをそれぞれ備えていた。しかし、本実施形態によれば、1つのメモリにプログラムデータとユーザデータとを格納しても、プログラムデータの破壊を防ぐことができるため、メモリを1つにすることができる。例えば、プログラム用の専用のメモリを設ける必要がなくなる。よって、データ記録装置100のコストを削減することができる。 According to this embodiment, since program data can be prevented from being destroyed, program data and user data can be stored in one memory. For example, a conventional data recording device such as an IC recorder has a memory for storing program data (for example, a NOR flash memory) and user data such as recording data in order to prevent destruction of the program data. And a memory (for example, a NAND flash memory). However, according to the present embodiment, even if the program data and the user data are stored in one memory, the program data can be prevented from being destroyed, so that one memory can be used. For example, it is not necessary to provide a dedicated memory for programs. Therefore, the cost of the data recording apparatus 100 can be reduced.
 なお、本実施形態では、データ記録装置100として、不揮発性記憶媒体であるフラシュメモリ102に対してオーディオデータの読み書きを行うICレコーダを例にして説明したが、データ記録装置100の種類は本実施形態に限定されない。データ記録装置100は、不揮発性記憶媒体に対して、ユーザデータの読み書きを行う機器であればよい。例えば、データ記録装置100は、デジタルカメラや携帯端末であってもよい。 In the present embodiment, the data recording apparatus 100 has been described using an IC recorder that reads and writes audio data from and to the flash memory 102 that is a non-volatile storage medium. However, the type of the data recording apparatus 100 is not limited to this embodiment. The form is not limited. The data recording device 100 may be any device that reads / writes user data from / to a nonvolatile storage medium. For example, the data recording device 100 may be a digital camera or a portable terminal.
 また、本実施形態では、データ記録装置100の一部(具体的には、メモリ管理部110)がメモリ管理装置である場合を例にして説明したが、メモリ管理装置は、データ記録装置100の機能の一部として、データ記録装置100内に設けられていなくてもよい。例えば、メモリ管理装置は、データ記録装置100とは別の装置の内部に設けられてもいいし、メモリ管理装置自体が1つの装置として機能するようなものであってもよい。例えば、メモリ管理装置は、プログラムデータ領域を設定する装置やプログラムデータが書き込まれたフラッシュメモリを生産するプログラム書き込み装置の機能の一部又は全部であってもよい。 In the present embodiment, a case where a part of the data recording apparatus 100 (specifically, the memory management unit 110) is a memory management apparatus has been described as an example. It may not be provided in the data recording apparatus 100 as part of the function. For example, the memory management device may be provided inside a device different from the data recording device 100, or the memory management device itself may function as one device. For example, the memory management device may be a part or all of the functions of a device for setting a program data area and a program writing device for producing a flash memory in which program data is written.
 本実施形態では、フラッシュメモリ102がNAND型フラッシュメモリである場合について説明したが、フラッシュメモリ102の種類は本実施形態に限定されない。例えば、本実施形態のフラッシュメモリ102の代わりに、NOR型フラッシュメモリ及びEEPROMなど、他のあらゆる不揮発性記憶媒体を使用してもよい。 In the present embodiment, the case where the flash memory 102 is a NAND flash memory has been described, but the type of the flash memory 102 is not limited to the present embodiment. For example, instead of the flash memory 102 of this embodiment, any other nonvolatile storage medium such as a NOR flash memory and an EEPROM may be used.
 本実施形態では、マイコンとして制御部101を使用し、外付けRAMとしてRAM103を設ける構成を例にして説明したが、RAM103は制御部101に内蔵されていてもよい。 In the present embodiment, the configuration in which the control unit 101 is used as a microcomputer and the RAM 103 is provided as an external RAM has been described as an example. However, the RAM 103 may be built in the control unit 101.
 本実施形態では、フラッシュメモリ102に、プログラムデータ、システムデータ、及びユーザデータが格納されるものとして説明したが、フラッシュメモリ102に格納されるデータの種類は、本実施形態に限定されない。プログラムデータと、読み書きを行うその他のデータ(例えば、ユーザデータ)が、同一のフラッシュメモリに格納される場合に、本実施形態を適用することができる。 In the present embodiment, the program data, the system data, and the user data are stored in the flash memory 102. However, the type of data stored in the flash memory 102 is not limited to the present embodiment. The present embodiment can be applied when program data and other data to be read and written (for example, user data) are stored in the same flash memory.
 本実施形態においては、プログラムデータの書き込み(S409)の直前に、領域を設定する例で説明したが、領域の設定はプログラムデータの書き込み(転送処理)とは別のタイミングで行ってもよい。例えば、S409の前処理(S401、S402、S403、S405、S407を含む。)は、必ずしも転送処理中に行う必要はなく、あらかじめ計算しておいてもよい。 In the present embodiment, the area is set immediately before the program data is written (S409). However, the area may be set at a timing different from the program data write (transfer process). For example, the pre-processing of S409 (including S401, S402, S403, S405, and S407) is not necessarily performed during the transfer process, and may be calculated in advance.
《実施形態2》
 本実施形態のメモリ管理装置は、工場等に設けられて、プログラムデータが書き込まれたフラッシュメモリを大量に生産する装置(プログラム書き込み装置)である。本実施形態のプログラム書き込み装置は、プログラムデータの書き込み先の物理ブロックを再配置し、再配置済みのフラッシュメモリをマスタとして、そのフラッシュメモリをコピーすることにより、短時間での大量のコピー(すなわち、書き込み済みフラッシュメモリの生産)を可能にする。
<< Embodiment 2 >>
The memory management device of this embodiment is a device (program writing device) that is provided in a factory or the like and produces a large amount of flash memory in which program data is written. The program writing apparatus according to the present embodiment rearranges the physical block to which program data is written, and copies the flash memory using the rearranged flash memory as a master, thereby copying a large amount of data in a short time (that is, , Production of pre-written flash memory).
<1.メモリ管理装置の構成>
 図9に、本実施形態におけるメモリ管理装置の一例であるプログラム書き込み装置を示す。プログラム書き込み装置1000は、ROMライタ1001と、パーソナルコンピュータ(PC)1002と、を含む。ROMライタ1001は、PC1002に接続されている。ROMライタ1001は、PC1002に保存されているデータを、ブランクフラッシュメモリ1004、1005等に書き込むことができる。また、ROMライタ1001は、書き込み済みフラッシュメモリ1003に記録されているデータを、書き込み済みフラッシュメモリ1003から読み出して、PC1002に保存することができる。PC1002は、ROMライタ1001からデータを読み出し、読み出したデータを加工し、加工したデータをブランクフラッシュメモリ1004、1005に書き込むことが可能である。本実施形態において、書き込み済みフラッシュメモリ1003及びブランクフラッシュメモリ1004、1005は、NAND型フラッシュメモリである。
<1. Configuration of memory management device>
FIG. 9 shows a program writing device which is an example of a memory management device in the present embodiment. The program writing device 1000 includes a ROM writer 1001 and a personal computer (PC) 1002. The ROM writer 1001 is connected to the PC 1002. The ROM writer 1001 can write data stored in the PC 1002 to the blank flash memories 1004, 1005, and the like. The ROM writer 1001 can read data recorded in the written flash memory 1003 from the written flash memory 1003 and save it in the PC 1002. The PC 1002 can read data from the ROM writer 1001, process the read data, and write the processed data to the blank flash memories 1004 and 1005. In the present embodiment, the written flash memory 1003 and the blank flash memories 1004 and 1005 are NAND flash memories.
<2.メモリ管理装置の動作>
 プログラム書き込み装置(メモリ管理装置)1000の動作について、図10及び図11を用いて説明する。図10(a)及び(b)は、書き込み済みフラッシュメモリ1003にプログラムデータ及びシステムデータが書き込まれている状態を示している。図10(a)は論理ブロックにおける配置を示し、図10(b)は物理ブロックにおける配置を示している。図10(a)の論理ブロック配置において、プログラムデータ領域には、プログラムデータA、プログラムデータB、プログラムデータC、プログラムデータD、及びプログラムデータEが書き込まれている。システムデータ領域には、システムデータFが書き込まれている。図10(b)の物理ブロック配置は、図10(a)の論理ブロック配置の各ブロックを物理配置に並べ替えたものであり、論理ブロック配置に含まれていたプログラムデータやシステムデータを含む。図10(c)は、本実施形態において、PC1002上で、図10(b)の物理ブロック配置に含まれていたプログラムデータやシステムデータを再配置した後の物理ブロック配置を示している。
<2. Operation of memory management device>
The operation of the program writing device (memory management device) 1000 will be described with reference to FIGS. FIGS. 10A and 10B show a state where program data and system data are written in the written flash memory 1003. FIG. 10A shows the arrangement in the logical block, and FIG. 10B shows the arrangement in the physical block. In the logical block arrangement of FIG. 10A, program data A, program data B, program data C, program data D, and program data E are written in the program data area. System data F is written in the system data area. The physical block arrangement in FIG. 10B is obtained by rearranging the blocks in the logical block arrangement in FIG. 10A into the physical arrangement, and includes program data and system data included in the logical block arrangement. FIG. 10C shows the physical block arrangement after the program data and system data included in the physical block arrangement of FIG. 10B are rearranged on the PC 1002 in this embodiment.
 プログラムデータ及びシステムデータが、例えば、実施形態1のメモリ管理装置(データ記録装置100のメモリ管理部110)により、フラッシュメモリに書き込まれると、図10(a)及び図10(b)に示す書き込み済みフラッシュメモリ1003の状態になる。具体的には、図10(a)の論理ブロック配置に示すように、プログラムデータAはLBA0、プログラムデータBはLBA1、プログラムデータCはLBA2、プログラムデータDはLBA3、プログラムデータEはLBA4に格納され、システムデータFはLBA6に格納された状態になる。 When the program data and the system data are written into the flash memory by the memory management device of the first embodiment (the memory management unit 110 of the data recording device 100), for example, the writing shown in FIGS. 10A and 10B The flash memory 1003 is in a state. Specifically, program data A is stored in LBA 0, program data B is LBA 1, program data C is stored in LBA 2, program data D is stored in LBA 3, and program data E is stored in LBA 4, as shown in the logical block arrangement of FIG. As a result, the system data F is stored in the LBA 6.
<3.従来手法の動作>
 まず、従来の一般的なフラッシュメモリのプログラムデータ及びシステムデータのコピーについて説明する。プログラムデータが書き込まれた書き込み済みフラッシュメモリ1003がROMライタ1001に装着されると、従来のメモリ管理装置は、書き込み済みフラッシュメモリ1003からプログラムデータ及びシステムデータを読み出す。ROMライタ1001は、フラッシュメモリに対して、論理アドレスでアクセスを行うのではなく、物理アドレスでアクセスを行う。よって、例えば、プログラムデータ及びシステムデータが格納される可能性のある場所がPBA0~PBA13と決まっている場合は、その14ブロック分のデータを読み出す。
<3. Operation of conventional method>
First, a copy of program data and system data in a conventional general flash memory will be described. When the written flash memory 1003 in which the program data is written is loaded into the ROM writer 1001, the conventional memory management device reads the program data and the system data from the written flash memory 1003. The ROM writer 1001 accesses the flash memory with a physical address instead of accessing it with a logical address. Therefore, for example, if the locations where program data and system data may be stored are determined as PBA0 to PBA13, the data for 14 blocks is read.
 次に、プログラムデータ及びシステムデータが書き込まれていないブランクフラッシュメモリ1004がROMライタ1001に装着されると、ROMライタ1001は、物理ブロック配置の14ブロック分のデータを、ブランクフラッシュメモリ1004に書き込む。この時の書き込みに要する時間は、14ブロック分のデータを書き込む(及びベリファイ等を含む。)時間となる。これにより、ブランクフラッシュメモリ1004は、プログラムデータ等が書き込まれた状態になる。その後、さらにコピーを繰り返す場合は、別のブランクフラッシュメモリ1005がROMライタ1001に装着される。ROMライタ1001は、物理ブロック配置の14ブロック分のデータを、ブランクフラッシュメモリ1005に書き込む。この動作を繰り返すことにより、メモリ管理装置は、プログラムデータが書き込まれたフラッシュメモリを複数個生産する。 Next, when the blank flash memory 1004 in which program data and system data are not written is loaded into the ROM writer 1001, the ROM writer 1001 writes data for 14 blocks in the physical block arrangement into the blank flash memory 1004. The time required for writing at this time is a time for writing data for 14 blocks (and including verification and the like). As a result, the blank flash memory 1004 is in a state in which program data and the like are written. Thereafter, when further copying is repeated, another blank flash memory 1005 is mounted on the ROM writer 1001. The ROM writer 1001 writes data for 14 blocks in the physical block arrangement to the blank flash memory 1005. By repeating this operation, the memory management device produces a plurality of flash memories in which program data is written.
 アプリケーションプログラムは論理アドレスしか認識できないため、実施形態1のデータ記録装置100等により論理ブロック配置において連続した領域にプログラムデータが書き込まれても、実際には図10(b)の物理ブロック配置に示すように離れた位置に書き込まれることになる。ROMライタ1001は、フラッシュメモリに対して、物理アドレスでしかアクセスすることができない。ROMライタ1001は、プログラムデータが物理ブロックのどこに配置されているかがわからないため、例えば、図10(b)に示す、PBA1,3,6,9,11のみを読み出すことができない。そのため、例えば、フラッシュメモリの全領域、つまり、物理ブロックの先頭ブロック(PBA0)から物理ブロックの最終ブロックまでのように、プログラムが格納される可能性のある物理ブロックを全て読み出して、読み出した全ての物理ブロック(空きブロックを含む。)をブランクフラッシュメモリに書き込むことになる。よって、従来のメモリ管理装置は、短時間で、書き込み済みフラッシュメモリを大量に生産することができない。そこで、本実施形態では、以下に示すように、マスタとなる書き込み済みフラッシュメモリの物理ブロックの配置を再配置する。 Since the application program can recognize only the logical address, even if the program data is written in a continuous area in the logical block arrangement by the data recording apparatus 100 or the like of the first embodiment, it is actually shown in the physical block arrangement of FIG. Thus, it will be written at a distant position. The ROM writer 1001 can access the flash memory only with a physical address. Since the ROM writer 1001 does not know where the program data is arranged in the physical block, for example, only the PBAs 1, 3, 6, 9, and 11 shown in FIG. Therefore, for example, all the physical blocks in which the program can be stored are read out from all areas of the flash memory, that is, from the first block (PBA0) of the physical block to the last block of the physical block. Physical blocks (including empty blocks) are written to the blank flash memory. Therefore, the conventional memory management device cannot produce a large amount of written flash memory in a short time. Therefore, in the present embodiment, as shown below, the physical blocks of the written flash memory that is the master are rearranged.
<4.本実施形態における手法>
<4.1 プログラムデータ・システムデータの読み出し>
 図11に、実施形態2における、メモリ領域設定(具体的には、プログラムデータの再配置)を含むプログラム格納方法のフローチャートを示す。実施形態1のデータ記録装置100等により、プログラムデータ及びシステムデータが既に格納された書き込み済みフラッシュメモリ1003がROMライタ1001に装着されると、ROMライタ1001は、書き込み済みフラッシュメモリ1003からプログラムデータ及びシステムデータを読み出す(S1101)。
<4. Method in this embodiment>
<4.1 Reading program data and system data>
FIG. 11 shows a flowchart of a program storage method including memory area setting (specifically, relocation of program data) in the second embodiment. When the written flash memory 1003 in which program data and system data are already stored is loaded into the ROM writer 1001 by the data recording apparatus 100 or the like of the first embodiment, the ROM writer 1001 reads the program data and the program data from the written flash memory 1003. System data is read (S1101).
 プログラムデータは、図10(a)の論理ブロック配置のように、書き込み済みフラッシュメモリ1003の連続した領域LBA0~LBA4に格納されている。しかし、実際は、図10(b)の物理ブロック配置のように、バラバラに配置されている(図4の論理物理変換テーブル700参照)。ROMライタ1001は、フラッシュメモリに対して、物理アドレスでアクセスを行うものであるため、PBA1,3,6,9,11のみを読み出すことができない。すべてのプログラムデータ及びシステムデータを読み出すのに、予めデータが格納されている物理ブロックアドレスがわかっている場合は、ROMライタ1001は、その最終の物理ブロック(PBA)までのブロックデータを読み出せばよい。一方、予めデータが格納されている物理ブロックアドレスがわからない場合は、かなり余裕を持った個数のブロックを読み出して中身を確認するか、又は、全領域のブロックを読み出す必要がある。図10(b)の例においては、予めプログラムデータ及びシステムデータが、PBA0~PBA13のどこかに格納されていることがわかっていることを前提とする。本実施形態において、ROMライタ1001は、PBA0~PBA13までの14ブロック分のデータを読み出す。 Program data is stored in the continuous areas LBA0 to LBA4 of the written flash memory 1003 as in the logical block arrangement of FIG. However, in actuality, they are arranged apart like the physical block arrangement of FIG. 10B (see the logical-physical conversion table 700 of FIG. 4). Since the ROM writer 1001 accesses the flash memory with a physical address, it cannot read only the PBAs 1, 3, 6, 9, and 11. When reading all program data and system data, if the physical block address where the data is stored is known in advance, the ROM writer 1001 reads the block data up to the final physical block (PBA). Good. On the other hand, if the physical block address where the data is stored in advance is not known, it is necessary to read out the block having a considerable margin and confirm the contents, or to read out the blocks in the entire area. In the example of FIG. 10B, it is assumed that it is known in advance that program data and system data are stored somewhere in PBA0 to PBA13. In this embodiment, the ROM writer 1001 reads data for 14 blocks from PBA0 to PBA13.
 図10(b)の物理ブロック配置に示すように、プログラムデータAはPBA1、プログラムデータBはPBA6、プログラムデータCはPBA3、プログラムデータDはPBA9、プログラムデータEはPBA11に配置されている。また、システムデータFはPBA2に配置されている。ROMライタ1001は、読み出した14ブロック分のデータをPC1002に送信する。これにより、読み出されたデータが、PC1002に取り込まれる。 As shown in the physical block arrangement of FIG. 10B, program data A is arranged in PBA1, program data B in PBA6, program data C in PBA3, program data D in PBA9, and program data E in PBA11. The system data F is arranged in PBA2. The ROM writer 1001 transmits the read 14 blocks of data to the PC 1002. As a result, the read data is taken into the PC 1002.
<4.2 プログラムデータ・システムデータの再配置>
 本実施形態において、プログラム書き込み装置1000は、PC1002上で、プログラムデータとシステムデータが書き込まれた物理ブロックの再配置を行う(S1102)。すなわち、図10(b)の物理ブロック配置を図10(c)の物理ブロック配置のように並べ替える。具体的には、PC1002は、物理ブロック配置を仮想作成する。次に、物理ブロック配置をPBA0からサーチしていき、最初に見つかったプログラムデータAが含まれる物理ブロックPBA1を、物理ブロック配置のPBA0に配置する。ここで、データが格納されている物理ブロックには、空きブロックに対して、識別可能となるような仕組みを含んでおく。PC1002は、次に見つかったシステムデータFが含まれる物理ブロックPBA2を、物理ブロック配置のPBA1に配置する。その後、順に、プログラムデータCが含まれる物理ブロックPBA3を物理ブロック配置のPBA2に配置し、プログラムデータBが含まれる物理ブロックPBA6を物理ブロック配置のPBA3に配置し、プログラムデータDが含まれる物理ブロックPBA9を物理ブロック配置のPBA4に配置し、プログラムデータEが含まれる物理ブロックPBA11を、物理ブロック配置のPBA5に配置する。これにより、物理ブロック配置(6ブロック分)が完成する。PC1002は、完成した6ブロック分の物理ブロック配置をROMライタ1001に装着された別のブランクフラッシュメモリに書き込む。論理物理変換テーブル700により、再配置された後の物理アドレスを論理アドレスに対応させる。これにより、プログラムデータ領域102p及びシステムデータ領域102sは、PBA0~PBA5に設定されることになる。なお、分割されたプログラムデータの順序が予めわかっている場合は、その順序で再配置をおこなってもよい。このフラッシュメモリがマスターフラッシュROMとなる。
<4.2 Rearrangement of program data and system data>
In the present embodiment, the program writing apparatus 1000 rearranges physical blocks in which program data and system data are written on the PC 1002 (S1102). That is, the physical block arrangement in FIG. 10B is rearranged to the physical block arrangement in FIG. Specifically, the PC 1002 virtually creates a physical block arrangement. Next, the physical block arrangement is searched from PBA0, and the physical block PBA1 including the program data A first found is arranged in PBA0 of the physical block arrangement. Here, the physical block in which the data is stored includes a mechanism that makes it possible to identify an empty block. The PC 1002 arranges the physical block PBA2 including the system data F found next in the physical block arrangement PBA1. Thereafter, in order, the physical block PBA3 including the program data C is allocated to the PBA2 having the physical block arrangement, the physical block PBA6 including the program data B is allocated to the PBA3 having the physical block arrangement, and the physical block including the program data D is included. PBA9 is arranged in PBA4 of physical block arrangement, and physical block PBA11 including program data E is arranged in PBA5 of physical block arrangement. Thereby, the physical block arrangement (for 6 blocks) is completed. The PC 1002 writes the completed physical block arrangement for six blocks to another blank flash memory mounted on the ROM writer 1001. The physical address after rearrangement is made to correspond to the logical address by the logical physical conversion table 700. As a result, the program data area 102p and the system data area 102s are set to PBA0 to PBA5. If the order of the divided program data is known in advance, rearrangement may be performed in that order. This flash memory becomes the master flash ROM.
<4.3 プログラムデータ・システムデータの書き込み>
 プログラムデータ及びシステムデータが書き込まれていないブランクフラッシュメモリ1004がROMライタ1001に装着されると、ROMライタ1001は、プログラムデータ領域102p及びシステムデータ領域102sである物理ブロック配置の6ブロック分のデータを、ブランクフラッシュメモリ1004に書き込む(S1103)。ステップS1102により、プログラムデータ及びシステムデータが書き込まれている物理ブロックを再配置しているため、書き込みに要する時間は、6ブロック分のデータを書き込む(及びベリファイ等)時間となる。これは、従来の手法による8000ブロック以上分の書き込みに要する時間よりも短い。別のブランクフラッシュメモリ1005がROMライタ1001に装着され、プログラムデータ及びシステムデータが書き込まれたフラッシュメモリをさらに生成する場合は(S1104でNo)、ROMライタ1001は物理ブロック配置の6ブロック分のデータを別のブランクフラッシュメモリ1005に書き込む(S1103)。これを繰り返すことにより、プログラムデータ及びシステムデータが書き込まれたフラッシュメモリが大量に生産される。データのコピーを終了する場合(S1104でYes)、ROMライタ1001はデータのコピーを終了する。
<4.3 Writing program data and system data>
When a blank flash memory 1004 in which program data and system data are not written is loaded into the ROM writer 1001, the ROM writer 1001 stores data for six blocks in the physical block arrangement which is the program data area 102p and the system data area 102s. Then, the data is written in the blank flash memory 1004 (S1103). Since physical blocks in which program data and system data are written are rearranged in step S1102, the time required for writing is the time for writing data for 6 blocks (and verifying, etc.). This is shorter than the time required for writing more than 8000 blocks by the conventional method. When another blank flash memory 1005 is mounted on the ROM writer 1001 and a flash memory in which program data and system data are written is further generated (No in S1104), the ROM writer 1001 stores data for six blocks in the physical block arrangement. Is written into another blank flash memory 1005 (S1103). By repeating this, a large amount of flash memory in which program data and system data are written is produced. When the data copy is to be ended (Yes in S1104), the ROM writer 1001 ends the data copy.
 本実施形態のプログラム書き込み装置1000により、プログラムデータが書き込まれたフラッシュメモリ(すなわち、プログラムデータ領域及びシステムデータ領域がPBA0~PBA5に設定されたフラッシュメモリ)は、例えば、ICレコーダ等のデータ記録装置に組み込まれる。 A flash memory in which program data is written by the program writing apparatus 1000 of the present embodiment (that is, a flash memory in which the program data area and the system data area are set to PBA0 to PBA5) is a data recording apparatus such as an IC recorder, for example. Incorporated into.
 なお、図10(c)の例では、システムデータFがプログラムデータAとプログラムデータCとの間に配置されているが、プログラムデータとシステムデータを分けて配置することがより好ましい。例えば、システムデータFは、プログラムデータEの次のブロックに配置すると良い。これにより、プログラムデータ領域が連続した物理ブロックで構成される。 In the example of FIG. 10C, the system data F is arranged between the program data A and the program data C, but it is more preferable to arrange the program data and the system data separately. For example, the system data F is preferably arranged in the next block of the program data E. As a result, the program data area is composed of continuous physical blocks.
 上記のように、物理的に分散した物理ブロックに配置されたプログラムデータを、物理的に連続した物理ブロックに再配置して、フラッシュメモリに格納することにより、実施形態1で説明したようなメモリ破壊のリスクを低減する効果を維持したまま、プログラムデータを格納したフラッシュメモリをROMライタ等で大量に生産する際におけるROMライタでの書き込み時間の削減を図ることが可能となる。すなわち、プログラムデータの書き込み先を再配置することにより、物理ブロック配置において読み出すべきプログラムデータ領域を小さくできる。よって、ROMライタ等で書き込むべきデータのサイズを削減でき、書き込み時間を短縮できる。 As described above, the program data arranged in the physically distributed physical blocks is rearranged in the physically continuous physical blocks and stored in the flash memory, so that the memory described in the first embodiment While maintaining the effect of reducing the risk of destruction, it is possible to reduce the writing time in the ROM writer when the flash memory storing the program data is mass-produced with the ROM writer or the like. That is, the program data area to be read in the physical block arrangement can be reduced by rearranging the program data write destination. Therefore, the size of data to be written by a ROM writer can be reduced, and the writing time can be shortened.
 本実施形態においては、プログラムデータと共にシステムデータが、ROMライタ1001により、書き込み済みフラッシュメモリからブランクフラッシュメモリに書き込まれる場合を例にして説明したが、システムデータは必ずしもブランクフラッシュメモリに書き込む必要はない。少なくともプログラムデータを書き込むものであればよい。この場合、プログラムデータの再配置により、プログラムデータ領域が連続した物理ブロックに設定される。 In the present embodiment, the system data and the system data are described as an example in which the ROM writer 1001 writes the written flash memory to the blank flash memory. However, the system data does not necessarily need to be written to the blank flash memory. . At least the program data may be written. In this case, the program data area is set to a continuous physical block by relocation of the program data.
 なお、本実施形態では、メモリ管理装置として、ROMライタ1001及びPC1002を含むプログラム書き込み装置1000を例にして説明したが、メモリ管理装置の構成は本実施形態に限定されない。フラッシュメモリ1003の物理ブロック(物理セクタや物理ページなどの物理アドレスであれば同様)に対してデータの読み出し/再配置/書き込みができる機器であれば、本実施形態と同様の構成とみなすことができるため、それらを排除しない。 In this embodiment, the program writing apparatus 1000 including the ROM writer 1001 and the PC 1002 is described as an example of the memory management apparatus. However, the configuration of the memory management apparatus is not limited to this embodiment. Any device capable of reading / rearranging / writing data with respect to a physical block of the flash memory 1003 (same as a physical address such as a physical sector or a physical page) can be regarded as having the same configuration as in the present embodiment. Do not exclude them because they can.
 本実施形態では、フラッシュメモリ1003,1004,1005がNAND型フラッシュメモリである場合について説明したが、フラッシュメモリ1003,1004,1005の種類は本実施形態に限定されない。例えば、本実施形態のフラッシュメモリ1003,1004,1005の代わりに、NOR型フラッシュメモリ及びEEPROMなど、他のあらゆる不揮発性記憶媒体を使用してもよい。 In the present embodiment, the case where the flash memories 1003, 1004, and 1005 are NAND flash memories has been described, but the types of the flash memories 1003, 1004, and 1005 are not limited to the present embodiment. For example, instead of the flash memories 1003, 1004, and 1005 of this embodiment, any other nonvolatile storage medium such as a NOR flash memory and an EEPROM may be used.
 本実施形態では、フラッシュメモリに、プログラムデータ、システムデータ、及びユーザデータが格納されるような場合を例にして説明したが、フラッシュメモリに格納されるデータの種類は、本実施形態に限定されない。プログラムデータと、読み書きを行うその他のデータ(例えば、ユーザデータ)が、同一のフラッシュメモリに格納される場合に、本実施形態を適用することができる。また、本実施形態では、プログラムデータとシステムデータを書き込むものとして説明したが、書き込むデータの種別や個数はこれらに限定するものではない。様々な組み合わせであっても、本実施形態と同様の構成とみなすことができるため、それらを排除しない。 In this embodiment, the case where program data, system data, and user data are stored in the flash memory has been described as an example. However, the type of data stored in the flash memory is not limited to this embodiment. . The present embodiment can be applied when program data and other data to be read and written (for example, user data) are stored in the same flash memory. In this embodiment, the program data and the system data are written. However, the type and number of data to be written are not limited to these. Even various combinations can be regarded as the same configuration as in the present embodiment, and thus are not excluded.
 本発明は、読み出しのみ行われるプログラムデータのような極めて重要なデータの破壊のリスクを低減することができるという効果を有し、フラッシュメモリを搭載したICレコーダ及び半導体音楽プレーヤなどに有用である。 The present invention has the effect of reducing the risk of destruction of extremely important data such as program data that is read only, and is useful for IC recorders and semiconductor music players equipped with flash memory.
  100   データ記録装置
  101   制御部
  102   フラッシュメモリ
  102p  プログラムデータ領域
  102s  システムデータ領域
  102y  ユーザデータ領域
  102m  メモリ領域
  103   RAM
  104   表示部
  105   操作部
  106   オーディオ処理部
  106e  エンコーダ
  106d  デコーダ
  107   マイク
  108   スピーカ
  109   通信部
  110   メモリ管理部
  120   メモリ制御部
  700   論理物理変換テーブル
  802   アプリケーションプログラム部
  803   メモリコントローラ
  853   メモリコントローラ
  1000  プログラム書き込み装置
  1001  ROMライタ
  1002  PC
  1003  書き込み済みフラッシュメモリ
  1004  ブランクフラッシュメモリ
  1005  ブランクフラッシュメモリ
DESCRIPTION OF SYMBOLS 100 Data recording device 101 Control part 102 Flash memory 102p Program data area 102s System data area 102y User data area 102m Memory area 103 RAM
DESCRIPTION OF SYMBOLS 104 Display part 105 Operation part 106 Audio processing part 106e Encoder 106d Decoder 107 Microphone 108 Speaker 109 Communication part 110 Memory management part 120 Memory control part 700 Logical physical conversion table 802 Application program part 803 Memory controller 853 Memory controller 1000 Program writing device 1001 ROM Writer 1002 PC
1003 Pre-programmed flash memory 1004 Blank flash memory 1005 Blank flash memory

Claims (9)

  1.  メモリを制御するメモリ制御部を備えたメモリ管理装置であって、
     前記メモリのデータ領域は第1及び第2の管理領域の単位で管理され、前記第1の管理領域はデータの読み出し及び書き込み単位であり、前記第2の管理領域はデータの消去単位であり、前記第2の管理領域は複数の第1の管理領域を含み、
     前記メモリのデータ領域は、データの読み出しのみを行うリードオンリーデータ領域と、データの書き込み、消去を行うリードライトデータ領域とを含み、
     前記メモリ制御部は、前記リードオンリーデータ領域と前記リードライトデータ領域の境界が、前記第2の管理領域間の境界と一致するように、前記メモリのデータ領域を管理する、
    メモリ管理装置。
    A memory management device including a memory control unit for controlling a memory,
    The data area of the memory is managed in units of first and second management areas, the first management area is a unit for reading and writing data, and the second management area is a unit for erasing data, The second management area includes a plurality of first management areas,
    The data area of the memory includes a read-only data area for only reading data, and a read / write data area for writing and erasing data,
    The memory control unit manages the data area of the memory such that a boundary between the read-only data area and the read / write data area coincides with a boundary between the second management areas;
    Memory management device.
  2.  前記リードオンリーデータ領域は、前記メモリ内の連続した前記第2の管理領域に設けられる、請求項1に記載のメモリ管理装置。 The memory management device according to claim 1, wherein the read-only data area is provided in the continuous second management area in the memory.
  3.  前記第1の管理領域がページであり、前記第2の管理領域がブロックであることを特徴とする、請求項1に記載のメモリ管理装置。 The memory management device according to claim 1, wherein the first management area is a page, and the second management area is a block.
  4.  請求項1に記載のメモリ管理装置と、
     前記メモリ管理装置により設定された領域を備えるメモリにデータを記録するデータ記録部と、
     を有するデータ記録装置。
    A memory management device according to claim 1;
    A data recording unit for recording data in a memory having an area set by the memory management device;
    A data recording apparatus.
  5.  前記リードオンリーデータ領域には、データ記録装置の動作を制御するためのプログラムのデータが記録され、前記リードライトデータ領域には、ユーザデータが記録される、請求項4に記載のデータ記録装置。 The data recording apparatus according to claim 4, wherein program data for controlling operation of a data recording apparatus is recorded in the read-only data area, and user data is recorded in the read / write data area.
  6.  メモリの領域を設定する方法であって、
     前記メモリのデータ領域は第1及び第2の管理領域の単位で管理され、前記第1の管理領域はデータの読み出し及び書き込み単位であり、前記第2の管理領域はデータの消去単位であり、前記第2の管理領域は複数の第1の管理領域を含み、
     前記メモリのデータ領域において、データの読み出しのみを行うリードオンリーデータ領域と、データの書き込み、消去を行うリードライトデータ領域とを設定し、
     前記リードオンリーデータ領域と前記リードライトデータ領域の境界が、前記第2の管理領域間の境界と一致するように、前記メモリのデータ領域を設定する、
    メモリ領域設定方法。
    A method for setting a memory area,
    The data area of the memory is managed in units of first and second management areas, the first management area is a unit for reading and writing data, and the second management area is a unit for erasing data, The second management area includes a plurality of first management areas,
    In the data area of the memory, a read-only data area for only reading data and a read / write data area for writing and erasing data are set.
    Setting the data area of the memory so that the boundary between the read-only data area and the read / write data area coincides with the boundary between the second management areas;
    Memory area setting method.
  7.  前記メモリのサイズが複数種類ある場合に、前記リードオンリーデータ領域と前記リードライトデータ領域の境界が、前記第2の管理領域の前記複数のサイズ間の最小公倍数となる境界に一致するように、前記メモリのデータ領域を設定する、請求項6に記載のメモリ領域設定方法。 When there are a plurality of sizes of the memory, the boundary between the read-only data area and the read / write data area matches the boundary that is the least common multiple between the plurality of sizes of the second management area. The memory area setting method according to claim 6, wherein a data area of the memory is set.
  8.  前記リードオンリーデータ領域を、連続した複数の第2の管理領域で構成する、請求項6に記載のメモリ領域設定方法。 The memory area setting method according to claim 6, wherein the read-only data area is constituted by a plurality of continuous second management areas.
  9.  前記第2の管理領域がページであり、前記第2の管理領域がブロックであることを特徴とする、請求項6に記載のメモリ領域設定方法。 7. The memory area setting method according to claim 6, wherein the second management area is a page, and the second management area is a block.
PCT/JP2010/001593 2009-03-12 2010-03-08 Memory management device, data recorder, and memory area setting method WO2010103780A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011503699A JP5395163B2 (en) 2009-03-12 2010-03-08 Memory management device and memory area setting method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2009-059072 2009-03-12
JP2009059072 2009-03-12

Publications (1)

Publication Number Publication Date
WO2010103780A1 true WO2010103780A1 (en) 2010-09-16

Family

ID=42728076

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/001593 WO2010103780A1 (en) 2009-03-12 2010-03-08 Memory management device, data recorder, and memory area setting method

Country Status (2)

Country Link
JP (1) JP5395163B2 (en)
WO (1) WO2010103780A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012234607A (en) * 2011-05-09 2012-11-29 Nec Access Technica Ltd Data writing device and data writing method

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102491624B1 (en) 2015-07-27 2023-01-25 삼성전자주식회사 Method for operating data storage device and method for operating system having same
WO2021005777A1 (en) 2019-07-11 2021-01-14 Primetals Technologies Japan株式会社 Method of operating rolling device, control device for rolling device, and rolling equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0773098A (en) * 1993-09-01 1995-03-17 Toshiba Emi Ltd Data write method
JP2007220101A (en) * 2006-02-17 2007-08-30 Samsung Electronics Co Ltd Method and apparatus for managing block according to update type of data in block-type memory

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006235960A (en) * 2005-02-24 2006-09-07 Fujitsu Ltd Method for increasing speed of garbage collection
JP2007219793A (en) * 2006-02-16 2007-08-30 Matsushita Electric Ind Co Ltd Writing method of flash memory

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0773098A (en) * 1993-09-01 1995-03-17 Toshiba Emi Ltd Data write method
JP2007220101A (en) * 2006-02-17 2007-08-30 Samsung Electronics Co Ltd Method and apparatus for managing block according to update type of data in block-type memory

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012234607A (en) * 2011-05-09 2012-11-29 Nec Access Technica Ltd Data writing device and data writing method

Also Published As

Publication number Publication date
JP5395163B2 (en) 2014-01-22
JPWO2010103780A1 (en) 2012-09-13

Similar Documents

Publication Publication Date Title
JP5295778B2 (en) Flash memory management method
KR100618298B1 (en) Recording system, data recording device, memory device, and data recording method
US8312554B2 (en) Method of hiding file at data protecting mode for non-volatile memory module, memory controller and portable memory storage apparatus
US8291155B2 (en) Data access method, memory controller and memory storage system
US9037782B2 (en) Method of programming memory cells and reading data, memory controller and memory storage apparatus using the same
JP4713867B2 (en) Memory controller, memory device, and memory controller control method
US8055873B2 (en) Data writing method for flash memory, and controller and system using the same
US9058296B2 (en) Data processing method, memory storage device and memory control circuit unit
WO2009096180A1 (en) Memory controller, nonvolatile storage device, and nonvolatile storage system
KR20110107857A (en) Solid state memory formatting
JPWO2007000862A1 (en) MEMORY CONTROLLER, NONVOLATILE MEMORY DEVICE, NONVOLATILE MEMORY SYSTEM, AND DATA WRITE METHOD
US20150089124A1 (en) Data accessing method for flash memory storage device having data perturbation module, and storage system and controller using the same
JP4253272B2 (en) Memory card, semiconductor device, and control method of semiconductor memory
JP2007280108A (en) Storage medium controller, storage medium control method, and program
TW201344434A (en) Memory formatting method, memory controller and memory storage apparatus
TW201447578A (en) Data storage apparatus and management method thereof
JP5395163B2 (en) Memory management device and memory area setting method
JPWO2007105688A1 (en) MEMORY CONTROLLER, NONVOLATILE STORAGE DEVICE, AND NONVOLATILE STORAGE SYSTEM
JP2005078378A (en) Data storage device and data writing method in non-volatile memory
TW201621668A (en) Data storage device and data writing method thereof
US20090204776A1 (en) System for securing an access to flash memory device and method for the same
JP4818453B1 (en) Electronic device and data reading method
JP2008299455A (en) Data storage device and data management method
US20140281226A1 (en) Memory card and host device
JP2008251063A (en) Storage device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10750538

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2011503699

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10750538

Country of ref document: EP

Kind code of ref document: A1