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.

RTOS/PROCESSOR-SDK-K2G: The PRU module is missing in the header file, pinmux.h.

Part Number: PROCESSOR-SDK-K2G

Tool/software: TI-RTOS

processor_sdk_rtos_k2g_4_00_00_04

pdk_k2g_1_0_6

I got error when building custom board library with output files generated from TI PinMux.
According to SDK RTOS Release Notes of processor_sdk_rtos_k2g_4_00_00_04,
"Pinmux Tool Integration to Board Library for K2GEVM,K2GICE and AM571x IDK"

I added PR0_PRU0 GPIs and GPOs by selecting PRU_ICSS0_PRU under "Peripherals" tab in TI PinMux tool v4.0.1492. See the figure below.

The generated output file, 66AK2G0x_pinmux_data.c, contains the following:
...
#ifndef BUILDCFG_MOD_PRU_ICSS
#define BUILDCFG_MOD_PRU_ICSS
#endif /* BUILDCFG_MOD_PRU_ICSS */
...
#if defined(BUILDCFG_MOD_PRU_ICSS)
    {CHIPDB_MOD_ID_PRU_ICSS, gPru_icssPinCfg},
#endif /* if defined(BUILDCFG_MOD_PRU_ICSS) */
...


But when built board library I got "CHIPDB_MOD_ID_PRU_ICSS" undefined error as followed:
...
"src/evmK2G/66AK2G0x_pinmux_data.c", line 2132: error #20: identifier
"CHIPDB_MOD_ID_PRU_ICSS" is undefined
1 error detected in the compilation of "src/evmK2G/66AK2G0x_pinmux_data.c".
...


It seems the PRU module is missing in the header file, pinmux.h.
C:\ti\pdk_k2g_1_0_6\packages\ti\board\src\evmK2G\include\pinmux.h
typedef enum
{
    CHIPDB_MOD_ID_CPTS,
    CHIPDB_MOD_ID_PWMSS,
    CHIPDB_MOD_ID_MCASP,
    CHIPDB_MOD_ID_DSS,
    CHIPDB_MOD_ID_TIMER,
    CHIPDB_MOD_ID_DCAN,
    CHIPDB_MOD_ID_GPIO,
    CHIPDB_MOD_ID_MCBSP,
    CHIPDB_MOD_ID_UART,
    CHIPDB_MOD_ID_PCIE,
    CHIPDB_MOD_ID_MMCSD,
    CHIPDB_MOD_ID_DEBUGSS,
    CHIPDB_MOD_ID_GPMC,
    CHIPDB_MOD_ID_EMAC,
    CHIPDB_MOD_ID_CPSW,
    CHIPDB_MOD_ID_DDR,
    CHIPDB_MOD_ID_MCSPI,
    CHIPDB_MOD_ID_USB,
    CHIPDB_MOD_ID_SYSTEM,
    CHIPDB_MOD_ID_I2C,
    CHIPDB_MOD_ID_QSPI,
    CHIPDB_MOD_ID_MLB,
    CHIPDB_MOD_ID_INVALID = UINT32_MAX
} chipdbModuleID_t;

I can build my custom board library successfully after added "CHIPDB_MOD_ID_PRU_ICSS" in pinmux.h.
Is this the correct way to build board library? Am I missing anything else? Thanks.

  • Hi Joshua,

    I've forwarded this to the TI-RTOS experts. Their feedback should be posted here.

    BR
    Tsvetolin Shulev
  • Joshua,

    The correct approach is to use pinmux.h and pinmux_data.c  that are auto generated from pinmux tools.  You can download/ use the cloud based TI pinmux tool for this platform that can be downloaded from here:

    Open the tool and then open the file. K2GEVM.pinmux or K2GICE.pinmux (depends on the board your custom board is based on). This will bring up the interface that looks like the following.

    Select the PRU pins you want to configure and then download the .h and .c file from Generated files tab and replace the files in the board libray.

    Hope this helps.

    Regards,

    Rahul

    We talk about this process in the Processor SDK RTOS Training in the Porting section. (9.5)

    training.ti.com/application-development-using-processor-sdk-rtos

  • Rahul,

    Thanks for your detail instructions.

    Unfortunately, I didn't attach the figure(actually, it is a screen shot of my settings in TI PinMux tool) successfully in my original post. This might mislead you.
    Yes, I was using TI PinMux tool to generate the two files: "66AK2G0x_pinmux.h" and "66AK2G0x_pinmux_data.c" for building board library.


    The pinmux.h file is not an auto generated file in Ti PinMux tool and is different from the generated "66AK2G0x_pinmux.h."
    It is in C:\ti\pdk_k2g_1_0_6\packages\ti\board\src\evmK2G\include\pinmux.h as delivered in processor_sdk_rtos_k2g_4_00_00_04. It does NOT define "CHIPDB_MOD_ID_PRU_ICSS."

    If you check the pinmux.h for iceK2G in C:\ti\pdk_k2g_1_0_6\packages\ti\board\src\iceK2G\include
    It does define "CHIPDB_MOD_ID_PRU_ICSS."
  • Ah.. I understand the question now. Yes, that is correct, if you are going to enable the PRU ICSS then you need to add that to the pinmux.h file as you can see from the iceK2G board library that enables the PRU pins.

    Refer pinmux.h under:
    pdk_k2g_1_0_6\packages\ti\board\src\iceK2G\include