Patent ID: 11921655
Assignee: STMICROELECTRONICS S.R.L.
Field: Computer technology (Electrical engineering)
Classification: CPC G  H | IPC G  H

Claim 0:
1. A microcontroller, comprising:
a memory;
one or more direct memory access (DMA) controllers coupled to the memory; and
a microprocessor coupled to the memory, wherein the microprocessor, in operation:
maintains one or more memory protection (MP) configurations to control access to protected memory areas of the microcontroller;
executes an unsecure user-application; and
responds to a secure service call of the executing unsecure user-application by:
disabling interrupt requests;
determining whether one or more DMA controller configurations satisfy DMA secure-service criteria associated with the secure service request, wherein the determining whether a DMA controller configuration satisfies DMA secure-service criteria comprises determining whether the DMA configuration permits access by the DMA controller to one or more of the protected memory areas;
determining whether one or more MP configurations satisfy MP secure-service criteria associated with the secure service request;
in response to determining the DMA secure-service criteria and the MP secure-service criteria are satisfied:
executing at least one secure operation associated with the secure service call, the at least one secure operation accessing at least one protected memory area; and
cleaning one or more memory areas accessed during the execution of the at least one secure operation; and

enabling the interrupt requests, wherein the microprocessor, in operation, responds to a failure of a DMA controller configuration to satisfy the DMA secure-service criteria by:

storing the DMA controller configuration;
modifying the DMA controller configuration to restrict access of the DMA controller to the one or more protected memory areas during the executing and the cleaning; and
restoring the stored DMA controller configuration after the cleaning.