We are using the MKE18F512VLH16, and using startup code from MCUXpresso with FreeRTOS.
A while back, we had altered the initial FTFE_FOPT byte from 0x7D to 0x79 to disable the NMI pin at boot because we don't use it. On that particular board, we discovered that if that pin was pulled low at power up, it didn't boot properly. We redesigned it to make sure that pin wasn't pulled low, not fully understanding why it wouldn't boot properly.
On a new board, I forgot that little quirk, and didn't take that into consideration, so if the pin is pulled low, it doesn't boot. Looking into the FTFE_FOPT register, it appears that in the configuration it was using, pulling NMI low means "boot from ROM" and leaving it high means "boot from Flash"
What exactly is "boot from ROM" in a KE18? I found if I simply change the FOPT[7]:FOPT[1] to 01, it seems to boot fine regardless of what PTD3 is pulled to. If that's all it takes, that would save us from having to modify several boards.
已解决! 转到解答。
Hi
With FOPT[7;1] at 0x01 the ROM loader is disabled and the processor always boots up from its reset vector (as is the case in all Kinetis parts without BOOT ROM).
When set to 00 (Boot from ROM) the processor starts in the ROM boot loader, which checks the state of the BOOTCFG0 pin to decide whether to jump to the reset vector or to remain in the boot loader (which then allows loading new code via Kboot).
Therefore the setting 01 effectively disables the ROM boot loader.
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 product development requirements
Hi
With FOPT[7;1] at 0x01 the ROM loader is disabled and the processor always boots up from its reset vector (as is the case in all Kinetis parts without BOOT ROM).
When set to 00 (Boot from ROM) the processor starts in the ROM boot loader, which checks the state of the BOOTCFG0 pin to decide whether to jump to the reset vector or to remain in the boot loader (which then allows loading new code via Kboot).
Therefore the setting 01 effectively disables the ROM boot loader.
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 product development requirements