MKL03 will not boot if PTB5 is grounded.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MKL03 will not boot if PTB5 is grounded.

跳至解决方案
1,022 次查看
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.

 

标签 (1)
0 项奖励
回复
1 解答
1,006 次查看
ErichStyger
Specialist I

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 项奖励
回复
3 回复数
970 次查看
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 项奖励
回复
1,007 次查看
ErichStyger
Specialist I

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 项奖励
回复
1,000 次查看
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 项奖励
回复