This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28375S: TMS320F28375S

Part Number: TMS320F28375S
Other Parts Discussed in Thread: SYSCONFIG

Hello Team,

I am using ccs 12.6.0 with sysconfig 1.19.0. I want to use FreeRTOS in my project. i am new to this controller. can you please help me with how to start with FreeRTOS in TMS320F28375S?

i have launchpad F28379D for use. i started with configuring FreeRTOS in sysconfig but it is giving error as shown below.

then do some changes in my cmd file.

now, i am able to build my project. but i am not able to execute the task while debugging. my code stucks and not going inside the task.

//###########################################################################

//
// Included Files
//

#include "driverlib.h"
#include "board.h"
#include "FreeRTOS.h"
#include "c2000_freertos.h"
#include "FreeRTOSConfig.h"


//
// Globals
//


//
// Function Prototypes
//
void mcu_task1(void* pvParameters);

//
// Main
//
void main(void)
{

    //
    // Intialize device clock and peripherals
    //
    Device_init();

    //
    // Disable pin locks and enable internal pullups.
    //
    //Device_initGPIO(); //skipped for this example

    //
    // Initialize PIE and clear PIE registers. Disables CPU interrupts
    //
    Interrupt_initModule();

    //
    // Initialize the PIE vector table with pointers to the shell Interrupt
    // Service Routines (ISR).
    //
    Interrupt_initVectorTable();

    //
    // Initialize resources
    //
    Board_init();

    //
    // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
    //
    EINT;
    ERTM;

    FreeRTOS_init();

    for(;;)
    {

    }
}

void mcu_task1(void* pvParameters)
{
    GPIO_togglePin(19);
    vTaskDelay(500);
}

//
// End of file
//

any help will be highly appreciated.

thanks and regards.

  • Hi Muzammil,

    A couple of observations from looking at your code:

    1) When initializing tasks with Sysconfig, you will notice #pragma DATA_SECTION(taskStack, ".freertosStaticStack") in the c2000_freertos.c file. This is required since in C28x devices, the stack pointer only has access to memory range 0x0000 - 0xFFFF. Therefore, you will need to provide the .freertosStaticStack section in your linker command file, to ensure allocations are within this range.

    2) Your mcu_task1() function does not execute in a loop. So, after the first time the task runs and the function is done executing, it will return from the function and go into an unpredictable state. If this is the desired flow, then you would need to appropriately delete the task to avoid errors.

    Both of these could be possible reasons for the error you're facing. Do let me know if this helps. If this doesn't resolve the issue, I can take a look at your project and help debug further.

    Thanks,

    Arnav

  • Hello Arnav,

    Thanks for the help buddy.

    the two problems mentioned by you were the exactly which I was facing (both).

    firstly, I had allocated the RAMGS11,12,13,14 to freertosStaticStack. (not were in range of 0x0000 to 0xFFFF).

    secondly, I forgot to put a while loop inside my task.

    this resolved my issue.

    thank you so much.