On 04/18/2018 12:58 PM, novello wrote:
I waold like to know if there is an application note that explain haw to make an application with some thread that are static.Every thread will have an fixed address space.The address space at the moment is fixed in Zephyr. A feature to fuzz the initial stack pointer is available (CONFIG_STACK_POINTER_RANDOM) to provide some unpredictability at runtime, but that's disabled by default.
We have plans to support address space layout randomization on devices with memory management units (MMUs), but this requires some design changes that will happen only in upcoming releases. On systems with memory protection units (MPUs), which comprises the majority of devices supported by Zephyr, there isn't much that can be done WRT randomizing the memory layout besides what we have now.
When creating a thread with k_thread_create(), a pointer to a memory block to be used as a stack has to be passed to the function. A dynamic memory allocator (e.g. malloc) is not required for Zephyr to function. Any sample found in the "samples" directory that calls this function should be sufficient to guide you.