Electronic device
By designing debugging ports, authentication interface circuits and registers in electronic devices, it is possible to securely open access to memories and processing units, solve the challenges of security and access port control in the debugging process in the existing technology, and improve debugging efficiency and Security.
Patent Information
- Application Number
- CN202323263406.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Priority Date
- 2023-11-28
- Filing Date
- 2023-11-30
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2033-11-30
AI Technical Summary
It is difficult for existing electronic devices to safely open access ports to memory and processing units during debugging, resulting in security and technical challenges.
An electronic device is designed, including a debugging port, multiple processing unit access ports, authentication interface circuits and registers. Through these components, authentication and secure access to external devices are achieved, ensuring that the debugging port is only opened after the authentication is passed, using monotonous Counters and acknowledgment registers improve security and communication efficiency.
It achieves securely opening access to memory and processing units during the life of the device, ensuring the protection of sensitive data while improving the efficiency and security of the debugging process.
Smart Images

Figure CN221927109U_ABST
Abstract
Description
[0001] Priority declaration
[0002] This application claims priority to French Patent Application No. 2212575 filed on November 30, 2022 and to U.S. Patent Application No. 18 / 521,480 filed on November 28, 2023, the contents of which are incorporated herein by reference in their entirety to the maximum extent permitted by law. Technical Field
[0003] The present disclosure relates generally to the field of electronic devices such as microcontrollers, and in particular to interface circuits and methods that allow secure access to given functions of electronic devices, such as debug functions. Background Art
[0004] Electronic devices such as microcontrollers or other types of integrated circuits often include memories that can store sensitive data, such as flash memory, RAM (random access memory) and registers. In addition, processing units such as CPU (central processing unit) of such electronic devices can manipulate sensitive data during processing. Sensitive data is any data that should remain secret, and therefore should not be accessible from outside the device. Such sensitive data can, for example, include encryption keys, passwords, software codes, boot codes, etc. Such electronic devices generally include mechanisms for protecting data stored on the device or otherwise manipulated by the device. For example, one or more access ports are used to store data to the memory when manufacturing the device, and then these access ports are closed to prevent further access to the memory or processing unit during the life of the device. Such access ports can also be used to prevent access to peripheral devices of electronic devices.
[0005] However, it is sometimes desirable for the memory, processing unit, and / or peripherals of an electronic device to become accessible during the life of the device, for example for debugging purposes. In particular, analysis of data stored in the memory and / or registers of the CPU by field application engineers can help identify the source of erroneous behavior. However, there are technical and security challenges in implementing interfaces that allow access ports to be opened to access the memory, processing unit, and / or peripherals during the life of the device. Utility Model Content
[0006] According to one aspect, an electronic device includes: a debug port providing a communication interface for debugging purposes; a first processing unit; a plurality of processing unit access ports coupled to the debug port, a first processing unit access port of the plurality of processing unit access ports being coupled between the debug port and the first processing unit, each of the plurality of processing unit access ports being configured to be in one of an open state and a closed state, the processing unit access port relaying communications to and from the debug port in the open state, and the processing unit access port blocking communications to and from the debug port in the closed state; an authentication interface circuit configured to authenticate an external device; and an additional access port coupled between the debug port and the authentication interface circuit, wherein the additional access port is configured to be in an open state, relaying communications between the debug port and the authentication interface circuit in the open state, the authentication interface circuit including registers, the registers including a status register configured to be readable by an external device via the debug port and the additional access port, the status register being further configured to store an indication of an open state or a closed state of each of the plurality of processing unit access ports.
[0007] According to an embodiment, the registers further comprise a host register configured to be read by the first processing unit and to be written by an external device via the debug port and the further access port.
[0008] According to an embodiment, the registers further comprise device registers configured to be read by an external device via the debug port and the further access port and to be written by the first processing unit.
[0009] According to one embodiment, the register further comprises: a host register configured to be readable by the first processing unit and writable by an external device via the debug port and the further access port; and a confirmation register configured to indicate when at least a portion of the electronic message can be read in the host register and when at least a portion of the electronic message can be read in the device register.
[0010] According to one embodiment, the confirmation register is configured to be read-only to the first processing unit and the external device.
[0011] According to one embodiment, the authentication interface circuit is configured to: detect when at least a portion of an electronic message has been written to a host register and, in response, set a host confirmation bit in a confirmation register; and detect when the first processing unit reads the host register and, in response, reset the host confirmation bit in the confirmation register.
[0012] According to one embodiment, the authentication interface circuit is configured to: detect when at least a portion of an electronic message has been written to a device register and, in response, set a device confirmation bit in the confirmation register; and detect when an external device reads the device register and, in response, reset the device confirmation bit in the confirmation register.
[0013] According to one embodiment, the first processing unit is configured to: read an authentication request from an external device from a host register; authenticate the external device; set at least one of the one or more processing unit access ports to an open state, so that an indication of the state of the one or more processing unit access ports is updated in the status register.
[0014] According to one embodiment, the register also includes: a host register configured to be readable by the first processing unit and writable by an external device via the debug port and the additional access port; and a device register configured to be readable by the external device via the debug port and the additional access port and writable by the first processing unit; the first processing unit is configured to authenticate the external device by: storing an authentication challenge or password request to the device register; reading an authentication certificate or password from the host register; and verifying the certificate or password.
[0015] According to one embodiment, the electronic device further comprises a monotonic counter, wherein the first processing unit is further configured to read an indication of a count value from the certificate, the debug functionality being authorized based on the count value, and wherein the first processing unit is further configured to execute a startup sequence comprising incrementing the monotonic counter, wherein the debug functionality is authorized once the monotonic counter reaches the count value.
[0016] According to one embodiment, the plurality of processing unit access ports are each coupled to an associated processing unit.
[0017] According to one embodiment, the electronic device also includes: a peripheral interface; and a peripheral interface access port coupled between the debug port and the peripheral interface, wherein the peripheral interface access port is configured to be in one of an open state and a closed state, the peripheral interface access port relays communications to and from the debug port in the open state, and the peripheral interface access port blocks communications to and from the debug port in the closed state, wherein the status register is configured to store an indication of the open state or the closed state of the peripheral interface access port.
[0018] According to another aspect, an electronic device includes: a debug port, which provides a communication interface for debugging purposes; a first processing unit; a plurality of processing unit access ports coupled to the debug port, a first processing unit access port of the plurality of processing unit access ports being coupled between the debug port and the first processing unit, each of the plurality of processing unit access ports being configured to be in one of an open state and a closed state, the processing unit access port relaying communications to and from the debug port in the open state, and the processing unit access port blocking communications to and from the debug port in the closed state; an authentication interface circuit configured to authenticate an external device; and an additional access port coupled between the debug port and the authentication interface circuit, the additional access port being configured to be in an open state before releasing a reset state of the electronic device during power-on and during startup when an authentication request is received from an external device, the additional access port being configured to be in an open state, and in the open state relaying communications between the debug port and the authentication interface circuit.
[0019] According to one embodiment, the authentication interface circuit comprises a host register configured to be readable by the first processing unit and to be writable by the external device via the debug port and the further access port.
[0020] According to one embodiment, the authentication interface circuit comprises a device register configured to be readable by the external device via the debug port and the further access port and to be writable by the first processing unit.
[0021] According to one embodiment, the authentication interface circuit further comprises: a host register configured to be readable by the first processing unit and writable by an external device via the debug port and the further access port; and a confirmation register configured to indicate when at least a portion of the electronic message can be read in the host register and when at least a portion of the electronic message can be read in the device register.
[0022] According to one embodiment, the confirmation register is configured to be read-only to the first processing unit and the external device.
[0023] According to one embodiment, the authentication interface circuit is configured to: detect when at least a portion of an electronic message has been written to a host register and, in response, set a host confirmation bit in a confirmation register; and detect when the first processing unit reads the host register and, in response, reset the host confirmation bit in the confirmation register.
[0024] According to one embodiment, the authentication interface circuit is configured to: detect when at least a portion of an electronic message has been written to a device register and, in response, set a device confirmation bit in the confirmation register; and detect when an external device reads the device register and, in response, reset the device confirmation bit in the confirmation register.
[0025] According to one embodiment, the first processing unit is configured to: read an authentication request from an external device from a host register; authenticate the external device; and set at least one of the multiple processing unit access ports to an open state, so that an indication of the state of the multiple processing unit access ports is updated in a status register of the authentication interface circuit.
[0026] According to one embodiment, the first processing unit is configured to authenticate the external device by: storing an authentication challenge or password request to a device register; reading an authentication certificate or password from a host register; and verifying the authentication certificate or password.
[0027] According to one embodiment, the electronic device also includes a monotonic counter, wherein the first processing unit is further configured to read an indication of a count value from the authentication certificate and execute a startup sequence including incrementing the monotonic counter, the debugging functionality being authorized based on the count value, and the debugging functionality being authorized once the monotonic counter reaches the count value.
[0028] According to one embodiment, the plurality of processing unit access ports are each coupled to an associated processing unit.
[0029] According to one embodiment, the electronic device also includes: a peripheral interface; and a peripheral interface access port coupled between the debug port and the peripheral interface, wherein the peripheral interface access port is configured to be in one of an open state and a closed state, the peripheral interface access port relays communications to and from the debug port in the open state, and the peripheral interface access port blocks communications to and from the debug port in the closed state, wherein the status register is configured to store an indication of the open state or the closed state of the peripheral interface access port. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The foregoing features and advantages as well as other features and advantages will be described in detail in the following description of specific embodiments given by way of illustration and not limitation, with reference to the accompanying drawings, in which:
[0031] Figure 1 An electronic device is schematically illustrated;
[0032] Figure 2 More detailed schematic diagram Figure 1 access ports for electronic devices;
[0033] Figure 3 Schematically illustrates Figure 2 a register of an authentication interface circuit of a communication interface; and
[0034] Figure 4is a flow chart illustrating operations in a method of accessing an electronic device for debugging purposes using an external device. DETAILED DESCRIPTION
[0035] Similar features are denoted by similar reference numerals in the various drawings. In particular, common structural and / or functional features between various embodiments may have the same reference numerals and may have exactly the same structure, dimensions, and material properties.
[0036] For the sake of clarity, operations and elements useful for understanding the embodiments described herein have been illustrated and described in detail.For example, debugging techniques for electronic devices using an external debugger are well known in the art and have not been described in detail.
[0037] Unless otherwise indicated, when referring to two elements being connected together, this means a direct connection without any intermediate elements except conductors, and when referring to two elements being coupled together, this means the two elements may be connected or they may be coupled via one or more other elements.
[0038] In the following disclosure, unless otherwise indicated, when referring to absolute position qualifiers (such as terms "front", "back", "up", "down", "left", "right", etc.) or relative position qualifiers (such as terms "above", "below", "higher than", "lower than", etc.) or orientation qualifiers (such as "horizontal", "vertical", etc.), reference is made to the orientation shown in the figure.
[0039] Unless otherwise specified, the expressions "about," "approximately," "substantially," and "around" mean within 10%, and preferably within 5%.
[0040] The term "volatile memory" is used herein to refer to memory devices where the data stored in the memory is only saved while the device is powered on, meaning the data is lost when the power is removed. In contrast, "non-volatile memory" retains its stored data even when the device is powered down.
[0041] Figure 1 An electronic device 100 according to an example embodiment is schematically illustrated. The electronic device 100 is, for example, an integrated circuit. In some embodiments, the electronic device is a microcontroller. The electronic device 100, for example, includes one or more processing units CPU1, CPU2, CPUn, such as a central processing unit (CPU). For example, in some embodiments, the electronic device 100 includes at least two processing units. One of the processing units of the electronic device 100 is, for example, designated as a main processing unit. In the example embodiment described below, the processing unit CPU1 is designated as the main processing unit, but in an alternative embodiment another processing unit may be the main processing unit.
[0042] The processing units CPU1 to CPUn are coupled to a system bus 102, for example, which is further coupled to one or more memory circuits. The memory circuits may include one or more non-volatile memories and / or one or more volatile memories. Figure 1 In the example of the present invention, the memory circuit includes a non-volatile memory 104 (FLASH) (e.g., flash memory) and a volatile memory 106 (RAM) (e.g., random access memory). One or more memory circuits 104, 106 can store, for example, software codes including instructions executed by one or more processing units to implement the functionality of the electronic device 100.
[0043] In some embodiments, the electronic device 100 further includes a monotonic counter 108 (MONOTONIC CNTR). The monotonic counter 108 may be coupled to the bus 102, for example.
[0044] Monotonic counters are known in the art, and examples of such counters are described in the publication "Virtual Monotonic Counters and Count-Limited Objects using a TPM without a Trusted OS" by LFG Sarmenta et al., which is incorporated by reference to the fullest extent permitted by law. This paper describes embodiments of counters implemented by hardware and / or software. The monotonic counter 108 is implemented, for example, by hardware in the form of a digital circuit such as an application specific integrated circuit (ASIC). The monotonic counter 108 is configured to maintain a count value accessible at an output 109 of the counter. At Figure 1 In the example of , the monotonic counter 108 can be coupled to the non-volatile memory 104 .
[0045] After an increment instruction generated, for example, by the main processing unit CPU1, the monotonic counter 108 is configured to irreversibly increase its count value by one or more units, but after each increment, the operation is irreversible. In fact, the monotonic counter 108 is configured so that its count value can only increase and never decrease. Moreover, between two increments, the count value is protected from any modification and therefore cannot be erased or changed. Only an increment instruction allows replacing a current value with a new value that is higher than the current value.
[0046] The monotonic counter 106 is configured so that once an increment instruction is executed, no instruction will allow the counter to return to the previous count value except for a reset of the electronic device 100. In the case where the count value is stored in a volatile manner, the count value is lost each time the electronic device 100 is powered off, and the monotonic counter 108, for example, regenerates the initial count value each time the device 100 is restarted. In the case where the count value is stored in a non-volatile memory, the current count value stored in the non-volatile memory is overwritten by the initial count value each time the device 100 is restarted.
[0047] The electronic device 100 further includes an authentication interface circuit 110 (DBG AUTH hardware interface), which is, for example, a hardware circuit coupled to the bus 102 and configured to allow authentication of an external device ( Figure 1 ), the external device can be connected to the electronic device 100 for debugging purposes.
[0048] The electronic device 100 also includes a debug port 112 (DEBUG PORT), which provides a communication interface for debugging purposes. For example, the debug port 112 is a hardware circuit that includes a data buffer and / or other circuit systems for facilitating data communication between the electronic device 100 and an external device coupled to the debug port 112. For example, the debug port 112 includes a wired communication interface configured to provide wired communication between the electronic device 100 and the external device, and the wired communication interface includes, for example, a socket for receiving a plug of a cable that links the device 100 to the external device. Alternatively, the debug port 112 includes a wireless communication interface for providing wireless communication between the electronic device 100 and the external circuit.
[0049] Debug port 112 is coupled to authentication interface circuit 110 and to each of processing units CPU1 to CPUn, for example, via a dedicated bus 114 that is different from system bus 102 .
[0050] Although Figure 1 Although not shown in the figure, the electronic device 100 may also include one or more peripheral device interface circuits for interfacing with peripheral devices of the device 100. For example, such interface circuits are also coupled to the system bus 102 and may also be accessed by the debug port 112 via the dedicated bus 114.
[0051] Figure 2 Schematically illustrates an exemplary embodiment of the present disclosure Figure 1 Access ports AP0 to APn of the electronic device 100.
[0052] In particular, the debug port 112 is coupled to each of the processing units CPU1 to CPUn via, for example, a dedicated bus 114 and via corresponding access ports AP1 to APn. These access ports will also be referred to herein as processing unit access ports, and each can be in an open and closed state. Furthermore, in the case where the electronic device 100 includes one or more peripheral device interface circuits, the debug port 112 is coupled to each interface circuit, for example, via the dedicated bus 114 and via corresponding peripheral interface access ports (not shown) similar to the access ports AP1 to APn. In the following, what is described with respect to the processing unit access ports applies similarly (e.g., mutatis mutandis) to the peripheral interface access ports.
[0053] When in an open state, each access port relays communications to and from debug port 112. When in a closed state, the debug port blocks communications to and from debug port 112.
[0054] In addition, the debug port 112 is coupled to, for example, the authentication interface circuit 110 via the dedicated bus 114 and via the access port AP0. The access port AP0 is, for example, configured to be always open during one or more states of the electronic device 100, as will now be defined. For example, when the electronic device 100 is in a state according to which it is powered on but before the reset state of the device is released, and during the startup state in the case where a debug authentication request has been made, the access port AP0 is open, as described in more detail below. In this open state, the access port AP0 is configured to relay communications between the debug port 112 and the authentication interface circuit 110.
[0055] Each of the access ports AP0 to APn is, for example, a hardware circuit including a memory buffer and / or other circuit systems for relaying communications between the debug port and the circuit 110 or the processing units CPU1 to CPUn when in an open state. In the case of the processing unit access ports AP1 to APn, these ports are respectively located between the debug port 112 and the processing units CPU1 to CPUn, and provide the only available communication channel between the debug port 112 and the processing units CPU1 to CPUn. Therefore, when these access ports AP1 to APn are in a closed state, there is no available communication link between the debug port 112 and the processing units CPU1 to CPUn, and thus the processing units CPU1 to CPUn are protected from unauthorized access attempts via the debug port 112.
[0056] The access ports AP0 to APn are controlled to be in an open state or a closed state by, for example, control bits stored in a system control register 201 , which is programmed by, for example, the main processing unit CPU1 .
[0057] like Figure 2 As shown in FIG. 1 , when a debugging process is to be initiated, an external device 200 (EXTERNAL DEVICE) is connected to the debugging port 112 , for example. The external device 200 is, for example, a computer that executes a debugger, which is a software program for debugging the electronic device 100 .
[0058] The authentication interface circuit 110 comprises, for example, registers 202 (host-device registers) that allow communication between an external device 200 (host) and the main processing unit CPU1, as will now be referred to. Figure 3 Described in more detail.
[0059] Figure 3 The exemplary embodiment of the present disclosure is schematically illustrated in more detail. Figure 2 The host-device register 202 of the authentication interface circuit 110.
[0060] The register 202 is, for example, a volatile register.
[0061] Registers 202 include, for example, a status register (DBG_AUTH status register [31:0]) 302, which is configured to store an indication of an open state or a closed state of each access port of the storage device (such as processing unit access ports AP1 to APn, and one or more peripheral interface access ports (if present)). Status register 302 can be read by external device 200 via debug port 112 and via access port AP0. In some embodiments, status register 302 is read-only. Figure 3 In the example of , the status register 302 is a 32-bit register, but other sizes are possible in alternative embodiments. Figure 3 In the example embodiment of FIG. 3 , the status register 302 is capable of indicating the status of up to 16 access ports AP0 to AP15, but in alternative embodiments more or fewer access ports may be supported, depending on the size of the status register 302. Figure 3 In the example, the status register 302 stores, for each access port, a first bit AP0P to AP15P indicating whether the corresponding access port AP0 to AP15 exists, and a second bit AP0S to AP15S indicating the current state (in other words, open or closed) of the corresponding access port AP0 to AP15.
[0062] When the electronic device 100 is powered on, the contents of the state register 302 are read from a non-volatile memory (such as a memory card) by a state machine (not shown), for example. Figure 1The security storage device in the memory 104 of the electronic device 100 is loaded. For example, by default, when power is turned on, the access ports AP1 to APn are all set to be closed, and the access port AP0 is set to be open. For example, the open state or closed state of each of the access ports AP0 to APn is directly controlled by the stored state of the electronic device 100 stored in the security storage device.
[0063] The advantage of the status register is that it provides a scalable solution that can support the addition of additional access ports to the system.
[0064] In some embodiments, register 202 further includes a host register 304 (DBG_AUTH host register [31:0]), which allows an external device 200 acting as a host to write to the electronic device 100, for example, to the main processing unit CPU1. Therefore, the host register 304 can be written and read by the external device 200, for example, and can be read by the electronic device 100 (for example, by the main processing unit CPU1). Figure 3 In the example shown, host registers 304 are 32-bit registers, but other sizes are possible in alternative embodiments.
[0065] In some embodiments, registers 202 also include a device register 306 (DBG_AUTH device register [31:0]) that allows electronic device 100 (e.g., main processing unit CPU1) to write to external device 200. Therefore, device register 306 can be read by external device 200 via debug port 112 and access port AP0, for example, and can be written to and read from electronic device 100 by main processing unit CPU1, for example. Figure 3 In the example shown, device registers 306 are 32-bit registers, but other sizes are possible in alternative embodiments.
[0066] The host and device registers 304, 306 are configured, for example, to function as single-word receive / transmit depth FIFO (first-in, first-out) buffers. In particular, data messages larger than the size of either register can be transmitted, for example, one word at a time via registers 304, 306, and read one word at a time until the entire message has been transmitted.
[0067] In some embodiments, registers 202 also include an acknowledgement register 308 (DBG_AUTH acknowledgement register [1:0]) for indicating when at least a portion of the electronic message can be read in host registers 304 and when at least a portion of the electronic message can be read in device registers 306.
[0068] The acknowledge register 308 is, for example, read-only for the processing unit CPU1 and for the external device 200. In some embodiments, the acknowledge register 308 stores a host acknowledge bit HOST_ACK and a device acknowledge bit DEV_ACK.
[0069] For example, the authentication interface circuit 110 is configured to detect when at least part of the electronic message has been written to the host register 304, and in response, set the host confirmation bit HOST_ACK in the confirmation register 308. The main processing unit is configured to poll the host confirmation bit HOST_ACK, and in response to the host confirmation bit HOST_ACK being set, read the host register 304. The authentication interface circuit 110 is also configured to detect when the electronic device (e.g., the main processing unit CPU1) reads the host register 304, and in response, reset the host confirmation bit HOST_ACK in the confirmation register 308.
[0070] For example, the authentication interface circuit 110 is further configured to detect when at least a portion of the electronic message has been written to the device register 306, and in response, set the device acknowledgement bit DEV_ACK in the acknowledgement register 308. The external device 200 is, for example, configured to poll the device acknowledgement bit DEV_ACK, and in response to the device acknowledgement bit DEV_ACK being set, read at least one device register 306. The authentication interface circuit 110 is, for example, further configured to detect when the external device reads the electronic message from the device register 306, and in response, reset the device acknowledgement bit DEV_ACK in the acknowledgement register 308.
[0071] A technical advantage of the dedicated acknowledgement register 308 is that it results in improved communication bandwidth between the external device 200 and the main processing unit CPU1, as data messages or frames can flow in parallel in both directions. A technical effect of the acknowledgement register being read-only is that this improves security.
[0072] Furthermore, a technical advantage of providing both device and host registers is that they speed up the debug authentication process because the device or host does not need to wait for a read confirmation before transmitting in the other direction.
[0073] Figure 4 is a flowchart illustrating operations in a method of accessing an electronic device 100 for debugging purposes using an external device 200 according to an example embodiment of the present disclosure.
[0074] In operation 401 (Connect Debugger), the external device 200 is connected to the debug port 112 of the electronic device 100, for example, via a wired or wireless link.
[0075] In operation 402 (detecting debug is turned off under reset), the external device 200 is configured, under the control of the debugger, to detect that the debug function of the electronic device 100 is turned off, for example, by reading the status register 302 and determining that one or more of the access ports AP1 to APn via which debugging is to be performed is turned off. This operation is performed, for example, when the external device 200 applies a reset command to the electronic device 100, for example, via a reset pin of the electronic device 100.
[0076] In operation 403 (write authentication request to host register + release reset), the external circuit 200 is configured, for example, under the control of the debugger, to write the authentication request to the host register 304 and then release the reset of the electronic device 100. In response, the authentication interface circuit 110 is configured, for example, to set the ACK_HOST bit in the confirmation register 308.
[0077] In operation 404 (main CPU startup + read host register), the main processing unit CPU1 is configured to start and read the authentication request in the host register 304, for example, after detecting that the ACK_HOST bit in the confirmation register 308 is set. This, for example, enables the main processing unit to maintain the open state of the access port AP0 during startup. In response, the authentication interface circuit 110 is configured to reset the ACK_HOST bit in the confirmation register 308.
[0078] In operation 405 (Host CPU writes authentication challenge to device register and debugger reads device register), the main processing unit CPU1 is, for example, configured to write the authentication challenge to the device register 306. In response, the authentication interface circuit 110 is, for example, configured to set the ACK_DEV bit in the confirmation register 308. Then, under the control of the debugger, the external device 200 is, for example, configured to read the authentication challenge in the device register 306, for example after detecting that the ACK_DEV bit in the confirmation register 308 is set. In response, the authentication interface circuit 110 is, for example, configured to reset the ACK_DEV bit in the confirmation register 308. Of course, if the size of the challenge exceeds the size of the device register 306, it is transmitted to the external circuit 200 over several write / read cycles, for example, by the main processing unit, until it is completely sent.
[0079] In operation 406 (debugger stores certificate in host register), the external circuit 200 is configured, for example, under the control of the debugger, to generate an authentication certificate based on the challenge and store the certificate in the host register 304. In response, the authentication interface circuit 110 is configured, for example, to set the ACK_HOST bit in the confirmation register 308. The main processing unit CPU1 is then configured, for example, to read the host register 304, for example, after detecting that the ACK_HOST bit in the confirmation register 308 is set. In response, the authentication interface circuit 110 is configured, for example, to reset the ACK_HOST bit in the confirmation register 308. Of course, if the size of the certificate exceeds the size of the host register 306, it is transferred to the main processing unit CPU1, for example, by the external device 200 over several write / read cycles until it is completely sent.
[0080] In operation 407 (main CPU verifies certificate + unlocks AP), the main processing unit CPU1 is configured to verify the certificate, and if verified, unlocks one or more of the processing unit access ports AP1 to APn based on the credentials indicated by the certificate and thus sets to an open state. In other words, debugging is turned on for all or for selected processing unit access ports AP1 to APN. This is done, for example, by the main processing unit CPU1 sending a command to the processing unit. Figure 2 This is accomplished by writing to one or more system control registers 201. For example, each processing device access port has its own dedicated control bit in the system control register 201.
[0081] In some embodiments, the credentials indicated in the certificate also indicate the level of debugging allowed, such as indicating whether all firmware can be debugged, or only non-secure firmware can be debugged.
[0082] Furthermore, in some embodiments, the main processing unit CPU1 is configured to set the Figure 1The count value of the monotonic counter 108 of the embodiment of the present invention is determined, according to which the debugging functionality is authorized. This count value is stored, for example, as a parameter in the non-volatile memory 104. Then, when the main processing unit CPU1 is next configured to execute a startup sequence involving an increment of the monotonic counter 108, the debugging functionality is authorized as soon as the monotonic counter reaches the determined count value. For example, the startup sequence comprises two or more stages, each stage being associated with a corresponding software code, which is executed in sequence. The software code for each stage is associated with a corresponding count value, which means that once the monotonic counter 108 exceeds this count value, the non-volatile memory 104 is configured to no longer allow access to the code. The use of the monotonic counter 108 for controlling secure debugging during the startup sequence is described in more detail, for example, in European patent application EP04068134, the content of which is incorporated herein by reference to the maximum extent permitted by law.
[0083] In case the main processing unit CPU1 fails to verify the certificate in operation 407 (for example, because the certificate is false), the main processing unit is configured to maintain the processing unit access ports AP1 to APn in a closed state and notify the external device, for example, via the device register 306.
[0084] In operation 408 (main CPU sends authentication validity message to debugger + waits for authentication ACK), main processing unit CPU1 stores authorization validity message to device register 306, which is read by external device 200 under the control of debugger. Main processing unit CPU1 then waits for confirmation from external device 200, for example.
[0085] In operation 409 (debugger configures debug peripheral device + makes CPU suspend request + sends authentication ACK), the external device 200 configures the debug peripheral device under the control of the debugger, for example, via the access port, and then issues a CPU suspend request, for example, to the main processing unit and / or another processing unit. For example, when the access port AP1 is in the open state, the CPU associated with the main processing unit Figure 2 The system control registers 201 are accessible so that the debugger can make a CPU halt request via these registers. For example, if this halt request corresponds to a start level corresponding to a count value of a monotonic counter that is equal to or greater than an authorized count value, then this halt request will only be allowed by the main processing unit CPU1. The external device 200 also sends an authentication confirmation to the main processing unit CPU1, for example via the host registers 304, under the control of the debugger.
[0086] In operation 410 (main CPU turns on debugging), the main processing unit CPU1 is configured to fully turn on debugging of the processing unit access port covered by the certificate, for example by writing Figure 2 For example, fully opening debugging means that a debugger of the external device 200 can access the system control registers of the associated processing unit, such as registers 201 in the case of the main processing unit.
[0087] In some embodiments, initiating Figure 1 The method for debugging the electronic device 100 includes: after coupling the external device 200 to the debug port 112, the external device 200 reads the status of each of the processing unit access ports AP0 to APn stored in the status register 302 via the debug port 112 and another access port AP0; and the external device initiates debugging of one or more processing units in an open state.
[0088] An advantage of the embodiments described herein is that they provide a technical effect of allowing an external device (such as a computer) running a debugger to communicate with an electronic device in a secure manner to identify the debugging state of the electronic device, and in some cases obtain a unique identifier of the electronic device 100, which is stored, for example, in a non-volatile memory (such as memory 104), and / or issue credentials for reopening debugging on the electronic device.
[0089] Various embodiments and variations have been described. Those skilled in the art will appreciate that certain features of these embodiments may be combined, and those skilled in the art will readily recognize other variations. For example, it will be apparent to those skilled in the art that in some embodiments, Figure 3 Only one or some of the registers 302, 304, 306 and 308 may be present in the authentication interface circuit 110. Furthermore, although an embodiment has been described in which authentication is based on a challenge and response certificate, in an alternative embodiment, rather than a challenge, a password request is set by the main processing unit to the external device, and the external device responds with a password rather than a certificate, which is then verified by the main processing unit.
[0090] An embodiment of the present disclosure also includes a method for initiating debugging of the above-mentioned electronic device, comprising: reading, by an external device via a debugging port and another access port, the status of each processing unit access port stored by a status register; and initiating, by the external device, debugging of one or more of the processing units in an open state.
[0091] Embodiments of the present disclosure also include a method for managing communications in an electronic device, the method comprising: providing a communication interface for debugging purposes via a debug port; coupling a first processing unit to the debug port via a first processing unit access port among a plurality of processing unit access ports; selectively setting each of the plurality of processing unit access ports to one of: an open state, in which communications to and from the debug port are relayed; and a closed state, in which communications to and from the debug port are blocked; using an authentication interface circuit to authenticate an external device; coupling the debug port to the authentication interface circuit via an additional access port, wherein in the open state, communications are relayed between the debug port and the authentication interface circuit; reading a status register in the authentication interface circuit by an external device via the debug port and the additional access port; storing an indication of an open state or a closed state of each of the plurality of processing unit access ports in a status register; reading a status of each of the plurality of processing unit access ports stored by the status register by an external device via the debug port and the additional access port; and initiating debugging of one or more of the plurality of processing unit access ports that are in an open state by an external device.
[0092] For example, the method further includes: reading a device register in the authentication interface circuit by an external device via the debug port and the additional access port; and writing the device register by the first processing unit.
[0093] For example, the method further comprises: reading a host register in the authentication interface circuit by the first processing unit; writing the host register by an external device via the debug port and the further access port; indicating the availability of electronic messages in the host register and the device register via the confirmation register.
[0094] For example, the confirmation register is accessed by the first processing unit and the external device in a read-only mode.
[0095] For example, the method further includes: detecting, by the authentication interface circuit, an electronic message written in the host register; setting a host confirmation bit in the confirmation register; and resetting the host confirmation bit when the host register is read by the first processing unit or an external device.
[0096] For example, the method also includes: reading an authentication request from a host register by the first processing unit; authenticating an external device; setting at least one of the multiple processing unit access ports to an open state, thereby updating an indication of the state of the multiple processing unit access ports in a status register; storing an authentication challenge or password request in a device register by the first processing unit; reading an authentication certificate or password from a host register; verifying the authentication certificate or password; reading a count value from the authentication certificate by the first processing unit, and debugging functionality is authorized based on the count value; and executing a startup sequence including incrementing a monotonic counter, wherein debugging functionality is authorized once the monotonic counter reaches the count value.
[0097] Embodiments of the present disclosure also include a non-transitory computer-readable medium storing a program, which, when executed by a processor or a computing system in an external device, causes the external device to perform the method defined above.
[0098] The non-transitory computer readable medium may have similar features and advantages as those set forth with respect to the related method and the related apparatus.
[0099] Finally, actual implementation of the embodiments and variations described herein is well within the capabilities of those skilled in the art, based on the functional description provided above.
Claims
1. An electronic device, It is characterized in that The electronic device comprises: Debug port, which provides a communication interface for debugging purposes; a first processing unit; a plurality of processing unit access ports coupled to the debug port, a first processing unit access port of the plurality of processing unit access ports coupled between the debug port and the first processing unit, each of the plurality of processing unit access ports being configured to be in one of an open state and a closed state, the processing unit access port relaying communications to and from the debug port in the open state and the processing unit access port blocking communications to and from the debug port in the closed state; an authentication interface circuit configured to authenticate an external device; and An additional access port is coupled between the debug port and the authentication interface circuit, the additional access port is configured to be in an open state, and in the open state relays communication between the debug port and the authentication interface circuit, the authentication interface circuit includes registers, the registers include a status register configured to be readable by an external device via the debug port and the additional access port, the status register is also configured to store an indication of the open state or closed state of each of the multiple processing unit access ports. 2 . The electronic device of claim 1 , wherein the registers further comprise host registers configured to be readable by the first processing unit and writable by an external device via a debug port and the further access port. 3 . The electronic device of claim 1 , wherein the register further comprises a device register configured to be readable by an external device via a debug port and the further access port and to be writable by the first processing unit.
4. The electronic device as claimed in claim 3, wherein the register further include: a host register configured to be readable by the first processing unit and writable by an external device via the debug port and the further access port; as well as An acknowledgement register is configured to indicate when at least a portion of the electronic message can be read in the host register and when at least a portion of the electronic message can be read in the device register. 5 . The electronic device of claim 4 , wherein the confirmation register is configured to be read-only for the first processing unit and the external device.
6. The electronic device of claim 4, wherein the authentication interface circuit is configured to: detecting when at least a portion of an electronic message has been written to a host register and, in response, setting a host acknowledgement bit in an acknowledgement register; and A first processing unit is detected when it reads a host register and, in response, resets a host acknowledge bit in an acknowledge register.
7. The electronic device of claim 4, wherein the authentication interface circuit is configured to: detecting when at least a portion of the electronic message has been written to a device register and, in response, setting a device acknowledgement bit in an acknowledgement register; and Detects when an external device reads a device register and, in response, resets the device acknowledge bit in the acknowledge register.
8. The electronic device of claim 4, wherein the first processing unit is configured to: Read the authentication request from the external device from the host register; Authentication of external devices; as well as At least one of the plurality of processing unit access ports is set to an open state, thereby causing an indication of the state of the plurality of processing unit access ports to be updated in a status register.
9. The electronic device as claimed in claim 8, wherein the register further include: a device register configured to be readable by an external device via the debug port and the further access port and to be writable by the first processing unit; The first processing unit is configured to authenticate the external device by: storing the authentication challenge or password request in a device register; Reading authentication credentials or passwords from host registers; and Verify authentication credentials or password.
10. The electronic device of claim 9 further comprising a monotonic counter, wherein the first processing unit is further configured to read an indication of a count value from the authentication certificate and execute a startup sequence comprising incrementing the monotonic counter, the debug functionality being authorized based on the count value, the debug functionality being authorized once the monotonic counter reaches the count value.
11. The electronic device of claim 1, wherein the plurality of processing unit access ports are each coupled to an associated processing unit.
12. The electronic device according to claim 1, further comprising: include: Peripheral interfaces; as well as A peripheral interface access port is coupled between the debug port and the peripheral interface, the peripheral interface access port is configured to be in one of an open state and a closed state, the peripheral interface access port relays communications to and from the debug port in the open state, and the peripheral interface access port blocks communications to and from the debug port in the closed state, wherein the status register is configured to store an indication of the open state or the closed state of the peripheral interface access port.
13. An electronic device, It is characterized in that The electronic device comprises: Debug port, which provides a communication interface for debugging purposes; a first processing unit; a plurality of processing unit access ports coupled to the debug port, a first processing unit access port of the plurality of processing unit access ports coupled between the debug port and the first processing unit, each of the plurality of processing unit access ports being configured to be in one of an open state and a closed state, the processing unit access port relaying communications to and from the debug port in the open state and the processing unit access port blocking communications to and from the debug port in the closed state; an authentication interface circuit configured to authenticate an external device; and An additional access port is coupled between the debug port and the authentication interface circuit. The additional access port is configured to be in an open state before releasing the reset state of the electronic device during power-on and during startup when an authentication request is received from an external device, and in the open state, relays communication between the debug port and the authentication interface circuit.
14. An electronic device as claimed in claim 13, wherein the authentication interface circuit comprises a host register configured to be readable by the first processing unit and writable by the external device via the debug port and the further access port.
15. The electronic device of claim 13, wherein the authentication interface circuit comprises a device register configured to be readable by an external device via the debug port and the further access port and to be writable by the first processing unit.
16. The electronic device of claim 15, wherein the authentication interface circuit further include: a host register configured to be readable by the first processing unit and writable by an external device via the debug port and the further access port; as well as An acknowledgement register is configured to indicate when at least a portion of the electronic message can be read in the host register and when at least a portion of the electronic message can be read in the device register. 17 . The electronic device of claim 16 , wherein the confirmation register is configured to be read-only to the first processing unit and the external device.
18. The electronic device of claim 16, wherein the authentication interface circuit is configured to: detecting when at least a portion of an electronic message has been written to a host register and, in response, setting a host acknowledgement bit in an acknowledgement register; and A first processing unit is detected when it reads a host register and, in response, resets a host acknowledge bit in an acknowledge register.
19. The electronic device of claim 16, wherein the authentication interface circuit is configured to: detecting when at least a portion of the electronic message has been written to a device register and, in response, setting a device acknowledgement bit in an acknowledgement register; and Detects when an external device reads a device register and, in response, resets the device acknowledge bit in the acknowledge register.
20. The electronic device of claim 16, wherein the first processing unit is configured to: Read the authentication request from the external device from the host register; Authentication of external devices; as well as At least one of the plurality of processing unit access ports is set to an open state, thereby causing an indication of the state of the plurality of processing unit access ports to be updated in a state register of the authentication interface circuit.
21. The electronic device of claim 20, wherein the first processing unit is configured to authenticate the external device by: storing the authentication challenge or password request in a device register; Reading authentication credentials or passwords from host registers; and Verify authentication credentials or password.
22. The electronic device of claim 21 further comprising a monotonic counter, wherein the first processing unit is further configured to read an indication of a count value from an authentication certificate and execute a startup sequence comprising incrementing the monotonic counter, the debugging functionality being authorized based on the count value, the debugging functionality being authorized once the monotonic counter reaches the count value.
23. The electronic device of claim 13, wherein the plurality of processing unit access ports are each coupled to an associated processing unit.
24. The electronic device according to claim 13, further comprising: include: Peripheral interfaces; as well as A peripheral interface access port is coupled between the debug port and the peripheral interface, wherein the peripheral interface access port is configured to be in one of an open state and a closed state, wherein the peripheral interface access port relays communications to and from the debug port in the open state and blocks communications to and from the debug port in the closed state, wherein the status register is configured to store an indication of the open state or the closed state of the peripheral interface access port.
