Hello,
I tried to enter LowPowerMode from RAM by using PMM32.
Placed the FRAM in INACTIVE mode before any entry to LPM2/3/4 by clearing the FRPWR bit and FRLPMPWR bit (if exist) in the GCCTL0 register. This must be performed from RAM as shown below:
// define a function in RAM
#pragma CODE_SECTION(enterLpModeFromRAM,".TI.ramfunc") void enterLpModeFromRAM(unsigned short lowPowerMode) { FRCTL0 = FRCTLPW; GCCTL0 &= ~(FRPWR+FRLPMPWR); //clear FRPWR and FRLPMPWR FRCTL0_H = 0; //re-lock FRCTL __bis_SR_register(lowPowerMode); }
Linker Command File:
lnk_msp430fr6989.cmd MEMORY { ... RAM_CODE : origin = 0x23E0, length = 0x0020 ... FLASH_RAM_CODE : origin = 0x158A2, length = 0x0020 ... } SECTIONS { ... TI.ramfunc : {} > RAM_CODE ... /****************************************************************************/ /* CODE AND CONSTANT MEMORY-SEGMENTS */ /****************************************************************************/ .fir: load = FLASH_RAM_CODE, run =RAM_CODE ... .flash_ram_code : ALIGN(0x02) { *.obj(.flash_ram_code) } > FLASH_RAM_CODE ... }
placementDefinition.h
placementDefinition.h #define FLASH_RAM_CODE_BEGIN() EMIT_PRAGMA(SET_DATA_SECTION(".flash_ram_code")) #define FLASH_RAM_CODE_END() EMIT_PRAGMA(SET_DATA_SECTION())
After the shown changes the current consumption increased a lot.
Before the adaptions there was a current consumption of about 9µA (avg) and after the changes the current consumption is about 24µA (avg).
Is the higher current consumption an expected case for calling this function from RAM?
Thank you