Re: Task with statically allocated stack

2021-02-06 Thread Xiang Xiao
On Sat, Feb 6, 2021 at 7:38 AM Gregory Nutt wrote: > > > I am using NuttX-v10.0.1. > > This is fixed in 625eef20f00fbe9bdb4995ad9dfb24b71227e954, which came at > a > > later time. > > Hmm.. I guess I still don't understand the failure. That change was: > > #ifdef CONFIG_STACK_COLORATION >

Re: Task with statically allocated stack

2021-02-06 Thread Gregory Nutt
I am using NuttX-v10.0.1. This is fixed in 625eef20f00fbe9bdb4995ad9dfb24b71227e954, which came at a later time. Hmm.. I guess I still don't understand the failure.  That change was:  #ifdef CONFIG_STACK_COLORATION -  if (tcb->pid != 0) -    { -  memset(tcb->stack_alloc_ptr,

Re: Task with statically allocated stack

2021-02-06 Thread Fotis Panagiotopoulos
Well.. it's not strange at all :) I am using NuttX-v10.0.1. This is fixed in 625eef20f00fbe9bdb4995ad9dfb24b71227e954, which came at a later time. I just tried master, which brought the expected results. Thank you. Στις Σάβ, 6 Φεβ 2021 στις 5:27 μ.μ., ο/η Gregory Nutt έγραψε: > On 2/6/2021 9:

Re: Task with statically allocated stack

2021-02-06 Thread Gregory Nutt
On 2/6/2021 9:13 AM, Fotis Panagiotopoulos wrote: Indeed I was expecting arm_usestack() to do the colorization, but apparently it doesn't. That is what is confusing because it does do the coloration: https://github.com/apache/incubator-nuttx/blob/master/arch/arm/src/common/arm_usestack.c#L153

Re: Task with statically allocated stack

2021-02-06 Thread Fotis Panagiotopoulos
has to be 8 byte aligned. So you need attributes on >> your variable called stack to set the alignment. >> >> David >> -Original Message- >> From: Fotis Panagiotopoulos [mailto:f.j.pa...@gmail.com] >> Sent: Saturday, February 06, 2021 6:08 AM >> To: dev@nuttx.apac

Re: Task with statically allocated stack

2021-02-06 Thread Fotis Panagiotopoulos
t; > David > -Original Message- > From: Fotis Panagiotopoulos [mailto:f.j.pa...@gmail.com] > Sent: Saturday, February 06, 2021 6:08 AM > To: dev@nuttx.apache.org > Subject: Task with statically allocated stack > > Hi, > > I am trying to create a new tas

Re: Task with statically allocated stack

2021-02-06 Thread Gregory Nutt
You have to init the memory used for the stack: Have a look in the normal tasking init , and you will see the call out to init the stack, that you neeed to call. arm_usestack() should be called in this case and won't that initialize (colorize) the stack?

RE: Task with statically allocated stack

2021-02-06 Thread David Sidrane
-Original Message- From: Fotis Panagiotopoulos [mailto:f.j.pa...@gmail.com] Sent: Saturday, February 06, 2021 6:08 AM To: dev@nuttx.apache.org Subject: Task with statically allocated stack Hi, I am trying to create a new task using a statically allocated stack. Here is my code: static struct

Task with statically allocated stack

2021-02-06 Thread Fotis Panagiotopoulos
Hi, I am trying to create a new task using a statically allocated stack. Here is my code: static struct task_tcb_s tcb; static uint8_t stack[CONFIG_NETWORK_THREAD_STACKSIZE] void start_my_thread() { memset(&tcb, 0, sizeof(struct task_tcb_s)); tcb.cmn.flags = TCB_FLAG_TTYPE_TASK;