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

Claim 14:
15. 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
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 determining whether a MP configuration satisfies the MP secure-service criteria comprises determining whether the MP configuration permits access to one or more of the protected memory areas,
the microprocessor, in operation, responds to a failure of a MP configuration to satisfy the MP secure-service criteria by generating an error message in response to the secure service request, the error message indicating the MP configuration does not satisfy the MP secure-service criteria, and
the executing unsecure user-application responds to the error message by:
saving the MP configuration;
modifying access permissions of the MP configuration;
resubmitting the secure service request; and
restoring the saved MP configuration.