TI中文支持网
TI专业的中文技术问题搜集分享网站

LP-CC2652RB: Debug 时,重新运行出现错误 Error_policyMin()

Part Number:LP-CC2652RBOther Parts Discussed in Thread:CC2652RB

Hi Ti,

在开发过程中,我遇到一个很奇怪的问题。

我的代码是基于 simplelink_cc13x2_26x2_sdk_4_30_00_54 的 spimaster_CC2652RB_LAUNCHXL_tirtos_ccs 例程修改而来;

MCU 是 CC2652RB

我点 RUN->Debug 后,等编译下载完成后点 Resume 程序可以正常运行;

但是当我点 Suspend –> Restart –> Resume 后,程序总是卡在下图中的循环中。(我试了很多遍)

我想请教一下上面这个函数是由于什么错误触发的,或者有可能是什么原因导致的。

多谢

Kevin Qiu1:

这是内核引起的错误,参考这里提到的方法进行检查https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/796862/rtos-cc2652r-error_policymin-how-to-find-why-i-m-getting-in-this-routine-i-can-t-be-the-first-to-wonder-how-to-track-this-down

,

junde deng:

你好

我今天跟踪了一下这个错误,最后定位到问题可能是由如下代码引起的:

UART2_readTimeout(uartHandle, tmpBuf, RSBUS_PACK_MAX_LENGTH, &recvCnt, UART_READ_TIMEOUT);

我已经试过很多遍了,只要加上这句,restart 后就会进入 Error_policyMin() ,注释掉就可以正常 restart。

我的 UART2 配置如下:

       

请问这里有可能有什么问题吗?(波特率我也试了 115200,结果也会进入Error_policyMin())

谢谢!

,

Kevin Qiu1:

但从这一句看没什么问题,可能和其他产生冲突了,你使用上面链接提到的ROV看一下

§ UART2_readTimeout()
int_fast16_t UART2_readTimeout	(	UART2_Handlehandle,
void *buffer,
size_tsize,
size_t *bytesRead,
uint32_ttimeout)Function that reads data from a UART, with a specified timeout for blocking mode.UART2_readTimeout() reads data from a UART controller. The destination is specified by buffer and the number of bytes to read is given by size.In UART2_Mode_BLOCKING with UART2_ReadReturnMode_FULL, UART2_readTimeout() blocks task execution until all the data in buffer has been read, or the specified timeout has elapsed. In UART2_Mode_BLOCKING with UART2_ReadReturnMode_PARTIAL, UART2_readTimeout() returns before all the data has been read, if some data has been received, but reception has been inactive sufficiently long for a hardware read timeout to occur (e.g., for a 32-bit period). UART2_readTimeout() will also return if the specified timeout parameter has elapsed. Note that the timeout parameter is different from the hardware read timeout.In UART2_Mode_CALLBACK, UART2_readTimeout() does not block task execution. Instead, a callback function specified by UART2_Params::readCallback is called when the transfer is finished (UART2_ReadReturnMode_FULL), or reception has become inactive (UART2_ReadReturnMode_PARTIAL). The callback function can occur in the caller's context or in HWI context, depending on the device-specific implementation. An unfinished asynchronous read operation must always be cancelled using UART2_readCancel() before calling UART2_close(). In UART2_Mode_CALLBACK, the timeout parameter passed to UART2_readTimeout(), is ignored.In UART2_Mode_NONBLOCKING, UART2_readTimeout() will return the minimum of size and the number of data in the RX circular buffer. In this mode, the application should check the number of bytes read in the bytesRead parameter. A status of success will be returned if one or more bytes is available, unless an error occured. In UART2_Mode_NONBLOCKING, the timeout parameter passed to UART2_readTimeout(), is ignored.Note
It is ok to call UART2_readTimeout() from its own callback function when in UART2_Mode_CALLBACK.
Parameters
[in]	handle	A UART2_Handle returned by UART2_open()
[in]	buffer	A pointer to an empty buffer to which received data should be read
[in]	size	The number of bytes to be read into buffer
[out]	bytesRead	If non-NULL, the location to store the number of bytes actually read into the buffer. If NULL, this parameter will be ignored. In callback mode, NULL could be passed in for this parameter, since the callback function will be passed the number of bytes read. Similarly, in blocking mode with infinite timeout, NULL can be passed. However, status should be checked in case the number of bytes requested was not received due to errors. In non-blocking mode, it is not recommended to pass NULL for this parameter, as it would be impossible to determine the number of bytes actually read.
[in]	timeout	The number of system clock ticks to wait until all data is received. If not all requested data was received within the timeout period, an error of UART2_STATUS_ETIMEOUT will be returned. This parameter is only applicable to UART2_Mode_BLOCKING.
Returns
Returns a status indicating success or failure of the read.
Return values
UART2_STATUS_SUCCESS	The call was successful.
UART2_STATUS_EINUSE	Another read from the UART is currently ongoing.
UART2_STATUS_EAGAIN	In UART2_Mode_NONBLOCKING, no data is currently available.
UART2_STATUS_ECANCELLED	In UART2_Mode_BLOCKING, the read was canceled by a call to UART2_readCancel() before any data could be received.
UART2_STATUS_ETIMEOUT	The read operation timed out.

赞(0)
未经允许不得转载:TI中文支持网 » LP-CC2652RB: Debug 时,重新运行出现错误 Error_policyMin()
分享到: 更多 (0)

© 2024 TI中文支持网   网站地图 鲁ICP备2022002796号-1