Dear Damien,
do you already have an embOS license?
Why do you use embOS V4? The latest embOS version is 5.18.0.
Would it be possible to share your code? You don't need to publish it here, but you can also contact us directly:
https://www.segger.com/doc/UM01001_embOS.html#Support
A basic embOS mailbox sample application OS_Mailboxes.c can be found in every BSP in the embOS shipment:
#define MAX_MSG_SIZE (8) // Max. number of bytes per message
#define MAX_MSG_NUM (2) // Max. number of messages per Mailbox
static OS_STACKPTR int StackHP[128], StackLP[128]; // Task stacks
static OS_TASK TCBHP, TCBLP; // Task control blocks
static OS_MAILBOX MyMailbox;
static char MyMailboxBuffer[MAX_MSG_SIZE * MAX_MSG_NUM];
static void HPTask(void) {
char aData[MAX_MSG_SIZE];
while (1) {
OS_MAILBOX_GetBlocked(&MyMailbox, (void *)aData);
OS_COM_SendString(aData);
}
}
static void LPTask(void) {
while (1) {
OS_MAILBOX_PutBlocked(&MyMailbox, "\nHello\0");
OS_MAILBOX_PutBlocked(&MyMailbox, "\nWorld!\0");
}
}
int main(void) {
OS_Init(); // Initialize embOS
OS_InitHW(); // Initialize required hardware
OS_TASK_CREATE(&TCBHP, "HP Task", 100, HPTask, StackHP);
OS_TASK_CREATE(&TCBLP, "LP Task", 50, LPTask, StackLP);
OS_MAILBOX_Create(&MyMailbox, MAX_MSG_SIZE, MAX_MSG_NUM, &MyMailboxBuffer);
OS_COM_SendString("embOS OS_Mailbox example");
OS_COM_SendString("\n\nDemonstrating message passing\n");
OS_Start(); // Start embOS
return 0;
}
Display More
However, if necessary, I can also create a sample application like the CMSIS sample application.
Best regards,
Til