Bare-metal on KL03:

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

Bare-metal on KL03:

Jump to solution
753 Views
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 Kudos
1 Solution
490 Views
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.

View solution in original post

0 Kudos
2 Replies
490 Views
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 Kudos
491 Views
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 Kudos