I am new user of the TMS320F2808 DSP developing C application code with Code Composer v5.3.0 and am using the SYS/BIOS v6.34.02.18. My question is in regards to using the SYS/BIOS’s Mailbox module. I used the “Minimal Project”example to start with for my platform with an eye on frugal memory use. I have incremental added CPU Timer, Semaphore and a Mailbox without too much difficulty. The API in question is “Mailbox_create().” I noticed that when I create a Mailbox dynamically in “main()” before the call to “BIOS_start()” everything works fine, however when I move it into a task and use the same code snippets creation fails . The code snippets I cite are below:
typedef struct HaloMsg {
unsigned short mid; /*## attribute mid */
unsigned short control; /*## attribute control */
unsigned char data[8]; /*## attribute data */
} HaloMsg;
Mailbox_Params mboxParams;
Error_Block eb;
Error_init(&eb);
Mailbox_Params_init(&mboxParams);
mbox = Mailbox_create(sizeof(HaloMsg), 50, &mboxParams, &eb);
if (mbox == NULL) {
System_printf("taskFxn(): %s\n", Error_getMsg(&eb) );
System_abort("Mailbox create failed");
}
/* Mailbox_create() sets Mailbox's initial buffer count = 50 */
The above code should be eerily similar to what is found on page 116 of the “TI SYS/BIOS v6.34 Real-time Operating System User's Guide”, SPRUEX3L, September 2012. The documentation on this API within CodeComposer’s help says you can call it from the context of a running task so what am I doing wrong here?