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.

LAUNCHXL2-570LC43: FreeRTOS with external interrupt configuration:

Part Number: LAUNCHXL2-570LC43
Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN

Hi @jagadish gundavarapu ,  

I created a project using TMS570LC4357 development board. I used Halcogen to get it done. In halcogen I selected FreeRTOS but developed my application without creating a task. 

I configured external interrupts with below mentioned I/O pins :

Inputs:   PA0  (with external interrupt on high side) 

           PA6  (with external interrupt on high side) 

           PA7  (with external interrupt on high side) 

           PB2  (with external interrupt on high side) 

Outputs:

           PB6 = User LED 2 

           PB7 = User LED 3 

Execution:

Application work well when I execute the code. Attached is the main.c file for reference. 

HL_sys_main_NoTask_WorkGood.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/** @file HL_sys_main.c
* @brief Application main file
* @date 11-Dec-2018
* @version 04.07.01
*
* This file contains an empty main function,
* which can be used for the application.
*/
/*
* Copyright (C) 2009-2018 Texas Instruments Incorporated - www.ti.com
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

--------------------

Now the Problem Statement:

I have another project which uses FreeRTOS and 2 Task are running in it.

I modified this code to configure above specified I/O pins with external interrupts. 

When I executed my code, it get stuck In os_port.c --> vPortStartFirstTask(); function.  

Below is my freeRTOS config:

Attached is the main.c file with freeRTOS task running in it. 

HL_sys_main_FreeRTOS_Task_NotWorking.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/** @file HL_sys_main.c
* @brief Application main file
* @date 11-Dec-2018
* @version 04.07.01
*
* This file contains an empty main function,
* which can be used for the application.
*/
/*
* Copyright (C) 2009-2018 Texas Instruments Incorporated - www.ti.com
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Did I placed the "void gioNotification(gioPORT_t *port, uint32 bit)" function at the right place in my main.c file?

Below is the  gioNotification(gioPORT_t *port, uint32 bit)  function in my main.c file: 

/* USER CODE BEGIN (4) */
void gioNotification(gioPORT_t *port, uint32 bit)
{
if(port == gioPORTB && bit == 2)
{
PB2_Flag = true;
PROX1_A_Flag = true;
PROX1_A_Counter++; // Increment counters for Sensor 1 based on received signal A
}
else if(port == gioPORTA && bit == 0)
{
PA0_Flag = true;
PROX1_B_Flag = true;
PROX1_B_Counter++; // Increment counters for Sensor 1 based on received signal B
}
else if(port == gioPORTA && bit == 6)
{
PA6_Flag = true;
PROX2_B_Flag = true;
PROX2_B_Counter++; // Increment counters for Sensor 2 based on received signal B
}
else if(port == gioPORTA && bit == 7)
{
PA7_Flag = true;
PROX2_A_Flag = true;
PROX2_A_Counter++; // Increment counters for Sensor 2 based on received signal A
}
else
{
PROX1_A_Flag = PROX1_B_Flag = PROX2_A_Flag = PROX2_B_Flag = false ;
}
}
/* USER CODE END */

Can you help me to fix the code? 

  • Hi Vivek,

    I verified your both the applications with RTOS and without RTOS and i didn't find out any issues there.

    Did I placed the "void gioNotification(gioPORT_t *port, uint32 bit)" function at the right place in my main.c file?

    Yes, it is fine to be placed there.

    Is it possible for you to share your complete projects of both, so that i can debug them directly on my Lauchpad. You can send them through private chat as well.

    --
    Thanks & regards,
    Jagadish.

  • Hey Jagadish,

    I managed to fix this issue. 

    I did some silly mistake in gio.c file and messed up my RMII pins configurations. I fixed it and its working well. 

    My interrupt config is also working well now....

    But just in case anyone wants a reference project for interrupt configuration, I am happy to leave this project here attached. 

    Have a happy programming...

    Attached project details:

    > Development Board: TI Hercules TMS570LC4357 development board .

    > INPUT: 4 pins are configured for external interrupt configuration:

      PB2 [Ball F2]   ,   PA0[Ball A5]    ,     PA6[Ball H3]      ,     PA7[Ball M1]

    > OUTPUT: Output will be displayed on User LED2&3:

        USER LED 2 = PB6[Ball J2]

        USER LED 3 = PB7[Ball F1]

    > Halcogen used for pin configuration. Kindly refer Halcogen project. 

    Workspace_InterruptConfig.zip