Bare-metal on KL03:

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

Bare-metal on KL03:

跳至解决方案
760 次查看
chucksmith
Contributor II

Hello, after trying out some code on a FRDM-KL03Z, we now want to run it on our bare-metal KL03Z32VFG4 based design. Using KDS and a J-Link, I load the code into the board, but I cannot hit the breakpoint at main(), and cannot even hit a breakpoint in the .S startup file. When I pause the execution, the program counter seems to be in the ROM Bootloader (0x1C00070E). The NMI pin is pulled low on our board, but the flash configuration values in startup_MKL03Z4.s are:

/* Flash Configuration */

    .section .FlashConfig, "a"

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFF3DFE

I believe the 3D disables the NMI function, and says boot from Flash.

So, how to give our application control?

Thanks


0 项奖励
1 解答
497 次查看
chucksmith
Contributor II

Hi Jeremy - that got me looking in the right area. I actually had to use a value of 0x3B to get it to boot to flash. Its now working. Thanks.

在原帖中查看解决方案

0 项奖励
2 回复数
497 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Chuck,

According to your statement, the MCU obviously are stuck in the Bootloader mode, the 0x30 means the setting of Fig 1.

Actually, you should set the 0x3F to FTFA_FOPT register, instead of  the 0x3D.

2016-07-18_17-34-14.jpg

                                                                              Fig 1


Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
498 次查看
chucksmith
Contributor II

Hi Jeremy - that got me looking in the right area. I actually had to use a value of 0x3B to get it to boot to flash. Its now working. Thanks.

0 项奖励