Disable NMI_b pin/interrupt KL04Z?

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable NMI_b pin/interrupt KL04Z?

Jump to solution
1,895 Views
rflmota
Contributor II

How can I disable NMI Interrupt at startup of μController MKL04Z32VFK4 using CodeWarrior but without Processor Expert? I've seen many threads here in the community regarding my problem and I came to the conclusion that to solve my problem I should disable NMI Interrupt at startup, because I'm using PTB5 as its alternate function of ADC channel through a pull-down network. I've searched the Reference Manual and found that for that I should change the Flash Configurations of the microcontroller that were then loaded at boot to Flash Option Register (FTFA_FOPT). The problem here is the only examples I came across all involves changing this Flash Configurations through PE interface, my question is how can this be accomplished using just plain code and none of Rapid Application Development features.

Thank you in advance for your help. :smileywink:

Labels (1)
1 Solution
431 Views
jcottier
Contributor II

Hi Ricardo, I had a similar issue with the KL02. The solution from Freescale is attached. Probably the same or very similar on the KL04 if you research the reference manual. Its all in there but quite hard to find and piece together without an example.

Regards

John Cottier.

View solution in original post

4 Replies
431 Views
mohamedabdelmag
Contributor II

Hi,

I had the same problem but the solution above didn't work

I use IAR to program and debug, can you advice what is the address of the byte to be changed to FB? Is it the only thing I must do?

I am using MKE04Z8VWJ4 uc

Thank you in advance for your help

0 Kudos
431 Views
santiago_gonzal
NXP Employee
NXP Employee

Hello,

Yes, is the only thing you need to do. Usually in IAR there is a section in the linker called m_flash_config and at some point in your code you should see something similar to this:

(In the project I am using now it's inside startup_MK64F12.s). When you find this section you only need to change the bits corresponding to the NMI pin (You can check that in the Reference Manual of the device).

        SECTION FlashConfig:CODE

__FlashConfig

        DCD 0xFFFFFFFF

        DCD 0xFFFFFFFF

        DCD 0xFFFFFFFF

        DCD 0xFFFFFFFE

__FlashConfig_End

Regards,

Santiago

0 Kudos
432 Views
jcottier
Contributor II

Hi Ricardo, I had a similar issue with the KL02. The solution from Freescale is attached. Probably the same or very similar on the KL04 if you research the reference manual. Its all in there but quite hard to find and piece together without an example.

Regards

John Cottier.

View solution in original post

431 Views
rflmota
Contributor II

Many thanks jcottier your tips helped me with solving exactly the problem! :smileywink:

0 Kudos