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.

[参考译文] TMS320F2800137:SYSCTL_clearInterruptStatus ()的 Driverlib 实现错误

Guru**** 2481465 points
Other Parts Discussed in Thread: C2000WARE

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1461114/tms320f2800137-driverlib-implementation-error-for-sysctl_clearinterruptstatus

器件型号:TMS320F2800137
Thread 中讨论的其他器件:C2000WARE

工具与软件:

SYSCTL_clearInterruptStatus (uint32_t intFlags)函数的实现无法清除 FPU OFLOW/UFLOW 中断标志。 该函数将 uint32_t 作为参数、其中包含应通过写入 SYS_ERR_INT_CLR 寄存器来清除的标志。 该函数使用 HWREGH 宏并将参数强制转换为 uint16_t 这意味着该函数无法清除 FPU OFLOW/UFLOW 位(位16和17)。

SysCtl_getInterruptStatus()和 SysCtl_setInterruptStatus()使用 HWREG 宏来访问整个寄存器、而不是使用 HWREGH 宏的 SysCtl_clearInterruptStatus()。 应更新该函数以使用 HWREG 宏并删除转换为 uint16_t 的命令、以便能够清除 FPU_OFLOW/UFLOW 标志。

在 C2000Ware 5.04.00.00中运行:

//*****************************************************************************
//
//! Clears the interrupts due to multiple different errors in the system.
//!
//! \param intFlags is the interrupt that needs to be cleared.
//!
//! The \e intFlags parameter are the Interrupts generated on errors in
//! the system that need to be cleared. The values can be one or more from:
//! - SYSCTL_STATUS_GINT
//! - SYSCTL_STATUS_CORRECTABLE_ERR
//! - SYSCTL_STATUS_RAM_ACC_VIOL
//! - SYSCTL_STATUS_EPG1_INT
//! - SYSCTL_STATUS_FPU_UFLOW
//! - SYSCTL_STATUS_FPU_OFLOW
//!
//! \return None.
//
//*****************************************************************************
static inline void
SysCtl_clearInterruptStatus(uint32_t intFlags)
{
    HWREGH(SYSSTAT_BASE + SYSCTL_O_SYS_ERR_INT_CLR) |= (uint16_t)intFlags;
}

建议的修复:

SysCtl_clearInterruptStatus(uint32_t intFlags)
{
    HWREG(SYSSTAT_BASE + SYSCTL_O_SYS_ERR_INT_CLR) |= intFlags;
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Marius:

    感谢您关注这个问题、我将创建一个 JIRA 工单来跟踪这个问题、并将在下一个版本中对其进行更新。

    谢谢

    Aswin