2017-09-13 05:41 AM
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
2017-09-14 12:59 AM
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=false2017-09-19 09:43 AM
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
2017-11-23 02:02 AM
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
2018-02-01 01:56 AM
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