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.
Can the AUXKEY be written during LOCKAUX is set? (to configure the AUXCTL2 as code below)
AUXCTL0_H = AUXKEY_H; AUXCTL2 = (AUXMR_0 | AUX0LVL_6 | AUX1LVL_5 | AUX2LVL_0);
Part Number: MSP430F6779A
Are there other cases that LOCKAUX will be locked without reset?
with our system found sometimes (rare cases) the LOCKAUX locked without reset after call the pmm api
below
PMM_setVCore(PMM_CORE_LEVEL_3);
uint16_t PMM_setVCoreUp ( uint8_t level){ uint32_t PMMRIE_backup, SVSMHCTL_backup, SVSMLCTL_backup; //The code flow for increasing the Vcore has been altered to work around //the erratum FLASH37. //Please refer to the Errata sheet to know if a specific device is affected //DO NOT ALTER THIS FUNCTION //Open PMM registers for write access HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0xA5; //Disable dedicated Interrupts //Backup all registers PMMRIE_backup = HWREG16(PMM_BASE + OFS_PMMRIE); HWREG16(PMM_BASE + OFS_PMMRIE) &= ~(SVMHVLRPE | SVSHPE | SVMLVLRPE | SVSLPE | SVMHVLRIE | SVMHIE | SVSMHDLYIE | SVMLVLRIE | SVMLIE | SVSMLDLYIE ); SVSMHCTL_backup = HWREG16(PMM_BASE + OFS_SVSMHCTL); SVSMLCTL_backup = HWREG16(PMM_BASE + OFS_SVSMLCTL); //Clear flags HWREG16(PMM_BASE + OFS_PMMIFG) = 0; //Set SVM highside to new level and check if a VCore increase is possible HWREG16(PMM_BASE + OFS_SVSMHCTL) = SVMHE | SVSHE | (SVSMHRRL0 * level); //Wait until SVM highside is settled while ((HWREG16(PMM_BASE + OFS_PMMIFG) & SVSMHDLYIFG) == 0) ; //Clear flag HWREG16(PMM_BASE + OFS_PMMIFG) &= ~SVSMHDLYIFG; //Check if a VCore increase is possible if ((HWREG16(PMM_BASE + OFS_PMMIFG) & SVMHIFG) == SVMHIFG){ //-> Vcc is too low for a Vcore increase //recover the previous settings HWREG16(PMM_BASE + OFS_PMMIFG) &= ~SVSMHDLYIFG; HWREG16(PMM_BASE + OFS_SVSMHCTL) = SVSMHCTL_backup; //Wait until SVM highside is settled while ((HWREG16(PMM_BASE + OFS_PMMIFG) & SVSMHDLYIFG) == 0) ; //Clear all Flags HWREG16(PMM_BASE + OFS_PMMIFG) &= ~(SVMHVLRIFG | SVMHIFG | SVSMHDLYIFG | SVMLVLRIFG | SVMLIFG | SVSMLDLYIFG ); //Restore PMM interrupt enable register HWREG16(PMM_BASE + OFS_PMMRIE) = PMMRIE_backup; //Lock PMM registers for write access HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00; //return: voltage not set return ( STATUS_FAIL) ; } //Set also SVS highside to new level //Vcc is high enough for a Vcore increase HWREG16(PMM_BASE + OFS_SVSMHCTL) |= (SVSHRVL0 * level); //Wait until SVM highside is settled while ((HWREG16(PMM_BASE + OFS_PMMIFG) & SVSMHDLYIFG) == 0) ; //Clear flag HWREG16(PMM_BASE + OFS_PMMIFG) &= ~SVSMHDLYIFG; //Set VCore to new level HWREG8(PMM_BASE + OFS_PMMCTL0_L) = PMMCOREV0 * level; //Set SVM, SVS low side to new level HWREG16(PMM_BASE + OFS_SVSMLCTL) = SVMLE | (SVSMLRRL0 * level) | SVSLE | (SVSLRVL0 * level); //Wait until SVM, SVS low side is settled while ((HWREG16(PMM_BASE + OFS_PMMIFG) & SVSMLDLYIFG) == 0) ; //Clear flag HWREG16(PMM_BASE + OFS_PMMIFG) &= ~SVSMLDLYIFG; //SVS, SVM core and high side are now set to protect for the new core level //Restore Low side settings //Clear all other bits _except_ level settings HWREG16(PMM_BASE + OFS_SVSMLCTL) &= (SVSLRVL0 + SVSLRVL1 + SVSMLRRL0 + SVSMLRRL1 + SVSMLRRL2 ); //Clear level settings in the backup register,keep all other bits SVSMLCTL_backup &= ~(SVSLRVL0 + SVSLRVL1 + SVSMLRRL0 + SVSMLRRL1 + SVSMLRRL2); //Restore low-side SVS monitor settings HWREG16(PMM_BASE + OFS_SVSMLCTL) |= SVSMLCTL_backup; //Restore High side settings //Clear all other bits except level settings HWREG16(PMM_BASE + OFS_SVSMHCTL) &= (SVSHRVL0 + SVSHRVL1 + SVSMHRRL0 + SVSMHRRL1 + SVSMHRRL2 ); //Clear level settings in the backup register,keep all other bits SVSMHCTL_backup &= ~(SVSHRVL0 + SVSHRVL1 + SVSMHRRL0 + SVSMHRRL1 + SVSMHRRL2); //Restore backup HWREG16(PMM_BASE + OFS_SVSMHCTL) |= SVSMHCTL_backup; //Wait until high side, low side settled while (((HWREG16(PMM_BASE + OFS_PMMIFG) & SVSMLDLYIFG) == 0) || ((HWREG16(PMM_BASE + OFS_PMMIFG) & SVSMHDLYIFG) == 0)) ; //Clear all Flags HWREG16(PMM_BASE + OFS_PMMIFG) &= ~(SVMHVLRIFG | SVMHIFG | SVSMHDLYIFG | SVMLVLRIFG | SVMLIFG | SVSMLDLYIFG ); //Restore PMM interrupt enable register HWREG16(PMM_BASE + OFS_PMMRIE) = PMMRIE_backup; //Lock PMM registers for write access HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00; return ( STATUS_SUCCESS) ; }
I think it's set because the voltage drops during the vcore change api, right?
What conditions the MCU detected core power down and the set the LOCKAUX bit?
Hi Tink,
AUXKEY will need to be written with enabling the LOCKAUX bit, so in your first line I would replace the AUXCTL0_H to just AUXCTL0 so you can set the LOCKAUX bit as well.
LOCKAUX can be set after a BOR or when recovering from an LPMx.5 low power mode. Is your voltage dropping too low that you're triggering a BOR? Or are you using any LPMx.5 modes? (LPM3.5 or LPM4.5)
Regards,
Luke
Hi Luke,
No, I do not use the LPM 3.5 and LPM 4.5 and the BOR is not occurred.
I debugged the source code before line 112 LOCKAUX is clear. but after line 113 LOCKAUX is set.
Do you think AUXKEY be written during LOCKAUX is set may cause unexpected result? (in rare cases that i found)
Hi Tink,
Can you check the SYSRSTIV register to see if there was a POR that got triggered? There are a couple of erratas related to false POR activation (PMM18 and PMM20). I want to verify that we aren't accidently hitting those erratas which is causing a reset to lock the AUX.
(User's guide for your convenience: MSP430F6779A User's Guide)
Regards,
Luke
**Attention** This is a public forum