cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX FreeRTOS and Queue Sizes (Bug)

Posted on September 13, 2017 at 14:41

STM32CubeMX allows to enter either a type (i.e. uint16_t) or a decimal (i.e. 50) in the 'Item Size' edit box when defining a Queue and correctly calculates the overall size in the GUI. However, when using a decimal, the generated code isn't correct. Here is the part of a generated code when using 50 as 'Item Size' and 4 as 'Queue Size':

osMessageQId my_queueHandle;
uint8_t my_queue_buffer[ 4 * sizeof( 50 ) ];
osStaticMessageQDef_t my_queue_control;�?�?�?

sizeof ( 50 ) is 4 in STM The correct code is:

osMessageQId my_queueHandle;
uint8_t my_queue_buffer[ 4 * 50 ];
osStaticMessageQDef_t my_queue_control;�?�?�?

As a suggestion, STM32CubeMX's FreeRTOS configuration window has a 'User Constants' tab where we can enter constant definitions. It would be very nice if we could use those defined constants too when entering the queue (or other) sizes too. We will end up with something like this which is way better:

osMessageQId my_queueHandle;
uint8_t my_queue_buffer[ MY_QUEUE_SIZE * MY_QUEUE_ITEM_SIZE ];
osStaticMessageQDef_t my_queue_control;�?�?�?

#queue #freertos
4 REPLIES 4
Posted on September 14, 2017 at 09:59

Forgot to mention software versions:

STM32CubeMX v4.1 on Linux, STM32CubeL0 v1.0, STM32L IOC file is attached.

________________

Attachments :

freertos-test.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyR8&d=%2Fa%2F0X0000000b7k%2F0qe4XhGybGuC0rHU4WITHbjSq2SYKYBZdfzZQyX4yXY&asPdf=false
FCR
Associate III
Posted on September 19, 2017 at 18:43

Hi

sweden

Thank you for reporting that issue.

We will try to fix it asap, in a future CubeMx release, including, if possible, your suggestion that I share.

I will check if we can make it for the next release (4.23) and will keep you informed.

Regards,

Fred

FCR
Associate III
Posted on November 23, 2017 at 11:02

Hi

sweden

For your information, the bug is being fixed for the next official release (4.24).

As for the suggestion, the analysis is on-going: it could be in 4.24 as well, but nothing sure right now (I'll come back to you when things are clearer).

Regards,

Fred

Jeanne Joly
Senior III
Posted on February 01, 2018 at 10:56

Hi

sweden

,

I confirm that the bug you highlighted is corrected and available in the current release (CubeMX4.24) .

Your suggestion isbeing corrected and will be available in the next CubeMX release or the one after.

BR. Jeanne