STM32Cube  Version 2.0
Create Projects for STM32F2 Series with STM32Cube HAL and STM32CubeMX
 All Files Pages
Troubleshooting

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

CMSIS-RTOS RTX: Application sporadically stops working

The application uses CMSIS-RTOS RTX but during execution it shows sporadic problems and sometimes stops working.

CMSIS-RTOS RTX 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 Add CMSIS-RTOS RTX for more information.

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

Compile Errors after adding Components through the Run-Time Environment that are not configured with STM32CubeMX

Certain components (mainly Board Support) already contain initialization code and do not require to be configured with STM32CubeMX. After adding such a component through the Run-Time Environment, the build process fails indicating undefined identifiers. Example:

error: #20: identifier "UART_HandleTypeDef" is undefined

The file stm32f7xx_hal_conf.h needs to be manually updated to enable the missing peripheral. Open the file in the editor and un-comment the module (in this case the UART module).

:
#define HAL_UART_MODULE_ENABLED // un-comment this define!
:

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

The CMSIS-RTOS RTX real-time operating system 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; }
Note
Refer to Add CMSIS-RTOS RTX for more information.

Variables in off-chip RAM are not Initialized

The #define symbols DATA_IN_ExtSRAM and DATA_IN_ExtSDRAM configure the external memory bus interface in the CMSIS-CORE file system_stm32fxxx.c. Access to the external memory must be setup using these define symbols to ensure that the compiler initialization that executes before 'main' can access external (or off-chip) RAM.