AnsweredAssumed Answered

_mqx_init_task() not completed before user tasks are started - bug?

Question asked by Bjorn Hammarberg on Feb 24, 2015
Latest reply on May 13, 2015 by Adrian Rockall

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 */

}

Outcomes