Entering into VLPS mode is abandoned

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Entering into VLPS mode is abandoned

1,150 Views
jqy
Contributor I

I have a problem when the power mode gets into VLPS. i found the STOPA bit is set somehow, even if I disabled all the interrupts. I am using a KL03 mcu. It seems that the stop mode is abandoned after this. The code is running at 2MHz with low power uart enabled, and the power consumption is about 200uA. I read some of the questions being asked, it seems the e8068 RTC mask issue. i tried disable it but nothing changed. 

0 Kudos
10 Replies

892 Views
kerryzhou
NXP TechSupport
NXP TechSupport

HelloJieqiu,

  1. Clear time invalid flag of RTC before entering low power mode.

     Just like what you have said that e8068, add the workaroud.

pastedImage_1.png

2. Did you disable the global interrupt and make sure your NMI is stable.

  Please add 4.7K to 10K external pull up resistor in the NMI pin, because the internal pull up is weak.

 pastedImage_2.png

So you need to make sure, no interrupt and reset happens. watchdog also need to disabled.

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

892 Views
jqy
Contributor I

Hi Kerry,

I have just found out that it could be the ADC and V_REF using a lot of power.

1. The firmware running at 2MHz with LPUART (9600) enabled, has a current 280uA, with ADC and V_REF enabled.

2. After I managed to disable V_REF and stop the clock when I don’t use in VLPS, the current is reduced to 160uA.

3. I managed to stop the ADC clock when I don’t use it, the current is down further to about 92uA.

4. I am trying to disable the ADC when it is in VLPS, and I haven’t found the control bit to do it.

I will have a look at what you suggested.

Could you please give some comments on my above tests?

Best regards

Jieqiu

0 Kudos

892 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Jieqiu,

    Thank you for your updated information.

    Yes, if you enable the ADC module, of course it will cause more power consumption, from the datasheet, you also can find it:

pastedImage_1.png

If you want to disable the ADC module.

Please also disable these register:

ADCx_SC1n[ADCH]=11111.

SIM_SCGC6[ADC0]=0.

Then try it again.

Any question, just let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

892 Views
jqy
Contributor I

Hi Kerry,

Quick question here. I tried to write a data into the last sector of the KL03 on chip flash. All the read and erase operation is ok. But when I tried to write the data into the sector, the code executed this line: kFCCOBx[1] = *src++; and get a hard fault error.

I have initialised and don’t know what else I need to do.

Please help.

Jieqiu

status_t FLASH_Program(flash_config_t *config, uint32_t start, uint32_t *src, uint32_t lengthInBytes)

{

status_t returnCode;

flash_operation_config_t flashOperationInfo;

if (src == NULL)

{

return kStatus_FLASH_InvalidArgument;

}

flash_get_matched_operation_info(config, start, &flashOperationInfo);

/* Check the supplied address range. */

returnCode = flash_check_range(config, start, lengthInBytes, flashOperationInfo.blockWriteUnitSize);

if (returnCode)

{

return returnCode;

}

start = flashOperationInfo.convertedAddress;

flash_cache_clear_process(config, kFLASH_CacheClearProcessPre);

while (lengthInBytes > 0)

{

/* preparing passing parameter to program the flash block */

kFCCOBx[1] = *src++;

if (4 == flashOperationInfo.blockWriteUnitSize)

{

kFCCOBx[0] = BYTES_JOIN_TO_WORD_1_3(FTFx_PROGRAM_LONGWORD, start);

}

else if (8 == flashOperationInfo.blockWriteUnitSize)

{

kFCCOBx[2] = *src++;

kFCCOBx[0] = BYTES_JOIN_TO_WORD_1_3(FTFx_PROGRAM_PHRASE, start);

}

else

{

}

/* calling flash command sequence function to execute the command */

returnCode = flash_command_sequence(config);

/* calling flash callback function if it is available */

if (config->PFlashCallback)

{

config->PFlashCallback();

}

/* checking for the success of command execution */

if (kStatus_FLASH_Success != returnCode)

{

break;

}

else

{

/* update start address for next iteration */

start += flashOperationInfo.blockWriteUnitSize;

/* update lengthInBytes for next iteration */

lengthInBytes -= flashOperationInfo.blockWriteUnitSize;

}

}

flash_cache_clear(config);

return (returnCode);

}

0 Kudos

892 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Jieqiu,

   Before you do the flash operation, please disable the global interrupt, then try again, whether you still have the hardfault problem.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

892 Views
jqy
Contributor I

Hi Kerry,

Thank you very much for your help

I added this line before the operation

__asm("CPSID i");

still not working

0 Kudos

892 Views
jqy
Contributor I

Hi Kerry,

It works now!

Thank you for your help!

0 Kudos

892 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jieqiu,

How did you make it work after saying disable the global interrupt doesn't work?


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

892 Views
jqy
Contributor I

Hi Kerry,

It is a silly typo error made when I copy and paste the code!

Thank you for your help

Jieqiu

0 Kudos

892 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jieqie Yang,

    Thank you for your updated information.

    Now, if your problem is solved, please mark the correct answer to close this question, thank you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos