Method for assisting in the identification of blank sectors of a non-volatile memory of a microcontroller

IN604692BActive Publication Date: 2026-09-30VITESCO TECHNOLOGIES GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
IN202247010085
Authority / Receiving Office
IN · IN
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-10-15
Filing Date
2022-02-25
Publication Date
2026-09-30
Estimated Expiration
2040-10-08
Patent Text Reader

Abstract

The invention discloses a method for assisting in the identification of blank sectors of a non-volatile memory of a microcontroller, the method consisting, upon each receipt (401) of a command to write or erase a given sector of the matrix of memory cells of a non-volatile memory, in writing (403) in a given memory cell in the microcontroller register, which cell is associated with the given sector, an item of information representative of the fact that the sector has been written or erased, i.e. of the fact that the sector in question is written or blank.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field

[0001] The present invention generally pertains to memories integrated intomicrocontrollers. It relates more particularly to identifying blank sectors of a nonvolatilememory of a microcontroller. The invention is applicable, in particular, tomicrocontrollers equipped with a flash memory, programming memory cells ofwhich entails checking beforehand whether they are blank.Prior art

[0002] Generally, the term "microcontroller" denotes an integrated circuit whichcomprises at least one processor, memories (at least one volatile memory and atleast one non-volatile memory) and input-output interfaces suitable for allowing itto be connected to other electronic circuits of the electronic system in which it isused. It is an autonomous component, which can carry out a program contained inthe non-volatile memory when it is powered on, which can acquire data in digitalor analog form, and which can generate and deliver digital data and / or analogelectrical signals.

[0003] Microcontrollers are nowadays commonly used in all embedded electronicsystems, particularly in motor vehicle applications. They allow specific functionsto be performed in an environment which is subject to significant constraints onsystems simultaneously in terms of size, of power consumption and of cost.

[0004] In the motor vehicle field, the majority of electronic systems with whichmodern motor vehicles are equipped are controlled by such microcontrollers. Thisis, for example, the case for systems for controlling the injection of fuel into anengine, anti-lock braking systems or indeed embedded systems for analyzing radarimages in the context of more autonomous vehicles. In each of these examples, themicrocontroller can perform all sorts of operations to control the relevant system.

[0005] One particular function of the non-volatile memory with which amicrocontroller is equipped is to store the program which can be carried out by saidmicrocontroller. To this end, this non-volatile memory must be able to beprogrammed and, where applicable, reprogrammed, according to the specific usewhich is made of the microcontroller in the system within which it is embedded.Programming the non-volatile memory of a microcontroller targets an operation bymeans of which specific data (which correspond to a program) are written to thenon-volatile memory from a dedicated interface of said non-volatile memory. Theterm "write operation" is used when the data are useful data to be retained in thememory, in the form of binary values "0" and "1", so as to give rise to subsequentread operations according to the needs of the application. Erasing all or some of thememory is also a programming operation, of a particular type since it consists inwriting "0"s or "1"s, according to the type of technology used, to all the memorycells which are erased.

[0006] Now, for some non-volatile memory technologies commonly employed incurrent microcontrollers, particularly flash memory technology, writing anyinformation to the memory entails that the memory space into which theinformation is to be written is a blank memory space. Within the meaning of thepresent description, a blank memory space is a memory space which contains noalready written useful data (user information) at the moment when the write processis performed. In other words, either the memory space contains, at the momentwhen the write process is launched, no useful information and it is then possible towrite certain information directly to it, or it already contains written informationand the latter must first be erased before it is possible to write new information. Awrite operation therefore comprises an operation of checking the state, blank orotherwise, of the memory cells which are affected by the operation.

[0007] Further, in a non-volatile memory such as those used in microcontrollers,such as, for example, in a flash memory, the data are stored in a matrix of memorycells which is sectorized. A sector (also called a block of memory cells or a memoryblock) is a set of memory cells of the matrix which are necessarily erased togetherwhen an erase operation is performed. Put differently, any erase operation, inparticular, involves erasing all the memory cells of a certain sector. In some cases,in contrast, a write operation can involve only a single memory cell. Nevertheless,a write operation can obviously also involve a plurality of memory cellssimultaneously, and do so whichever sector or sectors they belong to.

[0008] In the case of a sectorized non-volatile memory, however, reasonsconnected with the technology, as already mentioned above, dictate that, for data tobe written to any sector whatsoever, all the memory cells of the sector in questionbe blank as originally, or indeed have been erased if they had previously alreadybeen written. In both cases, the sector is blank and can, on command, be wholly orpartly written. This is why managing, by means of a microcontroller, the storage ofdata in such a non-volatile memory involves it being possible to regularly identifythe blank sectors of said non-volatile memory.

[0009] The process of identifying the blank sectors of a non-volatile memory asknown until now is long and laborious. Specifically, according to a first knownapproach, this process involves, on the one hand, using a user code (user software)designed, when it is carried out, to perform consecutive operations of reading allthe memory cells of the matrix of a non-volatile memory, and on the other handinterpreting the result of this read. In this case, a specific user code, suitable for thetechnology of each given microcontroller, must be developed to perform theseoperations. Further, such a code involves risks of bugs and / or configurationdifficulties.

[0010] A second known approach rests on the fact that such a non-volatilememory is managed by a control module integrated into said memory, whichcomprises an interface module. Besides the fact that the interface module fulfillsthe basic control functions for the memory, such as writing, reading or erasing, itcan also fulfill a function referred to as the function of checking the state of thememory cells of erased sectors, called "verifying the erased logical sector range" inthe literature. This function can be called by the user code to check the state, blankor otherwise, of the memory cells of the various sectors of a matrix of memory cellsof a non-volatile memory.

[0011] In any case, with the first as with the second approach, all the memorycells of a non-volatile memory must be scanned (i.e. read or checked) in order todetermine which are the blank sectors among all the sectors of a matrix of memorycells. Consequently, the operations required to identify the blank sectors of a nonvolatilememory prove to be particularly long and resource-intensive, since theyinvolve checking the state, blank or otherwise, of each memory cell of the sector.Further, the total storage capacity of a given memory or the particular division ofthe sectors of a given memory (i.e. their number and their size) can also contributeto prolonging the time needed to identify the blank sectors.Summary of the invention

[0012] The invention aims to alleviate the aforementioned drawbacks of the priorart by providing a method which makes it possible to simply and quickly write, toa register of a microcontroller, information allowing the state, blank or otherwise,of various sectors of a matrix of memory cells of a non-volatile memory of saidmicrocontroller to be known. In particular, the invention starts from the observationmade by the inventors that a memory cell (i.e. a bit) of the register can be associatedwith each sector of the non-volatile memory so as to reflect the state of the sector,that is to say the fact that it is written or erased. In addition, advantageously, writingto the register can be concurrent with each operation of writing or erasing a sector.Thus, the invention therefore intrinsically comprises dynamically updating theregister so as to reflect the actual state, blank or otherwise, of the sectors at a giveninstant. Lastly, reading the register so as to identify the blank sectors of a matrix ofmemory cells of a non-volatile memory is a much faster operation than theprocesses for performing such an identification according to the known approacheswhich were presented and discussed above.

[0013] To this end, a first aspect of the invention provides a method for managinga non-volatile and rewritable memory of a microcontroller, said memorycomprising a matrix of memory cells which is organized into a plurality of sectorseach comprising a plurality of memory cells, and further comprising a controlmodule suitable for managing said matrix of memory cells being and comprisingan interface module configured to receive commands to write, read or erase data toor from the memory, to interpret said received commands and to perform operationscorresponding to said received commands on certain memory cells of the nonvolatilememory, said method comprising the following steps, carried out by theinterface module in response to receiving a command to write data to at least onememory cell of a certain sector of the matrix of memory cells, or a command toerase said certain sector:

[0014] - performing the write operation or the erase operation corresponding tothe write command or to the erase command, respectively, on the one hand; and

[0015] - writing, to a memory cell of a register of the microcontroller, which isassociated with the certain sector, information representative of the non-blank stateor of the blank state, respectively, of the memory cells of said certain sector, on theother hand.

[0016] Some implementations taken individually or in combination furtheranticipate that:

[0017] - the non-volatile memory further comprises a plurality of memory banks,each memory bank comprising a local matrix of memory cells and a local controlmodule which is configured to receive commands from the control module of thenon-volatile memory and to perform, on certain memory cells of the memory bank,operations associated with said received commands;

[0018] - the method further comprises, in response to the interface modulereceiving a request to detect the blank sectors of the matrix of memory cells:

[0019] - reading, from the register of the microcontroller, the informationrepresentative of the blank state or of the non-blank state of the memory cells of thesectors of the matrix of memory cells; and / or

[0020] - the method comprises reading the memory cells of the register of themicrocontroller which are respectively associated with the sectors of the memory,using a binary mask.

[0021] In a second aspect, another subject of the invention is a non-volatilememory suitable for storing data which can be written, read and erased by aprocessor of a microcontroller, said non-volatile memory comprising a matrix ofmemory cells and a control module, said matrix of memory cells being organizedinto a plurality of sectors each comprising a plurality of memory cells, said controlmodule comprising an interface module suitable for implementing all the steps ofthe method according to the first aspect.

[0022] Some embodiments taken individually or in combination also anticipatethat:

[0023] - the non-volatile memory is a memory of flash type; and / or

[0024] - the interface module of the control module of the non-volatile memory isa module of flash standard interface (FSI) type.

[0025] In a third aspect, another subject of the invention is a microcontrollercomprising a processor, at least one input / output interface and a non-volatilememory which is suitable for storing data and exchanging data with the processorvia a computer bus, said non-volatile memory comprising a matrix of memory cellsand a control module, said matrix of memory cells comprising a plurality of sectorsrespectively composed of a plurality of memory cells, said control modulecomprising an interface module suitable for implementing all the steps of themethod according to the first aspect.Description of the drawings

[0026] Other features and advantages of the invention will become more apparenton reading the description which follows. This description is purely illustrative andmust be read with reference to the attached drawings, in which:

[0027] [Fig. 1] is a schematic representation of a microcontroller according to oneembodiment of the invention;

[0028] [Fig. 2] is a schematic representation of a non-volatile memory accordingto one embodiment of the invention;

[0029] [Fig. 3] is a schematic representation of a register of a microcontrolleraccording to one embodiment of the invention; and

[0030] [Fig. 4] is a diagram of steps of one implementation of the methodaccording to the invention.Description of the embodiments

[0031] In the description of embodiments which follows and in the figures of theattached drawings, the same elements or similar elements bear the same referencenumbers in the drawings.

[0032] Although the applications of the invention are not limited to this type ofmemory, embodiments will be described in the context of the application to a flashmemory. Flash memory is a rewritable semiconductor mass memory, that is to saya memory possessing the features of a random-access memory but which, unlike arandom-access memory, is suitable for retaining the recorded data even when it isno longer supplied with power. From the functional point of view, a flash memorystores, in memory cells, the bits of data which are retained when the power supplyis interrupted.

[0033] From the point of view of technology, a flash memory is based onEEPROM (electrically erasable programmable read-only memory) chips. As itsbasic cell it uses a MOS transistor possessing a floating gate buried in the gate oxide,between the channel and the gate, and the information is stored in a non-volatilemanner by virtue of electrons being trapped in this floating gate. Data are writtento and erased from a flash memory (the term "programming" is used) by applyingvarious voltages at the input points of the cell, these voltages being higher than thevoltages needed for a simple read operation. A flash memory is therefore aparticular type of EEPROM. Data are generally erased and written in blocks. Lastly,data need to be erased before new data can be written.

[0034] Figure 1 shows an example of a microcontroller which comprises a nonvolatilememory to which the method according to the invention can be applied.

[0035] The microcontroller 101 comprises a processor 102, a non-volatilememory 103, a volatile memory 104, an oscillator 105 and input / output interfaces107a, 107b, 107c and 107d. Further, the microcontroller also comprises one or moreperipheral components 106 such as, for example, an analogue-to-digital converteror a bus controller. Specifically, the various components of the microcontrollerexchange data in the form of binary signals via a computer bus which connects them,but can also receive and / or generate analogue electrical signals from sensors and / orintended for circuits to be controlled. As has already been mentioned above, such amicrocontroller can be integrated into any embedded electronic system, for whichit then acts as a control unit for managing a certain function.

[0036] It will be recalled, as is known per se, that the processor 102 can carry outa user program which is stored in the non-volatile memory 103 of themicrocontroller 101. The volatile memory 104 is, for its part, used to store data andvariables which are useful to the operation of the microcontroller but which are lostwhen the latter is no longer supplied with power. The oscillator 105 is used to clockall the operations performed by the components of the microcontroller. It can be,for example, an RC circuit. Lastly, the input / output interfaces, as their nameindicates, can be connected to other electronic components or circuits of anembedded system with which the microcontroller interacts.

[0037] With reference to figure 2, one embodiment of a non-volatile andrewritable memory to which the method according to the invention can be appliedwill now be described in more detail. As previously indicated, the memory underconsideration here is a memory of flash type, but a person skilled in the art willappreciate that the invention is not limited to this type of memory.

[0038] Advantageously, a flash memory offers a high access speed, a long lifetimeand low electricity consumption. This is why it is used extensively, particularly inmicrocontrollers used in motor vehicle applications.

[0039] The non-volatile and rewritable memory 103 comprises a matrix 201 ofmemory cells (an array) and a control module 202. The matrix 201 of memory cellscomprises a plurality of sectors each composed of a plurality of memory cells. Itwill be recalled that a memory cell is the fundamental unit for storing data in amemory. In particular, each memory cell stores a binary information bit in the formof a "0" or of a "1". A person skilled in the art will appreciate that the methodaccording to the invention is applicable to a non-volatile memory whatever the size(i.e. the total storage space) of said memory, the number of sectors which its matrixof memory cells comprises or the respective sizes of its various sectors.

[0040] The control module 202 manages access to and the operation of thememory as a whole. More specifically, the control module 202 comprises aninterface module 203 which is configured to receive commands, for example viathe computer bus 206 of the microcontroller, to interpret said commands and toperform, on certain memory cells of the non-volatile memory, certain operationswhich correspond to said received commands. The operations in question can be,for example, operations of writing, reading, erasing or indeed checking memorycells of the matrix. What is meant by "checking" is, more specifically, checking thestate, blank or otherwise, of the memory cells of the memory. Further, in oneparticular embodiment, the interface module 203 can also interact with a code errorcorrection module 204 which allows the errors connected with the possiblecorruption of data contained in the memory to be corrected. Lastly, the interfacemodule 203 also accesses a state register 205 (or flag register) of the microcontrollerin which it can write and erase memory cells. The state register 205 is a dedicatedportion of the non-volatile memory which is not integrated into the matrix 201 ofmemory cells. As is known per se, the state register is therefore a very quicklyaccessible memory used, inter alia, to store information in relation to the state ofthe non-volatile memory or with the operations performed on said non-volatilememory. Of course, the microcontroller can comprise other state registers (whichare not shown) like the register 205, which are suitable for being used in the contextof managing other functionalities of the microcontroller.

[0041] Figure 3 shows a schematic representation of a state register 205 of amicrocontroller according to one embodiment of the invention. More particularly,figure 3 shows a state register 205 with three subsets 301, 302 and 303 of memorycells of 32 bits each, which are respectively used to store specific information inrelation, for example, to identifying the non-volatile memory or with the status ofthe non-volatile memory. The method according to the invention, as will bedescribed below, consists in using some of these memory cells of the state register205 to store information which reflects the state of certain sectors of the matrix ofmemory cells of the non-volatile memory. The state of a certain sector can be blank(that is to say that the sector has never had data written to it, or indeed that datawhich had been written to it have subsequently been erased by an erase operation)or non-blank (that is to say that useful data have been written to the sector and arestill stored there). In other words, the state of a certain bit of the state register isdirectly associated with the state, blank or otherwise, of the memory cells of acertain sector. In particular, depending on whether the value of the bit in questionis 0 or 1, the corresponding certain sector is blank or written, or vice versa.

[0042] Returning to figure 2, a person skilled in the art will appreciate that, in oneparticular embodiment, a non-volatile memory can comprise a plurality of memorybanks. Each memory bank can be accessed in the same way by the processor of themicrocontroller via a computer bus and integrates elements which are substantiallyidentical to those contained in a non-volatile memory as was described above withreference to figure 2. In particular, each memory bank comprises a local matrix ofmemory cells and a local control module which is configured to receive commandsfrom the control module of the non-volatile memory and to perform, on certainmemory cells of the memory bank, operations associated with said receivedcommands. Advantageously, each operation of managing data in the memory canbe performed in parallel on a plurality of memory banks of a single non-volatilememory. Further, in such a configuration, the instructions / commands from the busare first received and interpreted by a single control module of the non-volatilememory which passes them on to the local control modules, specific to each bank,which are in charge of carrying out the associated commands.

[0043] With reference to figure 4, one implementation of the method according tothe invention will now be described. The method can be carried out by the interfacemodule of the control module of the non-volatile memory.

[0044] Step 401 consists in receiving a command PROG_req to program in thememory, which can be a command to write data to at least one memory cell of acertain sector of the matrix of memory cells or a command to erase a certain sectorof the matrix of memory cells. Specifically, it will be recalled that the eraseoperation can bear only on an entire sector whereas the write operation can bear ononly part of a sector, where applicable. Typically, the write resolution, that is to saythe minimum number of memory cells which can be written simultaneously duringa write operation, is 8 bytes. The term "page" is used to denote such a group ofbytes forming a subdivision of a sector of the memory.

[0045] The block 402 of the diagram of steps illustrates the choice made by theinterface module in response to receiving the programming command PROG_reqin step 401, depending on whether the command received in said step is a write orerase command. The first case leads to step 403a of the method being performedand the second to step 403b of the method being performed. A person skilled in theart will appreciate that, whatever the chosen case, step 403 is performedconcurrently with the commanded write or read operation being performed. Inparticular, it is this aspect which allows the state register 205 of the microcontrollerto be dynamically updated and, consequently, the blank or non-blank state of thevarious sectors of the matrix of memory cells of the non-volatile memory to bemonitored over time.

[0046] Thus, in the first case, step 403a consists in writing, to a certain memorycell REGi of the state register 205 of the microcontroller, which memory cell isassociated with the sector thus written, information representative of said certainsector being written (namely the logical value "1" in the example shown). Putdifferently, at the same time as the interface module actually writes all or some ofa certain sector, it also writes a certain bit REGi of the state register 205, which isspecifically associated with this sector, so that this bit represents the written stateof said sector.

[0047] In the second case, step 403b consists in writing, to the certain memorycell REGi of the state register 205 of the microcontroller, which memory cell isassociated with the sector thus erased, information representative of said certainsector being erased (namely the logical value "0" in the example shown). Theinformation reflects the fact that the sector in question is therefore blank, that is tosay the fact that all its memory cells are in the blank state. Put differently, when theinterface module actually erases the whole of a certain sector, it also writes a certainbit REGi of the state register 205, which corresponds specifically to this sector, sothat this bit represents the blank state of said sector.

[0048] In one particular implementation of the method, the method furthercomprises, in response to the interface module receiving a request to detect theblank sectors of the matrix of memory cells, reading the register of themicrocontroller and transmitting information representative of the sectors of thematrix of memory cells being written or erased. These steps allow the various blanksectors of a non-volatile memory to be identified reliably at a given instant.Particularly with a view to programming memory cells of said non-volatile memory.

[0049] Advantageously, the method therefore makes it possible to write theinformation relating to the state of the sectors in a very quickly accessible memoryand to update this information each time the state of the sectors changes. Identifyingthe blank sectors is, as a result, much less resource-intensive, particularly less timeconsuming,than the approaches known until now.

[0050] Further, in one particular implementation of the method, reading eachmemory cell of the register of the microcontroller is respectively associated withthe sectors of the memory, using a binary mask. As is known per se, such a binarymask is a binary sequence intended to indicate the position of the bits which areaffected by a certain operation. A certain logical operation, applied to thecombination of the mask and of the cells of the register, allows only the cells ofinterest to be targeted. Thus, the operation of reading the register of themicrocontroller bears only on a certain portion of the memory cells of said registerwhich are considered useful so as to further reduce the duration of the operation.

[0051] In one particular embodiment of the non-volatile memory, the interfacemodule of the control module of the non-volatile memory can be a module of flashstandard interface (FSI) type, generally present in memories of flash type.Advantageously, such an interface module is a module commonly used to receive,interpret and carry out the commands from the bus of the microcontroller andtherefore does not require anything specific to implement the method in amicrocontroller.

[0052] In the claims, the term "comprise" does not exclude other elements or othersteps. A single processor or a plurality of other units can be used to implement theinvention. The various presented and / or claimed features can advantageously becombined. Their presence in the description or in different dependent claims doesnot exclude this possibility. The reference signs should not be understood aslimiting the scope of the invention.

Claims

1. A method for managing a non-volatile and rewritable memory (103) of a microcontroller (101), said memory comprising a matrix (201) of memory cells which is organized into a plurality of sectors each comprising a plurality of memory cells, and further comprising a control module (202) suitable for managing said matrix of memory cells being and comprising an interface module (203) configured to receive commands to write, read or erase data to or from the memory, to interpret said received commands and to perform operations corresponding to said received commands on certain memory cells of the non-volatile memory, said method comprising the following steps, carried out by the interface module in response to receiving (401) a command to write data to at least one memory cell of a certain sector of the matrix of memory cells, or a command to erase said certain sector: - performing the write operation or the erase operation corresponding to the write command or to the erase command, respectively, on the one hand; and - writing (403), to a memory cell of a register (205) of the microcontroller, which is associated with the certain sector, information representative of the non-blank state or of the blank state, respectively, of the memory cells of said certain sector, on the other hand.

2. The method as claimed in claim 1, wherein the non-volatile memory further comprises a plurality of memory banks, each memory bank comprising a local matrix of memory cells and a local control module which is configured to receive commands from the control module of the non-volatile memory and to perform, on certain memory cells of the memory bank, operations associated with said received commands.

3. The method as claimed in either one of claims 1 and 2, further comprising, in response to the interface module receiving a request to detect the blank sectors of the matrix of memory cells: - reading, from the register of the microcontroller, the information representative of the blank state or of the non-blank state of the memory cells of the sectors of the matrix of memory cells.

4. The method as claimed in claim 3, comprising reading the memory cells of the register of the microcontroller which are respectively associated with the sectors of the memory, using a binary mask.

5. A non-volatile memory (103) suitable for storing data which can be written, read and erased by a processor (102) of a microcontroller (101), said non-volatile memory comprising a matrix (201) of memory cells and a control module (202), said matrix of memory cells being organized into a plurality of sectors each comprising a plurality of memory cells, said control module comprising an interface module (203) suitable for implementing all the steps of the method as claimed in any one of claims 1 to 4.

6. The non-volatile memory as claimed in claim 5, said non-volatile memory being a memory of flash type.

7. The non-volatile memory as claimed in claim 5, wherein the interface module of the control module of the non-volatile memory is a module of flash standard interface (FSI) type.

8. A microcontroller (101) comprising a processor (102), at least one input / output interface (107) and a non-volatile memory (103) which is suitable for storing data and exchanging data with the processor via a computer bus, said nonvolatile memory comprising a matrix of memory cells and a control module, said matrix of memory cells comprising a plurality of sectors respectively composed of a plurality of memory cells, said control module comprising an interface module suitable for implementing all the steps of the method as claimed in any one of claims 1 to 4.