# US 2019/0102538 A1 · Secure environment in a non-secure microcontroller

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2019/0102538 A1
- Document ID: US20190102538A1
- Status: Published application
- Kind: A1
- Application number: 15/721,362
- Filed: 2017-09-29
- Published: 2019-04-04
- Earliest claimed: 2017-09-29
- Assignees: STMicroelectronics S.r.l.
- Applicants: Stmicroelectronics, Inc.
- Inventors: Maurizio Gentili; Massimo Panzica
- Web page: https://patentgrep.com/patent/US20190102538A1

## CPC

- G06F 21/53: by executing in a restricted environment, e.g. sandbox or secure virtual machine
- G06F 13/24: using interrupt (G06F13/32 takes precedence)
- G06F 13/28: using burst mode transfer, e.g. direct memory access {DMA}, cycle steal (G06F13/32 takes precedence)
- G06F 21/575: {Secure boot}
- G06F 21/74: operating in dual or compartmented mode, i.e. at least one secure mode
- G06F 21/79: in semiconductor storage media, e.g. directly-addressable memories
- H04L 63/061: {for key exchange, e.g. in peer-to-peer networks (cryptographic mechanisms or cryptographic arrangements for key agreement H04L9/0838)}
- H04L 63/0853: {using an additional device, e.g. smartcard, SIM or a different communication terminal (cryptographic mechanisms or cryptographic arrangements for entity authentication involving additional secure or trusted devices H04L9/3234)}
- G06F 2213/24: Interrupt
- G06F 2221/2143: Clearing memory, e.g. to prevent the data from being stolen
- G06F 2221/2149: Restricted operating environment
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A secure engine method includes providing an embedded microcontroller in an embedded device, the embedded microcontroller having internal memory. The method also includes providing a secure environment in the internal memory. The secure environment method recognizes a boot sequence and restricts user-level access to the secure environment by taking control over the secure environment memory. Taking such control may include disabling DMA controllers, configuring at least one memory controller for access to the secure environment, preventing the execution of instructions fetched from outside the secure environment, and only permitting execution of instructions fetched from within the secure environment. Secure engine program instructions are then executed to disable interrupts, perform at least one secure operation, and re-enable interrupts after performing the at least one secure operation. Control over the secure environment memory is released, which can include clearing memory, re-enabling DMA controllers, and restoring memory controller parameters.

## Claims

### Claim 1

A secure engine method, comprising:
providing a secure environment in an internal memory of a microcontroller, the secure environment having secure engine program instructions executable by a microprocessor of the microcontroller;
restricting user-level access to the secure environment;
recognizing a boot-sequence of the microcontroller;
after recognizing the boot-sequence:
disabling all direct memory access (DMA) controllers of the microcontroller that are configurable to access memory of the secure environment;
configuring at least one memory controller of the microcontroller for access to the secure environment;
preventing the microprocessor of the microcontroller from executing instructions fetched from outside the secure environment;
only permitting execution of instructions fetched from the secure environment;
executing various ones of the secure engine program instructions as a state machine, said executing including:
disabling interrupts;
performing at least one secure operation after interrupts are disabled; and
enabling interrupts after performing the at least one secure operation;
clearing memory;
restoring an enabled/disabled status of each DMA controller disabled after recognizing the boot-sequence; and
performing user-level operations.

### Claim 2 (depends on 1)

A method according to claim 1 wherein the secure engine program instructions executable by the microprocessor of the microcontroller are stored in a non-volatile memory.

### Claim 3 (depends on 1)

A method according to claim 1 wherein the microcontroller is an embedded microcontroller in an embedded device, and wherein the at least one secure operation includes a secure boot of the embedded device.

### Claim 4 (depends on 1)

A method according to claim 1 wherein the microcontroller is an embedded microcontroller in an embedded device, and wherein the at least one secure operation includes an update to firmware of the embedded device.

### Claim 5 (depends on 1)

A method according to claim 1 wherein the at least one secure operation includes a signature verification function.

### Claim 6 (depends on 1)

A method according to claim 1 wherein the act of performing at least one secure operation includes accessing protected cryptic values.

### Claim 7 (depends on 1)

A method according to claim 1 wherein the microcontroller is an embedded microcontroller in an embedded device, and wherein the embedded device is a wearable device.

### Claim 8 (depends on 1)

A method according to claim 1 wherein the microcontroller is an embedded microcontroller in an embedded device, and wherein the embedded device is an Internet of Things device.

### Claim 9 (depends on 1)

A method according to claim 1, comprising:
after recognizing the boot-sequence, enabling a firewall to protect the secure environment, wherein executing various ones of the secure engine program instructions as the state machine includes executing a call gate function to open an area of access within the secure environment.

### Claim 10 (depends on 9)

A method according to claim 9, comprising:
after performing at least one secure operation, executing a second call gate function to close the area of access within the secure environment.

### Claim 11

An Internet of Things (IoT) device, comprising:
a microcontroller having a microprocessor and a memory configured internal to the microcontroller, the internal memory having a secure environment configured therein, the secure environment having secure environment configuration instructions executable by the microprocessor and secure engine program instructions executable by the microprocessor, wherein after recognizing a boot-sequence, the microprocessor directed to:
via the secure environment configuration instructions:
disable each direct memory access (DMA)controller that is configurable to access memory of the secure environment;
configure at least one memory controller for access to the secure environment;
prevent the microprocessor from executing instructions fetched from outside the secure environment;
via the secure engine program instructions:
only permit execution of instructions fetched from the secure environment;
disable interrupts;
perform at least one secure operation after interrupts are disabled; and
enable interrupts after performing the at least one secure operations; and
via the secure environment configuration instructions:
clear memory; and
restore an enable/disable status of each DMA controller disabled after recognizing the boot-sequence.

### Claim 12 (depends on 11)

An IoT device according to claim 11 wherein the IoT device is arranged as a wearable computing device.

### Claim 13 (depends on 11)

An IoT device according to claim 11, comprising:
a communications interface; and
at least one sensor, the at least one sensor arranged to provide sensor data to the microcontroller.

### Claim 14 (depends on 11)

An IoT device according to claim 11 wherein the at least one secure operation is a cryptographic operation.

### Claim 15 (depends on 11)

An IoT device according to claim 11 wherein the at least one secure operation is a secure key operation.

### Claim 16

A non-transitory computer-readable storage medium whose stored contents configure a computing system to implement a secure engine method, the secure engine method comprising:
restricting user-level access to a secure environment defined in the non-transitory computer-readable storage medium;
detecting a boot-sequence, and after detecting the boot-sequence:
disabling direct memory access (DMA) controllers;
configuring at least one memory controller for access to the secure environment by a secure engine;
preventing execution of any instructions fetched from outside the secure environment;
executing secure engine program instructions, said executing including:
disabling interrupts;
performing at least one secure operation after interrupts are disabled; and
enabling interrupts after performing the at least one secure operation;
clearing at least some volatile memory;
re-enabling the disabled DMA controllers; and
performing user-level operations.

### Claim 17 (depends on 16)

A non-transitory computer-readable storage medium according to claim 16 whose stored contents configure the computing system to perform the method, the method further comprising:
after detecting the boot-sequence, enabling a firewall to protect the secure environment, wherein performing the at least one secure operation includes executing a call gate function to open an area of access within the secure environment.

### Claim 18 (depends on 17)

A non-transitory computer-readable storage medium according to claim 17 whose stored contents configure the computing system to perform the method, the method further comprising:
after performing the at least one secure operation, executing a second call gate function to close the area of access within the secure environment.

### Claim 19 (depends on 16)

A non-transitory computer-readable storage medium according to claim 16 whose stored contents configure the computing system to perform the method, wherein the at least one secure operation includes a secure boot operation.

### Claim 20 (depends on 16)

A non-transitory computer-readable storage medium according to claim 16 whose stored contents configure the computing system to perform the method, wherein the at least one secure operation includes a secure firmware update operation.
