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.

Locked processor with SCI half-duplex

Other Parts Discussed in Thread: LAUNCHXL-F28027

Hi

I am working on LAUNCHXL-F28027 C2000 Piccolo LaunchPad.

Currently I am programming the periphery SCI. I use transmitting functions from example Example_2802xSci_Echoback.c without FIFO.
These functions are changed to half-duplex mode. At the beggingng I set on SCI only to RX mode and during transmition SCI is set to TX.
This functions are paste in Motorwave projects proj_lab01.c with your sci driver.

Here is code of transmitting functions:

void HAL_scia_xmit(int a, HAL_Handle handle)
{
    HAL_Obj   *obj = (HAL_Obj *)handle;
    while(!SCI_txEmpty(obj->sciHandle)){}
    SCI_putDataBlocking(obj->sciHandle, a);


}

void HAL_scia_msg(char * msg, HAL_Handle handle)
{
    HAL_Obj  *obj = (HAL_Obj *)handle;

  SCI_reset(obj->sciHandle);
    SCI_enableTx(obj->sciHandle);
    SCI_disableRx(obj->sciHandle);
    SCI_enable(obj->sciHandle);

    int i = 0;
    while(msg[i] != '\0')
    {
        HAL_scia_xmit(msg[i], handle);
        i++;
    }
    while(!SCI_txEmpty(obj->sciHandle)){}

      SCI_reset(obj->sciHandle);
      SCI_disableTx(obj->sciHandle);
      SCI_enableRx(obj->sciHandle);
      SCI_enableRxInt(obj->sciHandle);
      SCI_enable(obj->sciHandle);
}

static inline bool SCI_txEmpty(SCI_Handle sciHandle)
{
  SCI_Obj *sci = (SCI_Obj *)sciHandle;
  bool status;

  status = (sci->SCICTL2 & SCI_SCICTL2_TXEMPTY_BITS) >> 6;

  return status;
}

For receiveing data is used PIE interrupt SCIRXINTA.
Initialization of SCI is taken over from example.
SCI periphery is correct beause of it was tested in full-duplex SCI mode.

In half-duplex where the change RX and TX without FIFO occurs a problem locking the processor.
The first time debug was performed successfully. But the next time debugging error occurs while cleaning flash and CSM key is overwritten at all zeros.

  • Please provide some more details about what you are doing with the CSM? Where is the code executing from?

    How are you loading code into the device? What do you mean CSM key is overwritten at all zeros?

    What pins are you using for SCI communication? Are you using the mini-USB connection or the GPIO pin outs?

    sal