Data memory emulation in a Flash memory

The described method and device in Flash memory efficiently emulate EEPROM functionality by utilizing a Flash memory controller to perform multiple writing steps within a Flash line, addressing memory waste and complexity issues, thereby achieving fine access granularity and improved data storage efficiency.

FR3136100B1Active Publication Date: 2024-08-16STMICROELECTRONICS (ALPS) SAS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
FR2022005050
Authority / Receiving Office
FR · FR
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-05-25
Publication Date
2024-08-16
Estimated Expiration
2042-05-25

AI Technical Summary

Technical Problem

Existing Flash memory technologies cannot emulate the fine access granularity and efficient data storage capabilities of EEPROMs without significant waste of memory space and increased complexity.

Method used

A method and device that utilizes a Flash memory controller to perform multiple writing steps within a Flash line to store multiple data packets and error correction codes, allowing for efficient emulation of EEPROM-like functionality with reduced memory waste.

Benefits of technology

Enables efficient emulation of EEPROM-like functionality in Flash memory with minimal memory waste and reduced complexity, achieving fine access granularity and improved data storage efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 1.1
    Figure 1.1
Patent Text Reader

Abstract

Data Memory Emulation in Flash Memory This description relates to a method for writing to Flash memory, the method comprising the implementation, by a Flash memory controller: - of one or more first write steps to write a first data packet (EE PACKET 1) to a first part (D0, D1, D2) of a first row (300) of the Flash memory; and - of one or more second write steps, after the first one or more first write steps, to write a second data packet (EE PACKET 2) to a second part (D3, D4, D5) of the first row (300) of the Flash memory such that the first row contains the first and second data packets. Figure for the abstract: Fig. 3
Need to check novelty before this filing date? Find Prior Art

Description

Description Title of the invention: Emulation of data memory in a Flash memory Technical field

[0001] — This description relates generally to the field of Flash memories. Prior art

[0002] = A programmable non-volatile memory, such as a programmable read-only memory electrically erasable (EFEPROM), allows certain data to be stored, such as configuration settings, in electronic devices even when the electronic devices are not powered. However, due to technology used to implement an EEPROM, it generally cannot be integrated on a chip. External (off-chip) implementations of an EEPROM lead to increased usable area, power consumption and cost.

[0003] Flash memory can be implemented on a chip. However, a memory Flash has specific access constraints. For example, unlike a EEEPROM, it is not possible to overwrite individual data values in a Flash memory. Therefore, there are technical problems in using a on-chip Flash memory to implement memory storage similar to that provided by an EEPROM or other types of data memory. Summary of the invention

[0004] There is a need in the state of the art for a method and device intended to emulate a FEPROM using Flash memory which overcomes all or part of the known issues.

[0005] — According to one aspect, a method of writing to a Flash memory is provided, the method including the implementation, by a Flash memory controller: of one or more several first writing steps to write a first data packet into a first part of a first line of Flash memory; and one or more second writing stages, after the first one or more writing stages, to write a second data packet into a second part of the first line of Flash memory so that the first line contains the first and second data packet.

[0006] — According to another aspect, a Flash memory is provided comprising a controller configured to implement: one or more first writing steps for write a first data packet in a first part of a first line of Flash memory; and one or more second write steps, after the one or more several first stages of writing, including writing a second package of data in a second part of the first row of Flash memory such that the first row contains the first and second data packets. According to one embodiment, the one or more first writing steps further comprise writing a first error correction code, associated with the first data packet, in a third portion of the first line; and the one or more second writing steps further comprise writing a second error correction code, associated with the second data packet, in a fourth portion of the first line. According to one embodiment, the first data packet comprises a first data value and a first virtual address associated with the first data value, and the second data packet comprises a second data value and a second virtual address associated with the second data value, the second virtual address being different from, or the same as, the first virtual address. According to one embodiment, the first and second virtual addresses are the same address. According to one embodiment, the first data packet further comprises a first packet integrity verification code and the second data packet further comprises a second packet integrity verification code. According to one embodiment, the method further comprises one or more third writing steps, before or after the one or more first writing steps, comprising writing a code value to a first portion of a second row of the Flash memory and writing a third error correction code to a second portion of the second row, a bit length of the code value being equal to or greater than a combined bit length of the first and second data packets. According to one embodiment, the controller is further configured to implement one or more third write steps, before or after the one or more first write steps, comprising writing a code value to a first portion of a second row of the Flash memory and writing a third error correction code to a second portion of the second row, wherein a bit length of the code value is equal to or greater than a combined bit length of the first and second data values. In one embodiment, the first line is part of a data storage area of ​​the Flash memory, and the second line is part of a code storage area of ​​the Flash memory, the Flash memory further comprising at least one non-volatile register storing an indication of which lines of the Flash memory are part of the data storage area and which lines of the Flash memory are part of the code storage area. code storage. According to one embodiment, the first row is associated with both a first data storage address and a first code storage address different from the first data storage address; and the one or more first and second write steps include receiving, by the controller, the first data storage address and mapping, by the controller, the first data storage address to a physical address of the first row of the Flash memory. According to one embodiment, the method further comprises, before the first writing step: receiving, by the controller of the Flash memory, one or more first write commands associated with the one or more first writing steps, the one or more first write commands comprising the first data packet and the first storage address; and verifying, on the basis of one or more parameters stored by the at least one non-volatile register, that the first row of the Flash memory is configured to be part of the data storage area. According to yet another aspect, a method is provided comprising: writing first and second data packets to a Flash memory according to the preceding method; and reading a current data value associated with the first virtual value from the Flash memory by: identifying in the Flash memory a most recently stored data packet comprising the first virtual address; transferring to a read buffer a data value of the identified data packet; and outputting the data value of the identified data packet as the current data value. According to one embodiment, the controller is further configured to: identify in the Flash memory a most recently stored data packet comprising the first virtual address; transfer to a read buffer a data value of the identified data packet; and output the data value of the identified data packet as the current data value. According to one embodiment, outputting the data value of the identified data packet as the current data value is performed after checking an error correction code associated with the data value of the identified data packet. Brief description of the drawings These and other features and advantages will be set forth in detail in the following description of particular embodiments given without limitation in relation to the attached figures, among which: [Fig. 1] schematically represents an electronic device comprising a Flash memory configured to be used to emulate a data memory according to an exemplary embodiment of the present disclosure; [Fig.2] shows a line of a Flash memory storing an EEPROM packet according to a non-optimal approach; [Fig.3] shows a line of a Flash memory storing EEPROM packets according to an exemplary embodiment of the present disclosure; [Fig.4] schematically represents the Flash memory of [Fig.1] in more detail according to an exemplary embodiment of the present description; [Fig.5] schematically represents registers and Flash memory storage of [Fig.4] in more detail according to an exemplary embodiment of the present description; [Fig.6] is a flowchart showing steps of a method of writing to a Flash memory according to an exemplary embodiment of the present description; and [Fig.7] is a flowchart showing steps of a method of reading from a Flash memory according to an exemplary embodiment of the present description. Description of the embodiments The same elements have been designated by the same references in the different figures. In particular, the structural and / or functional elements common to the different embodiments may have the same references and may have identical structural, size and material properties. Unless otherwise specified, when referring to two elements connected together, this means directly connected without intermediate elements other than conductors, and when referring to two elements connected (in English "coupled") together, this means that these two elements can be connected or be connected by means of one or more other elements. In the following description, when reference is made to absolute position qualifiers, such as the terms “front”, “back”, “top”, “bottom”, “left”, “right”, etc., or relative position qualifiers, such as the terms “above”, “below”, “upper”, “lower”, etc., or to orientation qualifiers, such as the terms “horizontal”, “vertical”, etc., reference is made unless otherwise specified to the orientation of the figures. Unless otherwise specified, the expressions “about”, “approximately”, “substantially”, and “of the order of” mean to within 10%, preferably to within 5%. [Fig. 1] schematically represents an electronic device 100 comprising a processing device 102 (P), a Flash memory 104 (FLASH) and a memory volatile memory 106 (RAM), such as random access memory, interconnected by a bus 108. The processing device 102 comprises, for example, one or more processors controlled by instructions stored in the volatile memory 106. The electronic device 100 is, for example, an integrated circuit, or a chip, and the Flash memory 104 and volatile memory are, for example, integrated on a chip with the processing device 102. The electronic device 100 may comprise additional components (not shown) connected to the bus 108. In certain embodiments, the device 100 also comprises an input / output interface 110 (OO INTERFACE) connected to the bus, allowing communications with devices external to the chip such as an external memory device. The Flash memory 104 is configured to emulate, in at least a portion of its storage area, a data storage memory. For example, the emulated data storage memory has a finer access granularity than that of the FLASH memory. In the embodiments described in the present application, the emulated data storage memory is an EEPROM, however the principles described herein could be applied to the emulation, using a FLASH memory, of other types of data memories. [Fig. 2] shows a line 200 of the Flash memory 104 of [Fig. 1] storing an EEPROM packet according to a non-optimal approach. In the example of [Fig. 2], the Flash line 200 is 138 bits long. For example, there are 128 bits of data / code storage (bits 0-127), corresponding to the bit length granularity of a Flash read or write access, and 9 bits of error correction code (ECC) (bits 128-136). Bit 137 is not used, for example. In alternative embodiments, each Flash line and / or the data / code storage portion of each Flash line may have a different bit length. The access granularity of an EEPROM is generally smaller than that of a Flash memory and, according to an example shown in [Fig.2], each EEPROM data packet (EE PACKET) to be stored has a length of 48 bits, comprising 16 data bits, 16 address bits and 16 cyclic redundancy check (CRC) bits, which is used to check the integrity of the packet. The address is for example a virtual address associated with the EPROM data and serves for example as an EEPROM data identifier in the FLASH memory. When the data value associated with a given virtual address is to be changed, the changed data associated with the same virtual address is stored in a new Flash memory location, which is for example a next free memory location in the Flash memory.When a data value associated with a given virtual address is to be read from Flash memory, a search is performed through the EEPROM data using read steps to find the most recent data value, the . more up-to-date, associated with the virtual address. In alternative embodiments, each EEEPROM data packet could have a different length that is smaller than the data length of a Flash line. The EEEPROM packet is for example protected by 9 bits of ECC, stored in bits 128 to 136. Thus, 48 ​​bits of the Flash line are used, leaving an empty portion (EMPTY) of 80 bits, which in the example of [Fig. 2] are bits 48 to 127. Therefore, although the approach shown in [Fig. 2] allows to respect the access granularity of the Flash, it leads to a significant amount of wasted space, which means that a relatively large area of ​​the Flash memory is required for a given size of EEPROM to be emulated. Furthermore, a difficulty is that the Flash memory cannot be modified line by line.Therefore, if the EEPROM packet needs to be refreshed with a new data value, a new Flash line would have to be used, increasing the complexity of the EEPROM emulation. [Fig. 3] shows a line 300 of a Flash memory storing EEPROM packets according to an exemplary embodiment of the present disclosure. As in the example of [Fig. 2], the Flash line of [Fig. 3] is 138 bits long. In the example of [Fig. 3], the Flash line has data storage fields DO to DS for storing six corresponding data values, each having a length of 16 bits, and six corresponding ECC fields for storing error correction codes ECCO to ECCS associated with the data values, each having a length of 6 bits. Thus, 96 bits (bits 0 to 95) are for example used to store data, and 36 bits (bits 96 to 131) are for example used to store the ECC values, leaving an empty portion (EMPTY) of only six bits (bits 132 to 137 in the example of [Fig. 2]). In some embodiments, the data values ​​DO, D1 and D2 store a first 48-bit EEPROM packet (EE PACKET 1), with 18 corresponding ECC bits ECCO, ECC1, ECC2 and the data values ​​D3, D4 and DS store a second 48-bit EEPROM packet (EE PACKET 2), with 18 corresponding ECC bits ECC3, ECC4, ECCS. As in the example of [Fig. 2], each EEPROM packet includes for example a 16-bit data value, a 16-bit address, such as the virtual address associated with the EEPROM data, and a 16-bit CRC value, used to verify the integrity of the packet. However, in alternative embodiments, it could include only a data value or only a data value and an address, or only a data value and a CRC value, and the lengths of these values ​​could be other than 16 bits. Although [Fig.3] shows an example in which two EEPROM packets are stored depending on the length of each EEPROM packet and the length of the Flash line, a different number of EEPROM packets could be stored in each Flash line. For example, if each EEPROM packet has a bit length corresponding to only two of the six data fields (e.g., if it has a bit length of 32 bits), three EEPROM data packets could be stored in data fields DO, D1, data fields D2, D3, and data fields D4, D5, respectively, or if each EEPROM packet has a bit length corresponding to one of the six data fields (e.g., if it has a bit length of 16 bits), six FEPROM data packets could be stored in data fields DO to D5, respectively. Each Flash line is, for example, configured to store at least two FEPROM packets, each in a corresponding part of the Flash line, and at least two corresponding ECC values, each in another corresponding part of the Flash line. In some embodiments, the EEPROM packets stored in the same Flash row 300 are different packets associated with different virtual addresses. Alternatively, the EEPROM packets stored in the same Flash row 300 are different versions of the same packet associated with the same virtual address. For example, a first of the EEPROM packets contains a first data value associated with a first virtual address and a second of the EEPROM packets contains a second, updated, data value associated with the same first virtual address. As will be described in more detail later, the most recent EEPROM packet associated with a given virtual address is, for example, the packet stored furthest to the right in the Flash row 300, and at a higher Flash row address, although other arrangements are possible. [Fig.4] schematically represents the Flash memory 104 of the electronic device of [Fig.1] in more detail according to an exemplary embodiment of the present description. The Flash memory 104 includes, for example, a Flash memory storage 400 consisting of one or more Flash memory arrays divided into a code storage area 402 (CODE STORAGE) having Flash lines configured to store code in a non-volatile manner, and a data storage area 404 (DATA STORAGE) having, for example, Flash lines configured to store data packets such as EEPROM packets. For example, each Flash line of the code storage area 402 is configured to store a single data value and a single ECC value. In one example, the data value is up to 128 bits long, and the ECC value is up to 9 bits long, although other data lengths and / or ECC are possible. On the other hand, each Flash line of the data storage area 404 is by example configured to be able to store a plurality of EEPROM packets and a plurality of ECC values, in accordance with the format described in relation to [Fig.3]. Each EEPROM packet comprises for example a data value and a corresponding virtual address and, in some cases, also a CRC value. The Flash memory 104 also comprises, for example, a controller 406 (CTRLR) connected to the Flash storage 400 via a bus 405 and configured to write data to the Flash lines of the Flash storage 400 and to read data from the Flash lines of the Flash storage 400 via the bus 405. The bus 405 has, for example, a width equal to the size of the Flash line. The Flash controller 406 comprises, for example, an ECC calculation circuit 406 (ECC CALC), a write buffer 408 (WR BUF) adapted to store one or more Flash lines to be written to the Flash memory storage 400 and a read buffer 410 (RD BUF) adapted to store one or more Flash lines read from the Flash memory storage 400. The Flash controller 406 is for example connected to the bus 108 of [Fig. 1] and receives, for example, via the bus 108, an address (ADDR) of a Flash write or read access, a size value (SIZE) indicating a bit size of the access step, which is for example 16 or 32 bits in the case of a data access, or 128 bits in the case of a code access, write data (WR DATA) to be written to the Flash storage 400 during a Flash write step and write and read enable signals (WE / RE). The Flash controller 406 provides for example, to the bus 108, read data (RD DATA) which has been read from the Flash memory storage 400.The write data bus WR DATA and the read data bus RD DATA each have, for example, a width equal to the access granularity of the code storage area 402, for example, equal to 128 bits, and, while accesses are being made to the data storage area 404, only a portion of these buses is, for example, used. The controller 406 also comprises, for example, an address mapping circuit (ADDR MAPPING) 411 capable of mapping ADDR addresses provided on the ADDR bus to physical addresses of the Flash storage 400. The Flash memory 104 also comprises, for example, one or more non-volatile registers (USER OPTIONS) 412 capable of storing one or more Flash parameters defining, for example, the range of Flash lines forming the data storage area 404 and / or the range of Flash lines forming the code storage area 402. For example, the one or more Flash parameters comprise a parameter defining a boundary between the code storage area 402 and the data storage area 404. The registers 412 allow, for example, a user of the Flash memory 104 to set, as user options, a quantity of the code storage area 402 to be stored in the Flash memory 104. Flash memory to be used for storing data, for example for EEPROM emulation. The Flash access granularity differs, for example, for accesses to the data storage area 404 compared to accesses to the code storage area 402. For example, accesses to the code storage area 402 are performed with a read and write granularity equal to the bit length of the storage portion of the Flash lines, for example equal to 128 bits. On the other hand, accesses to the data storage area 404 are, for example, performed with a read and write granularity smaller than that of accesses to the code storage area 402 and, for example, corresponding to the size of the EEPROM packet or less and, for example, equal to the size of one, two or three of the data fields DO to DS. [Fig.5] schematically represents the Flash memory storage 400 and registers 412 of the Flash memory of [Fig.4] in more detail according to an exemplary embodiment of the present disclosure. In the example of [Fig. 5], the Flash storage is divided into two memory banks (Bank A, Bank B), each containing 128 sectors (Sector 0 to Sector 127). Of course, in alternative embodiments, the Flash storage could comprise a single memory bank or more than two memory banks. Each Flash sector comprises, for example, a plurality of Flash lines. In one example, each sector has a storage capacity of several thousand bytes. In bank A, for example, an EEPROM_SECTOR_START_A pointer is used to indicate the starting sector of data storage area 404. In the example of [Fig.5], this area begins in sector 120 and occupies eight final sectors 120 to 127 of bank A. Similarly, in bank B, an EEPROM_SECTOR_START_B pointer is for example used to indicate the starting sector of the data storage area 404. In the example of [Fig.5], this area begins in a sector 126 and occupies two final sectors 126 to 127 of bank B. In some embodiments, the sectors of the code storage area 402 have a first size, for example, approximately 8 kB, while the sectors of the data storage area 404 have a second size that is smaller than the first size, for example, approximately 6 kB. The pointers EEPROM_SECTOR_START_A and EEPROM_SECTOR_START_B are for example stored in corresponding registers 412A, 412B, respectively, of registers 412. For example, register 412A is a 16-bit register storing three bits (bits 0 to 2 in the example of [Fig. 5]), indicating the starting sector of the data storage area 404 of bank A, which can for example be any of the last eight sectors numbered 127 / 0 to 120 / 7 in [Fig. 5]. For For example, the binary value "000" designates sector 127 / 0 and the binary value "111" designates sector 120 / 7. Register 412A also stores, for example, an EEPROM_ENA bit, indicating whether bank A has a data storage area 404, this bit being bit 15 of register 412A in the example of [Fig.5]. Similarly, register 412B is for example a 16-bit register storing three bits (bits 0 to 2 in the example of [Fig.5]), indicating the starting sector of the data storage area of ​​bank B. Register 412B also stores for example an EEPROM_ENB bit, indicating whether bank B has a data storage area 404, this bit being bit 15 of register 412B. In some embodiments, the enable bits EEFPROM_ENA and EEPROM_ENB are set by default to a value, e.g., a "0", which disables the data storage areas 404 of each bank, so that all banks are used for code storage, and the designation of the data storage areas is specifically programmed by writing to the registers 412. In some embodiments, the addresses provided on bus 108 of [Fig. 1] that are used to access code storage area 402 are different from the addresses provided on bus 108 that are used to access data storage area 404, and controller 406 is, for example, configured to implement address mapping, using, for example, address mapping circuit 411, of these addresses with the physical addresses of the Flash sectors. In the example of [Fig.5], the addresses for accessing sectors O to 127 of code storage area 402 are from Ox0800_0000 to Ox080F_FFFF for bank A and from O0x0810_0000 to Ox081F_FFFF for bank B (addresses represented in hexadecimal), while the addresses for accessing sectors 120 to 127 of code storage area 402 are from Ox0900_0000 to 0x0900_BFFF for bank A and from 0x0900_C000 to 0x0901_7FFF for bank B.Of course, these addresses are essentially examples and any address ranges that are different and non-overlapping could be used to access the code storage area 402 and the data storage area 404. An advantage of using different addresses is that it allows the controller 406 to detect when access is desired to the code storage area 402 or the data storage area 404 and to verify, using the registers 412, that the corresponding portion of the Flash memory is indeed configured as the desired storage type. [Fig. 6] is a flowchart representing steps of a method 600 for writing to a Flash memory according to an exemplary embodiment of the present description. The steps of the method 600 are for example implemented by the controller 406 of the Flash memory 104. In a step 601 (RECEIVE WR CMD TO FIRST DATA STORAGE ZONE ADDR), the Flash memory controller 406 receives, for example, a write command intended for an address associated with the data storage area 404. In some embodiments, the address of the write command designates a portion of a Flash line in an address range dedicated to the data storage area 404, which means that the controller 406 can infer from the address that the intention is to write to the data storage area 404. The address of the write command is provided on the ADDR input bus lines and is, for example, accompanied by a size value on the SIZE input bus lines indicating a size in bits of the data value to be written, which is, for example, 16 or 32 bits. Furthermore, a first data value to be written is provided on the WR DATA input bus lines. The write enable signal WE is also, for example, asserted. In a step 602 (FLASH LINE = DATA STORAGE ZONE?), the controller 406 is for example configured to verify that the Flash line corresponding to the address to be accessed is part of the data storage zone 404. To do this, the controller 406 reads for example the registers 412 and verifies that the Flash line to be accessed is part of a sector designated as part of the data storage zone 404. If the Flash line is not in the data storage area 404 (branch N starting from step 602), in a step 603 (ERROR SIGNAL), an error signal is for example transmitted by the controller 406 to the processing device 102 and / or to another circuit, indicating that the write command cannot be satisfied and the write step is for example aborted. If the Flash line is in the data storage area 404 (branch Ÿ starting from step 602), in a step 604 (WRITE FIRST DATA VALUE AND ECC TO FIRST PORTIONS OF FLASH LINE), a write step is implemented by the controller 406 on the portion of the Flash line designated by the write address. This involves, for example, calculating an ECC value associated with the write data and then storing the write data as the first data value in one portion of the Flash line and storing the calculated ECC value in another portion of the Flash line. It is assumed that, before this write step, all the bits of the Flash line are in an unprogrammed state which is, for example, a state corresponding to a logic "1". In some embodiments, the writing step involves loading the write data and the ECC value into the write register 408 of the controller 406. The write register 408 has, for example, the length of a Flash line and this step involves, for example, masking in the write register 408 the bits of the Flash line that are not to be modified. The controller 406 is, for example, configured to determine the physical address of the Flash line containing the address write address and to read this Flash line from the Flash storage 400 and store it in the write buffer 408. The controller 406 is for example configured to then write the first data value in the part of the Flash line identified by the write address. For example, the write address designates one or two of the data fields DO to D5 of the Flash line. The controller 406 stores for example, in the write buffer 408, the data value in the data part of the Flash line designated by the write address, and the corresponding ECC value in the part of the Flash line associated with this data part. For example, taking the example of the Flash line 300 of [Fig. 3], the first data value is for example stored in the fields DO and D1 and the ECC value is for example stored in the fields ECCO and ECCI.The contents of the write register 408 are then written, for example, to the corresponding Flash line of the data storage area 404, so that only the data fields DO and D1, and the ECC fields ECCO and ECC, are modified and the other bits of the Flash line are kept unmodified, and therefore in the unprogrammed state. Of course, among the bits of the modified fields, only the bits that are to change state, for example from a logical "1" to a logical "0", are actually modified. In some embodiments, the first data value stored during the first write step of steps 601 to 604 corresponds to a complete EEPROM packet. Alternatively, in the case where the size of the EEPROM packet is larger than the write granularity, one or more additional write steps are for example implemented by repeating steps 601 to 604 in order to store the complete EEPROM packet. Some time after the first write step implemented in steps 601 to 604, a further write step of a second data value in the same Flash line is for example implemented, as represented by steps 605 to 608. For example, the Flash line is reserved for a given EEPROM packet and the second write step is implemented in order to store at least a part of an updated second data value of the EEPROM packet. It is not possible to modify the first data value in the Flash line without first erasing the entire sector. Therefore, the new data value and the corresponding new ECC are instead written in other unprogrammed parts of the Flash line in steps 605 to 608. Alternatively, the second write step is implemented in order to store an EEPROM packet associated with another virtual address.Steps 605 (RECEIVE WR CMD TO SECOND DATA STORAGE ZONE ADDR), 606 (FLASH LINE=DATA STORAGE ZONE?) and 607 (ERROR SIGNAL) are for example identical to steps 601 to 603 described previously, and will not be described again in detail. Step 608 (WRITE SECOND DATA . VALUE AND ECC TO SECOND PORTIONS OF FLASH LINE) is however different as will be described in more detail below. This second step of writing to the Flash line involves, for example, calculating an ECC value associated with the second write data, then storing the write data as a second data value in the unprogrammed portion of the Flash line and storing the calculated ECC value in another unprogrammed portion of the Flash line. In some embodiments, the writing step involves loading the new write data and the new ECC value into the write register 408 of the controller 406, while masking in the write register 408 the bits of the Flash line that are not to be modified, which are the portions that have already been written and the portions that are not to be written.The controller 406 is for example configured to determine the physical address of the Flash line containing the write address and to read this Flash line from the Flash storage 400, and to store it in the write buffer 408. The controller 406 is configured for example to then write the second data value in the part of the Flash line identified by the write address. For example, the write address designates one or two of the data fields DO to D5 of the Flash line not already written during the first writing step. The controller 406 stores for example, in the write buffer 408, the second data value in the data part of the Flash line designated by the write address and the corresponding ECC value in the part of the Flash line associated with this data part. Taking the example of the Flash line 300 of [Fig.3], the second data value is stored for example in the data fields D3 and D4, and the ECC value is stored for example in the ECC fields ECC3 and ECC4. The contents of the write register 408 are then written for example in the corresponding Flash line of the data storage area 404, so that only the data fields D3 and D4 and the ECC fields ECC3 and ECC4 are modified and the other bits of the Flash line are left unmodified. Of course, of the bits of the modified fields, only the bits which are to change state, for example from a logical "1" to a logical "0", are actually modified. In some embodiments, the second data value stored during the second write step of steps 605 to 608 corresponds to a complete EEPROM packet. Alternatively, in the case where the size of the EEPROM packet is larger than the write granularity, one or more additional write steps are for example implemented by repeating steps 605 to 608 in order to store the complete EEPROM packet. The method of [Fig.6] also includes a step of writing to the code storage area 402 of the Flash memory, as represented by the steps 609 to 612. These steps are for example implemented some time after the second writing step of steps 605 to 608, but could alternatively be implemented at any time before or after the first writing step. For example, these steps are implemented as part of a software update. In step 609 (RECEIVE WR CMD TO FIRST CODE STORAGE ZONE ADDR), the Flash memory controller 406 receives, for example, a write command intended for an address associated with the code storage zone 402. In some embodiments, the address of the write command designates a Flash line in an address range dedicated to the code storage zone 402, which means that the controller 406 can infer from the address the intention to write to the code storage zone 402. The address of the write command is provided on the input bus lines ADDR and is, for example, accompanied by a corresponding data value on the input bus lines WR DATA and the write enable signal WE is, for example, asserted. In a step 610 (FLASH LINE = CODE STORAGE ZONE?), the controller 406 is for example configured to verify that the Flash line corresponding to the address to be accessed is part of the code storage zone 402. To do this, the controller 406 reads for example the registers 412 and verifies that the Flash line to be accessed is not part of a sector designated as part of the data storage zone 404. If the Flash line is not in the code storage area 402 (branch N starting from step 610), in a step 611 (ERROR SIGNAL), an error signal is for example transmitted by the controller 406 to the device 102 and / or to another circuit, indicating that the write command cannot be fulfilled and the write step is for example aborted. If the Flash line is in the code storage area 402 (Y branch from step 610), in a step 612 (WRITE CODE VALUE AND ECC TO FLASH LINE), a write step is implemented by the controller 406 in the Flash line designated by the write address. This involves, for example, calculating an ECC value associated with the code value, then storing the code value and the calculated ECC value in the Flash line with a write granularity larger than that of a data write. For example, the write granularity is 128 bits. It is assumed that, before this write step, all the bits of the Flash line are in an unprogrammed state, which is, for example, a state corresponding to a logical "1". In some embodiments, the writing step involves loading the write data and the ECC value into the write register 408 of the controller 406.The contents of the write register 408 are then, for example, written into the corresponding Flash line of the code storage area 402. Although not shown in [Fig.6], in some embodiments, before writing to a portion of a Flash line, a check is performed by the controller 406 to verify that the portion is empty, for example that all bits are in an unprogrammed state, such as a logical "1". Indeed, in the case where the Flash line portion contains data, the data written to this portion will be corrupted, since it is not possible to write a "1" bit to memory cells already programmed with a "0" bit. Even if no check is performed, the error will be detected during the subsequent data reading step because the ECC value will no longer be correct. A method of reading an EEPROM packet from Flash memory will be described below in relation to [Fig.7]. [Fig. 7] is a flowchart representing steps of a method 700 for reading a current data value from a Flash memory according to an exemplary embodiment of the present description. The steps of the method 700 are for example implemented by the processing device 102 of the device 100 of [Fig. 1] and by the controller 406 of the Flash memory 104. These steps are for example used to read a data value stored in the data storage area 404 according to the method of [Fig. 6]. In particular, it is for example desired to read the current data value associated with a given virtual address. In a step 701 (SEARCH DATA STORAGE ZONE FOR RD VIRTUAL ADDRESS), data memory emulation software executed by the processing device 102 triggers, for example, a search, in the data storage area 404 of the Flash memory, for an EEPROM packet associated with a virtual address of the data value to be read. More than one value of the data value associated with the read virtual address may have been stored in the data storage area and, in order to identify the latest, most up-to-date value, a search is for example performed by reading the portions in the data storage area 404 storing the virtual addresses, starting from the end of the data storage area 404, and working backward in the memory, and from the end to the beginning of each Flash line.For example, in each Flash line, only two data portions, such as data portions DO and D3, store the virtual address associated with each EEPROM packet and only these portions are read. Once there is a match, meaning that the packet containing the read virtual address is located or once the beginning of the data storage area 404 is reached without any match, a step 702 is implemented. In step 702 (RD VIRTUAL ADDRESS FOUND'?), it is determined whether the virtual read address has been found. If not (branch N), in a step 703 (END), the read step ends, for example, without finding any data value. associated with the virtual read address. If a match has been found in the memory (Y branch), a step 704 is implemented. In step 704 (RD CMD OF DATA VALUE ADDR IN DATA STORAGE ZONE), the processing device 102 transmits, for example, a read command to the controller 406 of the Flash memory to read a portion of data corresponding to the EEPROM packet identified by the search. In some embodiments, the address of the read command designates a portion of a Flash line in an address range dedicated to the data storage area 404, which means that the controller 406 can deduce from the address that the intention is to read from the data storage area 404. The address of the read command is provided on the input bus lines ADDR, a size value, for example designating a size in read bits of 16 or 32 bits, is for example provided on the input bus lines SIZE and the read enable signal RE is for example asserted. In a step 705 (FLASH LINE = DATA STORAGE ZONE?), the controller 406 is for example configured to verify that the Flash line corresponding to the read address to be accessed is part of the data storage zone 404. To do this, the controller 406 reads for example the registers 412 and verifies that the Flash line to be accessed is part of a sector designated as being part of the data storage zone 404. If the Flash line is not in the data storage area 404 (branch N starting from step 705), in a step 706 (ERROR SIGNAL), an error signal is for example transmitted by the controller 406 to the processing device 102, and / or to another circuit, indicating that the read command cannot be satisfied and the read step is for example abandoned. If the Flash line is in the data storage area 404 (branch Ÿ starting from step 705), in a step 707 (TRANSFER FLASH LINE TO RD BUFFER), the Flash line including the data value designated by the read data value address is for example transferred to the read buffer 410. In a step 708 (VALID ECC VALUE?), the ECC value associated with the read data value address is for example verified. If the ECC value is not valid (branch N starting from step 708), in a step 709 (ERROR SIGNAL), an error signal, an error signal is for example transmitted by the controller 406 to the processing device 102, e.g. / or to another circuit, indicating that the data has been corrupted and the reading step is for example abandoned. If the ECC value is valid (Y branch starting from step 708), in a step 710, the data value in the Flash line designated by the read data value address is for example provided on the RD DATA output bus lines of the controller 406 and the data value is thus provided to the processing device 102. If the data value of the EEPROM packet associated with the virtual address has a bit length larger than the read granularity of the data storage area 404, steps 704 to 710 are for example repeated for other bits of the data value until the entire data value has been read. An advantage of the embodiments described herein is that an EEPROM or other type of non-volatile data memory can be emulated in an area of ​​a Flash memory with a relatively small wasted memory area. Indeed, by allowing a write granularity of less than half of a Flash line, it is possible to store two or more data values ​​in the Flash line at different times. Various embodiments and variations have been described. Those skilled in the art will understand that certain features of these various embodiments and variations could be combined, and other variations will be apparent to those skilled in the art. For example, it will be apparent to those skilled in the art that, although embodiments have been described in which the same physical address space of the Flash memory is accessed using different addresses depending on whether the data storage area or the code storage area is being accessed, it would be possible in alternative embodiments to use the same addresses to access the Flash memory regardless of whether the area is defined as a data storage area or not. Finally, the practical implementation of the embodiments and variants described is within the reach of those skilled in the art from the functional indications given above.

Claims

Claims

1. A method of writing to a Flash memory, the method comprising: implementation, by a controller (406) of the Flash memory: - one or more first stages of writing to write a first data packet (EE PACKET 1) in a first part (DO, D1, D2) of a first line (300) of the Flash memory; - one or more second writing stages, after the one or more several first stages of writing, to write a second package of data (EE PACKET 2) in a second part (D3, D4, D5) of the first line (300) of Flash memory so that the first line contains the first and second data packets; and one or more third writing stages, before or after the one or more several first writing steps, including writing a value of code in a first part of a second line of memory Flash and writing a third error correction code in a second part of the second line, in which a bit length of the code value is equal to or greater than a bit length combined first and second data packets.

2. Flash memory comprising a controller (406) configured to put in operation: - one or more first writing steps to write a first data packet (EE PACKET 1) in a first part (DO, D1, D2) of a first line (300) of the Flash memory; - one or more second writing stages, after the one or more several early stages of writing, including writing a second data packet (EE PACKET 2) in a second part (D3, D4, D5) of the first line (300) of the Flash memory so that the first line contains the first and second packets of data; and - one or more third writing steps, before or after the first one or more writing stages, including writing a code value in a first part of a second Flash memory line and writing a third correction code error in a second part of the second line, in which a bit length of the code value is equal to or greater than one combined bit length of the first and second data packets.

3. The method of claim 1, wherein the one or more The first stages of writing also include writing a first error correction code, associated with the first data packet (EE PACKET 1), in a third part (ECCO, ECCI1, ECC2) of the first line; and wherein the one or more second steps writing also includes writing a second code of error correction, associated with the second data packet (EE PACKET 2), in a fourth part (ECC3, ECC4, ECCS) of the front line.

4. A method according to claim | or 3, wherein the first packet of data (EE PACKET 1) includes a first data value and a first virtual address associated with the first data value, and the second data packet (EE PACKET 2) includes a second data value and a second associated virtual address to the second data value, the second virtual address being different from, or identical to, the first virtual address.

5. The method of claim 4, wherein the first and second virtual addresses are the same address.

6. A method according to claim 4 or 5, wherein the first packet of data (EE PACKET 1) further comprises a first verification code- packet integrity verification and the second packet (EE PACKET 2) further includes a second integrity verification code of the pack.

7. A method according to claim 1 or 3 to 6, wherein the first line is part of a data storage area (404) of Flash memory, and the second line is part of a code storage area (402) of Flash memory, the Flash memory further comprising at least one non-volatile register (412) storing an indication of the lines of the Flash memory forming part of the data storage area (404) and lines of Flash memory that are part of the storage area of code (402).

8. A method according to claim 7, wherein: - the first line is associated with both a first address of data storage and to a first code storage address different from the first data storage address; and - the one or more first and second stages of writing com- take the reception, by the controller (406), of the first address of data storage and matching, by the controller, of the first data storage address with a physical address from the first line of Flash memory.

9. The method of claim 8, further comprising, before the first writing step: - the reception, by the controller (406) of the Flash memory, of one or more several first write commands associated with one or several first stages of writing, the first one or more write commands including the first data packet and the first storage address; and - verification, based on one or more parameters stored by the at least one non-volatile register (412), that the first line of the Flash memory is configured to be part of the storage area of data.

10. A method comprising: writing first and second data packets into a Flash memory according to the method according to any one of the re- dication 4 to 6: and reading a current data value associated with the first value virtual from Flash memory in: - identifying in Flash memory a data packet stored most recently including the first virtual address; - transferring to a read buffer (410) a data value from the identified data packet; and - outputting the data value of the data packet identified as the current data value.

11. | Flash memory according to claim 2, wherein the first packet data (EE PACKET 1) includes a first data value and a first virtual address associated with the first value of data, and the second data packet (EE PACKET 2) includes a second data value and a second virtual address associated with the second data value, the second virtual address being different from, or identical to, the first virtual address, and in which the controller (406) is further configured to: - identify in the Flash memory a data packet stored the most recently including the first virtual address; - transferring to a read buffer (410) a data value from the identified data packet; and - output the data value of the identified data packet as the current data value.

12. The method of claim 10, wherein the outputting of the data value of the identified data packet as the current data value is performed after a check of an error correction code associated with the data value of the identified data packet.