Skip to main content
michaelallan9
Visitor II
Sep 7, 2016 4:15 PM UTC
Question

STM32Cube FreeRTOS Bug

Posted on September 07, 2016 at 18:15

I've found a bug in the implementation of osMailCAlloc - the code uses sizeof(queue_id->queue_def->item_sz) when item_sz already has the right value.

@@ -1114,11 +1114,11 @@ 
void
*osMailCAlloc (osMailQId queue_id, uint32_t millisec)
{
uint32_t i;
void
*p = osMailAlloc(queue_id, millisec);
if
(p) {
- 
for
(i = 0; i < 
sizeof
(queue_id->queue_def->item_sz); i++) {
+ 
for
(i = 0; i < queue_id->queue_def->item_sz; i++) {
((uint8_t *)p)[i] = 0;
}
}
return
p;

I'm using STM32Cube 4.0.
    This topic has been closed for replies.

    2 replies

    slimen
    Visitor II
    Sep 8, 2016 8:01 AM UTC
    Posted on September 08, 2016 at 10:01

    Hi,

    I confirm this bug. 

    It is also checked with new CubeMx version 4.16.1.

    Regards
    ST Technical Moderator
    May 23, 2018 9:49 AM UTC
    Posted on May 23, 2018 at 11:49

    Hello

     ,

    Thanks for reporting such problem. This issue is already fixed.

    With Regards,

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks