on 2025-03-18 1:36 AM
For various reasons, developers may need to deactivate booting of a core in the STM32H7 dual core product. This article shows how to disable the Cortex®-M7 and Cortex®-M4 cores and enable them again.
Disabling a core is needed for debug purposes or to turn the product to a single core product. Dual and single core products have the same die, but some features are disabled in production on single core products. The Cortex®-M4 is one of the disabled features. So, you can turn the CM4 off on STM32H745 MCU to be seen as, for example, a STM32H743 MCU by taking care of some hardware specifications like the power supply configuration: SMPS and LDO.
To do so, STM32CubeProgrammer is a fast and easy solution using option bytes. In the next section, we describe how to use this tool to disable/enable Cortex®-M4 and Coretx-M7.
Note: If both cores are disabled in the option bytes, the Cortex®-M7 boots (see section 4).
Connect the board with STLINK and open the STM32CubeProgrammer tool:
Figure 1. Opening option bytes menu in STM32CubeProgrammer
Figure 2. Disabling the Cortex®-M7 in option bytes
After applying the change in the option bytes, the connection to the MCU is lost. This is normal behavior, and you see these messages:
Figure 3. STM32CubeProgrammer messages after the operation completion
To connect to the device again, you need to change the debug access port (see section 4).
To enable the Cortex®-M7 boot again, you need first to select the access port 3 to connect to the MCU port (for more details, see section 4):
Figure 4. Selecting access port 3 to connect to CM4
After a successful connection, you can see that the CM7 boot is disabled. Check the [BCM7] option again and click on the [Apply] button.
Figure 5. Reenabling the Cortex®-M7
Wait until the end of the operation. Do not disconnect or power off the board during this operation. At this stage, the Cortex®-M7 is enabled. You can disconnect and reconnect to check.
Same manipulation steps described in the section 2.1 for Cortex®-M7 but need to uncheck the option “BCM4”.
Figure 6. Disable of the Cortex®-M4 in option bytes
Apply this change by clicking on the [Apply] button and wait for the operation to complete.
Same manipulation steps described in the section 2.2, but you need to check the option “BCM4”.
Figure 7. Reenabling the Cortex®-M4
Wait until the end of the operation. Do not disconnect or power off the board during this operation. At this stage, the Cortex®-M4 is enabled. You can disconnect and reconnect to check.
There is no usage for this configuration but if the user disables by mistake both cores, there is a mechanism implemented in the MCU to prevent breaking the chip. If both cores are disabled, the Cortex®-M7 keeps booting. This table is provided in the reference manual RM0399:
This figure shows that if CM4 and CM7 boot are disabled in the option byte, the connection keeps going over access port 0:
To differentiate between the two cores in a connection session, the debugger (for example STM32CubeIDE, see the figures 9 and 10) or the STM32Cubeprogarmmer tool need to know which core is active in the current connection. The access port number is used for this purpose in the DP_SELECT register. For more information, refer to reference manual RM0399 debug port access port select register (DP_SELECT) bit description.
Figure 8. APSEL bitfield description in DP_SELECT register
If you disable Cortex®-M7 in the option bytes and the current access port set is 0 in STM32CubeProgrammer, the connection is lost. The same principle applies to Cortex®-M4. If the current active access port is set to 3 in STM32CubeProgrammer and you disable CM4 boot, the connection is lost.
When reestablishing the connection to the MCU, you need to select the access port number corresponding to an enabled core.
Figure 9. Debugger access port configuration of a Cortex®-M7 project in a STM32H7 dual core example
Figure 10. Debugger access port configuration of a Cortex®-M4 project in a STM32H7 dual core example
This article showed how to enable and disable the Cortex®-M7 and Cortex®-M4 boot using STM32CubeProgrammer.
Reference manual 0399: STM32H745/755 and STM32H747/757 advanced Arm®-based 32-bit MCUs.