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.

TMS320F280049C: error #20: identifier "GpioCtrlRegs" is undefined

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG, LAUNCHXL-F280049C

Hi,

I am trying to qualify a GPIO through sampling window (6-samples) by modifying epwm_ex3_synchronization. The folowing lines of code were added to the epwm_ex3_synchronization.c file to execute this: 

void configureGPIOs(void) {
EALLOW;

// Set GPIO56 as input
GpioCtrlRegs.GPBDIR.bit.GPIO56 = 0;

// Clear GPIO55
GpioDataRegs.GPBCLEAR.bit.GPIO56 = 1;

// Set the qualification period for GPIO pins in QUALPRD3 to 0xD0
GpioCtrlRegs.GPBCTRL.bit.QUALPRD3 = 0xD0;

// Set the qualification selection for GPIO34 to 2 (example)
GpioCtrlRegs.GPBQSEL2.bit.GPIO56 = 2;

EDIS;
}

This resulted to the following errors which I ahve tried reolving to no avail:

>> Compilation failure
subdir_rules.mk:9: recipe for target 'epwm_ex3_synchronization.obj' failed
"../epwm_ex3_synchronization.c", line 231: error #20: identifier "GpioCtrlRegs" is undefined
"../epwm_ex3_synchronization.c", line 234: error #20: identifier "GpioDataRegs" is undefined
2 errors detected in the compilation of "../epwm_ex3_synchronization.c".
gmake: *** [epwm_ex3_synchronization.obj] Error 1

.

.

gmake: Target 'all' not remade because of errors.

I have attached the project file for your kind help.8015.epwm_ex3_synchronization.zip

Regards,

  • HI Olutayo,

    Was this project imported from the "driverlib" folder in C2000Ware? The code you have added is only supported by bitfield based projects (located in the device support folder)

    You can use the GPIO_setQualificationMode function to configure this.

    I'd recommend you use SysConfig or refer to our GPIO examples in the driverlib folder to configure GPIOs.

    Let me know if you have additional questions.

    Thank you,

    Luke

  • Hi Luke,

    Thank you for your advice.

    The project was imported from "C:\ti\C2000Ware_4_02_00_00\driverlib\f28004x\examples\epwm\CCS\epwm_ex3_synchronization2". Please see my comments below in response to your recommendations:

    1. "SysConfig option": In this project, I'm using SysConfig option. Unfortunately, there is no menu to input the Qual period for the six-samples  for the GPIO qualification. The options availabble are shown below:


    One other issue is that there is zero signal (voltage) on GPIO 56 when measured with oscilloscope. To double-check, I tried to set up GPIO58 in ouput mode (high) as shown below - zero voltage also. Please note that my PWMs are working perfectly on other GPIOs (say 00 - 01).

    2. "GPIO examples option": I imported the GPIO example from C:\ti\C2000Ware_4_02_00_00\device_support\f28004x\examples\gpio. It built okay and debuged fine (example 1) but just like the problem with the No. 1 above, there is no output signal on (for insatnce) GPIOs 8 - 11. 

    3. I tried to add sysconfig file from No. 1 above to the GPIO example in no. 2 above but retured the error below when built from RAM: 

    gmake: *** [build-902921329] Error 1
    gmake: Target 'all' not remade because of errors.

    It built successfully on FLASH but no output from my PWM and the GPIO.

    While I await you kind advice on the above issues, assuming the issues above are resolved, can you please let me know if the following is executable: if I add the following line of code GpioCtrlRegs.GPBCTRL.bit.QUALPRD3 = 0xD0; to the gpio_ex1_setup.c file to work with the GPIO qualification set up in the sysconfig (I am proposing this option because the Qual period menu is not available in sysconfig as pointed out in No. 1 above). 

    I attached the projects if this helps. Please note that I am using LAUNCHXL-F280049C.

    Apologies - too many issues arround this - looking forward for your kind advice.

    Regards.

    0728.epwm_ex3_synchronization.zip

    gpio - Olutayo.zip

  • Hi Olutayo,

    1. What do you mean there is no option to input the qual period to 6 samples? This option exists in the drop down:

    The "58" you are seeing applies to the pin number. If you click on "Preferences and Actions in the top right of SysConfig, you can modify your Device Pin Label to show GPIO numbers instead, or GPIO numbers + the pin number.

    2. This issue may be resolved after you select the GPIO number instead of the pin number

    3. Can you show the entire error message? The error message you've shown doesn't seem to show the cause of the issue.

    SysConfig configures the following register by calling the GPIO_setQualificationMode function:

    Thank you,

    Luke

  • Hi Luke,

    Thank you for your feedback.

    1. I can see the pin naming options in "Preferences and Actions" and that helps (thanks). However, I have taken note of this confusion and that was why I ensured I tested the GPIOs on (GPIO8 (pin 74) - GPIO11 (pin 52)). I have double-tested again, there is no output on both input and output configurations. Please note that the empw septup using the sysconfig is working in the 0728.epwm_ex3_synchronization.zip but not in gpio - Olutayo.zip.

    2. Qual period: In the TRM (pp 945, please see the figures below), the qual period can be set between 0-255. In conventional coding, the hexadecimal equivalent of the number chosen from 0-255 will be entered in (for example) as  GpioCtrlRegs.GPBCTRL.bit.QUALPRD3 = 0xD0; The menu for the type of qualification (e.g, three- or six-sample) in sysconfig is available but the menu for the qualification period is not available (may be I am missing or misunderstanding something). 

    To provide more clarification on the qual period, in the C2000 microconroller blockset in Simulink (for instance), the qual period can be set as shown in the screeshot below. Please not that I have deliberately entred a wrong value for you to see the acceptable range.

    3. I can see that you probably skipped one of my questions viz "..while I await you kind advice on the above issues, assuming the issues above are resolved, can you please let me know if the following is executable: if I add the following line of code GpioCtrlRegs.GPBCTRL.bit.QUALPRD3 = 0xD0; to the gpio_ex1_setup.c file to work with the GPIO qualification set up in the sysconfig (I am proposing this option because the Qual period menu is not available in sysconfig as pointed out in No. 1 above)".

    4. Error message on building from RAM in gpio - Olutayo.zip: The full console message is shown below. Thank you in anticipation of further help.


    **** Build of configuration CPU1_RAM for project gpio_ex1_setup ****

    "C:\\ti\\ccs1210\\ccs\\utils\\bin\\gmake" -k -j 8 all -O

    Building file: "../epwm_ex3_synchronization.syscfg"
    Invoking: SysConfig
    "C:/ti/ccs1210/ccs/utils/sysconfig_1.14.0/sysconfig_cli.bat" --script "C:/ti/C2000Ware_4_02_00_00/driverlib/f28004x/examples/epwm/CCS/gpio_ex1_setup/epwm_ex3_synchronization.syscfg" -o "syscfg" --compiler ccs

    Usage:
    cli [-o <dir>] [-s <file>] [-u <string>] [-b <name>] [-d <name>] [-p <name>] [-r <name>] [--treatWarningsAsErrors] [--quiet -q] <script>
    cli --help
    cli --version

    example: cli -s meta_data/sdk.json -d MSP432P401R scripts/two_uarts.js
    example: -s sdk.json -d MSP432P401R -o ./display_cfg sdk/cfgs/display.syscfg

    Note that the all arguments other than '--help' and '--version' may also be
    specified via the script with an embedded @cliArgs comment directive.
    E.g. // @cliArgs -d MSP432P401R

    If an argument is embedded in a script and explicitly specified via the CLI
    then precedence is given to the CLI arguments. Additionally, specifying
    "--board" or "--device" on the CLI will override any "--board" and "--device"
    arguments specified in the script.

    subdir_rules.mk:9: recipe for target 'build-902921329' failed
    Invalid argument '--product': No product with name "C2000WARE" and version "4.02.00.00" found
    gmake: *** [build-902921329] Error 1
    gmake: Target 'all' not remade because of errors.

    **** Build Finished ****

    Reagards,

     

  • Hi Olutayo,

    I will need some time to test the examples you've provided to identify the issue, I'll get back to you sometime this week.

    Thank you,

    Luke

  • Hi Olutayo,

    I will be on vacation until end of June, I'll continue working on this once I return.

    Thank you,

    Luke

  • Hi Olutayo,

    You can use the GPIO_setQualificationPeriod driverlib function to do this instead of writing to GpioCtrlRegs.GPBCTRL.bit.QUALPRD3.

    Are you using C2000Ware version 4.02?

    Could you share your .sysfg file and a screenshot of the following menu in your project properties?

    Example:

    Thank you,

    Luke

  • It seems the menu option for setting the qualification period between samples is missing. I will file a ticket to have this added in SysConfig

    Thank you,

    Luke