Timer ISR problem with flash write/read for FRDM-K64F in MCUXpresso

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

Timer ISR problem with flash write/read for FRDM-K64F in MCUXpresso

640 Views
shoaibshaikh
Contributor III

Dear All,

I am facing some problems with timer interrupt while writing/reading data in flash in the timer ISR. I am able to write and read data in the ISR but the ISR is running at an independent rate, regardless of the value in the CMR (30 to 65530) of the lptmr0. In the ISR I toggle the LED whenever the read value is even.

I added the timer interrupt code to the PFlash example of the SDK.

I also checked the timer register values while debugging, they don't seem to get initialized as the watch window displays following error messages:

Multiple errors reported.

1) Unable to create variable object

2) Failed to execute MI command:
-data-evaluate-expression LPTMR0->CSR
Error message from debugger back end:
No symbol "LPTMR0" in current context.

3) Failed to execute MI command:
-var-create - * LPTMR0->CSR
Error message from debugger back end:
-var-create: unable to create variable object

4) Failed to execute MI command:
-var-create - * LPTMR0->CSR
Error message from debugger back end:
-var-create: unable to create variable object

The code does go into the timer ISR, as I checked it using breakpoints.

When I check the lptmr0 project independently it is running as expected.

Any pointers as to where I may be going wrong. I am using FRDM K64F board in MCUXpresso 10.0.0.

Thanks,

0 Kudos
3 Replies

408 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

You doesn't enable the SIM->SCGC5.LPTMR bit. This bit controls software access to the Low Power Timer module.

Since the K64 has very complex structure, I think you'd better refer to lptmr example, and use the functions in SDK to control all of the module.

Regards

Jing

0 Kudos

408 Views
shoaibshaikh
Contributor III

nxf32199

I attached the code

0 Kudos

408 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

would you mind to send me your code?

Regards

Jing

0 Kudos