STM32Cube  Version 2.1
Create Projects with STM32Cube HAL and STM32CubeMX
 All Files Pages
Troubleshooting

The section Troubleshooting gives you hints for fixing issues that could occur when using STM32CubeMX.

Project Migration for projects using 'STM32CubeMX' component without bundles 'STM32CubeMX'

The introduction of the component bundles 'STM32CubeMX' and 'Standalone' introduces incompatible component identifier. The following steps will allow to migrate the selected components to their new component IDs.

  • Open the file FrameworkCubeMX.gpdsc in an editor. It is located in the folder:
...\<project>\RTE\Device\<Dname>\FrameworkCubeMX.gpdsc
  • add the attribute Cbundle="STM32CubeMX" to the component line
...
<component generator="STM32CubeMX" Cvendor="Keil" Cclass="Device" Cbundle="STM32CubeMX" Cgroup="STM32Cube Framework" Csub="STM32CubeMX" Cversion="1.0.0" condition="STCubeMX">
...
  • Save and close the file.
  • Open the project in uVision.
  • Open the dialog 'Manger Run-Time Environment', expand component class 'Device' and component group 'STM32Cube Framework' and press the play button to open STM32CubeMX.
  • In STM32CubeMX, press the menu button to generate the source code.
  • Return to uVision and let it re-read the updated files.
  • The project migration is now completed.

Keil RTX5: Application sporadically stops working

Symptom: An application using Keil RTX5 shows sporadic problems and sometimes stops working.

Keil RTX5 requires that the System Tick Interrupt has the lowest priority. When working with 4-bit group priority, the setting for TICK_INT_PRIORITY should be 0x0F. Verify the section System Configuration in the file stm32fxxx_hal_conf.h. When using STM32CubeMX for configuration, refer to [Optional] Add and Configure Keil RTX5 for more information.

/* ########################### System Configuration ######################### */
#define TICK_INT_PRIORITY ((uint32_t)0x0F)

L6200E: Symbol SysTick_Handler multiply defined (by hal_cm4.o and stm32fxxx_it.o)

Keil RTX5 requires control of the SysTick_Handler function. Remove the function SysTick_Handler in the module stm32fxxx_it.c and add the code below to your project:

/* USER CODE BEGIN Includes */
#include "cmsis_os2.h"
/* USER CODE END Includes */
...
uint32_t HAL_GetTick (void) {
static uint32_t ticks = 0U;
uint32_t i;
if (osKernelGetState () == osKernelRunning) {
return ((uint32_t)osKernelGetTickCount ());
}
/* If Kernel is not running wait approximately 1 ms then increment and return auxiliary tick counter value */
for (i = (SystemCoreClock >> 14U); i > 0U; i--) {
__NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP();
}
return ++ticks; }

Refer to [Optional] Add and Configure Keil RTX5 for more information.