Hello Jagadish, sorry for my delay. I tried your solution on the link TMS570LS3137: Bootloader FreeRTOS program, but it didn't work for me.
I attached my complete code:
When the bootloader had finished, I noticed that the FreeRTOS didn't run (It had to power on the LEDs). So I clicked on 'pause', and I observed that the program showed the following:
I attached my code. Let me know if you want to see a particular piece of code.
sys_main.c
/* Include Files */ #include "sys_common.h" #include "system.h" #include "stdio.h" #include "esm.h" #include "sys_mpu.h" #include "FreeRTOS.h" #include "os_task.h" #include "os_semphr.h" #include "het.h" #include "gio.h" #include "can.h" #include "sci.h" #include "adc.h" #include "sys_vim.h" #include "sys_core.h" #include "bootloader.h" #include "bl_can.h" #include "includes.h" #include "bl_check.h" #include "bl_led_demo.h" #include "bl_config.h" #include "sci_common.h" void initFunction() { _enable_interrupt_(); gioSetDirection(hetPORT1, 0xFFFFFFFF); canInit(); // sciInit(); adcInit(); vimInit(); } /* ********************************************************************************************************* * MAIN ********************************************************************************************************* */ void main(void){ /* USER CODE BEGIN (22) */ systemInit(); _coreEnableIrqVicOffset_(); initFunction(); esmInit(); /* USER CODE END */ _mpuInit_(); RTOSFunction(); }
includes.c
/* Define Task Handles */ xTaskHandle xTask1Handle; xTaskHandle xTask2Handle; xTaskHandle xTask3Handle; xTaskHandle xTask4Handle; xTaskHandle xTask5Handle; xQueueHandle xMainQ = NULL; xQueueHandle xErrQ = NULL; xQueueHandle xComQ = NULL; xQueueHandle xComRx = NULL; xQueueHandle xComIn = NULL; xQueueHandle xSense = NULL; xQueueHandle xTimer = NULL; xSemaphoreHandle xSemaphoreTime = NULL; void vApp(void *pvParameters); void vTimer(void *pvParameters); void vTaskIDLE(void *pvParameters); void vSense(void *pvParameters); void RTOSFunction() { vSemaphoreCreateBinary(xSemaphoreTime); /*Create Queues*/ xMainQ = xQueueCreate(10, sizeof (struct xMessage)); xSense = xQueueCreate(10, sizeof (struct xMessage)); xErrQ = xQueueCreate(10, sizeof (struct xMessage)); xComIn = xQueueCreate(10, sizeof(int)); xComRx = xQueueCreate(10, sizeof(int)); /* Create Tasks */ xTaskCreate(vTimer, "TIMER", configMINIMAL_STACK_SIZE, NULL, 5, &xTask1Handle); xTaskCreate(vApp, "APP", configMINIMAL_STACK_SIZE, NULL, 5, &xTask1Handle); xTaskCreate(vTaskIDLE, "IDLE", configMINIMAL_STACK_SIZE, NULL, 4, &xTask1Handle); /*Create Aperiodic Tasks*/ xTaskCreate(vSense, "HK", configMINIMAL_STACK_SIZE, NULL, 4 , &xTask5Handle); xTaskCreate(vTCP, "TCP", configMINIMAL_STACK_SIZE, NULL, 4, &xTask4Handle); //_mpuInit_(); /* Start Scheduler */ vTaskStartScheduler(); /* Run forever */ while(1); }
sys_link.cmd
MEMORY { /* PARA GRABAR*/ VECTORS (X) : origin=0x00020020 length=0x00000020 FLASH_CODE (RX) : origin=0x00020040 length=0x008000-0x40 fill=0xFFFFFFFF FLASH0 (RX) : origin=0x00028000 length=0x0014FFC0 FLASH1 (RX) : origin=0x00180000 length=0x00180000 STACKS (RW) : origin=0x08000000 length=0x00000800 KRAM (RW) : origin=0x08000800 length=0x00000800 RAM (RW) : origin=(0x08000800+0x00000800) length=(0x0003F800 - 0x00000800) /* USER CODE BEGIN (2) */ /* USER CODE END */ } /* USER CODE BEGIN (3) */ /* USER CODE END */ /*----------------------------------------------------------------------------*/ /* Section Configuration */ SECTIONS { .intvecs : {} > VECTORS /* FreeRTOS Kernel in protected region of Flash */ .kernelTEXT : {} > FLASH0 | FLASH1 .cinit : {} > FLASH0 | FLASH1 .pinit : {} > FLASH0 | FLASH1 /* Rest of code to user mode flash region */ .text : {} > FLASH0 | FLASH1 .const : {} > FLASH0 | FLASH1 /* FreeRTOS Kernel data in protected region of RAM */ .kernelBSS : {} > KRAM .kernelHEAP : {} > RAM .bss : {} > RAM .data : {} > RAM /* USER CODE BEGIN (4) */ /* USER CODE END */ }
Thank you in advance. I'll wait for any suggestions.