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
1,420 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
Reply
1 Solution
1,413 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
Reply
2 Replies
1,414 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
Reply
1,418 Views
ErichStyger
Specialist I

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
Reply