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.

TMS320F28035-EP: Recovering from a break detect (BRKDT)

Part Number: TMS320F28035-EP

Tool/software:

Our customer was performing systems integration and lost communication with our board. The customer captured a break detect event on the oscilloscope and showed it to us. Our board did not recover once the break detect condition went away.

Upon reviewing our firmware, we found we correctly checked and cleared comm errors:

interrupt void SCIRXINTA_ISR (void)

 {
    if(SciaRegs.SCIRXST.bit.RXERROR == 1)

    {

        //*****************

        // Comm Error

        // Don't care which

        //*****************

        SciaRegs.SCICTL1.bit.SWRESET = 0;       // Toggle SW_RESET Low then high to clear flags

        SciaRegs.SCICTL1.bit.SWRESET = 1;       // and state machine.

 

        SciaRegs.SCICTL1.bit.SLEEP = 1;         // go back to sleep and wait for Idle

    }

 

We tested our board in the lab using Windows driver commands to create a break detect condition:

PCAS_SerialPort.BreakState = true;

.. and then to remove the break condition.

PCAS_SerialPort.BreakState = false;

 

Running the firmware through the  XDS 100v3 debugger, we placed breakpoints and observed the BRKDT, FE, and RXERROR flags being set and cleared correctly. We clicked the resume button (or F8) in Code Composer. Our Windows test GUI never generated time out errors when we sent commands to the board.

 

We cycled power to the board so it was no longer running in debug mode. We restarted the GUI and recreated the same break detect conditions as previously stated.  Unfortunately, the board never recovered from the break detect condition and failed to respond to commands from the GUI. The GUI reported comm timeout errors.

 

Why did our board recover from a comm break when in the debugger environment, but fail to respond in real life?

Thank you,

  • Hello,

    Can you confirm what the expected behavior is? Are you using both TX and RX? And what ISRs are enabled and being used? A bit more context in terms of the SCI configurations would help me understand the environment.

    Are you attempting to send data to the C2000 device during the when the board is powering up at all?

    Best Regards,

    Allison

  • Dear Tech Support,

    I figured out why my firmware did not recover from a BRKDT condition. The key piece of information missing in the technical reference manual was: the SWRESET bit needs to be toggled AFTER the RX pin has returned to the bus idle state. In my design that’s when GPIO7 changes from 0 to 1.

    The finer details of the solution are as follows:

    • Check for BRKDT first thing in the RX interrupt subroutine. If BRKDT = 1, then disable the RX interrupt by setting RXBKINTENA =0. Otherwise, process received byte normally.
    • In the main loop, periodically poll the RX pin with if (RXpin ==1 && RXERROR ==1) {}, but don’t block the process with while( !RXpin); The added condition of checking for an RX error prevents the branch from resetting when no reset is necessary.
    • When if (RXpin ==1 && RXERROR ==1) {} is true
      1. toggle SWRESET. I’ve placed some NOPs between toggle states to give the processor time to complete the reset.
      2. Enable the Rx int by setting RXBKINTENA =1.

    Please update the technical reference manuals and SCI (UART) app notes before closing out this case.

  • Hi Mark,

    Thanks for posting your resolution and details. I will file a bug to update our documentation and clarify your points. Please note that since this is an older device, the device TRM will not be refreshed. However, newer device docs will include this. Thanks!

    Best Regards,

    Allison