Skip to main content
xchen.3
Associate II
June 4, 2024
Question

After I program the board with j link the program doesnot run unless power is re-applied

hi , 

I am testing some code on a custom board containing stm32H7 , using CudeIDE and segger J-link EDU . using STlink V2 everything works normally. however using J-link debugging works OK , but when I program release version it programs correctly but program doesnot start. even if debugger is removed from board . the only solution is to turn my board off then on. then the program starts executing. 

info: i am using SWD interface , Reset is connected and verified it is being pulled low breifly during flashing. Also on the custom board the boot0 is connected to GND using pull down resistor . 

is this normal behavior ? is there a way to make the program run after flashing using J-link ?

 

This topic has been closed for replies.

5 replies

Andrew Neil
Super User
June 4, 2024

What happens if you just give the target a reset (assert NRST) - does that get it going?

Is there a J-Link option required to reset the system after programming?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
xchen.3
xchen.3Author
Associate II
June 4, 2024

If i give the target a reset (nrst to GND) the program is solved . the target starts . In Cubeide there is no option that i can find to reset after programming ,

So I installed another IDE (VS + visualgdb) there is option to rest after program : In Startup GDB command :

Mon reset

load

mon reset

and on scope i can verify that It is restarting . however the program still needs external reset. 

What is different between Stlink and Jlink is that stlink holds reset low for longer , Jlink pulls RST for very short time. then the RST capacitor (100nF as per ST recommendation) starts charging immediately.

 

Andrew Neil
Super User
June 4, 2024

@xchen.3 wrote:

What is different between Stlink and Jlink is that stlink holds reset low for longer , Jlink pulls RST for very short time. 


Might be worth asking Segger about that:

https://forum.segger.com/index.php/Board/3-J-Link-Flasher-related/

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
June 4, 2024

The H7 treats a power-cycle and reset differently. The power cycle latches the Option Bytes. There's also a determination about if there is usable code in the User Flash Banks, and that can be sticky

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
xchen.3
xchen.3Author
Associate II
June 5, 2024

how to give commands to Jlink from stm32cubeIDE ?

I am sure there is a command like Go or continue to make target run but where to put this ? I have read somewhere that the default settings in J-link is to halt CPU after programming , not sure how to change that