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/TMDSICE3359: UART configuration in Profibus

Part Number: TMDSICE3359
Other Parts Discussed in Thread: PROFIBUS, ISO1050, ISO1176T

Tool/software: TI-RTOS

Hello,

I want to use uart1(rs485) which is present profibus line to communicate with a MODBUS slave.

Please correct me if any of my following steps are wrong.

According to the schematics connected jumper J8 to use UART1.
Currently using UART_BasicExample_icev2AM335x_armExampleProject. Added few line of code to use UART1

UART_Params_init(&instance_params);

uart_instance = UART_open(1, &instance_params);

When I write a value to UART1 it is blocked.
As the UART1 driver is RS485. I assume transmission enable signal as to be high. I figured out that transmission enable pin for this UART1 instance is
GPIO3_19.
Now for this same project I included 

#include <ti/drv/uart/test/src/UART_board.h>
#include <ti/drv/gpio/GPIO.h>
#include <ti/drv/gpio/soc/GPIO_soc.h>


to use GPIO driver I also added C:\ti\pdk_am335x_1_0_7\packages\ti\drv\gpio path to the project.
I'm still getting an undefined reference to `GPIO_write' error 

Is my steps are correct? Can someone clearly explain how to use this UART1 in ICEV2AM3359.

 

Thank you

 

Regards

Vinay

  • The RTOS team have been notified. They will respond here.
  • Hi Vinay, sorry for my late reply, I am currently travelling. From AM335x HW User guide I see  we use PR1_UART0 port for PROFIBUS.

    On the other hand, I haven't tried UART example, but you should be able to change UART instance.. On top of my head, few things to check/change are:

    - Check pinmux module configuration (<pdk_am335x_1_0_7>\packages\ti\board\src\icev2AM335x\icev2AM335x_pinmux.c)

    - Check\change uartInitCfg (<pdk_am335x_1_0_7>\packages\ti\drv\uart\soc\am335x\UART_soc.c)

    - Check\change UART instance number (<TI\pdk_am335x_1_0_7>\packages\ti\board\src\icev2AM335x\include\board_cfg.h

    - Rebuild libraries that you have changed. For example starterware library, board library and/or UART library.
    Example: <pdk_am335_version>/packages> gmake board_lib

    hope this helps,

    Paula

  • Hi Paula,
    Thank you for the response. I been trying the above step for UART1 and UARt4 from almost 2 weeks. I want a UART instance working other than UART3 (USB Jtag). You mentioned you are using PR1_UART0 for Profibus, which is UART1 actually. Even I want to exercise the same UART1 peripheral. Profibus example is not sufficient to analyze this. When your back to work please take your time to help me out with this. Thank you!

    Regards
    Vinay
  • Hi Vinay, now I think I understand what you want to do =). But let me ask you few question. I am not too familiar with Modbus, but is it possible to use our SoC UARTs? If so, that might simpler as we have examples in our Processor SDK, as you already know.

    On the other hand, In TI-RTOS, we don't have simple example for using PRU-ICSS UART. As you know we use PRU-ICSS UART in our Profibus PRU-ICSS firmware, but we don't distribute it as a source code.

    Discussing with a colleague, he mentioned we have a PRU-ICSS UART example in our Linux support package.

    In any case, if due to speed, you need to use PRU-ICSS UART, then I can gather more details on our Linux support package. But, if Modbus can work on our AM335x SoC UARTs then I would advice to use them.

    thank you,
    Paula

  • Hi Paula,
    Thank you so much for the response. Yes using SoC UART I can communicate with modbus slave by writing some code to work as master. Processor SDK example as of now only working for UART3(which is mapped to USB). I tried all the steps to change uart in the example project but it didn't work :-(

    It would be of great help if any example code to work with UART1 which is present in Profibus line will be awesome.

    Please take information from the linux team and post it here. It will be helpful to even other members in the community.

    Thank you! Will be waiting for your reply.

    Best regards

    Vinay

  • Hi Paula,

    If all UART has been tested, then definitely there will be a good reference project which might help my cause.

    This weekend I'm setting up linux environment as you suggested there is a reference PRU-ICSS UART example. Hope that solves my problem.

    Meanwhile any update from your end will be of great help. Thank you!

    Best regards
    Vinay
  • Hi Vinay, I am back to office, I found this RTOS Customization (UART) application report.  But, from this post https://e2e.ti.com/support/arm/sitara_arm/f/791/t/678293 it seems that you already have tried it. Please let me know which error or behavior you are facing when trying to change UART number using UART_BasicExample_icev2AM335x_armExampleProject and following the application note.

    To centralize, let's close this E2E and continue on https://e2e.ti.com/support/arm/sitara_arm/f/791/t/678293

    In other words, please hold on your Linux testing... this simple TI-RTOS UART example should be a better (easier) way to test a change in UART instance.

    thank you,

    Paula

  • Hi Paula,

    I had posted in the steps I followed to reproduce the issue in e2e.ti.com/.../678293
    Unfortunately my post is yet to be verified by the admin bellow is the message after posting
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.

    If the administrator has configured this forum to support email notifications you will receive an email when your post is either approved or denied (if you have emails enabled in your profile).

    Thanks
    Regards
    Vinay
  • Hi Paula,

    My question is in the profibus line there exists a UART, till now I didn't get a accurate or related suggestion which was helpful. I tried several experiment and no success yet. Due to no progress with that we moved our platform to cypress. Looking forward for some valid response. Thank you!

    Best regards
    Vinay
  • Hi Vinay, I checked our other thread (e2e.ti.com/.../678293
    I see we were able to get SoC UART4 to work correctly. Why didn't you use it for Modbus? (just curious).
    I also see we explore the option of using PRU-ICSS UART1 (Used by Profibus/CAN). However, ICEv2 DB9 is connected to a Profibus transceiver (ISO1176T), or CAN bus transceiver (ISO1050). And I am not aware we ever tested as a pure UART controlled from the ARM. Our industrial examples control this PRU-ICSS UART via PRU firmware...
    Hope your development is going well, and I hope we can help you in the future.

    Paula