nrf5: Setting stack top in main.c. Thanks dhylands for pointing this out.

This commit is contained in:
Glenn Ruben Bakke 2017-02-26 01:29:13 +01:00
parent 64b23e1127
commit 65f3e16775
1 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,8 @@ extern uint32_t _heap_end;
int main(int argc, char **argv) {
mp_stack_set_top(&_ram_end);
// Stack limit should be less than real stack size, so we have a chance
// to recover from limit hit. (Limit is measured in bytes.)
mp_stack_set_limit((char*)&_ram_end - (char*)&_heap_end - 400);