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.

UART not functioning

Other Parts Discussed in Thread: OMAPL138

Hi,

I have an application communicating with a GPS receiver via UART. Before my customer board is ready, I had this application working with the EVM board, which is using UART 2. Everything was fine. When my custom board is done, I simply switched the application over, but this time using UART 1. Below is my PINMUX. When I reset my GPS receiver using GIO_write(), it seems like it is looping endlessly. I changed the timeout element in the Attr with some value, the GIO_write() returned with timeout error. I used an oscilloscope to check the TxD line, there isn't any signal.

I had checked the hardware for possible problem but I couldn't find any. Does anyone has any suggestion as where could go wrong besides pinmux?

I really need some help here. I am stuck with this problem and my product development deadline is closing in.

 

    // My pinmux codes

    KICK0R = KICK0_UNLOCK_CODE;

    KICK1R = KICK1_UNLOCK_CODE;

    PINMUX0  = 0x11111188;  // EMIFB, Check EMU0/RTCK

    PINMUX1  = 0x11111111;  // EMIFB

    PINMUX2  = 0x11111111;  // EMIFB

    PINMUX3  = 0x11111111;  // EMIFB

    PINMUX4  = 0x11111111;  // EMIFB

    PINMUX5  = 0x11111111;  // EMIFB

    PINMUX6  = 0x11111111;  // EMIFB

    PINMUX7  = 0x11111111;  // EMIFB, SPI0

    PINMUX8 = 0x11111111; // SPI1, UART0, McASP1

    PINMUX9  = 0x11011111; // RMII CLK, McASP0, USB_DRVVBUS, SPI1

    PINMUX10 = 0x22222221;  // RMII/ McASP0

    PINMUX11 = 0x11111122;  // McASP1, UART1, McASP0, MDIO (last 2 digits 0x22 for MDIO instead of GPIO)

    PINMUX12 = 0x11111111;  // McASP0 / McASP1

    PINMUX13 = 0x22111111;  // SD / McASP1

    PINMUX14 = 0x88222222;  // SD / EMIFA

    PINMUX15 = 0x21888888;  // SD / EMIFA

    PINMUX16 = 0x11111112;  // SD / EMIFA

    PINMUX17 = 0x00100111;  // EMIFA

    PINMUX18 = 0x11111111;  // EMIFA

    PINMUX19 = 0x00000001;  // EMIFA

Thanks

Chee-Beng

 

  • The first thing I would try would be to run your modified UART1 application on the EVM. Use the oscilloscope to check if UART1_TXD is toggling. If not then we can check your software setup more carefully. If so then there is some board dependency and we can look closely at the schematics.

    The pinmuxing looks correct. In CCS check to make sure the pinmux settings actually took effect by reading address 0x01C1414C, which should be 0x11111122.

    Jeff

  • HI Jeff,

    Thank you so much for your advice.

    Instead of trying my modified UART1 application on the EVM, I tested my application on UART0 and UART2 on the custom board (C6747 DSP). Strangely, only UART2 is working (I see toggling TxD). Personally I don't think the hardware for UART0 and UART1 are faulty.

    Jeff, is there something I missed totally? Why UART2 is working (coincidentally the same UART I tested my application on EVM and worked) and UART0 and UART1 are not? I checked my pinmux again and PSC, and don't see any thing suspicious. I can't test on the EVM now because it is occupied by another engineer.

    I really need your professional help. I am really lost here. I believe it is something to do with the software.

    Thanks.

    Chee-Beng

  • Try printing out the UART1 registers at 0x01D0C000. Are they all configured properly?

    When you changed your code I assume you did a find/replace on UART2 to UART1. Is it possible you are forgetting to change a few of the settings over when you do this? I can't say without seeing your code.

    If possible you can send the code that works on the EVM and I can try modifying it for UART1 and seeing how it goes.

    Jeff

  • Thanks, Jeff.

    I will try to read the UART1 registers. Before that, I would like to know am I right to say that the only things to change when changing UART are:

    1. The Device ID in the UART device driver in the TCF.

    2. The PINMUX.

    3. The PSC

    Thanks.

    Chee-Beng

     

  • That seems to be it.

    Again, if you can send over the code for uart2 that works on the EVM I can try it out over here.

    Jeff

  • Hi Jeff,

    I attached herewith the workings codes for Uart2. I forgot to inform you that the EVM I used was C6748 DSP, but my custom board uses C6747. Hence, the codes I attached are for the EVM C6748 DSP.

    Thanks for your help. Looking forward to receiving your good news.

    Chee-Beng

     

    gps_evmc6748.zip
  • Unfortunately not all the files are there in the .zip. It says I'm missing \src\persistable\SpiFlash.cpp

    In the meantime, I would suggest you verify your board by setting the UART1 pins as GPIO outputs and seeing if you can toggle them manually using the memory window of CCS. It might be an issue with the traces on the board.

    Also the C6747 and C6748 have different memory maps and pinmux settings. Have you verified that you ported them all over correctly?

    The best test is still to try and run the UART1 code on the EVM. That will eliminate many variables, so see if you can get the board back to try that test.

    Jeff

  • Hi Jeff,

    Sorry for missing out some files. I resend all the files one more time here. Hope you can help me locate where are the problems.

    For you information, I had tested the UART1 pin as GPIO and it works. So I ruled out physical link problem.

    To answer your question on porting over from C6748 to C6747, I am aware of the differences. Hence, I started off using the C6747 EVM GEL and platform to work with instead of the C6748EVM's. By the way, I had also sent you the pinmux previous for comment. You, too, think that the pinmux configuration is correct.

    Regarding about memory maps, does memory allocation such as SDRAM, IRAM affect UART1 functionality in this case? I know I still haven't sorted out my SDRAM problem yet. I am forcing everything to use IRAM now just to test out my custom board. I will come back to understand more about memory later. Can I leave them later?

    Thanks.

    Chee-Beng

     

    gpsC6748EVM.zip
  • Hi Jeff,

    I had printed out UART2 and UART1 memory for comparison Hopefully can spot any clues to my problem to UART1. The memory is printed just before the first GIO_write() statement, which somehow goes into a infinite loop when I use UART1 but not UART2. This GIO_write() is the first UART statement that reset the GPS receiver.

    The memory location highlighted in red are the differences between UART1 and UART2. However, I cannot understand the significance. Can you advice?

    For Uart 2 (working uart) at 0x01D0D000:

    Offset

    00h 0x00000000 0x00000004 0x000000C1 0x00000003

    10h 0x00000000 0x00000060 0x00000000 0x00000000

    20h 0x000000D0 0x00000003 0x44141102 0x00000000

    30h 0x0000E003 0x00000000 0x00000000 0x00000000

     

    For Uart 1 (not working) at 0x01D0C000:

    Offset

    00h 0x00000000 0x00000004 0x000000C6 0x00000003

    10h 0x00000000 0x000000F9 0x00000000 0x00000000

    20h 0x000000D0 0x00000003 0x44141102 0x00000000

    30h 0x0000E003 0x00000000 0x00000000 0x00000000

    Thanks
    Chee-Beng

  • In the UART 1 case, it looks like you have received some garbage on the RX line prior to this point. Your printout shows LSR=0xF9, which indicates unread data in FIFO and Framing error. Use the scope to verify there is no activity on the line before this.

    The code you sent is still not complete. It is missing serialisable.h. You can verify you sent everything by unzipping the files to a new directory and trying to compile yourself.

    Jeff

  • Hi Jeff,

    I am terribly sorry for sending incomplete files. This time, I also include the TI CSL and PSP files. These files are located in directory external/ti/.....

    As for the LSR=0xF9, I also noticed it. Will this cause the GIO_write() to loop endlessly? If yes, why? In practice, there is no guarantee that the client to this UART1, which is the GPS receiver in this case, will not send data out before I GIO_write() the "reset" command to it.

    Thanks.

    Chee-Beng

     

    gpsC6748EVM.zip
  • Still not working. Please extract all the files to a new directory on your hard drive and try to compile again so you can see what needs to be fixed. You should send 1 zip file that has all the files and directory structure intact already (not more zip files) so no modifications have to be made.

     undefined    first referenced                                                                                    
      symbol          in file                                                                                         
     ---------    ----------------                                                                                    
     _GPSUartInit ..\\e12\\newdir\\build\\gps\\Debug\\gpscfg.obj

     

    You should step into the GIO_write fuction in CCS. Eventually you will end up in the UART driver code if you keep stepping down, which will give you information on where it is stuck polling.

    Jeff

     

     

  • Hi Jeff,

    I thought I got all inside and tested. I can compile and build successfully. Anyway, I re-do all again. Hope there is no further problem at your side.

    Thanks for your help.

    Chee-Beng

     

    projects.zip
  • Thanks I finally got it compiled and running.

    Can you check if you have a pullup on the TX and RX lines for UART1? These are necessary for the drivers to work.

    Jeff

  • Hi Jeff,

    Nice to learn that the codes can be compiled. I sincerely hope you can help me with this UART1 obstacle I am facing now. My boss is breathing down my neck. We are rushing to get our new product prototype working by end of this month, and I have a lot more work to do.

    Today I had ensured the UART1 of our custom board are pulled-up using 2.2K ohms resistors for both RX and TX. However, it is still not working. It still looped endlessly in the first GIO_write() statement.

    Thanks, Jeff. Thank you for everything.

    Chee-Beng

     

  • Ok we're still looking into this.

    Theres also the option of just using the register level CSL to implement the UART functions without going through BIOS or the UART driver. Try writing some code to send the reset signal  to the GPS this way in the meantime.

    Jeff

  • Thanks, Jeff.

    I will implement it using the register level CSL as mentioned. However, I would like to see the BIOS and UART driver work as it is more elegant, especially handling the interrupt.

    Looking forward to hearing from you soon.

    Thanks.

    Chee-Beng

     

  • Hi,

    1. Can you please let me know the version of the BIOS PSP drivers that you are using.

    2. please let me know the mode of operation (polled/interrupt/edma)

    3. can you check if the your code works in the polled mode of operation(with different instances)

    4. can you check if the interrupt handler is invoked when the code is executed in interrupt mode?

    5. Can you also check that your UART event number is mapped correctly to the proper HWI number

    regards,

    imtiaz

     

     

  • Hi Imtiaz,

    1. The version of BIOS PSP driver is 01.30.01

    2. The mode of operation is interrupt.

    3. For interrupt mode, only Uart 2 is working. For poll mode, all are working.

    4. I don't understand how to check whether the interrupt handler is invoked? Can you show me to way, please?

    5. May I know how to check this? I only know my hwiNumber is set to 9, and HWI number are:

    /* ECM configuration */

    bios.HWI.instance("HWI_INT7").interruptSelectNumber = 0;

    bios.HWI.instance("HWI_INT8").interruptSelectNumber = 1;

    bios.HWI.instance("HWI_INT9").interruptSelectNumber = 2;

    bios.HWI.instance("HWI_INT10").interruptSelectNumber = 3;

    Thanks.

    Chee-Beng

  • Hi Chee-Beng,

    1. You can place a break point in the Function "uartIsr()" to check if the interrupts are occuring.

    2. Also please let me know where are you configuring the PINMUX and also kindly ensure that the values are not overwritten by the default settings in the "uart_evmInit.c"

    The event number to HWI mapping should be as follows

    HWI               event number

    7                           0-31

    8                           32-63

    9                           64-95

    10                         96-127

    Hence assuming you are using a "C6748/OMAPL138" SOC the event number to HWI mapping should be as below

    instance         event number              map to  HWI

       0                           38                              8

       1                           46                              8

       2                           69                              9

    I think changing the HWI number in your code to "8"  while using the UART instance 0 and 1 should make it work for you.

    regards,

    imtiaz

  • Hi Imtiaz,

    You are right. It is due to the mapping. Thank you for explaining the mapping to me in your last message. I am confused by the documentations about ECM. I fully understand about the ECM and the mapping now. Thank you so much.

    My application now is up and running.

    Thank you so much, Imitiaz

    Thank you too, Jeff. Really appreciate your help.

    Chee-Beng