Part Number: TMS320F2800137
Other Parts Discussed in Thread: C2000WARE
Tool/software:
The implementation of the SysCtl_clearInterruptStatus(uint32_t intFlags) function is unable to clear the FPU OFLOW/UFLOW interrupt flags. The function takes an uint32_t as the parameter containing the flags that should be cleared by writing to the SYS_ERR_INT_CLR register. The function uses the HWREGH macro and it casts the argument to uint16_t. This means that the function is not able to clear the FPU OFLOW/UFLOW bits (bit 16 and 17).
The SysCtl_getInterruptStatus() and SysCtl_setInterruptStatus() use the HWREG macro to access the entire registers as opposed to SysCtl_clearInterruptStatus() that use the HWREGH macro. The function should be updated to use the HWREG macro and remove the cast to uint16_t to be able to clear the FPU_OFLOW/UFLOW flags.
Function in 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;
}
Proposed fix:
SysCtl_clearInterruptStatus(uint32_t intFlags)
{
HWREG(SYSSTAT_BASE + SYSCTL_O_SYS_ERR_INT_CLR) |= intFlags;
}