Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 217572

Forum Post: RE: TMS320F2800157: LockStep Functionality

$
0
0
Alright, I got it working. I set up everything right and cleared the GERR flag, after the interrupt. One last question regarding this topic. We are forcing the LCM errors using LCM_runComp1ErrorForceTest() function but in production, we won't force errors but just get LockStep Compare Status after our critical algorithm and if it returns LCM_FAIL, then we encountered an LCM error (we need to clear LCM Flag, and in NMI_ISR, we need to clear NMI Flags and GERR Flag). I have put a sample code below of this implementation. Is this right way to code in production? // performing our algorithm uint16_t x = 10; uint16_t y = 5; uint16_t z = x+y; if (LCM_getLockStepCompareStatus(LCM_CPU1_BASE) == LCM_FAIL) { // handle error log("LCM_getLockStepCompareStatus Fail\n\0"); LCM_clearFlags(LCM_CPU1_BASE, LCM_STATUS_CLEAR_CMP_FAIL); } else { // algorithm works fine log("LCM_getLockStepCompareStatus Pass\n\0"); } __interrupt void nmi_isr(void) { uint16_t nmistatus = SysCtl_getNMIFlagStatus(); SysCtl_clearAllNMIFlags(); if ((nmistatus & SYSCTL_NMI_NMIINT) != 0U) { log("SYSCTL_NMI_NMIINT\n\0"); } if ((nmistatus & SYSCTL_NMI_LSCMPERR) != 0U) { uint32_t LCMErrorFlag = SysCtl_getLCMErrorFlag(); SysCtl_clearLCMErrorFlag(LCMErrorFlag); } } Also, thank you so much for all your help.

Viewing all articles
Browse latest Browse all 217572

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>