Skip to content

painted stack measure do not work #2

@pat1

Description

@pat1

The routine mu_StackPaint is not executed in section .init1
I use platformio and board = 1284p16m
better results with this approach:
https://www.avrfreaks.net/comment/1314296#comment-1314296
with little modification to take in account heap:

extern uint8_t _end;

void simpleStackPaint(void)
{
    uint8_t *p = &_end;

    while(p < (uint8_t*)&p)
    {
        *p = 0xc5;
        p++;
    }
} 

uint16_t simpleStackCount(void)
{
  const uint8_t *p =  (int) (__brkval == 0 ? (uint8_t *) &__heap_start : __brkval);
  //const uint8_t *p = &_end;
    uint16_t       c = 0;

    while(*p == 0xc5 && p < (uint8_t*)&p)
    {
        p++;
        c++;
    }

    return c;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions