KV56 Does not run without debugger connected

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

KV56 Does not run without debugger connected

Jump to solution
955 Views
derekcook
Senior Contributor I

Hello, 

My hardware and software runs when the J-Link debugger is connected with the KV56 MCU, but if I disconnect the debugger via stop in MCUXpresso the code freezes and also if I power the board without the debugger connected the code does not run. 

Why would this be? Is there something I need to do in MCUXpresso to get KV56 to run without debugger connected? 

0 Kudos
1 Solution
948 Views
derekcook
Senior Contributor I

It looks like the debugger unlocks the DWT but you have to do this yourself if not using the debugger. See this post: https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-DWT-Delay-Problem-DWT%E5%BB%B6%E6%97%B6%E...

I had to add this to the CM7 header

derekcook_0-1656615466407.png

 

Then I had to add unlocking the DWT registers

derekcook_1-1656615488579.png

 

View solution in original post

0 Kudos
2 Replies
949 Views
derekcook
Senior Contributor I

It looks like the debugger unlocks the DWT but you have to do this yourself if not using the debugger. See this post: https://community.nxp.com/t5/Kinetis-Microcontrollers/KV58-DWT-Delay-Problem-DWT%E5%BB%B6%E6%97%B6%E...

I had to add this to the CM7 header

derekcook_0-1656615466407.png

 

Then I had to add unlocking the DWT registers

derekcook_1-1656615488579.png

 

0 Kudos
953 Views
ErichStyger
Senior Contributor V

Are you using printf with semihosting?

If so, not having the correct hardfault handler will cause your target to stop if you print something.

0 Kudos