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.

MCU-PLUS-SDK-AM243X: .bss-subsections appearing as used rw data in map-file

Part Number: MCU-PLUS-SDK-AM243X

Hello,

so first of this is just an cosmetic-issue, since it does not affect the tunrime of the program, nor the compilation itself.

We are using the ipc of the AM243x and thus we are also using a buffer, which is marked with an attribute-directive

    uint8_t gRPMessageVringMem[IPC_RPMESSAGE_NUM_VRINGS][IPC_RPMESSAGE_VRING_SIZE] __attribute__((aligned(128), section(".bss.ipc_vring_mem")));

so the memory is located in the bss-section with its subsection ipc_vring_mem. The linker script defines the section like this:

.bss.ipc_vring_mem   (NOLOAD) : {} > RTOS_NORTOS_IPC_SHM_MEM

Unfortunately the taken space of the gRPMessageVringMem also appears in the corresponding map-file as space taken by the .c/.cpp-file where it is defined (IpcDriver.cpp.obj, last cloumn):

We can see that since if we change the number of buffers or the size of the ipc-buffers, this value also changes. Unfortunately this is true for all 4 cores if we use them. nevertheless they use exactly the same memory-address for the buffer but if you just look at the generated sizes this is applied to all mcu-memory-printouts via tiarmsize. Luckily the output-file-size is not affected by this!

So if I call tiarmsize for one mcu it shows me this for 8 buffers, 256 Bytes each, 4 cores:

and this for 16 buffers

So it's not a real problem but can be really confusing and misleading, since 4 cores share the same memory, but it is shown for every core each and seems to be an overall 4 times the size it really is. We want to track our memory-footprint in the future via tiarmsize but it's probably not the way to go then. Or is it possible to somehow make the tiarmsize notice it should not take that memory into account? Or is there a possiblity to show an overall memory footprint which takes in the common .bss-memory for all cores?
tiarmsize seems not to provide such an option.

Best regards

Felix

  • Hi Felix,

    The following sections are all in shared memory (0x701D0000 to 0x701DFFFF, CONFIG_MPU_REGION4, 64KB):

    USER_SHM_MEM : ORIGIN = 0x701D0000, LENGTH = 0x180
    LOG_SHM_MEM : ORIGIN = 0x701D0000 + 0x180, LENGTH = 0x00004000 - 0x180
    RTOS_NORTOS_IPC_SHM_MEM : ORIGIN = 0x701D4000, LENGTH = 0x0000C000

    They are all meant to be shared by all cores, that is why it is set to be non-cached. The IPC will take care the synchronization among cores.

    Best regards,

    Ming

  • Hey Ming, thanks for the reply.

    We configured our device like that so that's not the issue.
    Our "cosmetic" issue is the addition of each .bss-section-size of every core, even if they all use the same memory-area for the IPC. so if it would be like the 64KB max used we would have an overall size of the .bss-sections of 4*64KB, even if it is only 1*64KB.

    I tried using the tiarmsize with --totals for all elf-files but it does not take into account the same memory-areas over multiple elf-files and just adds every .bss-section size.

    Since we wanted to track our firmware-sizes and how they change it would be good to have the possibility of combining the shared-memories and IPC-memories when calculating the sizes via multiple elf-files if the have the same address (and size). But I guess that's a topic for the tiarmsize to handle.

    Best regards
    Felix

  • Hi Felix,

    You are correct. It is an issue for the tiarmsize. Since it is part of the TI compiler, I will forward this thread to SDTO team for further help!

    Best regards,

    Ming 

  • is it possible to somehow make the tiarmsize notice it should not take that memory into account?

    Unfortunately, no.  tiarmsize just computes the sizes of the sections it sees in the input object file(s) or libraries.  There is no mechanism by which you can indicate some part of that memory is shared across certain object files.

    is there a possiblity to show an overall memory footprint which takes in the common .bss-memory for all cores?

    Unfortunately, TI has no method for doing that.

    Thanks and regards,

    -George

  • ok, thanks for clarifying George!

    Best regards

    Felix