MKL03 will not boot if PTB5 is grounded.

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

MKL03 will not boot if PTB5 is grounded.

Jump to solution
678 Views
FirmEE
Contributor II

I am using an MKL03Z32VFK4 device in which I am using PTB5, pin19 as a general-purpose input.

Whenever I ground this pin the micro will not boot.  I am using other port pins in a similar fashion that works just fine.  Does anyone have any idea why grounding PTB5 will prevent the micro from booting?

I am not sure what this debugger screen is telling me.

FirmEE_0-1608659161384.png

Thanks in advance for any help.

 

Mike B.

 

Labels (1)
0 Kudos
1 Solution
662 Views
ErichStyger
Senior Contributor V

Hi @FirmEE ,

PTB5 is the NMI pin:

ErichS_0-1608706426902.png

 

You have to disable that function. Check the RM how to disable it. As an example for what to do, see Disabling NMI (Non Maskable Interrupt) Pin | MCU on Eclipse

I hope this helps,

Erich

View solution in original post

0 Kudos
3 Replies
626 Views
FirmEE
Contributor II

Thanks, Erich and Mark.  PTB5 (NMI) being low was causing the device to execute the bootloader. Disabling the NMI and BOOT from ROM fixed the issue.

Mike B

0 Kudos
663 Views
ErichStyger
Senior Contributor V

Hi @FirmEE ,

PTB5 is the NMI pin:

ErichS_0-1608706426902.png

 

You have to disable that function. Check the RM how to disable it. As an example for what to do, see Disabling NMI (Non Maskable Interrupt) Pin | MCU on Eclipse

I hope this helps,

Erich

0 Kudos
656 Views
mjbcswitzerland
Specialist V

Hi

PTB5 is also the BOOTCFG input so you will need to
1. Disable the ROM loader being started based on the BOOTFG state (in the flash configuration)
2. Disable also the NMI function (in the flash configuration) or add an NMI handler to do it at reset in case you may need it later in the application. Code shown below

static __interrupt void irq_NMI(void)
{
    // This is executed immediately out of reset if the NMI line is enabled and held low
    // set the NMI line to an input to remove the NMI function and allow the processor to continue
    //
    _CONFIG_PORT_INPUT_FAST_LOW(B, PORTB_BIT5, PORT_PS_UP_ENABLE);
}


To assign an application NMI handler later:

// Allow the user to enter an NMI handler, ensuring that the NMI pin is configured as NMI function
// - note that the NMI may not have been disabled to allow this to work
//
extern void fnEnterNMI(void (*_NMI_handler)(void))
{
    VECTOR_TABLE *ptrVect = (VECTOR_TABLE *)(RAM_START_ADDRESS);
    ptrVect->ptrNMI = _NMI_handler;                                       // enter interrupt handler                                  
    _CONFIG_PERIPHERAL(B, 5, (PB_5_NMI | PORT_PS_UP_ENABLE));             // set the NMI pin function
}

 

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or rapid product development requirements

For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: https://www.utasker.com/kinetis/FRDM-KL03Z.html

 

0 Kudos