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
Solved! Go to Solution.
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
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
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
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.
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
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
Hi Fan,
that explains everything.
Klemen
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.