STM32CubeMX 4.7.0 FreeRTOS osMessageCreate bug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-29 04:58 PM
osMessageQId osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id)
{ (void) thread_id; return xQueueCreate(queue_def->queue_sz, queue_def->item_sz); //return xQueueCreate(queue_def->queue_sz, (uint32_t) sizeof(queue_def->item_sz)); //-------------->Bug}if you want use a queue and the size larger than 4 bytes, osMessageCreate always give you a 4bytes queue. because sizeof(queue_def->item_sz) always return 4.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-05-18 06:01 PM
I have the same problem.
I try this: return xQueueCreate(queue_def->queue_sz, queue_def->item_sz); But osMessageGet() can return only (osEvent) type. Therefore I was compelled to return to xQueueCreate() and other basic FreeRTOS calls.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-06-19 06:24 PM
This bug is also present in STM32CubeMX 4.8.0 / STMCubeF4 1.6.0
So frustrating because the bugfix gets overwritten by CubeMX when you regenerate project code.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-16 08:00 PM
Bug is still present in STM32CubeMX 4.9.0 / STM32CubeF4 1.7.0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-23 06:24 AM
Hi,
I will report the issue to our development team.Thank you for the information and sorry for the inconvenience that it may bring.-Syrine-- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-09-16 01:28 AM
Hi, it seems that the bugfix on the STM32CubeF4 1.8.0 has highlighted another problem.
The functions osMessageGet and osMessageKeep will call the xQueueReceive(queue_id, &event.value.v, ticks) passing to it the address of the value.v element of a (osStatus) event variable; t
hen the &event.value.v is passed to the xQueueGenericReceive as the buffer (void * const pvBuffer) where to write the queue item you need to analyze.
Since the value.v is a single uint32_t, it is not correct to use it as a buffer where to store the queue item.
Moreover, if the queue item size is long enough, it will overwrite other stack elements and may lead the code to crash.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-08-15 10:44 PM
I hit the same issue. The problem is in the library template of the cmsis_os.h header file.
In my case I was running the current STM32CubeF4 release 1.13.0.I worked around the issue by editing the template header file cmsis_os.h.Change from:const osMessageQDef_t os_messageQ_def_##name = \{ (queue_sz),
sizeof
(type) }to:const osMessageQDef_t os_messageQ_def_##name = \
{ (queue_sz), (type) }The location of the template header file cmsis_os.h on my computer is:
C:\Users\Vlad\STM32Cube\Repository\STM32Cube_FW_F4_V1.13.0\Drivers\CMSIS\RTOS\Template\cmsis_os.h
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-04-05 05:50 AM
I confirm this in:
* @file cmsis_os.c
* @author MCD Application Team * @date 22-January-2016 * @brief CMSIS-RTOS API implementation for FreeRTOS V8.2.3looks like there should be a check on queue item size inside osMessageGet()
To avoid this bug is to not use queue with item size > 4 bytes