cancel
Showing results for 
Search instead for 
Did you mean: 

how to enable freeRTOS in autodevkit.

shiva_shankar_e
Associate III

Hello everyone,

I'm currently working with the AEK-AUD-C1D9031 development board and utilizing the "AVAS Compact 2.0 - Test Application" example code from AutoDevKitStudio2.2.1. I'm seeking assistance in extending this example code with FreeRTOS. However, upon including FreeRTOS_RLA, I'm encountering issues with CAN communication. During debugging, I noticed that the flow gets stuck at osalThreadDelayMilliseconds(500). Could anyone offer guidance on resolving this issue? Any help would be greatly appreciated. Thank you.

 

 

shiva_shankar_e_0-1712569601531.png

Here integrated the freeRTOS into project.

shiva_shankar_e_1-1712571195600.png

Added Break point.

shiva_shankar_e_2-1712571266161.png

4 break points added

shiva_shankar_e_3-1712571303198.png

It is hitting 1,3,2 break points

shiva_shankar_e_4-1712571348160.png

it is hitting osalThreadDelayMilliseconds(500);(2 break point)

shiva_shankar_e_5-1712571385813.png

heat the program is stopped.

3 REPLIES 3
Erwan YVIN
ST Employee

Hello Shiva ,

You are limited to the number of breakpoints with PLS 

i recommend to switch in assembler mode and reduce the number of breakpoints.

if you want to use FreeRTOS you should have a main.c like that :

SPC582Bxx_RLA FreeRTOS SERIAL Test Application for Discovery (cf example)

FreeRTOS is using the tick too

uint8_t message_task1[]= "Task1...\r\n";
uint8_t message_task2[]= "Task2...\r\n";

/* Demo tasks */
portTASK_FUNCTION( vTaskOne, pvParameters )
{
  ( void ) pvParameters;
  TickType_t xLastWakeTime = xTaskGetTickCount();
  for ( ;; ) {
    vTaskSuspendAll();
    sd_lld_write(&SD2,message_task1,(uint16_t)(sizeof(message_task1)/sizeof(message_task1[0])));
    xTaskResumeAll();
    pal_lld_togglepad(PORT_E, LED_4);
    vTaskDelayUntil( &xLastWakeTime, 200 );
  }
}

/* Demo tasks */
portTASK_FUNCTION( vTaskTwo, pvParameters )
{
  ( void ) pvParameters;
  TickType_t xLastWakeTime = xTaskGetTickCount();
  for ( ;; ) {
    vTaskSuspendAll();
    sd_lld_write(&SD2,message_task2,(uint16_t)(sizeof(message_task2)/sizeof(message_task2[0])));
    xTaskResumeAll();
    vTaskDelayUntil( &xLastWakeTime, 200 );
    pal_lld_togglepad(PORT_D, LED_5);
  }
}

/*
 * Application entry point.
 */
int main(void) {

  /* Initialization of all the imported components in the order specified in
     the application wizard. The function is generated automatically.*/
  componentsInit();

  /* Enable Interrupts */
  irqIsrEnable();

  /*
   * Activates the serial driver 1 using the driver default configuration.
   */
  sd_lld_start(&SD2, NULL);

  /* Creating first task to blink LED0 */
  xTaskCreate( vTaskOne,
               (const char * const)"task #1",
               configMINIMAL_STACK_SIZE,
               NULL,
               tskIDLE_PRIORITY + 1,
               NULL );

  /* Creating second task to blink LED1 */
  xTaskCreate( vTaskTwo,
               (const char * const)"task #2",
               configMINIMAL_STACK_SIZE,
               NULL,
               tskIDLE_PRIORITY + 1,
               NULL );

  /* Start the FreeRTOS scheduler */
  vTaskStartScheduler();

  Best regards

             Erwan

 

shiva_shankar_e
Associate III

Hi Erwan,

I hope you're doing well.

I'm encountering an issue with osalThreadDelayMilliseconds(500) in the code. It seems that the flow is getting stuck at this line and not progressing further. Despite my efforts, I haven't been able to resolve it.

Could you please lend me a hand with this? Any insights or suggestions you have would be greatly appreciated.

Looking forward to your assistance.

Hi Erwan,

I hope you're doing well.

I'm encountering an issue with osalThreadDelayMilliseconds(500) in the code. It seems that the flow is getting stuck at this line and not progressing further. Despite my efforts, I haven't been able to resolve it.

Could you please lend me a hand with this? Any insights or suggestions you have would be greatly appreciated.

Looking forward to your assistance.