I used puart_print and puart_wirte to send data from tag3 board on peripheral uart to another host MCU via uart.that is set to be
115200/8/n/1.I have also boosted the tag3 board VCC to 3.0V because my host MCU is powered by 3V.
So far tag board can receive data reliably form host MCU as SOC is configured to be Rx interrupt driven.
However I did not use Tx on SOC to be interrupt driven but just used puart API calls like puart_print and puart_write functions.
As observed from trace log on my host MCU side, occasionally the sent packet from SOC could have missing byte(s) (framing error) .
I have read puart_print and puart_write a bit on other Wiced projects' examples, and noticed that this two function will be blocked if tx FIFO is full. from my setup to my host MCU, I did not use HW flow control since host MCU cannot avoid extra signal pins as other GPIOs pin has been assigned for other host MCU control application, so HW flow control cannot be an option.
How and what can 1 do to setup SOC for Tx interrupt driven like the Rx is set for interrupt too? Please send me any example codes to setup TX for interrupt driven.
See below my usage of puart_print and puart_write, I use fine timer tick routine to poll for data exhange by sending host MCU as request commnad and enable RX interrupt after sent by using puart_print or puart_write, the fine time is ticked at 500ms periodically.
// It will be called every fine timer tick at every 500ms time interval.
//Todo: do you actions here every fine timer tick
// Poll for host mcu for data exhange ie, occupancy/unoccupancy heat and cool setpoints per 100ms
// Data exchange objects are listed in Config_Cmd lookup table
// exit if not in BLE application config mode or DE update is in progress
if (BleAppControl.Mode != BLE_CONFIG_MODE || bBleAppDEUpdateinProgess)
ble_trace1("BleAppLockDuration: %d\r\n", BleAppLockDuration);
if (BleAppLockDuration % MAX_BLE_APP_LOCK_DURATION)
// unlock to resume normal scan operation,
// however the last scan request will be discarded
BleAppConfig.bLocked = FALSE;
// clear Rx interrupt
// flush Rx FIFO
ble_trace1("flush Rx FIFO: %c\r\n", readbyte);
BleAppConfig.Id = (BleAppConfig.Id+1)%MAX_BLE_CONFIG_ID;
ble_trace1("BleAppConfig.Id: %d\r\n", BleAppConfig.Id);
BleAppConfig.bSet = GET_CFG;
BleAppConfig.bWaitAck = FALSE;
BleAppConfig.bCrcEnabled = FALSE;
BleAppConfig.Crc32 - 0;
if (Status = (BleAppBuildConfigCmdString(&BleAppConfig)))
// send SoC request for config data
// Note: break string down to CFG_CMD_BUFSZ bytes per send if size > CFG_CMD_BUFSZ bytes
// or make it simply fit into CFG_CMD_BUFSZ-2 bytes for config caommad
// (1 for LF, 1 for CR, make command string size to be 16-2 = 14 bytes)
if (BleAppConfig.Size <= sizeof(BleAppConfig.StrBuf)-2)
// clear StrBuf after send for saving received response
memset(BleAppConfig.StrBuf, 0, sizeof(BleAppConfig.StrBuf));
BleAppConfig.Size = 0;
// lock next poll for DE data variables until response is received
BleAppConfig.bLocked = TRUE;
// enable UART Rx interrupt in the Main Interrupt Controller
P_UART_INT_ENABLE |= P_UART_ISR_RX_AFF_MASK;