Assuming the goal is protect company intellectual property, STM32F7 and STM32F401re family of product offer distinct level of protection that might work.
Readout Protection (RDP)
- Level 0: No readout protection
- Level 1: memory readout protection
- Level 2: chip read out protection
Proprietary code Read out Protection (PcROP)
- PcROP is capable of preventing the CPU of executing malicious code
Write Protection (WRP)
- Protecting the flash sector Read/Write/Erase Access
The attached reference documents have in-depth details of the features. The following slide from the attached document might be of interest.
Readout Protection Configuration are done through options bytes. Review the content around option bytes.
The FLASH_OPTCR register is used to modify the option bytes.
In the respective microcontroller datasheet look for information similar to the below. This should help zero in the content that is of interest.
The system memory (ROM) stores the native bootloader (STM32F401re) and is read only.