none
ARM Compact 2013 Serial Port Problem RRS feed

  • Question

  • Has anyone any ideas on this Serial Port Problem?

    Situation:

    Windows Embedded Compact 2013 OS

    Version:                     Built with Update 5 Platform Builder

    BSP:                          A variant of the TI AM33X BSP ported to Compact 2013

    OS:                           Modified to be headless

    CPU:                         AM3352/4 using OEM SOM

    Hardware:                  Custom based upon OEM's DVK

    Issue

    Summary:                  Crash testing serial port eventually fails

    Serial Specs:              No Handshake, 8 bits etc.

    Serial Connection:       Loopback adapter

    BAUD Rate:                115200 (although at lower rates error still occurs just takes proportionally longer).

    Packet size:                11 bytes

                                    Although have tested with varying packet size 1 to 70 bytes .. same outcome

    Note: Apps work OK on Compact 7 on target hardware.

    Description

    In Native Code:

    Synchronously writing packet to COM1 and then synchronously receiving packet of same size.

    Using WriteFile and ReadFile

    ReadFile loops until it gets the required number of bytes

    After varying number of iterations, eg. 20 to 30K, hangings as probably DIDN’T receive the required number of bytes.

    Tried various timeout configurations. Get failure regardless.

    Upon examination, it seems that the apps eventually can read the required bytes and all serial port functionality ceases.

    In Managed Code:

    [1] Synchronous: Similar to above using serial_port.Write and serial_port.Read, except they take the packet size as a parameter.

    Timeout set to 500mS

    - Most write/reads proceed OK typically 20K+

    - Eventually hangs

    -     Error trap (get System Timeout Exception) is able to close serial port allowing app to restart OK.

    -     If instead just attempt to write another packet and read then timeouts are all that you get.

    -     Note: Tried not sending one packet occasionally. In this case the write/read loops are able to continue OK after handling timeout exception.

    [2] Asynchronous: Read thread is launched. Main thread writes then waits for signal from read thread (with timeout).

    Uses SerialPort.Write and SerialPort.ReadExisting

    - Most write/reads proceed OK typically 20K+

    -     Eventually get timeout exception on wait and attempt to write and read again fails

    -     If on timeout close serial port can restart OK.

    Thanks for any help on this


    DJaus Snr SW Dev (Embedded Systems and .NET)

    Monday, September 15, 2014 12:51 PM

All replies

  • If the Read and Write call is hanging it is definitely the issue with the driver or the hardware.

    Normally, it should timeout if data is not available.

    Internally DMA is used ? Then you can try without using the DMA.

    (May be change the driver.reg file to disable DMA, but not sure with your BSP)

    Ultimately you have to debug the driver.  

    If there is a hardware failure, driver debugging will only help.

    --- Misbah


    Senior Design Engineer T.E.S Electroni Solutions (Bangalore-India) www.tes-dst.com email-misbah.khan@tes-dst.com

    Friday, September 19, 2014 2:26 PM
  • The driver doesn't use DMA as the MDD doesn't.

    Note that the same driver (code unchanged) works on Compact 7.


    DJaus Snr SW Dev (Embedded Systems and .NET)

    Tuesday, September 30, 2014 12:47 AM
  • And the hardware is same when it works for Compact 7 ?

    If you can put debug prints or do the debug built or use kitl kernel debugging, then the log files could help.

    If the interrupt generation is OK ... there is just reading the fifo h/w register and coping the data back to MDD 

    The loop terminates on full data read/requested by the user or if there is timeout and no data is available

    I suspect that if there is a H/W failure the read from register would hang in while 1

    or there is infinite interrupt or interrupt always high causing the driver to hang

    The other cause could be totally S/W which could be debugged and resolved.

    ---- Misbah


    Senior Design Engineer T.E.S Electroni Solutions (Bangalore-India) www.tes-dst.com email-misbah.khan@tes-dst.com

    Tuesday, September 30, 2014 5:47 AM