请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320F28386S 主题中讨论的其他器件:C2000WARE
您好!
发生错误时应执行的操作
uint16_t rxStatus = SCI_getRxStatus (SCIA_BASE);
if (rxStatus & SCI_RXSTATUS_ERROR){
}
建议
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.
您好!
发生错误时应执行的操作
uint16_t rxStatus = SCI_getRxStatus (SCIA_BASE);
if (rxStatus & SCI_RXSTATUS_ERROR){
}
建议
Asaf、您好!
错误可能是由多种原因引起的、通常在我们随 C2000Ware 提供的示例代码中、我们使用 Estop 停止代码、并指示用户检查系统中的特定错误。 根据错误、您可以分析代码/硬件并进行相应的调试。
rxStatus = SCI_getRxStatus(SCIA_BASE);
if((rxStatus & SCI_RXSTATUS_ERROR) != 0)
{
//
//If Execution stops here there is some error
//Analyze SCI_getRxStatus() API return value
//
ESTOP0;
}
谢谢、
Aditya
可以使用 API 清除错误标志-"SCI_performSoftwareReset"
//*****************************************************************************
//
//! Performs a software reset of the SCI and Clears all reported receiver
//! status flags.
//!
//! \param base is the base address of the SCI port.
//!
//! This function performs a software reset of the SCI port. It affects the
//! operating flags of the SCI, but it neither affects the configuration bits
//! nor restores the reset values.
//!
//! \return None.
//
//*****************************************************************************
static inline void
SCI_performSoftwareReset(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(SCI_isBaseValid(base));
//
// To clear all errors a sw reset of the module is required
//
HWREGH(base + SCI_O_CTL1) &= ~SCI_CTL1_SWRESET;
HWREGH(base + SCI_O_CTL1) |= SCI_CTL1_SWRESET;
}
有关 SCI Rx 寄存器错误标志的具体详细信息、您可以从器件的技术参考手册中查看 SCIRXST 寄存器。
谢谢、
Aditya