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.

TMS570LS0432: Starting LED Blinking Program

Part Number: TMS570LS0432
Other Parts Discussed in Thread: HALCOGEN

Hi TI Community,

I am doing a program to turn on a led in TMS570LS0432 launch pad, I found one YouTube video https://www.youtube.com/watch?v=tsVmpH6Pm2U here i did same thing as per video, but CCS is throwing errors that 

"../source/sys_main.c", line 90: error #148: declaration is incompatible with "void gioNotification(gioPORT_t *, uint32)"

i have included gio.h also pls find code below:

/* USER CODE BEGIN (0) */
#include "het.h"
/* USER CODE END */

/* Include Files */

#include "sys_common.h"
#include "gio.h"

/* USER CODE BEGIN (1) */
/* USER CODE END */

int main(void)
{
/* USER CODE BEGIN (3) */
   // set port pins to output
   //gioPORTA.DIR |= (1U << 2);
   gioSetDirection(hetPORT1, 0xFFFFFFFF);

       while (1)
       {
           // Turn on the LED
          //gioPORTA.DSET = (1U << 2);
          gioSetBit(hetPORT1, 5, 1); // GIOA2 //on 5th pin led present
       }

/* USER CODE END */

 //   return 0;
}


/* USER CODE BEGIN (4) */

 void gioNotification(int bit)
{
    return;
}

void esmGroup1Notification(int bit)
{
    return;
}

void esmGroup2Notification(int bit)
{
    return;
}

please help me to figured out this I am new to Taxes instruments controllers.

Best Regards,

Tyagi

  • Hi Tyagi,

    Modify the code as below and test it

    /* USER CODE BEGIN (0) */
    #include "het.h"
    #include "esm.h"
    /* USER CODE END */
    
    /* Include Files */
    
    #include "sys_common.h"
    #include "gio.h"
    
    /* USER CODE BEGIN (1) */
    /* USER CODE END */
    
    int main(void)
    {
    /* USER CODE BEGIN (3) */
       // set port pins to output
       //gioPORTA.DIR |= (1U << 2);
       gioSetDirection(hetPORT1, 0xFFFFFFFF);
    
           while (1)
           {
               // Turn on the LED
              //gioPORTA.DSET = (1U << 2);
              gioSetBit(hetPORT1, 5, 1); // GIOA2 //on 5th pin led present
           }
    
    /* USER CODE END */
    
     //   return 0;
    }
    
    
    /* USER CODE BEGIN (4) */
    
     void gioNotification(gioPORT_t *port, uint32 bit)
    {
        return;
    }
    
    void esmGroup1Notification(esmBASE_t *esm, uint32 channel)
    {
        return;
    }
    
    void esmGroup2Notification(esmBASE_t *esm, uint32 channel)
    {
        return;
    }
    /* USER CODE END */

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagdish,

    I tried this but, same error is persists.

    "../source/sys_main.c", line 41: error #148: declaration is incompatible with "void esmGroup1Notification(uint32)" 
    "../source/sys_main.c", line 46: error #148: declaration is incompatible with "void esmGroup2Notification(uint32)" 

  • Hi Tyagi,

    One more small modification is required, here is the code you need to try

    /* USER CODE BEGIN (0) */
    #include "het.h"
    #include "esm.h"
    /* USER CODE END */
    
    /* Include Files */
    
    #include "sys_common.h"
    #include "gio.h"
    
    /* USER CODE BEGIN (1) */
    /* USER CODE END */
    
    int main(void)
    {
    /* USER CODE BEGIN (3) */
       // set port pins to output
       //gioPORTA.DIR |= (1U << 2);
       gioSetDirection(hetPORT1, 0xFFFFFFFF);
    
           while (1)
           {
               // Turn on the LED
              //gioPORTA.DSET = (1U << 2);
              gioSetBit(hetPORT1, 5, 1); // GIOA2 //on 5th pin led present
           }
    
    /* USER CODE END */
    
     //   return 0;
    }
    
    
    /* USER CODE BEGIN (4) */
    
     void gioNotification(gioPORT_t *port, uint32 bit)
    {
        return;
    }
    
    void esmGroup1Notification(uint32 channel)
    {
        return;
    }
    
    void esmGroup2Notification(uint32 channel)
    {
        return;
    }
    /* USER CODE END */

  • Hi Jagdish, 

    I am sharing output of build of this but before that i want to confirm on line number 25 i have given 5 pin number and assigned value high as 1 so this is the correct way of doing this or i need to change it.

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "GIO.out" not built
     
    >> Compilation failure
    makefile:150: recipe for target 'GIO.out' failed
    gmake[1]: *** [GIO.out] Error 1
    makefile:146: recipe for target 'all' failed
    gmake: *** [all] Error 2
    
    **** Build Finished ****
    
     

  • Hi Vishal,

    I can't see the complete build, i don't see the name of symbol that was missing there.

    i have given 5 pin number and assigned value high as 1

    5th pin means controller 5th pin you have LED right?

    If possible, can you please share the schematic of LED where exactly it was connected.

    Or else just give the details of the board you are using and mention the LED which you want to turn ON? so that i will open the corresponding schematic and verify the pin number.

    --
    Thanks & regards,
    Jagadish.

  • Sure Jagdish,

    Please find board details on below link 

    https://www.ti.com/lit/ug/spnu612a/spnu612a.pdf?ts=1705409474734&ref_url=https%253A%252F%252Fwww.google.com%252F

    And led position is on GIOA2 ON pin number 5.

  • Your basic problems is that your prototypes (which you do not show us) do not agree with your functions.

    Your function has the signature

    void esmGroup1Notification(esmBASE_t *esm, uint32 channel)

    but your prototype is indicated to be:

    "void esmGroup1Notification(uint32)"

    So you have two arguments in the function, but only one in the prototype.

  • Hi Keith

    In function 

    void esmGroup1Notification(uint32 channel)
    {
    return;
    }

    Yes I am passing only one argument,  as function definition also have same parameter in declaration. 

    I am sharing complete build result for reference.

    **** Build of configuration Debug for project GIO ****
    
    "C:\\ti\\ccs1250\\ccs\\utils\\bin\\gmake" -k -j 8 all -O 
     
    Building target: "GIO.out"
    Invoking: Arm Linker
    "C:/ti/ccs1250/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin/armcl" -mv7R4 --code_state=32 -g --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi -z -m"GIO.map" --heap_size=0x800 --stack_size=0x800 -i"C:/ti/ccs1250/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib" -i"C:/ti/ccs1250/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="GIO_linkInfo.xml" --rom_model --be32 -o "GIO.out" "./source/dabort.obj" "./source/errata_SSWF021_45.obj" "./source/esm.obj" "./source/notification.obj" "./source/pinmux.obj" "./source/sys_core.obj" "./source/sys_intvecs.obj" "./source/sys_main.obj" "./source/sys_mpu.obj" "./source/sys_pcr.obj" "./source/sys_phantom.obj" "./source/sys_pmu.obj" "./source/sys_selftest.obj" "./source/sys_startup.obj" "./source/sys_vim.obj" "./source/system.obj" "../source/sys_link.cmd"  -llibc.a 
    <Linking>
     
     undefined       first referenced     
      symbol             in file          
     ---------       ----------------     
     gioSetBit       ./source/sys_main.obj
     gioSetDirection ./source/sys_main.obj
     
    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "GIO.out" not built
     
    >> Compilation failure
    makefile:150: recipe for target 'GIO.out' failed
    gmake[1]: *** [GIO.out] Error 1
    makefile:146: recipe for target 'all' failed
    gmake: *** [all] Error 2
    
    **** Build Finished ****
    
     

  • Hi Tyagi,

    Actually, the way you are doing is wrong.

     gioSetBit(hetPORT1, 5, 1); // GIOA2 //on 5th pin led present

    The above line is not correct to SET the GIOA2, actually it will set the HET port 5th pin, i.e. N2HET[5]. This is because you are passing the hetPORT1 as first argument to the gioSetBit function and second argument is 5th bit, so that means you are saying you want to SET the 5th bit of N2HET.

    So, this is not correct. If you really want to SET the GIOA2 bit then do the following thing.

      

    You should pass the first argument as gioPORTA and second as 2 to the gioSetBit function, if you do that then it will SET the GIOA2 bit.

    I could see you are also getting undefined symbol errors for gioSetBit and gioSetDirection function right? this is because you didn't generate the GIO driver from HALCoGen, then only you will get this error.

    Make sure you enabled the GIO driver in HALCoGen.

    Also make sure you generate the code after you enabled the driver.

    I created one project for your requirement. Please use this project as reference and you can also use this project directly to test the GIOA2.

    LED_TEST_TMS570LS0432.zip

    I build this project and i don't see any errors:

    But i didn't test this project as i don't have TMS570LS0432 board, so please test it and let me know the result.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagdish,

    Thank you for detailed reply

    I Modified the changes and build the project it does not show any error but upon flashing, LED is not Turned ON, I tried with the project file you shared with that also LED is not turning ON, I have checked the Schematics of board on following link:

    https://www.ti.com/lit/ug/spnu612a/spnu612a.pdf?ts=1705409474734&ref_url=https%253A%252F%252Fwww.google.com%252F

    This is confirmed that LED Position is on 5th PIN number(GIOA2).

    I tired adding these lines also 

    void gioNotification(gioPORT_t *port, uint32 bit)
    {
        return;
    }
    
    void esmGroup1Notification(uint32 channel)
    {
        return;
    }
    
    void esmGroup2Notification(uint32 channel)
    {
        return;
    }

    But LED is not turning ON.

  • Hi Tyagi,

    The code should work. As i said i don't have board to test it.

    Is it possible for you to setup a meeting with me, show your screen and i will guide you.

    In our organization we are using webex for meetings.

    If you are okay with that, then please mention your convenient time for meeting.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagdish,

    Please schedule a meeting at 3 PM today.

    my Email id is vishal.tyagi1@vvdntech.in 

    Thanks and Regards

    Vishal Tyagi

  • Hi Tyagi,

    I sent you the meeting invite at 3PM today, please confirm it.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagdish,

    Thank you for sharing invitation, I received  it.

    Thanks & regards,
    Tyagi

  • The issue got resolved.

    The problem is that, if we trying to change the direction using "gioSetDirection" without using the "gioInit" then we should manually include the below lines to bring GIO out of RESET.

    gioREG->GCR0 = 1U;
    gioREG->ENACLR = 0xFFU;
    gioREG->LVLCLR = 0xFFU;

    If we didn't use these lines then the GIO will still in RESET mode only and the direction change will not happen.

    --
    Thanks & regards,
    Jagadish.

  • Thank you Jagdish for your prompt support and guiding me.