Other Parts Discussed in Thread: HALCOGEN
Tool/software: TI C/C++ Compiler
Hello Team,
I have successfully ran freertos on my hercules micro-controller RM48L952ZWT. Also, I successfully implemented LWIP stack on the micro- controller.
The code is generated through HALCOGEN. I have done both the tasks separately and now when I tried to generate a code for Freertos plus LWIP together through halcogen, I was successful in getting my build through.
But, during testing of the device I am not able to run both together. Only one can run at a time.
I am not sure how to run both the things at once.
For developing freertos I used:-
https://www.ti.com/lit/an/spna237/spna237.pdf
For developing Lwip I used
http://www.ti.com/lit/an/spna239/spna239.pdf
Please let me know what amendments I need to make.
My guess is I need to make some changes in my linker file to adjust the memory.
Below is main.c file
#include "sys_common.h"
#include "system.h"
#include <stdio.h>
#include "gio.h"
#include "emac.h"
/* USER CODE BEGIN (1) */
/* USER CODE BEGIN (1) */
/* Include FreeRTOS scheduler files */
#include "FreeRTOS.h"
#include "os_task.h"
/* USER CODE END */
/* Include HET header file - types, definitions and function declarations for system driver */
#include "het.h"
#include "gio.h"
/* Define Task Handles */
xTaskHandle xTask1Handle_1;
xTaskHandle xTask1Handle_2;
xTaskHandle xTask1Handle_3;
uint8 emacAddress[6U] = {0x00U, 0x08U, 0xEEU, 0x03U, 0xA6U, 0x6CU};
uint32 emacPhyAddress = 1U;
extern void EMAC_LwIP_Main (uint8_t * emacAddress);
/* Task1 */
void vTask1(void *pvParameters)
{
for(;;)
{
/* Taggle HET[1] with timer tick */
gioSetBit(hetPORT1, 16, gioGetBit(hetPORT1, 16) ^ 1);
vTaskDelay(1000);
}
}
/* Task2 */
void vTask2(void *pvParameters)
{
int count1 = 0;
for(;;)
{
/* Taggle HET[1] with timer tick */
gioSetBit(hetPORT1, 27, gioGetBit(hetPORT1, 27) ^ 1);
count1++;
vTaskDelay(1000);
if(count1 == 8)
vTaskDelete(xTask1Handle_2);
}
}
void vTask3(void *pvParameters)
{
int count2 = 0;
while(1)
{
/* Taggle HET[1] with timer tick */
gioSetBit(hetPORT1, 05, gioGetBit(hetPORT1, 05) ^ 1);
count2++;
vTaskDelay(1000);// 1 sec delay
if(count2 == 8)
vTaskDelete(xTask1Handle_3);
}
}
/** @fn void main(void)
* @brief Application main function
* @note This function is empty by default.
*
* This function is called after startup.
* The user can use this function to implement the application.
*/
/* USER CODE BEGIN (2) */
/* USER CODE END */
int main(void)
{
/* USER CODE BEGIN (3) */
gioInit();
EMAC_LwIP_Main(emacAddress);
/* Set high end timer GIO port hetPort pin direction to all output */
gioSetDirection(hetPORT1, 0xFFFFFFFF);
/* Create Task 1 */
if (xTaskCreate(vTask1,"Task1", configMINIMAL_STACK_SIZE, NULL, 1, &xTask1Handle_1) != pdTRUE)
{
/* Task could not be created */
while(1);
}
/* Create Task 1 */
if (xTaskCreate(vTask2,"Task2", configMINIMAL_STACK_SIZE, NULL, 1, &xTask1Handle_2) != pdTRUE)
{
/* Task could not be created */
while(1);
}
if (xTaskCreate(vTask3,"Task3", configMINIMAL_STACK_SIZE, NULL, 1, &xTask1Handle_3) != pdTRUE)
{
/* Task could not be created */
while(1);
}
/* Start Scheduler */
vTaskStartScheduler();
/* Run forever */
while(1);
/* USER CODE END */
}