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.

AM335x Profibus TX GPIO configuration

Guru 15520 points
Other Parts Discussed in Thread: PROFIBUS, SYSBIOS

Hi,

I have a question about AM335x Profibus slave application.

Q1.
In AM335x ICEv1 board, I guess GPIO3_19(C13 pin) is being used as pr1_pru0_pru_r30[5]
and it is used as Profibus TX control GPIO, is it correct?

Q2.
If I want to use C13 pin as other function,
is it available to change to other pr1_pru0_pru_r30[n] for Profibus TX Control usage?

Q3.
If Q2 answer is "Yes", which source code of ISDK need to be modify?
In SDK/examples\profibus_slave/APP/am33xx_bsp.c, there are following code in BSP_Init(void).
*************************************************************************************
g_pL2GlobVar->PruTxGpioNum = 5; //pr1_pru0_pru_r30[5] is used as TX GPIO for PROFIBUS
*************************************************************************************

If I'm going to use pr1_pru0_pru_r30[1] as Profibus TX Control GPIO,
do I only need to change the "PruTxGpioNum" value from 5 to 1?

best regards,
g.f.

  • Hi,

    The ISDK team have been notified. They will respond here.
  • Hi g.f

    Q1. From code inspections we have:.

    g_pL2GlobVar->PruTxGpioNum = 5; //pr1_pru0_pru_r30[5] is used as TX GPIO for PROFIBUS

    However, in latest sysbios_ind_sdk_02.01.02.02 I only see pinmux defined for for ICEv2, below snippet code.

    profi_appl_config.h

    PINMUX_config iceV2Mux[] =

    {

        {CHIPDB_MOD_ID_PRU_ICSS, 1, 0},

        {CHIPDB_MOD_ID_I2C, 0, 0},

        {0xFFFFFFFF, 0, 0}

    };

    In order to confirm, which ISDK are you testing? your test is on ICEv1 or ICEv2?

    thank you,

    Paula

  • Hi Paula,

    Thank you for the reply.

    Actually, this question is from my customer.
    Right now, they are using ISDK v01.xx.xx.xx and customer board which are ICEv1 base.

    But in near future, they are planning to change ISDK to newest v2.
    As you mention above, ISDKv2 only define pinmux for ICEv2, so they might modify their board to ICEv2 base.

    So, we would like to know against following cases.
    Case1. ISDKv1 with ICEv1
    Case2. ISDKv2 with ICEv1
    Case3. ISDKv2 with ICEv2

    best regards,
    g.f.
  • Hi g.f, let me recommend you some links

    For ICEv1 I found below links:

    For ICEv2

    I would suggest to use any "General purpose IO", which is not in use in Profibus for your customer specific need. In a quick search GPIO3_20 on ICEv2 seems to be a good candidate.

    Thank you,

    Paula

  • Hi Paula,

    Thank you for the reply.

    Our customer want to know how to set the pin which is for PROFIBUS TX GPIO.
    In "profi_appl_config.h" file of ISDK v01.xx.xx.xx, PINMUX mode of GPIO_19(C13 pin) are
    set to MODE5 which function as "pr1_pru0_pru_r30_5" and act as PROFIBUS TX GPIO.
    This PINMUX setting is same against ICEv1 and ICEv2.

    And as I mention above, in ISDK v01.xx.xx.xx/examples\profibus_slave/APP/am33xx_bsp.c,
    there are following code in BSP_Init(void).
    *************************************************************************************
    g_pL2GlobVar->PruTxGpioNum = 5; //pr1_pru0_pru_r30[5] is used as TX GPIO for PROFIBUS
    *************************************************************************************

    Our customer want to use other pin, not GPIO_19(C13 pin) for PROFIBUS TX GPIO.
    In document "PROFIBUS_FDL_API.pdf"page.28 which is include in ISDK, it said as follow:
    *****************************************************************
    Set to “n” for pr1_pru0_pru_r30[n] used as TX GPIO for PROFIBUS
    *****************************************************************
    So, I guess it's necessary to use pr1_pru0_pru_r30[x] which is pin of PRU0, not general purpose IO of peripheral
    for PROFIBUS TX GPIO,

    I have following question :
    Q1.
    When using ISDK v01.xx.xx.xx, what setting is needed for using other pin for PROFIBUS TX GPIO?
    Is it only changing PINMUX mode in "profi_appl_config.h" and changing the number of pr1_pru0_pru_r30[n] in "am33xx_bsp.c"?

    Q2.
    When using ISDKv02.xx.xx.xx, what setting is needed for using other pin as PROFIBUS TX GPIO?
    Is it only changing PINMUX mode in "profi_appl_config.h" and changing the number of pr1_pru0_pru_r30[n] in "am33xx_bsp.c"?
    But in "profi_appl_config.h" of ISDKv2, mode setting of PINMUX are written as follow and
    I don't know how to change the PINMUX mode:
    ***********************************
    PINMUX_config iceV2Mux[] =
    {

    {CHIPDB_MOD_ID_PRU_ICSS, 1, 0},

    {CHIPDB_MOD_ID_I2C, 0, 0},

    {0xFFFFFFFF, 0, 0}

    };
    ***********************************

    Q3.
    As you mention above, PINMUX mode setting are provided only for ICEv2 in ISDK v2.
    Does ISDK v2 support ICEv1?

    best regards,
    g.f.
  • Hi Paula,

    I think I found the way to set the PINMUX in ISDKv2.

    Is following configuration correct to change the pin C13 to other pin for PROFIBUS TX GPIO?

    I modified the "am335x_icev2_pinmux_data.c" which is in C:\ti\sysbios_ind_sdk_02.01.02.02\sdk\starterware\board\am335x

    1. Erased the PINMUX configuration of C13 pin which are defined in "pinmuxPerCfg_t gPru_icss1PinCfg[]"
    2. Add the PINMUX setting of D13 pin for example in "pinmuxPerCfg_t gPru_icss1PinCfg[]" as follow:
    ********************************************************************************
    {
    /* My PRU_PRUSS1 1 -> pr1_pru0_pru_r30[6] -> D13 */
    PIN_MCASP0_AXR1, (uint16_t)PINMUX_SS_PRU_ICSS_PRU0, \
    ( \
    PIN_MODE(5) | \
    ((0x38) & (~PIN_PULL_UD_EN & ~PIN_PULL_TYPE_SEL & ~PIN_RX_ACTIVE)) \
    ) \
    }
    ********************************************************************************
    3.Build the C:\ti\sysbios_ind_sdk_02.01.02.02\sdk\starterware\board project
    4.Build the Profibus_slave project

    Then I load the .out of Profibus_slave project.
    It seem that PINMUX of D13 was set to mode#5 correctly as I expected.

    So, if above PINMUX configuration is correct, can you please anwser to the other questions
    which I posted previously?

    best regards,
    g.f.
  • Hi g.f, I am glad you were able to change Profibus TX GPIO for ICEv2 on ISDKv2. About your other two questions:
    1) Yes, please modify profi_appl_config.h and am33xx_bsp.c accordingly, and rebuild the application.
    3) ISDKv2 doesn't support ICEv1..
    processors.wiki.ti.com/.../SYSBIOS_Industrial_SDK_02.01.01_User_Guide

    Thank you,
    Paula
  • Hi Paula,

    Thank you for the reply and sorry for the delay.

    May I ask again to make me sure?
    I was able to change the PINMUX setting in ISDKv2.
    So, if user want to change the PROFIBUS TX GPIO, is above modification in ISDKv2 correct ?
    Does user need to modify any other source code in ISDKv2?

    best regards,
    g.f.
  • Hi g.f, I haven't tested it in my setup, but the changes you mentioned before sounds correct to me. Those changes should be enough for modifying Profibus TX GPIO. But in anycase, I will send this E2E thread to a colleague for his inputs (or confirmation).

    thank you,
    Paula