diff --git a/sched/init/nx_smpstart.c b/sched/init/nx_smpstart.c index 831dd443514..20abe2c2e25 100644 --- a/sched/init/nx_smpstart.c +++ b/sched/init/nx_smpstart.c @@ -168,11 +168,7 @@ int nx_smp_start(void) return ret; } - /* Reinitialize the processor-specific portion of the TCB. This is - * the second time this has been called for this CPU, but the stack - * was not yet initialized on the first call so we need to do it - * again. - */ + /* Initialize the processor-specific portion of the TCB */ up_initial_state(tcb); } diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index b1c4d4626db..d4dff07f2e0 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -528,9 +528,14 @@ void nx_start(void) g_running_tasks[cpu] = &g_idletcb[cpu].cmn; - /* Initialize the processor-specific portion of the TCB */ + /* Initialize the 1st processor-specific portion of the TCB + * Note: other idle thread get initialized in nx_smpstart + */ - up_initial_state(&g_idletcb[cpu].cmn); + if (cpu == 0) + { + up_initial_state(&g_idletcb[cpu].cmn); + } } /* Task lists are initialized */