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.

Using Pinmux with energia

Other Parts Discussed in Thread: ENERGIA, TM4C123GH6PM, TM4C1294NCPDT, EK-TM4C1294XL

Beacuse some of the function in Energia is not so effective, I try to combine CCS code in Energia sketch.

I use Pinmux to define the pins, but the CCS doesn't recognize expressions that are defined in pin_map.h , like GPIO_PD0_T0CCP0 (this file include automatically by pinmux to its output).

I can change every experssion manually, but it is not friendly way to work.

How can I do it normally?

  • Hi Uriel,

    The error surely is more detailed than "doesn't recognize". Could you provide the error log?

    Gonna go ahead and make an educated guess that you only require to add in the top of the sketch "#define PART_TM4C123GH6PM" if you use the TM4C123 launchpad, or "define PART_TM4C1294NCPDT" if you use the connected launchpad (I'm not getting the reference names wrong am I?)

  • Hello Luis,

    I use TM4C1294NCPDT (EK-TM4C1294XL).

    I inserted: "#define PART TM4C1294NCPDT" as your suggestion, but there was no effect.

    This is the error log:

    Description Resource Path Location Type
    'GPIO_PA0_U0RX' undeclared (first use in this function) test_pins.c /test line 130 C/C++ Problem
    'GPIO_PA1_U0TX' undeclared (first use in this function) test_pins.c /test line 100 C/C++ Problem
    'GPIO_PB4_U0CTS' undeclared (first use in this function) test_pins.c /test line 106 C/C++ Problem
    'GPIO_PB5_U0RTS' undeclared (first use in this function) test_pins.c /test line 124 C/C++ Problem
    'GPIO_PD0_T0CCP0' undeclared (first use in this function) test_pins.c /test line 70 C/C++ Problem
    'GPIO_PD1_T0CCP1' undeclared (first use in this function) test_pins.c /test line 76 C/C++ Problem
    'GPIO_PH2_U0DCD' undeclared (first use in this function) test_pins.c /test line 118 C/C++ Problem
    'GPIO_PH3_U0DSR' undeclared (first use in this function) test_pins.c /test line 94 C/C++ Problem
    'GPIO_PK7_U0RI' undeclared (first use in this function) test_pins.c /test line 136 C/C++ Problem
    'GPIO_PM2_T3CCP0' undeclared (first use in this function) test_pins.c /test line 88 C/C++ Problem
    'GPIO_PM3_T3CCP1' undeclared (first use in this function) test_pins.c /test line 82 C/C++ Problem
    'GPIO_PP2_U0DTR' undeclared (first use in this function) test_pins.c /test line 112 C/C++ Problem
    gmake: *** [test_pins.o] Error 1 test C/C++ Problem
    gmake: Target `all' not remade because of errors. test C/C++ Problem

    And this is the full sketch:

    #include "test_pins.h"

    void setup() {
    // put your setup code here, to run once:
    PortFunctionInit();

    }

    void loop() {
    // put your main code here, to run repeatedly:

    }

  • Hello Uriel

    The "_" is missing between PART and TM4C1294NCPDT

    Regards
    Amit
  • Hello Amit,
    I inserted it, with no effect.
  • could you just send the entirety of the sketch folder? it's easier.
  • Ok.

    So first - you can't use .c files. Edit test_pins.c to be a .cpp (just edit the name). It's how energia linker works

    Second, it's curious (but not enough for me to check why), but having the define before including the header doesn't work.
    Add the define "test_pins.h"

    #ifndef __TEST_PINS_H__
    #define __TEST_PINS_H__
    #define PART_TM4C1294NCPDT

    extern void PortFunctionInit(void);

    #endif // __TEST_PINS_H__
  • It is work (also with c file).
    Thanks a lot.
  • No problem.

    With the .c file it failed to link the prototype to the definition. If you get a similar error, now you know