MKL03 will not boot if PTB5 is grounded.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MKL03 will not boot if PTB5 is grounded.

ソリューションへジャンプ
955件の閲覧回数
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 解決策
939件の閲覧回数
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 返答(返信)
903件の閲覧回数
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 件の賞賛
返信
940件の閲覧回数
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 件の賞賛
返信
933件の閲覧回数
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 件の賞賛
返信