Skip to main content
Associate II
September 3, 2025
Question

FreeRTOS queue size / item size

  • September 3, 2025
  • 4 replies
  • 670 views

STM32H562, STM32Cube FW_H5 V1.5.0, X-CUBE-FREERTOS.1.2.0

If i want a FreeRTOS queue of size 32 and item size 12 bytes i will write 32 i Queue Size and 12 in Item Size in CubeMX. Previously it would generate init code:

osMessageQueueId_t setpoint_sendHandle;
uint8_t setpoint_send_buffer[ 32 * 12 ];
osStaticMessageQDef_t setpoint_sendControlBlock;
const osMessageQueueAttr_t setpoint_send_attributes = {
 .name = "setpoint_send",
 .cb_mem = &setpoint_sendControlBlock,
 .cb_size = sizeof(setpoint_sendControlBlock),
 .mq_mem = &setpoint_send_buffer,
 .mq_size = sizeof(setpoint_send_buffer)
};

setpoint_sendHandle = osMessageQueueNew (32, 12, &setpoint_send_attributes);

With STM32Cube FW_H5 V1.5.0, X-CUBE-FREERTOS.1.2.0 i get:

osMessageQueueId_t setpoint_sendHandle;
uint8_t setpoint_send_buffer[ 32 * sizeof(12)];
osStaticMessageQDef_t setpoint_sendControlBlock;
const osMessageQueueAttr_t setpoint_send_attributes = {
 .name = "setpoint_send",
 .cb_mem = &setpoint_sendControlBlock,
 .cb_size = sizeof(setpoint_sendControlBlock),
 .mq_mem = &setpoint_send_buffer,
 .mq_size = sizeof(setpoint_send_buffer)
};

setpoint_sendHandle = osMessageQueueNew (32, sizeof(12), &setpoint_send_attributes);

 Which does not work as expected. Should i do something differently in CubeMX with the latest FreeRTOS?

4 replies

Pavel A.
Super User
September 3, 2025

Which version is the previous?

 

mipAuthor
Associate II
September 4, 2025

STM32Cube FW_H7 V1.11.1 generates working init code with numbers in Queue Size and Item Size.

Pavel A.
Super User
September 4, 2025

STM32Cube FW_H7 is just the runtime library, it does not contain anything  that generates the init code. What is the version of CubeMX or CubeIDE?

 

mipAuthor
Associate II
September 5, 2025

I just checked and it is not related to different versions of STM32CubeMX and CubeIDE 

I have two projects using STM32CubeMX version 6.15.0 and CubeIDE version 1.19.0. One is a STM32H5 and another a STM32H7.

With the H5, faulty init code is generated. With H7 correct init code is generated.

The way FreeRTOS is intergrated in STM32CubeMX is different in the two projects. In the H5 project it is a pack, where in H7 it is integrated some other way.

 

Pavel A.
Super User
September 5, 2025

#Bug-report   against CubeMX/IDE source templates(?) for H5.

 

Technical Moderator
September 9, 2025

Hello @mip 

Thank you for bringing this issue to our attention,
The concerned team is currently investigating the matter. I will get back to you as soon as possible.

KR,

Souhaib

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.