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.

After "'SetBaudRate", No data transmitted.

Other Parts Discussed in Thread: CC2564, MSP430F5438, MSP430FR5989

We have already complet the mirgation of SPPDemo to our module(FR5989 + CC2564).

    Now, we want to improve the throughput of the module, So we change the baudrate(between CC2564B and MSP430) from 115200 to 460800. but when we add the function "SetBaudRate" to our code , we found that the remote devive can only receive very few data at the beginning. We carefully check the funcion "HAL_CommConfigure"and  USCI_A0 registers,  did not find any error. And we also trace the function SetBaudRate, and return success.

   what can we do next? thanks for your help !!

  • Hi,

    Let me try it on my setup. Btw, which software release version are you using?

    Regards,
    Gigi Joseph.
  • The software version is "v1.5 R2".
  • Today , we tried to modify the baudrate from 115200 to 230400. And the module worked OK, the throughput nearly double compared to the baudrate 115200.
    So, the problem may be the USCI_A0 set when baudrate is 460800.

    To get correct setting of USCI, we have two reference:
    1) the function HAL_CommConfigure of the SPPDemo
    2) Table 21-5. Recommended Settings for Typical Crystals and Baudrates Of <slau367f.pdf>

    First, we tried to set the baudrate according to <slau367f.pdf>, and then we tried the oher way. but none of them worked ok.

    So , what is the right way to set USCI_A0 ?
  • Yesterday,we set another port(USCI_A1) with the same baudrate (460800), to communicate with another MCU, and the receive and transmit data was correct. So, the setting of USCI_A is right ? (According to the <slau367f.pdf>)

    So, is the CC2564B didnot work ok in baudrate 460800 ?
  • Hi,

    I tried the scenario on my setup (MSP430F5438+CC2564B), and did not see any problem with data send/receive.
    Below is what I tried:

    ***
    Choose Mode>Server

    ******************************************************************
    * Command Options: Inquiry, DisplayInquiryList, Pair, *
    * EndPairing, PINCodeResponse, PassKeyResponse, *
    * UserConfirmationResponse, *
    * SetDiscoverabilityMode, SetConnectabilityMode,*
    * SetPairabilityMode, *
    * ChangeSimplePairingParameters, *
    * GetLocalAddress, GetLocalName, SetLocalName, *
    * GetClassOfDevice, SetClassOfDevice, *
    * GetRemoteName, SniffMode, ExitSniffMode, *
    * Open, Close, Read, Write, *
    * GetConfigParams, SetConfigParams, *
    * GetQueueParams, SetQueueParams, *
    * Loopback, DisplayRawModeData, *
    * AutomaticReadMode, SetBaudRate, Send *
    * Help, Quit *
    ******************************************************************

    Server>SetBaudRate 460800
    VS_Update_UART_Baud_Rate(460800): Success.

    Server>Open 1
    Server Opened: 1.

    Server>
    atLinkKeyRequest: 0xC0EEFB312CBD

    GAP_Authentication_Response success.

    Server>
    atPINCodeRequest: 0xC0EEFB312CBD
    Respond with: PINCodeResponse

    Server>PINCodeResponse 0000
    GAP_Authentication_Response(), Pin Code Response Success.

    Server>
    atLinkKeyCreation: 0xC0EEFB312CBD
    Link Key Stored.

    Server>
    SPP Open Indication, ID: 0x0001, Board: 0xC0EEFB312CBD.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>Write
    Wrote: 22.

    Server>
    SPP Data Indication, ID: 0x0001, Length: 0x0001.

    Server>
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Sniff, Interval: 800

    Server>read
    Read: 1.
    Message: g
    Read: 0.

    Server>
    SPP Data Indication, ID: 0x0001, Length: 0x000C.

    Server>
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Active, Interval: 0

    Server>read
    Read: 12.
    Message: irrrrrrrrrr

    Read: 0.

    Server>read
    Read: 0.

    Server>re
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Sniff, Interval: 800

    Server>ad
    Read: 0.

    Server>read
    Read: 0.

    Server>
    SPP Data Indication, ID: 0x0001, Length: 0x0001.

    Server>
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Active, Interval: 0

    Server>read
    Read: 1.
    Message: g
    Read: 0.

    Server>
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Sniff, Interval: 800

    Server>
    SPP Data Indication, ID: 0x0001, Length: 0x0001.

    Server>
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Active, Interval: 0

    Server>read
    Read: 1.
    Message: h
    Read: 0.

    Server>
    SPP Data Indication, ID: 0x0001, Length: 0x0017.

    Server>read
    Read: 23.
    Message: cuftfshrubsufficiencygg
    Read: 0.

    Server>read
    Read: 0.

    Server>read
    Read: 0.

    Server>
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Sniff, Interval: 800

    Server>read
    Read: 0.

    Server>
    SPP Data Indication, ID: 0x0001, Length: 0x0001.

    Server>
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Active, Interval: 0

    Server>
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Sniff, Interval: 800

    Server>read
    Read: 1.
    Message: f
    Read: 0.

    Server>re
    SPP Data Indication, ID: 0x0001, Length: 0x0020.

    Server>
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Active, Interval: 0

    Server>ad
    Read: 31.
    Message: ructifyingdyftratifyusEttyCHgg

    Read: 1.
    Message:

    Read: 0.

    Server>read
    Read: 0.

    Server>
    HCI Mode Change Event, Status: 0x00, Connection Handle: 1, Mode: Sniff, Interval: 800

    Server>
    ***

    My recommendation would be to check this on the "MSP Low-Power Microcontroller Forum" - specifically if "HAL_CommConfigure" is valid for MSP430FR5989

    Regards,
    Gigi Joseph.
  • Thanks for your help!
    About this question, we found three clues:
    1、The function “SetConfigParams”,returns error (-4). The paras we want to set are (58,348, 348). And we set BTPS_MEMORY_BUFFER_SIZE to 7200.
    2、We called SPP_Data_Write in the IdleFunction. but we did not see any signal in the HCI (Using oscilloscope). So, it is sure that,the MSP430 did not send data to cc2564. and we also mesure the RTS and CTS ,they were both low, no flow control. So why MSP430 did not send data ?
    3、Different cellphone. when baudrate is 230400, connected to cellphone A, it works ok, the bitrate is close to 128kbps. if we use another cell cellphone, it can not Continuously receive data. when the transmit halt, we can not get any signal in HCI,(the same Phenomenon with (2) ).

    thanks for your help~
  • Hi,

    1. I do not see this problem on my setup. Did you change anything else?

    Server>SetConfigParams 58 348 348
    SPP_Set_Configuration_Parameters(): Success
    MaximumFrameSize : 58 (0x3A)
    TransmitBufferSize : 348 (0x15C)
    ReceiveBufferSize : 348 (0x15C)

    2. Why are you calling SPP_Data_Write() inside IdleFunction()? The IdleFunction will possibly enter LPM3 mode.

    3. Can you share a sniffer log for this issue? It is not clear where the problem could be.

    Regards,
    Gigi Joseph.
  • Hi,Joseph

    thanks for your help.
    1、This problem has been resolved. the function "SetConfigParams" should be called before "OpenServer".
    2、We Set SleepEnabled == FALSE, So we think the IdleFunction will not enter LPM3. We call SPP_Data_Write in IdleFunction for test,to send data as soon as possible.
    3、We call these functions by our code, in the “MainThread” :

    /* Add the idle function (which determines if LPM3 may be entered)*/
    /* to the scheduler. */
    if(BTPS_AddFunctionToScheduler(IdleFunction, NULL, 0))
    {
    / *========= We set Our para here ==========*/
    InitBluetoothSet();

    /* Loop forever and execute the scheduler. */
    while(1)
    {
    BTPS_ExecuteScheduler();
    }




    And our function :

    void InitBluetoothSet(void)
    {
    ParameterList_t Para_Init;
    long BaudRate = 460800;
    long MaximumFrameSize = 329;
    long TransmitBufferSize = 987;
    long ReceiveBuffSize = 2303;

    if (BluetoothStackID)
    {

    Para_Init.NumberofParameters = 1;
    Para_Init.Params[0].strParam = "CRTE_T001";
    SetLocalName(&Para_Init);

    #if 1
    Para_Init.NumberofParameters = 1;
    Para_Init.Params[0].intParam = BaudRate;
    gResult0 = SetBaudRate(&Para_Init);

    Para_Init.NumberofParameters = 3;
    Para_Init.Params[0].intParam = MaximumFrameSize;
    Para_Init.Params[1].intParam = TransmitBufferSize;
    Para_Init.Params[2].intParam = ReceiveBuffSize;
    gResult1 = SetConfigParams(&Para_Init);
    #endif

    Para_Init.NumberofParameters = 1;
    Para_Init.Params[0].intParam = 1;
    OpenServer(&Para_Init);

    SendImReadyMsg();

    }
    }
  • About the phenomenon we refered before: When App can not receive data, no data transfered by HCI ,what can we do to this clue? Make sure Mcu did not enter LPM3 ,any other suggestion ?
    thanks!
  • Hi,

    1. It is expected, and also documented. Please see: processors.wiki.ti.com/.../CC256x_TI_Bluetooth_Stack_SPPDemo_App

    ***
    This function is used to change the current SPP parameters that are to be used for future SPP Ports that are opened. These parameters are the RFCOMM Frame size that is to be used for incoming/outgoing connections and the size (in bytes) of the default transmit and receive buffers that are used. The transmit and receive buffer sizes are the sizes that are used by default for newly opened SPP Ports (either client or server). The programmer is free to use the SPP_Change_Buffer_Size() function to change the transmit and receive buffer sizes for an existing SPP Port (either client or server). This function cannot be called if there exists ANY active SPP Client of Server. In other words, these parameters can only change when there are no active SPP Server Ports or SPP Client Ports open. Note that for all of the parameters there exists special constants which indicate to use the currently configured parameters.
    ***

    2. Please "step into" the IdleFunction() and confirm if LPM3 is not entered. It is not enough to set SleepEnabled = FALSE. You will have to disable the CC256x device also going to sleep mode. Please see: HCI_Sleep_Callback() in the demo application

    3. You can add your own function to the BTPS scheduler and implement your code there (or have your own scheduler scheme)

    Regards.
    Gigi Joseph.