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.

AM3358: UART not reading

Part Number: AM3358


Hello am working with two beaglebone black board's to test UART functionallity. The BBB has the AM3358 processor which has 6 UART's on it [0:5]. I am trying to enable functionally on UART5. As of right now only the tx works as expected, the rx does not seem to be reading. Using the technical reference manual and the configuration of UART0 as a base of reference, I have configure UART5 control module registers to the following: 

             out32(0x44E108C4    , (0x4 | (0x1 << 4) |(0x1 << 5));            /* [P8 38] UART5_RXD  */

    out32(0x44E108C0    , (0x4 | 0x0 << 3));                               /* [P8 37] UART5_TXD  */

I took into account pinmuxing and make sure there were no pin conflicts. I also made sure the registers changed to the values I set be reading them back after setting. 

As far as I can tell there is not any other register I need to configure to get basic functionally working. Once I have configured the registers, I start UART5 with interrupt int set to 46 (from manual) on both boards at the same baud rate (115200) then connect the tx pin from one BBB (driverBBB) to the rx pin of the other (reciverBBB). I use an O-scope to verify that the correct data is being sent over the tx line correctly, but rx is not reading the data.

What is interesting is UART5 is configured very similar to UART0 (short of the mode), and UART0 works perfectly for both tx and rx. So I do not understand why UART5 tx works but rx does not. 

So my question is, are there other registers I need to configure in order to get UART5 to receive?

If it make any difference I am coding in QNX.  

Any suggestions would be great thanks, 

Jason

  • Try setting pinmux to 0x0C for TX and 0x2C for RX.
  • Biser,

    I did what you suggested  and set pinmux registers and verify after boot that the registers were indeed set to the expected values. The behavior has not changed.

    0x44E108C4    = 0x2C           /* [P8 38] UART5_RXD  */

    0x44E108C0    = 0x0C           /* [P8 37] UART5_TXD  */

    Let me explain a bit more about my setup. As stated before I have two Beaglebone Blacks, one is being used as a transmit and the other is a receive. UART5 is configured the same on both BBB at 19200 baud, which is the speed of the device they will be connected to, eventually. I have a simple program on my driver BBB spitting out "42" on the tx line as fast as the UART will allow and an O-Scope tied to that line to verify data is being sent over the tx. The tx line is connected to the other BBB rx pin and on this BBB I have a simple program running that just waits to read any data off the rx. Right now I do not even care if it reads the correct data, I just want it to read anything. Maybe I am trying to read the data incorrectly, but my method of reading works just fine on UART0. Below is the simple program I use to read, that works just fine on UART0.  

    int main(int argc, char *argv[]) {

     printf("Running data tx write...\n");

     fd = open("/dev/ser2", O_RDWR); //ser2 is the directory where UART5 lives UART0 live under ser1, which works fine.
     memset(in_buffer, 0, sizeof(in_buffer));
     if (fd > 0){

      cout << "File Open and descriptor = " << fd << endl;;
      read(fd, in_buffer, 2);
      cout << "Data from RX: "<<  in_buffer << endl;
     } else {
      cout << "Did not open file. \n";
     }

    return 0

    }   

    This program will wait at the read() line till data is received and then exits.

    Any other ideas?

    Thanks,

    Jason

  • Sorry, we do not support QNX so there is no way to replicate this. Have you checked if you have the same issue under Linux?
  • Biser, 

    Yes, I did try on Linux, but was unable to get UART5 to work even for tx, but I did not spend nearly as much time investigating that, since my requirement is that I need to use QNX. Thank you for the suggestion, I understand you do not support QNX here. I have a query in with QNX as well on this. They recommended I put in a question with TI, since the UART is part of the AM3358 processor.  If you have any other ideas to try, I am open to suggestion, otherwise, thanks again for trying to help, I appreciate it. 

    Jason

  • Jason -- you mentioned that you connected Tx of one board to Rx of the other board. Did you connect the grounds of the two boards together to make sure they have a common reference?

    One other thing that comes to mind is potentially to try sending a '\n' across the line in case there is any kind of line buffering or anything going on (e.g. that's something you see with operations like printf which won't flush the data to stdout until it hits the end of the line).

    Does the driver use DMA? If so, did you fill in the appropriate DMA events?
  • Brad, 

    Sorry, I thought I had responded to this. I was making sure I was sending '\n' across the line, which was required. I made some progress on getting this to work, but as it stands right now, I do not think the driver use DMA for UART's 1-5. Because of this and another behavior I have found, which is all data read on RX is echoed back out on TX (seen with using an O-scope), the QNX support engineer and I think there is a bug with the QNX driver. We are now waiting to hear back from their BSP team to verify. Thanks for the suggestions. 

    When I find resolution to this problem, would you like me to post it?

    Thanks, 

    Jason

  • Jason wilkins said:
    When I find resolution to this problem, would you like me to post it?

    I think that would be useful as long as you're not violating any confidentiality agreements, etc.