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.

TMDSCNCD28388D:About SCI communication

Part Number: TMDSCNCD28388D

When performing SCI communication, when multiple pieces of data with multiple NULLs at the end are sent, the problem occurs that the data cannot be received normally.


Resetting the SCI port register does not solve the problem.

Since the data can be received normally after resetting the CPU and re-executing it, the cause is thought to be the SCI driver.

What are the possible causes?

  • Hi Ryo,

      

    Thanks for your question.

    My immediate suspicion is the final "suggested answer" in the thread here: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1198816/tms320f280025-sci-communications-byte-timing

      

    Basically, if you're sending a lot of data back to back (and using interrupts, issue only occurs with interrupts specifically) C2000 device must receive data with 2 stop bits between data bytes. The reason is explained in that thread.

      

    When sending data to the C2000 device, please send 2 stop bits to the C2000 device. Let me know if this corrects the issue!

      
    Regards,

    Vince

  • Hello Vince.
    Thank you for answering.

    First of all, I set the stop bit to 2, so that method did not solve the problem.
    Also, even if the speed was reduced to 9600bps, the result did not change, so it turned out that it was not a speed problem.

    My SCI settings are 115200bps, Word size 8bit, Stopbit 2bit, Parity EVEN.
    The data I am sending to the SCI port is a mixture of ASCII character strings and binary data.
    Below is an example command.
    ex.<53><49><47><3A><4D><4F><4E><49><02><00><00><00><00>

    First, data transmission/reception uses a general-purpose LAN-SERIAL adapter to communicate with a PC.
    The data reception frequency is such that the above command is sent once every 3 seconds.

    Data acquisition then uses a FIFO to interrupt each character and store it in its own buffer.
    After that, get a timeout with a timer and perform task processing.

    After the event occurs, perform one transmission from the LAN-SERIAL adapter.
    In the receive operation, task processing is entered twice.
    When I checked the data, the first time the command was received halfway through, and the second time there was no normal data. (or no data)
    Regarding the content of the question at the beginning, it occurs by executing the above command about 8 times.
    There are other commands, but I think that other commands are unlikely to cause problems because there are few 0x00 data that are NULL.

    thank you.
    Ryo.

  • Hi Ryo,

    First of all, I set the stop bit to 2, so that method did not solve the problem.
    Also, even if the speed was reduced to 9600bps, the result did not change, so it turned out that it was not a speed problem.

    As I mention in that thread, this is not an issue with SPEED of the baud rate, but instead with TIMING. The timing when using less than 2 stop bits is the issue. So you can use a baud rate of 4800 or lower and still see this issue.

    I set the stop bit to 2

    If you set 2 stop bits on the C2000 device that will not fix the issue.

    You must set the 2 stop bits on the OTHER device (the PC).

    Regards,

    Vince

  • Hello Vince.
    The stop bit on the PC side is also set to 2 for communication.
    thank you.
    Ryo.

  • Hi Ryo,

    Can you place a long delay (maybe 10 ms) in the main function before the SCI initialization (to test the following)?

    Reason: SCI might be initialized while the GPIOs are still being initialized, leading to reading of false bits.

    Regards,

    Vince

  • I tried putting a Delay in the main function, but the situation didn't improve.

    thank you.

    Ryo.

  • Hi Ryo,

    Can you show me your main function and scope captures of the issue?

    Can you also read the SCIRXST when the issue occurs and provide the value from that register?

    Regards,

    Vince

  • Hello Vince.
    Send a capture of communication when it is normal and a capture when an abnormality occurs.

    This is the communication when the application I created is normal and the communication when an error occurs.

    This is the buffer data when normal.

    This is the buffer data when abnormal.(1times)

    This is the buffer data when abnormal.(2times)

    This is the RX part of the register when an error occurs.

    This is the entire code related to SCI communication.

    void Hwi_PCConnect_RX(){
        char rx_data;
    //    Message_queue("PCConnect",0);
        if(Ext_File_WR_Flag||SPI_W_Flag){
            SCI_Timeout_Flag_Post(PCConnect_BASE);
            SCI_ReadChar(PCConnect_BASE,&rx_data);
            SPI_SendData_Buf[PC_Read_Count]=rx_data;
            SCI_clearInterruptStatus(PCConnect_BASE, SCI_INT_RXFF);
            if(PC_Read_Count==4095){
                if(Ext_File_WR_Flag)Semaphore_post(Semaphore_PCConnect);
                else if(SPI_W_Flag)Semaphore_post(Semaphore_SPI);
            }
            else PC_Read_Count++;
        }
        else{
            SCI_Timeout_Flag_Post(PCConnect_BASE);
            SCI_ReadChar(PCConnect_BASE,&rx_data);
            SCI_Buffer_Input(PCConnect_BASE,rx_data);
            SCI_clearInterruptStatus(PCConnect_BASE, SCI_INT_RXFF);
        }
        if((*((uint16_t*)(PCConnect_BASE+SCI_O_RXST))&(SCI_RXST_BRKDT|SCI_RXST_FE))!=0){
            SCI_disableModule(PCConnect_BASE);
            SCI_clearInterruptStatus(PCConnect_BASE, SCI_INT_RXFF | SCI_INT_TXFF | SCI_INT_FE | SCI_INT_OE | SCI_INT_PE | SCI_INT_RXERR | SCI_INT_RXRDY_BRKDT | SCI_INT_TXRDY);
            SCI_clearOverflowStatus(PCConnect_BASE);
            SCI_resetTxFIFO(PCConnect_BASE);
            SCI_resetRxFIFO(PCConnect_BASE);
            SCI_resetChannels(PCConnect_BASE);
            SCI_setConfig(PCConnect_BASE, DEVICE_LSPCLK_FREQ, PCConnect_BAUDRATE, (SCI_CONFIG_WLEN_8|SCI_CONFIG_STOP_TWO|SCI_CONFIG_PAR_ODD));
            SCI_disableLoopback(PCConnect_BASE);
            SCI_performSoftwareReset(PCConnect_BASE);
            SCI_enableInterrupt(PCConnect_BASE, SCI_INT_RXFF | SCI_INT_TXFF);
            SCI_setFIFOInterruptLevel(PCConnect_BASE, SCI_FIFO_TX5, SCI_FIFO_RX1);
            SCI_enableFIFO(PCConnect_BASE);
            SCI_enableModule(PCConnect_BASE);
        }
    }
    
    ///
    /// PCConnect_Swi_Function
    ///
    void Swi_PCConnect_WriteData(){
        if(Ext_File_WR_Flag&&Access_Mode==0) SCI_writeCharArray(PCConnect_BASE,(uint16_t*)SPI_ReadData_Buf,SPI_ReadDataSize);
        else SCI_writeCharArray(PCConnect_BASE, (uint16_t*)Ret ,Send_Byte);
    }
    
    ///
    /// PCConnect_Task_Function
    ///
    
    void Task_PCConnect(){
        uint16_t size;
        uint16_t fail_comm_size=0;
        uint16_t error=0;
        while(1){
            if(Init_Flag) break;
        }
        while(1){
            Semaphore_pend(Semaphore_PCConnect,BIOS_WAIT_FOREVER);
            Message_queue("PCConnect",3);
           do{
               if(Ext_File_WR_Flag||SPI_W_Flag){
                   if(Access_Mode){ //Write
                       PC_Read_Count++;
                       if(File_Size>PC_Read_Count)File_Size-=PC_Read_Count;
                       else{
                           PC_Read_Count=File_Size;
                           File_Size=0;
                           File_WR_EndFlag=1;
                       }
                       size=PC_Read_Count;
                       PC_Read_Count=0;
                       SD_Use_Data_Address=SPI_SendData_Buf;
                       SD_Size=size;
                       Swi_post(swi_File);
                       if(File_WR_EndFlag==1){
                           ffcio_close(SD_FileNo);
                           Ext_File_WR_Flag=0;
                       }
                   }
                   else{    //Read
                       Semaphore_post(semaphore_FileRead);
                       Semaphore_pend(semaphore_ReadWait,BIOS_WAIT_FOREVER);
                       if(File_Size>SPI_ReadDataSize)File_Size-=SPI_ReadDataSize;
                       else{
                           SPI_ReadDataSize=File_Size;
                           File_Size=0;
                           File_WR_EndFlag=1;
                       }
                       Swi_post(swi_PCConnect);
                       if(File_WR_EndFlag==1){
                           ffcio_close(SD_FileNo);
                           Ext_File_WR_Flag=0;
                           if(SD_FileNo<=1){
                               if(SD_FileNo){
                                   strcpy(FilePath,LOG_DIR);
                                   strcpy(FilePath,"LOG");
                                   strcpy(FilePath,uint16_t_to_string(Start_Count));
                                   strcpy(FilePath,".LOG");
                                   ffcio_open(FilePath,O_RDWR|O_APPEND,0);
                               }
                               else{
                                   strcpy(FilePath,STREAM_DIR);
                                   strcpy(FilePath,"STREAM");
                                   strcpy(FilePath,uint16_t_to_string(Start_Count));
                                   strcpy(FilePath,".LOG");
                                   ffcio_open(FilePath,O_RDWR|O_APPEND,0);
                               }
                           }
                       }
                   }
               }
               else{
                   command=(Module_Command){0};
                   if(fail_comm_size!=0&&PCConnect_Buf.Position<6){
                       memcpy(&PC_Readdata[fail_comm_size],PCConnect_Buf.Buf_Data,PCConnect_Buf.Position);
                       if(PCConnect_Separate_CommandData(PC_Readdata,fail_comm_size+10,&command)==0){
                              Command_queue(&command);
                       }
                       memset(PC_Readdata, 0, 400);
                       fail_comm_size=0;
    
                   }
                   else{
                       memcpy(PC_Readdata,PCConnect_Buf.Buf_Data,PCConnect_Buf.Position);
                       if(PCConnect_Separate_CommandData(PC_Readdata,PCConnect_Buf.Position,&command)==0){
                              Command_queue(&command);
                              memset(PC_Readdata, 0, 400);
                       }
                       else{
                           fail_comm_size=PCConnect_Buf.Position;
                           error++;
                       }
                   }
                   SCI_Buffer_Clear(PCConnect_BASE);
    
     //              Response_Queue(&command,1);
    
               }
           }while(0);
           if(error>1){
               SCI_disableModule(PCConnect_BASE);
               SCI_clearInterruptStatus(PCConnect_BASE, SCI_INT_RXFF | SCI_INT_TXFF | SCI_INT_FE | SCI_INT_OE | SCI_INT_PE | SCI_INT_RXERR | SCI_INT_RXRDY_BRKDT | SCI_INT_TXRDY);
               SCI_clearOverflowStatus(PCConnect_BASE);
               SCI_resetTxFIFO(PCConnect_BASE);
               SCI_resetRxFIFO(PCConnect_BASE);
               SCI_resetChannels(PCConnect_BASE);
               SCI_setConfig(PCConnect_BASE, DEVICE_LSPCLK_FREQ, PCConnect_BAUDRATE, (SCI_CONFIG_WLEN_8|SCI_CONFIG_STOP_TWO|SCI_CONFIG_PAR_ODD));
               SCI_disableLoopback(PCConnect_BASE);
               SCI_performSoftwareReset(PCConnect_BASE);
               SCI_enableInterrupt(PCConnect_BASE, SCI_INT_RXFF | SCI_INT_TXFF);
               SCI_setFIFOInterruptLevel(PCConnect_BASE, SCI_FIFO_TX5, SCI_FIFO_RX1);
               SCI_enableFIFO(PCConnect_BASE);
               SCI_enableModule(PCConnect_BASE);
               error=0;
           }
       }
    }
    
    void SCI_Buffer_Input(uint32_t Base,char Data){
        SCI_Read_Buf *buffer=0;
        buffer=SCI_Module_Identify_ReadBuf(Base);
        if(buffer->Position<SCI_BUFFER_SIZE){
            buffer->Buf_Data[buffer->Position]=Data;
        }
        buffer->Position++;
    }
    
    void SCI_Get_Buffer_String(uint32_t Base,char *Data){
        SCI_Read_Buf *buffer=0;
        buffer=SCI_Module_Identify_ReadBuf(Base);
        buffer->Buf_Data[buffer->Position]=0;
        strcpy(Data,buffer->Buf_Data);
        buffer->Position=0;
    }
    
    void SCI_Buffer_Clear(uint32_t Base){
        SCI_Read_Buf *buffer=0;
        buffer=SCI_Module_Identify_ReadBuf(Base);
        buffer->Position=0;
    }
    
    void Timer_SCI_RX_Timeout(){
        int i;
        uint32_t base;
        ti_sysbios_knl_Semaphore_Handle Semaphore=0;
        SCI_Read_Buf *buffer=0;
        for(i=0;i<4;i++){
            base=SCI_BASE[i];
            buffer=SCI_Module_Identify_ReadBuf(base);
            Semaphore=SCI_Module_Identify_Semaphore(base);
            if(buffer->RX_Flag){
                if(buffer->RX_Interval>=buffer->RX_Timeout){
                    buffer->RX_Flag=0;
                    buffer->RX_Interval=0;
                    Semaphore_post(Semaphore);
                }
                buffer->RX_Interval++;
            }
            SCI_Repeat_Send_Post(base);
        }
    }

    Thank you.

    Ryo

  • Ryo,

    I am asking specifically for the SCIRXST register during the issue scenario, you have provided other registers, SCIRXST will let us know what issues the SCI-RX pin is detecting with the data and can diagnose the issue quickly.

    Also, please provide an oscilloscope capture of the data, as the Command Data view is insufficient, it is showing that there is bad data arriving, but doesn't show what the wave forms look like at the SCI-RX pin of the C2000 device. We need to see why the data is looking bad (to see if this is a hardware or software issue)

    Regards,

    Vince

  • Hello Vince.

    I captured the data waveform and the SCIRXST register on the oscilloscope for the SCIRX part when the problem occurred.

    I checked the data waveform with an oscilloscope, but there was no change in the waveform between normal and when the problem occurred.

    thank you.

    Ryo.

  • Ryo,

    Thanks for the follow-up. One of two issues could be reason here:

    FIRST POSSIBLE ISSUE: PARITY IS NOT MATCHING

    You originally said this:

    My SCI settings are 115200bps, Word size 8bit, Stopbit 2bit, Parity EVEN.

    The parity in the code you provided is ODD ("SCI_CONFIG_PAR_ODD")

    Please correct this and see if the issue goes away. If not, go on to second possible issue below.

        

    SECOND POSSIBLE ISSUE: SHIFT DUE TO LONG ISR

    1. The parity error bit is set (SCIRXST.PE), meaning the parity bit is assumed to be wrong, meaning it's not detecting the correct part of the byte

    2. The data coming in is the wrong data (it's shifted from where it is supposed to be, and is detecting the wrong bits at the wrong time, bits are coming in early). Meaning it's not detecting the correct part of the byte.

    ACTION1: Can you try to add a long delay (1ms) delay between bytes sent from the PC? So every time the PC sends a byte, the PC waits 1ms before sending another byte.

    The 2 stop bits might be insufficient between bytes, because your SCI ISR may be longer than ~200us.

    ACTION2: Please also take the scope capture of the data again with this additional 1ms delay between bytes.

    Regards,

    Vince

  • Hello Vince.
    The parity statement in the code you provided was wrong.
    I added a delay when sending from the PC.
    Since the TCPIP to SERIAL module is used, a delay of 250㎳ is inserted due to the packet.

    Regarding the result, a problem occurred when sending the command multiple times as before.

    As a test, I deleted the NULL included at the end and sent it, but the result did not change.

    thank you.

    Ryo.

  • The parity statement in the code you provided was wrong.

    Ryo,

    The code I provided was the code you provided, have you corrected this in your code? Please provide your updated code. This is what you provided before, and it is using the wrong parity:

    void Hwi_PCConnect_RX(){
        char rx_data;
    //    Message_queue("PCConnect",0);
        if(Ext_File_WR_Flag||SPI_W_Flag){
            SCI_Timeout_Flag_Post(PCConnect_BASE);
            SCI_ReadChar(PCConnect_BASE,&rx_data);
            SPI_SendData_Buf[PC_Read_Count]=rx_data;
            SCI_clearInterruptStatus(PCConnect_BASE, SCI_INT_RXFF);
            if(PC_Read_Count==4095){
                if(Ext_File_WR_Flag)Semaphore_post(Semaphore_PCConnect);
                else if(SPI_W_Flag)Semaphore_post(Semaphore_SPI);
            }
            else PC_Read_Count++;
        }
        else{
            SCI_Timeout_Flag_Post(PCConnect_BASE);
            SCI_ReadChar(PCConnect_BASE,&rx_data);
            SCI_Buffer_Input(PCConnect_BASE,rx_data);
            SCI_clearInterruptStatus(PCConnect_BASE, SCI_INT_RXFF);
        }
        if((*((uint16_t*)(PCConnect_BASE+SCI_O_RXST))&(SCI_RXST_BRKDT|SCI_RXST_FE))!=0){
            SCI_disableModule(PCConnect_BASE);
            SCI_clearInterruptStatus(PCConnect_BASE, SCI_INT_RXFF | SCI_INT_TXFF | SCI_INT_FE | SCI_INT_OE | SCI_INT_PE | SCI_INT_RXERR | SCI_INT_RXRDY_BRKDT | SCI_INT_TXRDY);
            SCI_clearOverflowStatus(PCConnect_BASE);
            SCI_resetTxFIFO(PCConnect_BASE);
            SCI_resetRxFIFO(PCConnect_BASE);
            SCI_resetChannels(PCConnect_BASE);
            SCI_setConfig(PCConnect_BASE, DEVICE_LSPCLK_FREQ, PCConnect_BAUDRATE, (SCI_CONFIG_WLEN_8|SCI_CONFIG_STOP_TWO|SCI_CONFIG_PAR_ODD));
            SCI_disableLoopback(PCConnect_BASE);
            SCI_performSoftwareReset(PCConnect_BASE);
            SCI_enableInterrupt(PCConnect_BASE, SCI_INT_RXFF | SCI_INT_TXFF);
            SCI_setFIFOInterruptLevel(PCConnect_BASE, SCI_FIFO_TX5, SCI_FIFO_RX1);
            SCI_enableFIFO(PCConnect_BASE);
            SCI_enableModule(PCConnect_BASE);
        }
    }
    
    ///
    /// PCConnect_Swi_Function
    ///
    void Swi_PCConnect_WriteData(){
        if(Ext_File_WR_Flag&&Access_Mode==0) SCI_writeCharArray(PCConnect_BASE,(uint16_t*)SPI_ReadData_Buf,SPI_ReadDataSize);
        else SCI_writeCharArray(PCConnect_BASE, (uint16_t*)Ret ,Send_Byte);
    }
    
    ///
    /// PCConnect_Task_Function
    ///
    
    void Task_PCConnect(){
        uint16_t size;
        uint16_t fail_comm_size=0;
        uint16_t error=0;
        while(1){
            if(Init_Flag) break;
        }
        while(1){
            Semaphore_pend(Semaphore_PCConnect,BIOS_WAIT_FOREVER);
            Message_queue("PCConnect",3);
           do{
               if(Ext_File_WR_Flag||SPI_W_Flag){
                   if(Access_Mode){ //Write
                       PC_Read_Count++;
                       if(File_Size>PC_Read_Count)File_Size-=PC_Read_Count;
                       else{
                           PC_Read_Count=File_Size;
                           File_Size=0;
                           File_WR_EndFlag=1;
                       }
                       size=PC_Read_Count;
                       PC_Read_Count=0;
                       SD_Use_Data_Address=SPI_SendData_Buf;
                       SD_Size=size;
                       Swi_post(swi_File);
                       if(File_WR_EndFlag==1){
                           ffcio_close(SD_FileNo);
                           Ext_File_WR_Flag=0;
                       }
                   }
                   else{    //Read
                       Semaphore_post(semaphore_FileRead);
                       Semaphore_pend(semaphore_ReadWait,BIOS_WAIT_FOREVER);
                       if(File_Size>SPI_ReadDataSize)File_Size-=SPI_ReadDataSize;
                       else{
                           SPI_ReadDataSize=File_Size;
                           File_Size=0;
                           File_WR_EndFlag=1;
                       }
                       Swi_post(swi_PCConnect);
                       if(File_WR_EndFlag==1){
                           ffcio_close(SD_FileNo);
                           Ext_File_WR_Flag=0;
                           if(SD_FileNo<=1){
                               if(SD_FileNo){
                                   strcpy(FilePath,LOG_DIR);
                                   strcpy(FilePath,"LOG");
                                   strcpy(FilePath,uint16_t_to_string(Start_Count));
                                   strcpy(FilePath,".LOG");
                                   ffcio_open(FilePath,O_RDWR|O_APPEND,0);
                               }
                               else{
                                   strcpy(FilePath,STREAM_DIR);
                                   strcpy(FilePath,"STREAM");
                                   strcpy(FilePath,uint16_t_to_string(Start_Count));
                                   strcpy(FilePath,".LOG");
                                   ffcio_open(FilePath,O_RDWR|O_APPEND,0);
                               }
                           }
                       }
                   }
               }
               else{
                   command=(Module_Command){0};
                   if(fail_comm_size!=0&&PCConnect_Buf.Position<6){
                       memcpy(&PC_Readdata[fail_comm_size],PCConnect_Buf.Buf_Data,PCConnect_Buf.Position);
                       if(PCConnect_Separate_CommandData(PC_Readdata,fail_comm_size+10,&command)==0){
                              Command_queue(&command);
                       }
                       memset(PC_Readdata, 0, 400);
                       fail_comm_size=0;
    
                   }
                   else{
                       memcpy(PC_Readdata,PCConnect_Buf.Buf_Data,PCConnect_Buf.Position);
                       if(PCConnect_Separate_CommandData(PC_Readdata,PCConnect_Buf.Position,&command)==0){
                              Command_queue(&command);
                              memset(PC_Readdata, 0, 400);
                       }
                       else{
                           fail_comm_size=PCConnect_Buf.Position;
                           error++;
                       }
                   }
                   SCI_Buffer_Clear(PCConnect_BASE);
    
     //              Response_Queue(&command,1);
    
               }
           }while(0);
           if(error>1){
               SCI_disableModule(PCConnect_BASE);
               SCI_clearInterruptStatus(PCConnect_BASE, SCI_INT_RXFF | SCI_INT_TXFF | SCI_INT_FE | SCI_INT_OE | SCI_INT_PE | SCI_INT_RXERR | SCI_INT_RXRDY_BRKDT | SCI_INT_TXRDY);
               SCI_clearOverflowStatus(PCConnect_BASE);
               SCI_resetTxFIFO(PCConnect_BASE);
               SCI_resetRxFIFO(PCConnect_BASE);
               SCI_resetChannels(PCConnect_BASE);
               SCI_setConfig(PCConnect_BASE, DEVICE_LSPCLK_FREQ, PCConnect_BAUDRATE, (SCI_CONFIG_WLEN_8|SCI_CONFIG_STOP_TWO|SCI_CONFIG_PAR_ODD));
               SCI_disableLoopback(PCConnect_BASE);
               SCI_performSoftwareReset(PCConnect_BASE);
               SCI_enableInterrupt(PCConnect_BASE, SCI_INT_RXFF | SCI_INT_TXFF);
               SCI_setFIFOInterruptLevel(PCConnect_BASE, SCI_FIFO_TX5, SCI_FIFO_RX1);
               SCI_enableFIFO(PCConnect_BASE);
               SCI_enableModule(PCConnect_BASE);
               error=0;
           }
       }
    }
    
    void SCI_Buffer_Input(uint32_t Base,char Data){
        SCI_Read_Buf *buffer=0;
        buffer=SCI_Module_Identify_ReadBuf(Base);
        if(buffer->Position<SCI_BUFFER_SIZE){
            buffer->Buf_Data[buffer->Position]=Data;
        }
        buffer->Position++;
    }
    
    void SCI_Get_Buffer_String(uint32_t Base,char *Data){
        SCI_Read_Buf *buffer=0;
        buffer=SCI_Module_Identify_ReadBuf(Base);
        buffer->Buf_Data[buffer->Position]=0;
        strcpy(Data,buffer->Buf_Data);
        buffer->Position=0;
    }
    
    void SCI_Buffer_Clear(uint32_t Base){
        SCI_Read_Buf *buffer=0;
        buffer=SCI_Module_Identify_ReadBuf(Base);
        buffer->Position=0;
    }
    
    void Timer_SCI_RX_Timeout(){
        int i;
        uint32_t base;
        ti_sysbios_knl_Semaphore_Handle Semaphore=0;
        SCI_Read_Buf *buffer=0;
        for(i=0;i<4;i++){
            base=SCI_BASE[i];
            buffer=SCI_Module_Identify_ReadBuf(base);
            Semaphore=SCI_Module_Identify_Semaphore(base);
            if(buffer->RX_Flag){
                if(buffer->RX_Interval>=buffer->RX_Timeout){
                    buffer->RX_Flag=0;
                    buffer->RX_Interval=0;
                    Semaphore_post(Semaphore);
                }
                buffer->RX_Interval++;
            }
            SCI_Repeat_Send_Post(base);
        }
    }

    a delay of 250㎳ is inserted due to the packet.

    Is the 250ms delay between every packet? Or every BYTE? If it's every packet then it won't fix the issue. It must be after every byte.

      

    If it is between every byte, then there can be a baud rate mismatch or a setting mismatch on the PC.

    Regards,

    Vince