init_flash_memory() - takes too long

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

init_flash_memory() - takes too long

461 Views
gauravbanyal
Contributor IV

Hello,

 

I took the function init_flash_memory() from one of the SDK2.0 examples for the FRDM-KL03 kit.

I have this function called in the initialization. In my design, the MCU sleeps in VLLS3 and wakes up and reads a line, does something based on that and sleeps again in VLLS3.

 

Problem is: 

I was trying to pofile the code. I noticed that init_flash_memory() takes 127ms to execute and in that time, I miss the signal on the line that I want to capture.

 

Any idea on why it takes so long and how I can avoid it?

 

Thanks.

Labels (1)
Tags (1)
0 Kudos
3 Replies

316 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Gaurav Banyal,

    Please give me a picture about init_flash_memory() function in the SDK2.0_FRDM-KL03.

   I check SDK2.0_FRDM-KL03, just find the status_t FLASH_Init(flash_config_t *config) function.

   Please check your init_flash_memory() function , what the code in this function. You can delete the not important code to cut down the execute time.


Have a great day,
Kerry

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

0 Kudos

316 Views
gauravbanyal
Contributor IV

Hello Kerry Zhou,

Sorry about this mistake. The procedure init_flash_memory() is indeed something I have created. This encapsulates much of what is in the initialization in the example SDK_2.0_FRDM-KL03Z\boards\frdmkl03z\driver_examples\flash\pflash.

Below is my function. Could you please suggest what is the not-important code that can be removed?

iflash.JPG

Good day to you too!

Thanks,

Gaurav.

0 Kudos

316 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Gaurav Banyal,

    Please comment all the code in the red rectangle:

pastedImage_1.png

Then try again, in your code, PRINTF will caused a lot of time.

Wish it helps you!

Have a great day,
Kerry

 

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

0 Kudos