Tool/software: TI-RTOS
CC640 4x4 custom board, ble_sdk_2_02_01_18, tirtos_cc13xx_cc26xx_2_20_01_08,
CCS 6.2, XDS 200 debugger.
The custom application uses the UART driver in read callback mode. The UART receives
bytes one at a time. It also uses the SPI and ADC drivers. UART is only used during sensor
calibration to talk to an external processor through a wired connection.
When the ble stack was upgraded to use the ADC driver, the sensor would reach a
Hard fault forced busfault PRECISERR. When the upper limit on the timeout in the
bytes received through the UART was increased, this error went away.
However, a few debug statements were in the UART callback routines processed
through the RTOS queue (pasted below underlined and highlighted in bold). When
these statements were deleted, the bus fault error would happen again. Task stack
overflow is seen in the ROV if the bus fault happens but not otherwise.
These statements debug don't impact the sensor steady state processing. The sensor is
also able to sustain UART communication through a 3 hour calibration process and
resume steady state operation.
Why is the firmware sensitive to the presence of these debug statements? Does
this indicate a task stack overflow of some kind? Or do they help wake up the
UART driver activity in the functions processed through the RTOS queue?
The UART callback stops working when messages with more than one byte are
received unless the RTOS queue functions are woken up by these debug statements.
Thanks,
Priya
static void receiveUartMsg (uint8_t value)
{
static uint8_t i, length = 5;
System_printf("\nvalue=%x clkCntDiff=%d clkCnt=%d prevClkCnt=%d", value, clkCnt-prevClkCnt, clkCnt, prevClkCnt);
static void UART_enqueueMsg(uint8_t value)
{
sbpEvt_t *pMsg;
// Create dynamic pointer to message.
if (pMsg = ICall_malloc(sizeof(sbpEvt_t)))
{
pMsg->hdr.event = UART_MSG_EVT;
pMsg->hdr.state = value;
PIN_setOutputValue(PinHandle, Board_HGM_OUT, 1);
// Enqueue the message.
Util_enqueueMsg(appMsgQueue, sem, (uint8*)pMsg);
}
}
static void SendUartMsg(void)
{
// Talk Mode Confirmation
if (uart_rx_buf[0] == 0x55) {
uint8 txbuf[] = {0x07};
UART_write(uart, txbuf, 1);
PIN_setOutputValue(PinHandle, Board_HGM_OUT, 0);
processingUARTMsg = 0;
waitForUARTMessage();
return;
}