STM32CubeH5 icon indicating copy to clipboard operation
STM32CubeH5 copied to clipboard

Compilation of cmsis_os2.c fails if USE_MEMORY_POOL_ALLOCATION is defined.

Open Vinzenz82 opened this issue 1 year ago • 2 comments

Describe the set-up STM32CubeIDE Version: 1.15.1

Describe the bug

#ifdef USE_DYNAMIC_MEMORY_ALLOCATION
  unused_memory = (CHAR *)_tx_initialize_unused_memory;
#elif  USE_MEMORY_POOL_ALLOCATION
  static CHAR freememStack[RTOS2_BYTE_POOL_STACK_SIZE + RTOS2_INTERNAL_BYTE_POOL_SIZE];
  static CHAR freememHeap[RTOS2_BYTE_POOL_HEAP_SIZE + RTOS2_INTERNAL_BYTE_POOL_SIZE];
  unused_memory_Stack = (CHAR *)freememStack;
  unused_memory_Heap = (CHAR *)freememHeap;
#endif

Compiler Output: cmsis_os2.c:270:34: error: #elif with no expression

How To Reproduce define USE_MEMORY_POOL_ALLOCATION instead of USE_DYNAMIC_MEMORY_ALLOCATION

The modules that you suspect to be the cause of the problem: stm32h5/Middlewares/ST/cmsis_rtos_threadx/cmsis_os2.c

Vinzenz82 avatar Jul 25 '24 10:07 Vinzenz82

ST Internal Reference: 187607

TOUNSTM avatar Jul 29 '24 11:07 TOUNSTM

See Also https://github.com/STMicroelectronics/stm32_mw_cmsis_rtos_tx/issues/2

TOUNSTM avatar Jul 29 '24 11:07 TOUNSTM

Fixed in 0d526a4930310cf8fa6dce7538ab891cc37eb250

TOUNSTM avatar Sep 16 '25 09:09 TOUNSTM