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.

L138 psp uart driver error

Other Parts Discussed in Thread: OMAPL138

i am modifying psp2.10.01 UART driver to make it work with UART1 on my custom L138 board

i changed the following parameters

instNum=1

hwiNumber=8

changed the pinmux for UART1 and compiled the library using xdc.

then i built the sample application and loaded the .x674 file

i can see the UART1 interrupt enable registers  getting set in the register view in the CCS

In terra term i see a set of junk charecters instead of ""

"UART Demo Starts: INPUT a file of size 1000 bytes"

i have verified the baud rate matches to 115200 on both terraterm and the in the cfg file.

the same code with changes to UART2 works on the EVM but on my customboard i

get the error message in the console of CCS as stream io generic failure when i send 1000 bytes from the teraterm

is there anything that i am missing

  • Hi Sriharsha,

    I have a clarification to make -

    Sriharsha Madhava said:

    the same code with changes to UART2 works on the EVM but on my customboard i get the error message in the console of CCS as stream io generic failure

    So even UART2 does not work on your custom board?.

    Since you are facing a problem when using UART1 on your custom board, I would suggest you to do a small test.. Test the uart CSLR example on your custom board as is.

    Before you jump to the sample application, I would like you to modify the CSLR example (placed in - pspdrivers_02_10_01\packages\ti\psp\cslr\evmOMAPL138\examples\uart\sample) to use UART instance 1 and check if its working. If this works, then we can move to the sample application.

    The CSLR example, demonstrates basic UART operations using the Register CSL macros. It sets up the UART(instance 0) in 8-bit loopback mode - Characters are transmitted and received using software polling. You will just have to change it to instance 1 (use CSL_UART_1_REGS)  and use psc1 (CSL_PSC_1_REGS) and test!.

    Also, what is the observation when configured UART to operate in POLLED mode??..

     

    Let us know the results..

     

    Thanks & regards,

    Raghavendra

  • hi raghavendra,

    In my custom board only UART1 is brought out.

    the rCsl loopback example runs with the changes to the UART1 on myboard.

    In Polled mode

    when there is a Stream_write at the start of the application and i see only junk characters(as in DMA Mode).
    There is no error when i send sample.txt to the board but
    there is no output of the same on the teraterm.

    IN DMA mode i get the following error when the stream_read happens

    here also i see junk characters at the start of the application when i should see the output in teraterm as "UART Demo:Input a file of 1000 bytes".

    The teraterm settings is 115200 8N1N

    when i send the sample.txt file from the teraterm i get the following error
    ti.sdo.io.Stream: line 460: Generic Failure
    xdc.runtime.Error.raise: terminating execution
     

  • Hi Sriharsha,

     

    Would it be possible for you to share your application project?. I would like to see all the configurations done for UART1 (device creation, pinmux, psc enable, etc) 

     

    Thanks & regards,

    Raghavendra

  • 3581.uart.zip

     

    hi raghavendra,

    I have attached the files of my project along with uartevmInit. where i do the pinmux.

    regards

  • Hi Sriharsha,

     

    All the configurations seems to be fine, except that you don’t seem to be writing to the KICK registers.

    Since the I do not have the custom board, I am trying to configure UART1 in loopback mode(write application) and test it on the OMAPL138 EVM.

    Might need some more time on this.

     

    Thanks for your patience..

     

    Regards,

    Raghavendra

  • hi raghavendra,

    I have made some progress with the non bios implementation.

    the UART1 works fine with this implementation on my custom board.

    but with psp bios there is no success still.

    regards

  • 7041.uart1_Loopback.zip

    Hi Sriharsha,

    I have attached an UART sample application that tests UART instance 1 in digital loopback mode.

    Please try executing the binaries already available in the attach on your custom board and check its working. I am able to successfully perform/verify loopback of 1000 bytes data on UART instance 1 on the OMAPL138 EVM. You can also refer to the configuration settiings made to configure UART (instance 1)in the code attached.

    Let me know the results..

     

    Thanks & regards,

    Raghavendra

  • hi raghavendra,

    the uart instance 1 on my custom boart works.i see the output completed loopback mode and then the psp Hrtbeat runs.

    i executed the precompiled binaries and i also verified its compiling and running . only the ipc version had to be changed to make the configuration file compile with the project with out errors.

    following similar lines i would want it to compile it to output on the UART1 Com port.

    can you please give me directions to proceed with the building for output on the Com port of the PC.

    regards

    sriharsha

     

  • Oh thats good!. So this confirms that the PSP has got no problem in configuring UART 1 instance and perform read/write.

    Sriharsha,

    Use the same loopback sample application (because it has the appropriate config settings for UART1 Instance - as it is working on your custom board) and alter it to your requirement(uartSample_io.c) - read 1000 bytes and write back 1000 bytes on the terminal. For this, make sure you remove the entry "uartPrms.loopbackEnabled = true;" or just make it false in the uartSample.cfg file and test the application. This should work for you.. else you will have to check with your setup/com port. Hope you follow what I am trying to convey here..

    Let me know the results.

    Thanks & regards,

    Raghavendra

     

  • Hi raghavendra,

    I made uartPrms.loopbackEnabled=false and commented out the Tx function.

    i then started the application and sent a 1000 byte file from teraterm. Then i get the same error

    ti.sdo.io.Stream: line 460 Generic Failure

    xdc.runtime.Error.raise:terminating execution.

     

  • Sriharsha,

    I would request you to probe into the driver and check what is causing this error?. Like - place a breakpoint in "Uart_localCompleteCurrentIO()" function and step through. Check the status of ioPacket (activeIOP). It is important to know the status of the activeIOP before "Application callback is invoked". Check(view call stack) from where this function(Uart_localCompleteCurrentIO) is called from?. Also, check if you are getting RX interrupts. Is rx getting timed out? RX timeout interrupt occuring?.

    Please check and Let me know..

     

    Best Regards,

    Raghavendra

  • hi Raghavendra,

    I am attaching the screenshot. as indicated i see an over run error also the activeIOP error is having a no 193724416 before calling the application callback.

  • Sriharsha,

    The divisor values in the UART driver is set based on a calculation depending on the input frequency and the baudrate used. Since you are using a custom board, can you please cross check the input frequency to the UART instance 1?. Since you are observing overrun errors, might be that the baudrate set for UART and the tera term baud rate are not matching/not in sync!. Let me know your views..

     

    Thanks & regards,

    Raghavendra 

  • hi raghavendra,

    My board has a crystal oscillator 27Mhz.Since UART1 is in ASYNC3 domain with /2 divisor,The input clock to UART is 148.5Mhz
    using this the divisor comes to 80.which is set in the DLH and DLL bits.i am using 16 times the baudrate.so it has to be sampled at 8th sample of the input. if the teraterm baud rate are not matching,i will verify for lesser baud rates and update along with setting for 13 times the baudrate. 
    regards

  • hi David,

    i verified the the PLLM multiplier to be 21 and my crystal oscillator is 27Mhz.

    so the uart input frequency is 148.5Mhz.i am not sure of how to change these values with the uartsamples, since it is configured to Dll of 51.

    i want to set the DLL to 50.

    but with the preconfigured settings if i set the 13times the baudrate i find the output in the teraterm with some of the junk charecters.

    Can you please provide me the settings to be done for my oscillator of 27mhz and the correct values for the DLL and how to set it in the cfg file.

    regards

  • Hi Sriharsha,

     

    Sorry for the delayed response. I somehow left this post unnoticed.

     

    UART1/2 derive clock from the same source on the OMAPL138. Since you mentioned it was a custom board, I asked you to cross check it.

    If I am not wrong, you had also mentioned that the UART2 instance works fine. So, the config settings being same, should work for both(DLL of 51h should be fine).

    Now, let’s go step by step to avoid confusions –

    Configure UART in interrupt mode, make sure the FIFO is enabled, and perform a write (Just write) as mentioned already, check if you still observe junk characters. Next, try doing a read(Just read) and then check the data in the buffer. If you still observe “overrun errors” try configuring for lesser baud rates and check it’s behavior. You can have this line(highlighted below) in your .cfg file(UartSample.cfg) for configuring UART for lesser baudrates.

     

    uartPrms.rxThreshold = Uart.RxTrigLvl_1;

    uartPrms.softTxFifoThreshold = 1;

    uartPrms.baudRate = Uart. BaudRate_2_4K;             /* Baudrate 2400    bps    */

    (Refer Uart.xdc file for various configurable “BaudRate”)

     

    Also, you had mentioned that you had made some progress with the non bios implementation. What were the divisor values then(DLL/DLH)?. Did you test it at 115200 baud? How many bytes of read/write was performed?. Let me know the results..

     

    Thanks & regards,

    Raghavendra

  • hi raghavendra,

    Uart1 now works fine. Thanks for your response and your pointers on the clock.

    In my board i was using a27Mhz clock and configuring the PLL to make the ARM/DSP to run at300Mhz but what was achieved is 297Mhz.

    I was using a gel file to configure the clocks and i had not observed that the PLLM in the gel file was set to 24. I am now using a arm application to startup the L138 and in that i am configuring the clocks properly.

    The way i figured out the clock was not proper was very round about procedure.

    since i was getting junk values in the teraterm i first tried to send a single char "a" from the stream write and scoped it on the CRO to find the Start and Stop bit and the the data bit. the entire char transmission was taking around 12Khz for the settings in the bios of 115200.

    so i worked reverse for the settings of DLL and then the divisor and then finally hit upon the value of 175Mhz is what is to be put in to get the correct value of divisor.so working back if i am getting a 175Mhz as the input frequency to the UART,my clock output should somewhere be outputting 350Mhz. so for 350 Mhz traced back the settings of the PLLM and i figured out that the clocksetting which i was using was not in tune with the settings.

    now that is working fine.

    Thanks

  • hi,

    now that the UART1 instance is working on my custom board,

    I would now want to change the clock of ARM and DSP to run @405 Mhz and with this new configuration

    what is the change i have to do to the uart code for making it work @ new clockfrequency.

    since the new input frequency would be 202.5Mhz for the SYSCLK2 paths.

  • hi,

    I made changes in the soc.xs file for the uart instance 1 for 202.5 Mhz and also chnaged the SysCLK1 in the soc.h header file before building the driver and compiling my uart sample again.

    now it workes fine with 405 sysclock.

    thanks for all the support

    regards