I am developing inMSP430F5335 + CC2564 with Bluetopia in IAR SPPLEDemo_Lite project. My Application is like the following: The debug UART send the data to the MSP430F5335 , and the MSP430F5335 and send out the data to PC via SPP . To improve throughput , I have reference the following page for improve the throughput of CC2564 and config the parameter. http://processors.wiki.ti.com/index.php/CC256x_MSP430_TI's_Bluetooth_Stack_Basic_SPPDemo_APP_Improving_throughput_v14 I also reference the sample code for reading data from debug UART in SPPDemo project , it use the HAL_ConsoleRead function for reading data from debug UART. The code is like the following: In MAIN.c static void IdleFunction(void *UserParameter) { /* If the stack is Idle and we are in HCILL Sleep, then we may enter */ /* LPM3 mode (with Timer Interrupts disabled). */ if((BSC_QueryStackIdle(BluetoothStackID)) && (SleepEnabled)) { /* Attempt to suspend the UART. */ if(!HCITR_COMSuspend(0)) { /* Enter MSP430 LPM3 with Timer Interrupts disabled (we will */ /* require an interrupt to wake us up from this state). */ HAL_LowPowerMode((unsigned char)FALSE); /* Check to see if a wakeup is in progress (by the Controller).*/ /* If so we will disable sleep mode so that we complete the */ /* process. */ if(!HCITR_UartSuspended(0)) SleepEnabled = FALSE; /* Go ahead and process any characters we may have received on */ /* the console UART. */ ProcessCharacters();//------------------------------------------Read the data from debug UART } else { /* Failed to suspend the UART which must mean that the */ /* controller is attempting to do a wakeup. Therefore we will */ /* flag that sleep mode is disabled. */ SleepEnabled = FALSE; } }else{ // Process any console characters that we may have. ProcessCharacters(); //------------------------------------------Read the data from debug UART } } In SPPLEDemo.c and in the ProcessCharacters() void ProcessCharacters(void) { char Char; while(HAL_ConsoleRead(1, &Char)) { //Send SPP BT data char Buffer[1]; Buffer[0]=Char; SPP_Data_Write(BluetoothStackID, SerialPortID, (Word_t)1, (Byte_t *)Buffer); } } When the baud rate of debug UART is 115200. But the SPP data will loss when the baud rate is set to 115200. I think the reason of data loss is MSP430F5335 need to receive data from UART and send the data via SPP at the same time. But I am not sure... Question: Is it correct to receive the console data at following function? Is it fast enough to read the data from console ? IdleFunction Can some one give me some suggestions ? Thanks in advance and sorry about my English.
↧