Stack memory overlap with file level variable memory region

Sysprogs forums Forums VisualGDB Stack memory overlap with file level variable memory region

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #27814
    guntiss
    Participant

    Using VisualDBG 5.2, GCC 9.2.1, EFM32 5.9.1, device EFM32TG11B120F128, default linker file

    When file level variable size is larger then 1000 bytes, the function variables are placed in the file level variable memory space. They overlap. No warning.

    RAM memory is used only 2028 bytes (6.2%) from 32Kb available.

    See the complete test code below.

    buffer is placed 0x2000001c <buffer> “” {0 ‘\000’}
    stack variable i is placed 0x200003f4 <buffer+984> {752}

    How to resolve that file level variables does not overlap with function stack memory?

    #include <stdint.h>

    uint8_t buffer[2000];
    void func(uint8_t param)
    {
    buffer[param] = param;
    }

    int main()
    {
    uint32_t i;
    for (;;)
    {
    i++;
    func(i & 0xFF);
    }
    return 0;
    }

    • This topic was modified 4 years, 7 months ago by guntiss.
    #27816
    support
    Keymaster

    Hi,

    Unfortunately, it looks like your support period has expired a while ago. Please renew it here and we will be happy to help you.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.