My code works only with debugger connected and run but doesn't work if it works freely without debugger MKL34z64

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

My code works only with debugger connected and run but doesn't work if it works freely without debugger MKL34z64

Jump to solution
3,842 Views
ahmedwahdan
Contributor I

My code works only with debugger connected and run but doesn't work if it works freely without debugger MKL34z64!!

What I have missed?

Labels (1)
0 Kudos
1 Solution
2,515 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi kareem,

The PTA4 by default is a NMI function. Driving the NMI signal low forces a non-maskable interrupt, if the NMI function is selected on the corresponding pin.

If it is possible, please use another pin instead of using PTA4 as GPIO.

If you want use PTA4 as GPIO function, please refer below:

  Using the NMI_b pin as GPIO on KL15 device  

  Disable NMI_b pin/interrupt KL04Z?  

  Need to use pin PTA4 but not as NMI_b (KL15)  

Best Regards,

Robin

View solution in original post

0 Kudos
6 Replies
2,515 Views
ahmedwahdan
Contributor I

Thanks Robin,

I found the problem and found that I can disable the NMI using flash config, I've changed the flash config in the startup code to disable the NMI but nothing changed in the flash.

confg.png

0 Kudos
2,515 Views
ahmedwahdan
Contributor I

I attached a picture of what connected to PTA4 and when switched the connection to another pin  it worked fine!!!
I've notied that PTA by default is a NMI so now i'm working on changing the default values and i'll keep you updated

schemeit-project.png

0 Kudos
2,516 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi kareem,

The PTA4 by default is a NMI function. Driving the NMI signal low forces a non-maskable interrupt, if the NMI function is selected on the corresponding pin.

If it is possible, please use another pin instead of using PTA4 as GPIO.

If you want use PTA4 as GPIO function, please refer below:

  Using the NMI_b pin as GPIO on KL15 device  

  Disable NMI_b pin/interrupt KL04Z?  

  Need to use pin PTA4 but not as NMI_b (KL15)  

Best Regards,

Robin

0 Kudos
2,515 Views
abosamy
Contributor I

I also have a similar problem. After I Download my code and it runs well, when I Reset, everything is gone.

Can Anyone help me fix this problem?

0 Kudos
2,515 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi kareem,

Have you test the project in SDK_1.3_MKL34Z64xxx4?

SDK_1.3_MKL34Z64xxx4.jpg

You can also test the Processor Expert project created by KDS3.2.0.

create Processor Expert project.jpg

KL34 Processor Expert.jpg

If the project still have problem on your customer board, please attach the schematic of your board.

What debugger are you using, Segger J-Link or PEmicro or the others?

Best Regards,

Robin

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
2,515 Views
ahmedwahdan
Contributor I

hey Robin  thanks for answering me.

I'm already using the SDK_1.3_MKL34Z64xxx4

and i'm also accessing the MCU using my own mapping files.

i got the FRDM-KL46Z which has a processor i believe it got the same architecture of the processor i use "KL34Z", the problem is when running the code on the FRDM board it works fine even after reset.

N.B: the on board debugger is PE-micro type

the problem is when i download this code on my custom board which has KL34Z the works fine only after downloading and while debugging but after reset it seems like it was downloaded on the RAM but it is not. I've read the code from my board after halting and it is the same code nothing missing N.B: i use J-LINK  SEGGER as a debugger for my board

i doubted the debugger but when i used it with the FRDM board it worked just fine.

any suggestion??

0 Kudos