Host device interface for debugging authentication

The described electronic device facilitates secure debugging by using a debug port, authentication interface, and registers to manage access and authentication, addressing the challenge of secure access to sensitive data during debugging.

FR3142576B1Active Publication Date: 2024-11-01STMICROELECTRONICS INT NV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
FR2022012575
Authority / Receiving Office
FR · FR
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2024-11-01
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

Existing electronic devices face challenges in securely allowing access to memories, processing units, and peripherals for debugging purposes while preventing unauthorized access during their lifespan.

Method used

An electronic device with a debug port, processing unit access ports, an authentication interface circuit, and additional access ports, along with status and acknowledgment registers, to manage secure communication and authentication for debugging.

Benefits of technology

Enables secure and efficient debugging by authenticating external devices, managing access states, and ensuring only authorized access to sensitive data, enhancing communication bandwidth and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000020_0000
    Figure 00000020_0000
  • Figure 00000020_0001
    Figure 00000020_0001
  • Figure 00000021_0000
    Figure 00000021_0000
Patent Text Reader

Abstract

Host device interface for debug authentication This description relates to an electronic device comprising: a debug port (112) providing a communication interface for debugging purposes; one or more access ports to processing units (AP1, APn); an authentication interface circuit (110) configured to authenticate the external device (200);and an additional access port (AP0) connected between the debug port (112) and the authentication interface circuit (110), the additional access port (AP0) being configured to be in an open state in which communications are relayed between the debug port and the interface authentication circuit (110), the interface authentication circuit (110) comprising registers (202) including a status register (302) which can be read by the external device (200) via the debug port (112) and the additional access port (AP0), the status register being configured to store an indication of the open or closed state of each of the access ports to processing units (AP1, APn). Figure for the abstract: Fig. 2;
Need to check novelty before this filing date? Find Prior Art

Description

Title of the invention: Host device interface for debugging authentication technical field

[0001] This description relates generally to the field of electronic devices such as microcontrollers and, in particular, an interface circuit and a method for securing access to given functions of electronic devices, such as debugging functions. Previous technique

[0002] Electronic devices such as microcontrollers or other types of integrated circuits often include memory, such as Flash memory, RAM (random access memory), and registers, which can store sensitive data. Furthermore, processing units, such as CPUs (central processing units), in such electronic devices can manipulate sensitive data during processing. Sensitive data refers to any data that should remain secret and therefore should not be accessible from outside the device. Sensitive data includes, for example, encryption keys, passwords, software codes, startup codes, or the like.Such electronic devices typically include mechanisms to protect data stored on or otherwise manipulated by the device. For example, data is stored in memory during device manufacturing using one or more access ports, and these access ports are subsequently closed to prevent further access to the memory or processing units during the device's lifetime. Such access ports can also be used to prevent access to peripherals of the electronic device.

[0003] However, it is sometimes desirable for the memory, processing unit, and / or peripheral components of an electronic device to be accessible during the device's lifetime, for example, for debugging purposes. In particular, analysis of data stored in the memory and / or registers of a CPU by a field application engineer can identify the origins of faulty behavior. However, there are technical and security challenges in implementing an interface that allows access ports to be opened to access memory, processing units, and / or peripheral components during the device's lifetime. Summary of the invention

[0004] One aspect provides for an electronic device comprising: a debugging port providing a communication interface for debugging purposes; a first processing unit; one or more processing unit access ports connected to the debug port, the first of the processing unit access ports being connected between the debug port and the first processing unit, each of the one or more processing unit access ports being configured to be in one of two states: an open state in which it relays communications to and from the debug port and a closed state in which it blocks communications to and from the debug port; an authentication interface circuit configured to authenticate an external device;and an additional access port connected between the debug port and the authentication interface circuit, the additional access port being configured to be in an open state in which communications are relayed between the debug port and the interface authentication circuit, the interface authentication circuit comprising registers including a status register which can be read by the external device via the debug port and the additional access port, the status register being configured to store an indication of the open or closed state of each of the access ports to processing units.

[0005] According to one embodiment, the registers further comprise a host register configured to be read by the first processing unit and into which the external device can write via the debug port and the additional access port.

[0006] According to one embodiment, the registers further comprise a device register configured to be read by the external device via the debug port and the additional access port and into which the first processing unit can write.

[0007] According to one embodiment, the registers further comprise an acknowledgment register to indicate a time when at least part of an electronic message is available to be read in the host register and a time when at least part of an electronic message is available to be read in the device register, the acknowledgment register being, for example, read-only for the first processing unit and for the external device.

[0008] According to one embodiment, the authentication interface circuit is configured: to detect when at least part of an email message has been written to the host register, and to set, in response, a host acknowledgment bit in the acknowledgment register; and to detect when the first processing unit reads the host register and, in response, to reset the host acknowledgment bit in the acknowledgment register.

[0009] According to one embodiment, the authentication interface circuit is configured to detect when at least part of an email message has been written in the device register, and to set, in response, a device acknowledgment bit in the acknowledgment register; and to detect when the external device reads the device register and, in response, to reset the device acknowledgment bit in the acknowledgment register.

[0010] According to one embodiment, the first processing unit is configured: to read from the host register an authentication request from the external device; to authenticate the external device; and to set at least one of the one or more processing unit access ports to an open state, thereby causing the indication of the state of the one or more processing unit access ports to be updated in the state register.

[0011] According to one embodiment, the first processing unit is configured to authenticate the external device by: storing a password query or authentication challenge in the device registry; reading a password or authentication certificate from the host registry; and verifying the certificate or password.

[0012] According to one embodiment, the electronic device further includes a monotone counter, the first processing unit being further configured to read from the certificate an indication of a count value from which a debugging functionality is allowed, and the first processing unit is configured to execute a startup sequence including the incrementing of the monotone counter, the debugging functionality being allowed once the monotone counter has reached said count value.

[0013] According to one embodiment, the access ports to processing units are each connected to an associated processing unit.

[0014] According to one embodiment, the electronic device further comprises: a peripheral interface; and a peripheral interface access port connected between the debug port and the peripheral interface, the peripheral interface access port being configured to be in a state between an open state in which it relays communications to and from the debug port and a closed state in which it blocks communications to and from the debug port, wherein the state register is configured to store an indication of the open or closed state of the peripheral interface access port.

[0015] Another aspect provides a method for triggering debugging of the preceding electronic device, comprising: reading, by the external device via the debug port and the additional access port, the state of each of the access ports to processing units stored by the status register; and triggering, by the external device, the debugging of one or more of the units of treatments that are in an open state.

[0016] Another aspect of the present description relates to a non-transient computer-readable medium storing a program which, when executed by a computer system or processor in an external device, causes the external device to implement the process as defined above.

[0017] The non-transient computer-readable medium may have characteristics and advantages that are analogous to those discussed below in relation to the associated method and device. Brief description of the drawings

[0018] These features and advantages, as well as others, will be described in detail in the following description of particular embodiments, given by way of non-limiting example, in relation to the accompanying figures, among which:

[0019] [Fig.1] schematically represents an electronic device according to an example of an embodiment of the present description;

[0020] [Fig.2] schematically represents access ports to the electronic device of [Fig.1] in more detail according to an example of an embodiment of the present description;

[0021] Figure 3 schematically represents registers of an authentication interface circuit of the communication interface of Figure 2 according to an example embodiment of the present description; and

[0022] [Fig.4] is a flowchart representing operations of a method of accessing an electronic device for debugging purposes using an external device according to an example of an embodiment of the present description. Description of the implementation methods

[0023] The same elements have been designated by the same reference numerals in the different figures. In particular, structural and / or functional elements common to the different embodiments may have the same reference numerals and may have identical structural, dimensional and material properties.

[0024] For the sake of clarity, only the steps and elements useful for understanding the described embodiments have been shown and detailed. For example, debugging techniques for electronic devices using an external debugging program are well known in the prior art and have not been described in detail.

[0025] Unless otherwise specified, when referring to two interconnected elements, this means directly connected without any intermediate elements other than conductors, and when referring to two coupled elements, this means that these two elements can be connected or linked by through one or more other elements.

[0026] 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", "superior", "inferior", etc., or to orientation qualifiers, such as the terms "horizontal", "vertical", etc., reference is made, unless otherwise specified, to the orientation of the figures.

[0027] Unless otherwise specified, the expressions "approximately", "roughly", and "in the order of" mean within 10%, preferably within 5%.

[0028] The term "volatile memory" is used here to refer to a memory device in which data stored in the memory is retained only as long as the device is powered, meaning that the data is lost when the power is switched off. In contrast, "non-volatile memory" retains its stored data even when the device is no longer powered.

[0029] Figure 1 schematically represents an electronic device 100 according to an example of an embodiment of this description. The electronic device 100 is, for example, an integrated circuit. In some embodiments, the electronic device is a microcontroller. The electronic device 100 comprises, for example, one or more processing units CPU1, CPU2, CPUn, such as central processing units (CPUs). For example, in some embodiments, the electronic device 100 comprises at least two processing units. One of the processing units of the electronic device 100 is, for example, designated as a master processing unit. In the examples of embodiments in the following description, the processing unit CPU1 is designated as the master processing unit, although in variant embodiments another of the processing units could be the master.

[0030] The CPU1 to CPUn processing units are, for example, connected to a system bus 102, which is further connected to one or more memory circuits. The memory circuits may include one or more non-volatile memories and / or one or more volatile memories. In the example of [Fig. 1], the memory circuits comprise a non-volatile memory 104 (FLASH), which is, for example, flash memory, and a volatile memory 106 (RAM), which is, for example, random access memory. The one or more memory circuits 104, 106 may store, for example, software code comprising instructions that are executed by the one or more processing units in order to implement the functionalities of the electronic device 100.

[0031] In some embodiments, the electronic device 100 further comprises a monotone counter 108 (MONOTONIC CNTR). The monotone counter 108 can be connected, for example, to the bus 102.

[0032] Monotonic counters are known in the prior art, an example of a Such a counter is described in the publication "Virtual Monotony Counters and Count-Limited Objects using a TPM without a Trusted OS" by LFG Sarmenta, M. Van Dijk, CW O'Donnell, J. Rhodes, and S. Devadas, and in particular in Part 3 of this article. This article describes implementations of counters implemented in hardware and / or software. The monotonic counter 108, for example, is implemented in hardware as 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. In the example in [Fig. 1], the monotonic counter 108 can be connected to the non-volatile memory 104.

[0033] After an increment instruction, for example generated by the master 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 not reversible. Indeed, the monotonic counter 108 is configured so that its count value can only increase and can never decrease. Furthermore, between two increments, the count value is protected against any modification, so that it cannot be erased or changed. Only the increment instruction allows the count value to be replaced with a new value that is greater than the current value.

[0034] The monotonic counter 106 is configured so that no instruction, other than a reset of the electronic device 100, allows the counter to revert to a previous count value once the increment instruction is executed. If the count value is stored volatilely, each time the electronic device 100 is powered off, the count value is lost, and each time the device 100 is restarted, the monotonic counter 108 generates, for example, a new initial count value. If the count value is stored in non-volatile memory, at each restart, a current count value stored in the non-volatile memory is, for example, overwritten by the initial count value.

[0035] The electronic device 100 further includes an authentication interface circuit 110 (DBG AUTH HW I / F), which is for example a hardware circuit connected to the bus 102 and configured to allow authentication of an external device (not shown in [Fig.1]), which can be connected to the electronic device 100 for debugging purposes.

[0036] The electronic device 100 further includes a debug port 112 (DEBUG PORT) providing a communication interface for debugging purposes. For example, the debug port 112 is a hardware circuit comprising data buffers and / or other circuitry intended to facilitate data communication between the electronic device 100 and an external device that is connected to the debug port. 112. For example, the debug port 112 includes a wired communications interface configured to provide wired communications between the electronic device 100 and the external device, the wired communications interface including, for example, a socket for receiving a connector for a cable linking the device 100 to the external device. In one variant, the debug port 112 includes a wireless communication interface to provide wireless communications between the electronic device 100 and the external circuit.

[0037] The debug port 112 is for example connected to the authentication interface circuit 110 and to each of the CPU1 to CPUn processing circuits via a dedicated bus 114, different from the system bus 102.

[0038] Although not shown in [Fig.1], the electronic device 100 may further include one or more peripheral device interface circuits for interfacing with peripheral devices of the device 100. For example, such interface circuits are also connected to the system bus 102 and are also accessible via the debug port 112 through the dedicated bus 114.

[0039] Figure 2 schematically represents the access ports AP0 to APn of the device electronic 100 of the [Fig.l] according to an example of an embodiment of the present description.

[0040] In particular, the debug port 112 is connected to each of the CPUs 1 to CPUn via, for example, the dedicated bus 114 and via corresponding API to APn access ports. These access ports will also be referred to herein as CPU access ports and are each capable of being in open and closed states. Furthermore, in the case where the electronic device 100 includes one or more peripheral device interface circuits, the debug port 112 is, for example, connected to each interface circuit via the dedicated bus 114 and via a corresponding peripheral interface access port (not shown) similar to the API to APn access ports. In what follows, what is described with respect to CPU access ports applies, all other things being equal, to peripheral interface access ports.

[0041] When in the open state, each access port relays communications to and from debug port 112. When in the closed state, each access port blocks communications to and from debug port 112.

[0042] Furthermore, the debug port 112 is, for example, connected to the authentication interface circuit 110, for example via the dedicated bis 114 and via an access port AP0. The access port AP0 is, for example, configured to always be open during one or more states of the electronic device 100, as will be defined hereafter. For example, the access port AP0 is open when The electronic device 100 is in a powered-on state, but before triggering a device reset state and during a startup state, in the event that a debug authentication request has been made, as will be described in more detail later. In this open state, the APO access port is configured to relay communications between the debug port 112 and the authentication interface circuit 110.

[0043] Each of the APO to APn access ports is, for example, a hardware circuit comprising memory buffers and / or another circuit for relaying communications, when open, between the debug port and circuit 110 or the CPU 1 to CPUn processing units. In the case of the APO to APn processing unit access ports, these are located between the debug port 112 and the CPU 1 to CPUn processing units respectively, and provide the only available communication channel between the debug port 112 and the CPU 1 to CPUn processing units. Thus, when these APO to APn access ports are closed, no communication link is available between the debug port 112 and the CPU 1 to CPUn processing units, and the CPU 1 to CPUn processing units are thereby protected from unauthorized access attempts via the debug port 112.

[0044] The APO access ports to APn are for example controlled to be in the open or closed state by control bits stored in a system control register 201, which is for example controlled by the master processing unit CPU1.

[0045] As shown in [Fig. 2], an external device 200 is, for example, connected to the debug port 112 when a debugging procedure needs to be initiated. The external device 200 is, for example, a computer running a debugging program, which is a software program used to debug the electronic device 100.

[0046] The authentication interface circuit 110 includes, for example, registers 202 (HOST-DEVICE REGS) which allow communication between the external device 200 (host) and the master processing unit CPU1, as will be described in more detail below in relation to [Fig.3].

[0047] Fig. 3 schematically represents the host device registers 202 of the authentication interface circuit 110 of Fig. 2 in more detail according to an example embodiment of the present description.

[0048] Registers 202 are, for example, all volatile registers.

[0049] Registers 202 include, for example, a status register (DBG_AUTH status) register [31:0]) 302, which is configured to store an indication of the open or closed state of each of the device's access ports, such as the access ports of the APO to APn processing units and one or more access ports of the peripheral interfaces, if present. The status register 302 can be read by the external device 200 by via debug port 112 and via the APO access port. In some embodiments, the status register 302 is read-only. In the example in [Fig. 3], the status register 302 is a 32-bit register, although in variant embodiments other sizes are possible. Furthermore, in the example embodiment of [Fig.3], the status register 302 can indicate the state of up to 16 access ports APO to AP 15, although in variant embodiments more or fewer access ports could be supported, depending on the size of the status register 302. In the example of [Fig.3], the status register 302 stores, for each access port, a first bit AP0P to AP15P indicating whether the corresponding access port APO to AP 15 is present, and a second bit AP0S to AP15S indicating the current state of the corresponding access port APO to AP 15, in other words whether it is open or closed.

[0050] When the electronic device 100 is started, the contents of the status register 302 are, for example, loaded by a state machine (not shown) from secure storage in non-volatile memory, such as memory 104 in [Fig. 1]. For example, by default, at startup, the API access ports to APn are all closed, while the APO port is open. The open or closed state of each of the APO ports to APn is, for example, directly controlled by stored states of the electronic device 100 that are stored in secure storage.

[0051] One advantage of the status register is that it provides a scalable solution capable of supporting the addition of additional access ports to the system.

[0052] In some embodiments, the registers 202 further include a host register 304 (DBG_AUTH host register [31:0]) enabling the external device 200, acting as host, to write to the electronic device 100, for example, to the master processing unit CPU1. Thus, the host register 304 can, for example, be written to and read by the external device 200 and be read by the electronic device 100, for example, by the master processing unit CPU1. In the example in [Fig. 3], the host register 304 is a 32-bit register, although in variant embodiments other sizes are possible.

[0053] In some embodiments, the registers 202 further include a device register 306 (DBG_AUTH device register [31:0]) enabling the electronic device 100, for example the master processing unit CPU1, to write to the external device 200. Thus, the device register 306 can, for example, be read by the external device 200 via the debug port 112 and the access port APO, and be written to or read from by the electronic device 100, for example the master processing unit CPU1. In the example in [Fig. 3], the device register 306 is a 32-bit register, although in variant embodiments it is of other sizes. are possible.

[0054] The host and device registers 304 and 306 are, for example, configured to act as a deep, single-word FIFO (first-in, first-out) receive / transmit buffer. In particular, a data message that is larger than the size of either register can, for example, be transmitted through registers 304 and 306 one word at a time, and read one word at a time, until the entire message has been communicated.

[0055] In some embodiments, the registers 202 further include an acknowledgment register 308 (DBG_AUTH acknowledge register [1:0]) to indicate a time when at least part of an electronic message is available to be read in the host register 304 and a time when at least part of an electronic message is available to be written in the device register 306.

[0056] The acknowledgment register 308 is, for example, read-only for the CPU1 processing unit and for the external device 200. In some embodiments, the acknowledgment register 308 stores a host acknowledgment bit HOST ACK and a device acknowledgment bit DEV_ACK.

[0057] For example, the authentication interface circuit 110 is configured to detect when at least part of an email message has been written to host register 304 and, in response, to set the host acknowledgment bit HOST_ACK in acknowledgment register 308. The master processing unit is, for example, configured to call the host acknowledgment bit HOST_ACK and to read host register 304 in response to the host acknowledgment bit being set. The authentication interface circuit 110 is, for example, further configured to detect when the electronic device, for example, the master processing unit CPU1, reads host register 304 and, in response, to reset the host acknowledgment bit HOST_ACK in acknowledgment register 308.

[0058] For example, the authentication interface circuit 110 is further configured to detect when at least part of an email message has been written to the device register and, in response, to set the device acknowledgment bit DEV_ACK in the acknowledgment register 308. The external device 200 is, for example, configured to call the device acknowledgment bit DEV_ACK and to read at least one register of device 306 in response to the setting of the device acknowledgment bit DEV_ACK. The authentication interface circuit 110 is, for example, further configured to detect when the external device reads the email message from the device register 306 and, in response, to reset the device acknowledgment bit DEV_ACK in the acknowledgment register 308.

[0059] A technical advantage of the dedicated acknowledgment register 308 is that it leads to improved communication bandwidth between the external device 200 and the master processing unit CPU1 because data messages, or frames, can flow in both directions simultaneously in parallel. A technical effect of the fact that the acknowledgment register is read-only is that it increases security.

[0060] In addition, a technical advantage of providing both a device register and a host register is that they speed up the debug authentication process, as it is not necessary for the device or host to wait for a read acknowledgment before transmitting in the other direction.

[0061] The [Fig.4] is a flowchart representing operations of a method of accessing the electronic device 100 for debugging purposes using the external device 200 according to an example of an embodiment of the present description.

[0062] In a 401 (CONNECT DEBUGGER) operation, the external device 200 is for example connected to the debug port 112 of the electronic device 100, for example via a wired or wireless connection.

[0063] In a 402 operation (DETECT UNDER RESET THAT DEBUG CLOSED), the external device 200, controlled by the debugging program, is configured, for example, to detect that the debugging function of the electronic device 100 is closed, for example, by reading the status register 302 and determining that one or more of the API access ports to APn through which debugging is to be performed are in the closed state. For example, this operation is performed while the external device 200 applies a reset command to the electronic device 100, for example, via a reset pin of the electronic device 100.

[0064] In a 403 operation (WRITE AUTH REQUEST TO HOST REG + RELEASE RESET), the external circuit 200, controlled by the debug program, is configured for example to write an authentication request to the host register 304, and then to trigger 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 acknowledgment register 308 to one.

[0065] In a 404 operation (MASTER CPU BOOTS + READS HOST REG), the master CPU 1 is configured, for example, to start up and to read the authentication request from the host register 304, for example, after detecting that the ACK_HOST bit in the acknowledgment register 308 is set to one. This causes, for example, the master CPU to maintain the open state of access port AP0 during startup. In response, the authentication interface circuit 110 is configured, for example, to reset the ACK_HOST bit in the acknowledgment register 308.

[0066] In a 405 operation (MASTER CPU WRITES AUTH CHALLENGE TO DEVICE REG AND DEVICE REG READ BY DEBUGGER), the master CPU 1 is, for example, configured to write an authentication challenge to device register 306. In response, the authentication interface circuit 110 is, for example, configured to set the ACK_DEV bit in the acknowledgment register 308 to 1. The external device 200, controlled by the debugger program, is then, for example, configured to read the authentication challenge from device register 306, for example, after detecting that the ACK_DEV bit in the acknowledgment register 308 is set to 1. In response, the authentication interface circuit 110 is, for example, configured to reset the ACK_DEV bit in the acknowledgment register 308.Of course, if the size of the challenge exceeds the size of the device register 306, it is, for example, communicated by the master processing unit to the external circuit 200 over several write / read cycles until it has been fully sent.

[0067] In a 406 operation (DEBUGGER STORES CERTIFICATE TO HOST REG), the external circuit 200, controlled by the debugging program, is configured, for example, to generate an authentication certificate based on the challenge and to 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 acknowledgment register 308 to high. The master 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 acknowledgment register 308 has been set to high. In response, the authentication interface circuit 110 is configured, for example, to reset the ACK_HOST bit in the acknowledgment register 308.Of course, if the size of the certificate exceeds the size of the host register 306, it is, for example, communicated by the external device 200 to the master processing unit CPU1 over several read / write cycles until it has been fully sent.

[0068] In a 407 operation (MASTER CPU VERIFIES CERTIFICATE + UNLOCKS APs), the master CPU1 is configured, for example, to verify the certificate and, if it is validated, to unlock, and thus open, one or more of the processing unit access ports AP0 to APn based on identifiers specified by the certificate. In other words, debugging is enabled for all processing unit access ports AP0 to APn or for selected ports thereof. For example, this is done by writing, by the master CPU1, to one or more system control registers 201 of [Fig. 2]. For example, each processing unit access port has its own dedicated control bits in the system control registers 201.

[0069] In some embodiments, the identifiers indicated in the certificate They also indicate a level of debugging that is permitted, indicating, for example, whether all firmware can be debugged or only insecure firmware.

[0070] Furthermore, in certain embodiments, the master processing unit CPU1 is configured to set, based on the identifiers indicated by the certificate, a count value for the monotone counter 108 of [Fig. 1] from which debugging functionality is enabled. This count value is, for example, stored as a parameter in non-volatile memory 104. Then, when the master processing unit CPU1 is subsequently configured to execute a boot sequence involving the incrementing of the monotone counter 108, debugging functionality is enabled once the monotone counter has reached the determined count value. For example, the boot sequence comprises two or more steps, each associated with corresponding software code, which is executed sequentially.The software code for each step is associated with a corresponding count value, meaning that once this count value has been exceeded by the monotonic counter 108, the non-volatile memory 104 is configured to prevent further access to the code. The use of a monotonic counter 108 to control safe debugging during a boot sequence is described, for example, in more detail in European patent application EP04068134, the contents of which are incorporated herein by reference to the maximum extent permitted by law.

[0071] In the event that, in operation 407, the verification by the master processing unit CPU 1 of the certificate fails, for example because the certificate is false, the master processing unit is configured for example to keep the access ports to API processing units to APn in the closed state and, for example, to inform the external device via the device register 306.

[0072] In operation 408 (MASTER CPU SENDS AUTH VALIDITY MESSAGE TO DEBUGGER + WAITS FOR AUTH ACK), the master CPU1 processes, for example, stores an authorization validity message in device register 306, which is read by the external device 200, controlled by the debugging program. The master CPU1 processes, for example, then waits for an acknowledgment from the external device 200.

[0073] In operation 409 (DEBUGGER CONFIGURE DEBUG PERIPHERALS + MAKES CPU HALT REQ + SENDS AUTH ACK), the external device 200, controlled by the debugging program, configures, for example, the debugging devices via the access ports, and then sends a CPU stop request, for example, to the master processing unit CPU1 and / or another of the processing units. For example, with the API access port open, the system control registers 201 of the [Fig.2] associated with the master processing unit are accessible, from This allows the debug program to request a CPU shutdown via these registers. For example, this shutdown request will only be permitted by the master CPU 1 if it corresponds to a startup step with a monotonic counter count value equal to or greater than the allowed count value. The external device 200, controlled by the debug program, also sends, for example, an authentication acknowledgment to the master CPU 1 via host register 304.

[0074] In a 410 operation (MASTER CPU OPENS DEBUG), the master CPU 1 is configured, for example, to fully open debugging of the access ports of the processing units covered by the certificate, for example by writing to the system control registers 201 of [Fig. 2], when the appropriate startup execution step is reached. For example, fully opening debugging means that the debugging program of the external device 200 can access the system control registers of the associated processing unit, such as register 201 in the case of the master CPU.

[0075] In some embodiments, a method for triggering debugging of the electronic device 100 of [Fig.1] comprises, after connecting the external device 200 to the debug port 112, reading, by the external device 200 via the debug port 112 and the additional access port AP0, the state of each of the access ports to processing units AP0 to APn stored by the status register 302; and triggering, by the external device, the debugging of one or more of the processing units which is in the open state.

[0076] An advantage of the embodiments described here is that they provide the technical effect of enabling an external device, such as a computer, running a debugging program, to communicate securely with an electronic device in order to identify a debugging state of the electronic device and to obtain in some cases a unique identifier of the electronic device 100, which is stored for example in non-volatile memory for example in memory 104, and / or to provide identifiers to reopen debugging on the electronic device.

[0077] Various embodiments and variants have been described. Those skilled in the art will understand that certain features of these various embodiments and variants could be combined, and other variants will be apparent to those skilled in the art. For example, it will be obvious to those skilled in the art that in some embodiments, only one or some of the registers 302, 304, 306, and 308 of [Fig. 3] may be present in the authentication interface circuit 110. Furthermore, although the described embodiments involve authentication based on a challenge and a response certificate, in variant embodiments, rather than a challenge, a password request is made by the master processing unit to the external device, and the external device responds with a password rather than a certificate, the password then being verified by the master processing unit.

[0078] Finally, the practical implementation of the embodiments and variants described is within the reach of a person skilled in the art, based on the functional indications given above.

Claims

Claims

1. An electronic device comprising: - a debug port (112) providing a communication interface for debugging purposes; - a first processing unit (CPU1); - one or more processing unit access ports (API, APn) connected to the debug port (112), a first of the processing unit access ports (API) being connected between the debug port (112) and the first processing unit (CPU1), each of the one or more processing unit access ports (API, APn) being configured to be in one of an open state in which it relays communications to and from the debug port (112) and a closed state in which it blocks communications to and from the debug port (112); - an authentication interface circuit (110) configured to authenticate an external device (200);and - an additional access port (APO) connected between the debug port (112) and the authentication interface circuit (110), the additional access port (APO) being configured to be in an open state in which communications are relayed between the debug port and the interface authentication circuit (110), the interface authentication circuit (110) comprising registers (202) comprising a status register (302) which can be read by the external device (200) via the debug port (112) and the additional access port (APO), the status register being configured to store an indication of the open or closed state of each of the access ports to processing units (API, APn).;

2. An electronic device according to claim 1, wherein the registers (202) further comprise a host register (304) which can be read by the first processing unit (CPU1) and in which the external device (200) can write via the debug port (112) and the additional access port (APO).

3. An electronic device according to claim 1 or 2, wherein the registers (202) further comprise a device register (306) which can be read by the external device (200) via the debug port (112) and the additional access port (APO) and in which the first processing unit (CPU1) can write.

4. An electronic device according to claim 3 as dependent on claim 2, wherein the registers (202) further comprise an acknowledgment register (308) for indicating a time at which at least a portion of an electronic message is available to be read from the host register (304) and a time at which at least a portion of an electronic message is available to be read from the device register (306), the acknowledgment register (308) being, for example, read-only for the first processing unit (CPU1) and for the external device (200).

5. An electronic device according to claim 4, wherein the authentication interface circuit (110) is configured: - to detect a time at which at least a portion of an electronic message has been written to the host register (304), and to set, in response, a host acknowledgment bit (HOST_ACK) in the acknowledgment register (308); and - to detect a time at which the first processing unit (CPU1) reads the host register (304) and, in response, to reset the host acknowledgment bit (HOST_ACK) in the acknowledgment register (308).

6. An electronic device according to claim 4 or 5, wherein the authentication interface circuit (110) is configured: - to detect a time at which at least a portion of an electronic message has been written to the device register (306), and to set, in response, a device acknowledgment bit (DEV_ACK) in the acknowledgment register (308); and - to detect a time at which the external device (200) reads the device register (306) and, in response, to reset the device acknowledgment bit (DEV_ACK) in the acknowledgment register (308).

7. An electronic device according to any one of claims 1 to 6, wherein the first processing unit (CPU1) is configured: - to read from the host register (306) an authentication request from the external device; - to authenticate the external device (200); and - to set at least one port among the one or more processing unit access ports (API, APn) to an open state, thereby causing the indication of the state of the one or more processing unit access ports (API, APn) to be updated in the state register (302).

8. An electronic device according to claim 7 in its dependency on claims 2 and 3, wherein the first processing unit (CPU1) is configured to authenticate the external device (200) by: - storing a password request or authentication challenge in the device register (302, 304); - reading a password or authentication certificate from the host register (306); and - verifying the certificate or password.

9. The electronic device of claim 8, further comprising a monotonic counter (108), wherein the first processing unit (CPU1) is further configured to read from the certificate an indication of a count value from which debug functionality is allowed, and the first processing unit (CPU1) is configured to execute a startup sequence comprising incrementing the monotonic counter (108), wherein debug functionality is allowed once the monotonic counter (108) reaches said count value.

10. Electronic device according to any one of claims 1 to 9, in which the access ports to processing units (API, APn) are each connected to an associated processing unit (CPU1, CPUn).

11. An electronic device according to any one of claims 1 to 10, further comprising: - a peripheral interface; and - a peripheral interface access port connected between the debug port (112) and the peripheral interface, the peripheral interface access port being configured to be in one of an open state in which it relays communications to and from the debug port (112) and a closed state in which it blocks communications to and from the debug port (112), wherein the status register is configured to store an indication of the open or closed state of the peripheral interface access port.

12. Method for triggering debugging of the electronic device according to any one of claims 1 to 11, comprising: - reading, by the external device (200) via the debugging port (112) and the additional access port (AP0), the state of each of the access ports to processing units (API, APn) stored by the state register (302); and - triggering, by the external device, the debugging of one or more several of the processing units which is in the open state.

13. A non-transitory computer-readable medium storing a program that, when executed by a processor or computer system in an external device, causes the external device to perform the method of claim 12.