Creating a PE + MQX project in KDS and one user task results in the user task blocking the init task (because the init task has its priority set to lowest + 1).
The main problem with this is when using auto initialization of e.g. GPIO, the user task cannot use GPIO since it is initialized *after* the user task is created and run (see below).
Should the _bsp_post_init() function be used to signal the user task that it is ok to proceed? This would require *all* user tasks to block until _bsp_post_init() gives clearance to proceed.
Wouldn't it be better if the init task had highest priority assuring it to complete before any other task is started? Isn't the purpose of the init task to *init* the system *before* anything else is run?
void Components_Init(void)
{
/* Debug console initialization */
DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, DEBUG_UART_BAUD, DEBUG_UART_TYPE);
/*! Task1 Auto initialization start */
(void)Task1_Init();
/*! Task1 Auto initialization end */
/*! gpio1 Auto initialization start */
GPIO_DRV_Init(NULL,gpio1_OutConfig0);
/*! gpio1 Auto initialization end */
}
已解决! 转到解答。
Thanks for your comments Bjorn.
I will report this to development team.
Best regards,
Carlos
This appears to be solved in KDS 3.0 + KSDK 1.2 as it looks like user tasks are now created by the main task along with the other components. The order of the components in the KDS 3.0 Components tree determines the order that components are created, so just make sure that OS_Task components are at the bottom of the tree (drag and drop).
Thank you development team and co.
Adrian.