2023-04-25 07:03 AM
Hi
why is it not possible to configure mailbox queues in Cube graphically?
Shoudl they be avioded from the toolchain prespective?
Thx
2023-04-25 09:49 AM
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.
2023-04-25 10:10 AM
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?
2023-04-26 07:37 AM
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?