Kraig, I was wondering if you solved your issue.  I seem to be having a
possibly related issue.  I can send data and receive data after the send,
but sometime right after (whether I flush or close the serial port or not)
it crashes in the T3 simulator and locks up in a T3.  The weird part (this
is why I don't know exactly when it's crashing) it only crashes/locks up
using a Release build.  Removing the -02 optimization prevents the crash on
the simulator but it still locks up on the T3.

Our two issues could be similar and I don't think they're related to the
CTS/RTS problems others have been reporting.  Anyone have any ideas?
Thanks.

Mark Lenz
Software Engineer
Control Systems Group
Pierce Manufacturing, Inc.
(920) 832-3523
[EMAIL PROTECTED]


|---------+------------------------------------------->
|         |           "Kraig Ritmanich"               |
|         |           <[EMAIL PROTECTED]>          |
|         |           Sent by:                        |
|         |           [EMAIL PROTECTED]|
|         |           .palmos.com                     |
|         |                                           |
|         |                                           |
|         |           10/14/2003 07:34 AM             |
|         |           Please respond to "Palm         |
|         |           Developer Forum"                |
|         |                                           |
|---------+------------------------------------------->
  
>-----------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                   |
  |       To:       "Palm Developer Forum" <[EMAIL PROTECTED]>                         
                      |
  |       cc:                                                                          
                                   |
  |       Subject:  T3 serial communication problems                                   
                                   |
  
>-----------------------------------------------------------------------------------------------------------------------|




Hello,

I'm having problems sending data via RS232 with my Tungsten T3 running OS
5.2.1.  The strange thing is that I have a Zire 71 and Tungsten T2, both
with OS 5.2.1, as well as several OS 4.x devices and the code works fine on

all of these.  I've performed a serial (RS232) HotSync with the T3, so it
doesn't appear to be a bad serial port.  Here's what I'm seeing on the T3
(see code below):

1) serPortInit() executes without any errors
2) message is built in code that's not shown without errors
3) serMsgTransmit() executes (no errors), but data does not appear on the
line
4) another message is built
5) serMsgTansmit() starts execution, but T3 locks up and hangs after it
reaches SrmSendFlush()
6) need to Soft Reset the T3 to get it out of the lock-up

Any help would be much appreciated!

Thanks!
Kraig


Global Variables:
SerSettingsType   m_serSettings;
UInt              m_serRefNum;

Boolean serPortInit(Boolean sendSoundCmd)
{
  Err               error;
  UInt              tempInt;

  // Initialize the Settings Vars
  m_serSettings.baudRate = 9600;
  m_serSettings.ctsTimeout = 1;
  m_serSettings.flags = (srmSettingsFlagBitsPerChar8 |
srmSettingsFlagStopBits1 | srmSettingsFlagRTSAutoM);

  // Initialize the Serial Manager
  error = SrmOpen(serPortCradleRS232Port, m_serSettings.baudRate,
&m_serRefNum);
  if(error)
  {
    SrmClearErr(m_serRefNum);
    FrmAlert(SysErrSerCantOpenAlert);
    return true;
  }
  // initialize the serial port baud rate
  tempInt = sizeof(m_serSettings.baudRate);
  error = SrmControl(m_serRefNum, srmCtlSetBaudRate,
&m_serSettings.baudRate, &tempInt);
  if(error)
  {
    SrmClearErr(m_serRefNum);
    FrmAlert(SysErrSerValuesAlert);
    return true;
  }
  // initialize the serial port settings
  tempInt = sizeof(m_serSettings.flags);
  error = SrmControl(m_serRefNum, srmCtlSetFlags, &m_serSettings.flags,
&tempInt);
  if(error)
  {
    SrmClearErr(m_serRefNum);
    FrmAlert(SysErrSerValuesAlert);
    return true;
  }
  // initialize the serial port cts timeout
  tempInt = sizeof(m_serSettings.ctsTimeout);
  error = SrmControl(m_serRefNum, srmCtlSetCtsTimeout,
&m_serSettings.ctsTimeout, &tempInt);
  if(error)
  {
    SrmClearErr(m_serRefNum);
    FrmAlert(SysErrSerValuesAlert);
    return true;
  }

  // clear any pending serial errors
  SrmClearErr(m_serRefNum);

  // Initialize serial buffer handle
  m_serRxBufferHandle = MemHandleNew(SER_BUFF_SIZE);

  // Lock down the handle and get pointers to the memory chunk.
  m_serRxBuffer = (CharPtr)MemHandleLock(m_serRxBufferHandle);

  // Clear UART buffer
  StrCopy(m_serRxBufferHandle, "");

  return false;
}

Boolean serMsgTransmit(CharPtr txBuffer, UInt occ)
{
  Err       status = 0;
  Boolean   errorStatus = false;

  // Flush Tx and Rx buffer
  SrmReceiveFlush(m_serRefNum, 0);
  SrmSendFlush(m_serRefNum);

  // Send data to port
  SrmSend(m_serRefNum, txBuffer, occ, &error);

  if(error)
    status = true;  // Error occured

  return status;
}

_________________________________________________________________
Page a contact's mobile phone with  MSN Messenger 6.0. Download it now
FREE!
   http://msnmessenger-download.com


--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/






--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to