LPC54113 Freertos

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC54113 Freertos

2,201件の閲覧回数
TDC1333
Contributor III

Hi,

I am creating FreeRtos project For LED ON/OFF using LPC54113 MCU as per Demo Code reference .But Freertos vTaskStartScheduler() not working?

Below are the code,

#include <stdio.h>
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "LPC54113.h"
#include "fsl_debug_console.h"
#include "FreeRTOS.h"
//#include "queue.h"
#include "task.h"

void ECG_TASK(void *pvParameters);


/* TODO: insert other include files here. */

/* TODO: insert other definitions and declarations here. */

/*
* @brief Application entry point.
*/
int main(void) {

/* Init board hardware. */
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();

//#ifndef BOARD_INIT_DEBUG_CONSOLE_PERIPHERAL
// /* Init FSL debug console. */
// BOARD_InitDebugConsole();
//#endif
// GPIO_PinWrite(BOARD_INITPINS_SD1_GPIO,BOARD_INITPINS_SD1_PORT,BOARD_INITPINS_SD1_PIN,0U);
xTaskCreate(ECG_TASK, "ECG_task", configMINIMAL_STACK_SIZE, ((void *)0), 1, NULL);
vTaskStartScheduler();

// GPIO_PinWrite(BOARD_INITPINS_SD1_GPIO,BOARD_INITPINS_SD1_PORT,BOARD_INITPINS_SD1_PIN,1U);
while(1);

}

void ECG_TASK(void *pvParameters)
{
while (1)
{
GPIO_PinWrite(BOARD_INITPINS_SD1_GPIO,BOARD_INITPINS_SD1_PORT,BOARD_INITPINS_SD1_PIN,1U);

vTaskDelay(100);

GPIO_PinWrite(BOARD_INITPINS_SD1_GPIO,BOARD_INITPINS_SD1_PORT,BOARD_INITPINS_SD1_PIN,0U);
}
}

Thanks,

TDC

0 件の賞賛
返信
7 返答(返信)

2,181件の閲覧回数
hs2
Contributor I

You should check the return code of xTaskCreate if it was successful at all.
Then you could set a breakpoint on ECG_TASK function to see if it's hit (and the task was started by the scheduler)
Also I'd recommend to enable the debug features FreeRTOS provides like define configASSERT and enable stack checking.
See also https://www.freertos.org/FAQ.html for more useful hints.

0 件の賞賛
返信

2,180件の閲覧回数
TDC1333
Contributor III

xTaskCreate return pdPASS .But scheduler have not start,ECG_TASK function breakpoint not hit.

0 件の賞賛
返信

2,160件の閲覧回数
ErichStyger
Specialist I

did you step into the start scheduler routine to see what is not working? It could be that it run on an assert or into a fault condition. Let it run and then pause with the debugger to see where it is stuck.

0 件の賞賛
返信

2,152件の閲覧回数
TDC1333
Contributor III

@ErichStyger 

Code stuck in Scheduler routing Problem solve.But,

Now Scheduler run only once.For continuous run task what to do ?.

0 件の賞賛
返信

2,168件の閲覧回数
hs2
Contributor I
So something else isn't setup correctly. I think defining configASSERT could help to narrow down the issue.
0 件の賞賛
返信

2,154件の閲覧回数
TDC1333
Contributor III

@hs2

Now Scheduler run only once.For continuous run task what to do ?.

0 件の賞賛
返信

2,150件の閲覧回数
hs2
Contributor I
Did you step through the complete task code ?
Or does it hang in vTaskDelay ?
Is FreeRTOS xTaskIncrementTick() invoked means the SysTick is running correctly ?
0 件の賞賛
返信