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.

Getting this error: #20 identifier "GPIO_PD0_M1PWM0" is undefined main.c

Other Parts Discussed in Thread: TM4C1230H6PM, TM4C123GH6PM, EK-TM4C123GXL

Hi,

I wish to generate a PMW signal to control a motor using the LaunchPad. By modifiying Lab15 code of Ti Workshops I get following error:

Description Resource Path Location Type #20 identifier "GPIO_PD0_M1PWM0" is undefined main.c /PROVA_PWM line 41 C/C++ Problem

I have the header pin_map.h included in my code as well as PART_TM4C1230H6PM, TARGET_IS_BLIZZARD_RB1 and ccs="ccs" added in Project properties-->Build-->ARM Compiler-->Advanced options-->Predefined Symbols.

GPIO_PD0_M1PWM0 is used in following function:

GPIOPinConfigure(GPIO_PD0_M1PWM0);

When I replace last line with:

GPIOPinConfigure(0x00030005);

The code works fine. The PWM signal is generated and the motor is turning as a rocket... In pin_map.h,  GPIO_PD0_M1PWM0 is defined as follows:

#define GPIO_PD0_M1PWM0         0x00030005

Any idea on why I can not read properly the header? Where I am mistaken? I have check several posts and all the solutionsposted there seem to do not work.

Thanks in advance

Joan S.

  • Joan Sans said:
    I have the header pin_map.h included in my code as well as PART_TM4C1230H6PM

    The TM4C1230H6PM device doesn't have any Motion PWM Outputs, which is why then PART_TM4C1230H6PM is defined that the GPIO_PD0_M1PWM0 identifier is undefined.

    If you are using the EK-TM4C123GXL launchpad with the TM4C123GH6PM, then in the project should define PART_TM4C123GH6PM instead.

  • @Chester,

    As usual - you dig deep in matters of this vendor's software.    

    Yesterday I searched my 4C123 version of "pin_map.h" - and found NO match to 4C1230H6PM.    As firm/I avoid 4C129 I "chalked this up to the 4C1230 being w/in the 4C129 family" - thus not included w/in my "pin_map.h."

    All this said - what's been MISSED is poster's report that her, "Code works fine!"   And that the PWM signal IS GENERATED!  (and her motor turns (rocket-like, unlikely!)    

    So - I agree w/you that if her MCU is missing "formal, PWM Generators" her success - using that code - cannot be possible!   I am left (only) to conclude that her MCU:

    • is NOT 4C1230H6PM
    • is some variant which includes a PWM Generator

    Nothing else - to my mind - makes sense!

    The record must show that poster "left out" ALL key/critical "PWM Set-Up & Configuration" code - but for that single PWM function...

  • Hi Chester,

    You are right. With PART_TM4C123GH6PM works fine. Actually I could not remember from where I copied-pasted the line, and I did not realized the 0 instead of G.

    Thanks a lot