This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/SW-EK-TM4C123GXL: How to configure the mailbox allocbuf size?

Part Number: SW-EK-TM4C123GXL
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi all:

When i instance a mailbox using cfg file,it will auto produce the ".common:ti_sysbios_knl_Mailbox_Instance_State_0_allocBuf_A " buffer at SRAM .bss section.(Size 2048 bytes)

How to configure the  "ti_sysbios_knl_Mailbox_Instance_State_0_allocBuf_A " buffer size?

Environment:

Code Composer Studio  Version: 7.3.0.00019 ,XDCtools version: 3.32.0.06_core

Thank you for your help. 

  • Hi Andy,

    The msg size and number of msgs determines the size of the buffer (along with some alignment requirements). These values are passed into Mailbox.create in the .cfg (assuming you are editing the .cfg as a text file).

    Todd
  • Hi Todd,
    Suppose create the mailbox at running time,it don't need the buffer,right?why?

    Thank you for your help.
  • If you create it at runtime, you have two options:

    1. Leave the Mailbox_Params. buf NULL (which is the default when using Mailbox_Params_init) and the Mailbox_create API will allocate memory to be used as the msgs. It will use the heap specified in the Mailbox_Params.heap field. This too is NULL by default. NULL means to use the default system heap that the kernel creates.

    2. Set Mailbox_Params. buf to a buffer. Careful with this, the sizing is a little tricky since there are alignment requirements.

    The .common:ti_sysbios_knl_Mailbox_Instance_State_0_allocBuf_A you are seeing is for the statically created Mailbox. If you created two Mailboxes in the .cfg you'd see two buffers.

    Todd