ammannlu wrote on Wednesday, April 25, 2018:
hi
im running freertos on a efm32gg device (MCU),
i have an osal wrapper in c++oo which means, that the thread object is a template class where you input your desired stack size (aligned to 4 bytes of course).
i have random target resets after i call the scheduler start api, my threads execute 1 or 2 times then the reset occures for some reason.
it used to be no problem.
i was wondering if something corrupts the stack ( i checked 10 times that the alignment is right ). in this case, with an c++oo approach, i can easily control memory usage and allocate everying statically. the only thing what im doing (and what i not like this much) is that this way, the stacks are placed randomly in RAM rather than all close by each other and away from any other ram usage… i have concerns that some other program might overshoot and corrupt one of my stacks and this may cause the reset?
is there a tool inside the kernel that i could use to check if external stack manipulation has been happening so i know my system is corrupted?
i was playing with the tought of having 4 bytes before each stack and after, written with a “magic word” where i check periodically if those still are in place, but this covers just start and end, not if some other ressource writes in between.
any advice on how to proceed is highly appreciated!
thank you