Other Parts Discussed in Thread: HALCOGEN, LAUNCHXL2-570LC43
I have a Hercules Safety Development Kit that is running on FreeRTOS v9. I am using Code Composer Studio v11 and HALCoGen v4.
My program hangs in printf(). My SCI is working properly. I included the stdio.h library. The code builds without any issue. As I am new to this platform, I am surely missing something.
A snippet of a test code is given below
#include "FreeRTOS.h"
#include "os_task.h"
#include "HL_sci.h"
#include "HL_het.h"
#include "HL_gio.h"
#include "stdio.h"
#include "HL_sys_common.h"
#define UART sciREG1
#define LENGTH 18
xTaskHandle xTas1kHandle, xTask2Handle;
uint8 TEXT[LENGTH] = {'B', 'u', 't', 't', 'o', 'n', ' ', 'i', 's', ' ', 'p', 'r', 'e', 's', 's', 'e', 'd', ' '};
void consolePrint(sciBASE_t *sci, uint8 *text, uint32 length){
while(length--){
while((sci->FLR & 0x4) == 4);
sciSendByte(sci, *text++);
}
}
void vTask1(void *pvParameters){
for(;;){
gioSetBit(hetPORT1, 0, (gioGetBit(hetPORT1, 0)^1));
printf("Hello World\n\r"); //code hangs here
vTaskDelay(100);
}
}
void vTask2(void *pvParameters){
for(;;){
if((gioGetBit(gioPORTA, 7) == 0)){
consolePrint(UART, &TEXT[0], LENGTH);
vTaskDelay(100);
}
}
}
int main(void)
{
sciInit();
gioSetDirection(hetPORT1, 0xFFFFFFFF);
gioSetDirection(gioPORTA, 0x00000000);
if (xTaskCreate(vTask2, "Task 2", configMINIMAL_STACK_SIZE, NULL, 1, &xTask2Handle) != pdTRUE){
while(1);
}
if (xTaskCreate(vTask1, "Task 1", configMINIMAL_STACK_SIZE, NULL, 1, &xTas1kHandle) != pdTRUE){
consolePrint(UART, &TEXT[0], LENGTH);
}
vTaskStartScheduler();
while(1);
return 0;
}
Can anyone please help me with this issue? Any suggestion is appreciated.
Thank you.
Regards
UA

