CH_DBG_FILL_THREADS should fill the main stack Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
Post Reply
User avatar
wurstnase
Posts: 121
Joined: Tue Oct 17, 2017 2:24 pm
Has thanked: 43 times
Been thanked: 30 times

CH_DBG_FILL_THREADS should fill the main stack

Post by wurstnase »

Hi,

currently only CH_DBG_ENABLE_STACK_CHECK will fill the main-stack.
Also

Code: Select all

static inline stkalign_t *chThdGetWorkingAreaX(thread_t *tp)
should be available with CH_DBG_FILL_THREADS.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CH_DBG_FILL_THREADS should fill the main stack

Post by Giovanni »

Hi,

The main stack is not defined in the RTOS code, it is part of the normal C runtime because it is already in use upon main() function entry and before chSysInit() is called (you cannot clear a stack you are running on), the allocation is statically done in the linker file.

The fill options for system stacks are available in the startup file crt0xx.S:
- CRT0_STACKS_FILL_PATTERN
- CRT0_INIT_STACKS

Giovanni
Post Reply