KL03 pin reinitialisation in bootloader

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

KL03 pin reinitialisation in bootloader

跳至解决方案
2,788 次查看
kporenta
Contributor III

Hi,

 

question related to ROM bootloader burned into KL03.

 

Application enables only I2C as interface for bootloader (in BCA) and then jumps to bootloader. Will the ROM code change/reinitialise pin mux/state also for pins not used by bootloader or will leave them as they are on bootloader entry?

 

We are working on MKL03Z8VFG4 part number.

 

Thank you, Klemen

标签 (1)
0 项奖励
1 解答
2,316 次查看
ramboyang
NXP Employee
NXP Employee

Hi, Klemen,

After calling runBootloader API, device will reset itself (NVIC_SystemReset) and then boot from BootROM, so the GPIOs not touched by BootROM will be restored to default function.

Thanks,

Fan

在原帖中查看解决方案

7 回复数
2,316 次查看
ramboyang
NXP Employee
NXP Employee

Hi Klemen,

Only the pins of enabled peirpherals are re-initialized in BootROM, the other pinmux of toher pin is the same with the state out of reset.

Best Regards,

Fan

0 项奖励
2,316 次查看
kporenta
Contributor III

Hi Fan,

thank you for quick reply.

Is there a way to force BootROM not to change unused pins to out of reset state. In other word, leave them as they are before entering BootROM?

Klemen

0 项奖励
2,316 次查看
ramboyang
NXP Employee
NXP Employee

Hi Klemen,

Actually, BootROM doesn't change any unused pins, but I am not sure if the the pin mux would be restored to default state after reset.

0 项奖励
2,316 次查看
kporenta
Contributor III

Hi Fan,

we did a little test:

1. BCA flags were set to use I2C bus only (PTB3, PTB4), and peripheralDetectionTimeout timeout was set to 0xFFFF
2. execute application where we set muxing for pins PTA6 and PTA7 (GPIO)
3. inside application we jump to BootROM (runBootloaderAddress = **(uint32_t **)(0x1c00001c); runBootloader = (void (*)(void * arg))runBootloaderAddress; runBootloader(0);)
4. after few seconds we stop the MCU (PC is set to 0x1c000xxxx - BootROM) and pin muxing for PTA6 and PTA7 is reset to default value (DISABLED)

We have added also expression brake point to PORTA_PCR6 and PORTA_PCR7 but there are no accesses to this two register in BootROM.

Any idea?

WDT is disabled.

Klemen

0 项奖励
2,317 次查看
ramboyang
NXP Employee
NXP Employee

Hi, Klemen,

After calling runBootloader API, device will reset itself (NVIC_SystemReset) and then boot from BootROM, so the GPIOs not touched by BootROM will be restored to default function.

Thanks,

Fan

2,316 次查看
kporenta
Contributor III

Hi Fan,

that explains everything.

Klemen

0 项奖励
2,316 次查看
frankvanhooft
Contributor III

Just a warning on this same topic. The bootloader uses the PIT (timer). Specifically, it chains the two timers together. This tripped me up; my application wasn't working properly after using the bootloader, and it was because my app uses the PIT, but the bootloader had chained the two timers together, affecting their operation.

Frank.

www.frankvh.com

0 项奖励