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.
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!
-----------------------------------------------------------------------------------------------------------------------
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?
i
Good day to you too!
Thanks,
Gaurav.
Hi Gaurav Banyal,
Please comment all the code in the red rectangle:
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!
-----------------------------------------------------------------------------------------------------------------------