Skip to main content
MK..1
Associate III
April 25, 2023
Question

why does cubemx has no support for Freertos mailbox cues

  • April 25, 2023
  • 3 replies
  • 1323 views

Hi

why is it not possible to configure mailbox queues in Cube graphically?

Shoudl they be avioded from the toolchain prespective?

Thx

This topic has been closed for replies.

3 replies

Bob S
Super User
April 25, 2023

FreeRTOS does not provide a "mailbox" container. Mailboxes are typically constructed by combining a queue and a mutex. You need to make your own mailbox from the FreeRTOS primitives. You can configure the queue and mutex in CubeMX, but combining them into a mailbox is your own responsibility.

MK..1
MK..1Author
Associate III
April 25, 2023

Hi @Bob S​ 

 osMailQDef (objectPoolQ, 10, MEM_memberTypeDef); // Declare mail queue

 osMessageQDef(myQueue01, 16, uint16_t);

you want to say osMailQDef is a wrapper for mailboxes?

Bob S
Super User
April 26, 2023

ST's FreeRTOS port only supports mail queues in CMSIS v1. CMSIS v2 has some defines/declarations in cmsis_os.h, but it doesn't look like there is any code in cmsis_os.c to support them. Yes, even when using CMSIS V1, CubeMX doesn't give you the option to create/configure them. However, looking at the CMSIS V1 code, the osMailXXXX functions are pretty much just wrappers for regular FreeeRTOS queues.

So unless you are porting existing code that uses osMail functions, why not just use queues?