KL03 pin reinitialisation in bootloader

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

KL03 pin reinitialisation in bootloader

Jump to solution
3,457 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
2,985 Views
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

View solution in original post

7 Replies
2,985 Views
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 Kudos
Reply
2,985 Views
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 Kudos
Reply
2,985 Views
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 Kudos
Reply
2,985 Views
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 Kudos
Reply
2,986 Views
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,985 Views
kporenta
Contributor III

Hi Fan,

that explains everything.

Klemen

0 Kudos
Reply
2,985 Views
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 Kudos
Reply