cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable/disable cores on dual-core STM32H7 using STM32CubeProgrammer

mƎALLEm
ST Employee

Introduction

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.

1. Disabling a core in a dual-core configuration

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). 

2. Disabling and enabling Cortex®-M7 using STM32CubeProgrammer

2.1 Disabling Cortex®-M7 boot

Connect the board with STLINK and open the STM32CubeProgrammer tool:

  1. Go to the option bytes menu by clicking the [OB] button.
  2. Click on the [User Configuration] menu, the menu expands. 
  3. Find the option [BCM7] and uncheck it to disable the Cortex®-M7 boot.
  4. Apply this change by clicking on the [Apply] button and wait for the operation to complete.

Figure 1. Opening option bytes menu in STM32CubeProgrammerFigure 1. Opening option bytes menu in STM32CubeProgrammer

 

 

Figure 2. Disabling the Cortex®-M7 in option bytesFigure 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 completionFigure 3. STM32CubeProgrammer messages after the operation completion

 To connect to the device again, you need to change the debug access port (see section 4).

2.2 Enabling Cortex®-M7 boot

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):

  1. Go to the Access port menu
  2. Select “3” to enable the access port 3 as shown in the below figure.
  3. Click the [Connect] button to connect to the MCU.

Figure 4. Selecting access port 3 to connect to CM4Figure 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®-M7Figure 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.

3. Disabling and enabling Cortex®-M4 using STM32CubeProgrammer

3.1 Disabling Cortex®-M4 boot

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 bytesFigure 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.

3.2 Enabling Cortex®-M4 boot

Same manipulation steps described in the section 2.2, but you need to check the option “BCM4”.

Figure 7. Reenabling the Cortex®-M4Figure 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.

4. Disabling both cores

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:

CM7_CM4_Gated.png

This figure shows that if CM4 and CM7 boot are disabled in the option byte, the connection keeps going over access port 0:

SofLit_0-1738848718961.png

5. Access port number configuration in STM32CubeProgrammer

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 registerFigure 8. APSEL bitfield description in DP_SELECT register

  • AP0 is the debug access port for the Cortex®-M7
  • AP3 is the debug access port for the Cortex®-M4.

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 exampleFigure 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 exampleFigure 10. Debugger access port configuration of a Cortex®-M4 project in a STM32H7 dual core example

Conclusion

This article showed how to enable and disable the Cortex®-M7 and Cortex®-M4 boot using STM32CubeProgrammer. 

Related links 

Reference manual 0399: STM32H745/755 and STM32H747/757 advanced Arm®-based 32-bit MCUs.

 

Version history
Last update:
‎2025-03-18 1:30 AM
Updated by: