04-12-2022
05:35 PM
806 Views
karma_JC
Contributor I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I'm calling vTaskDelay in debug mode from a task. However, it is not return. So, does this vTaskDelay have same issue with OSIF_TimeDelay in debug mode???
Thanks
James
PS. Following is the the code:
/*
* Copyright (c) 2013 - 2015, Freescale Semiconductor, Inc.
* Copyright 2016-2017 NXP
* All rights reserved.
*
* THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/* ###################################################################
** Filename : main.c
** Processor : MPC574xG
** Abstract :
** Main module.
** This module contains user's application code.
** Settings :
** Contents :
** No public methods
**
** ###################################################################*/
/*!
** @file main.c
** @version 01.00
** @brief
** Main module.
** This module contains user's application code.
*/
/*!
** @addtogroup main_module main module documentation
** @{
*/
/* MODULE main */
/* Including necessary module. Cpu.h contains other modules needed for compiling.*/
#include "Cpu.h"
#include "FreeRTOS.h"
#include "clockMan1.h"
#include "pin_mux.h"
#include "task.h"
volatile int exit_code = 0;
/* User includes (#include below this line is not maintained by Processor Expert) */
#include "clockMan1.h"
//#include "pins_driver.h"
#define PIN_LOW 0
#define PIN_HIGH 1
#define LED_DELAY_MS ((TickType_t)1000/portTICK_PERIOD_MS)
#define TSK_BASE_PRIORITY (tskIDLE_PRIORITY + 2)
volatile int testValue = 0;
void vSystemInit(void);
void vTestTask(void *pParam);
/*!
\brief The main function for the project.
\details The startup initialization sequence is the following:
* - startup asm routine
* - main()
*/
int main(void)
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
#ifdef PEX_RTOS_INIT
PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of Processor Expert internal initialization. ***/
/* Write your code here */
/* For example: for(;;) { } */
vSystemInit();
PINS_DRV_WritePin(PTG, 2, 1);
PINS_DRV_WritePin(PTG, 3, 1);
PINS_DRV_WritePin(PTG, 4, 1);
PINS_DRV_WritePin(PTG, 5, 1);
xTaskCreate(vTestTask, (const char * const)"TestTask1", configMINIMAL_STACK_SIZE, (void *)0, TSK_BASE_PRIORITY, NULL);
//xTaskCreate(vTestTask, (const char * const)"TestTask2", configMINIMAL_STACK_SIZE, (void *)1, TSK_BASE_PRIORITY+1, NULL);
//xTaskCreate(vTestTask, (const char * const)"TestTask3", configMINIMAL_STACK_SIZE, (void *)2, TSK_BASE_PRIORITY+2, NULL);
//xTaskCreate(vTestTask, (const char * const)"TestTask4", configMINIMAL_STACK_SIZE, (void *)3, TSK_BASE_PRIORITY+3, NULL);
vTaskStartScheduler();
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;) {
if(exit_code != 0) {
break;
}
}
return exit_code;
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
/* END main */
void vSystemInit()
{
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_FORCIBLE );
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
}
void vTestTask(void *pParam)
{
uint32_t ulLED = (uint32_t)pParam;
for(;;){
vTaskDelay(1000); // This can not return in debug
PINS_DRV_WritePin(PTG, 2, 0);
testValue = (testValue + 1) % 100;
PINS_DRV_WritePin(PTG, 2, 1);
//vTaskDelay(LED_DELAY_MS);
//vTaskDelay(LED_DELAY_MS);
}
}
/*!
** @}
*/
/*
** ###################################################################
**
** This file was created by Processor Expert 10.1 [05.21]
** for the NXP C55 series of microcontrollers.
**
** ###################################################################
*/
Solved! Go to Solution.
1 Solution
04-18-2022
09:54 PM
776 Views
lukaszadrapa
NXP TechSupport
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi James,
yes, vTaskDelay also uses OSIF, so the root cause is still the same.
Regards,
Lukas
1 Reply
04-18-2022
09:54 PM
777 Views
lukaszadrapa
NXP TechSupport
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi James,
yes, vTaskDelay also uses OSIF, so the root cause is still the same.
Regards,
Lukas