How to run FreeRTOS on PSoC5 LP

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
eglic_2595086
Level 1
Level 1

Hello

I have dev-boart CY8CKIT-059 PSoC® 5LP and try run FreeRTOS v 10.0.1

The project is bulded successfully, however, the LED don't blink.

My application is:

void vTask1( void *pvParameters )

{

       

    while ( 1 )

    {

        LED_Write(~LED_Read());                                   // LED - Digital Output Pin v2.20, mapped to port P2.1

        vTaskDelay(1000 / portTICK_PERIOD_MS);     // also try change value "1000" for other value

    }

        vTaskDelete( NULL );

}

int main(void)

{

    CyGlobalIntEnable; /* Enable global interrupts. */

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    BaseType_t xReturned;

   

    LED_Write(0);               // after uploading the programm - LED blink

    CyDelay(2000);

   

    LED_Write(1);

    CyDelay(2000);

   

    LED_Write(0);

    CyDelay(2000);

    xReturned = xTaskCreate(vTask1, (signed char *) "Task1", configMINIMAL_STACK_SIZE, NULL, 1, NULL );

   

if( xReturned == pdPASS )

    {

        for (int i=0; i<5; i++)

        {

            LED_Write(~LED_Read());          //here it also blink

            CyDelay(500);

        }

        LED_Write(0);

    }

   

    vTaskStartScheduler();               // after that - LED don't blink

   

    LED_Write(1);

   

    for (;;);

}

The "FreeRTOSConfig.h" I get from "..\FreeRTOS\Demo\CORTEX_CY8C5588_PSoC_Creator_GCC\FreeRTOS_Demo.cydsn\"

and change only

#define configCHECK_FOR_STACK_OVERFLOW value "2" -> value "0"

/#define configUSE_MALLOC_FAILED_HOOK value "1" -> value "0"

During the degug - I do "step into " "vTaskStartScheduler", the the xTaskCreate(prvIdleTask, ...) has done successfully and when I reach "xPortStartScheduler" - nothing happen

Thank you

Also, the basic example I used:

Air Supply Lab - Lesson 11: Real-Time OS FreeRTOS

0 Likes
1 Solution
RoBO_1287886
Level 4
Level 4
First solution authored 25 replies posted 10 replies posted

hello,

I have also CY8CKIT-059 but i'm beginner in FreeRTOS 😉

I'm measuring the feasibility of FreeRTOS for my application.

I found a sample project also (may be into 9 version).

GitHub - btodoroff/FreeRTOS_CY8CKIT_059: Port of FreeRTOS Demo to CY8CKIT-059

Robin

View solution in original post

0 Likes
3 Replies
RoBO_1287886
Level 4
Level 4
First solution authored 25 replies posted 10 replies posted

hello,

I have also CY8CKIT-059 but i'm beginner in FreeRTOS 😉

I'm measuring the feasibility of FreeRTOS for my application.

I found a sample project also (may be into 9 version).

GitHub - btodoroff/FreeRTOS_CY8CKIT_059: Port of FreeRTOS Demo to CY8CKIT-059

Robin

0 Likes
eglic_2595086
Level 1
Level 1

    extern void xPortPendSVHandler( void );

    extern void xPortSysTickHandler( void );

    extern void vPortSVCHandler( void );

    extern cyisraddress CyRamVectors[];

/* Install the OS Interrupt Handlers. */

CyRamVectors[ 11 ] = ( cyisraddress ) vPortSVCHandler;

CyRamVectors[ 14 ] = ( cyisraddress ) xPortPendSVHandler;

CyRamVectors[ 15 ] = ( cyisraddress ) xPortSysTickHandler; 

I add the code above on the begin of main function and project so-so start execution %)

So-so, because at this moment vTaskDelay don't work. The delay I realized via CyDelay(<value>);

0 Likes