3

I did a program using ST-Link debugger on a custom board. The program is working fine. However, when I program the chip using ST-Link utility, the program is not starting without the ST-Link connected. When the ST-Link is connected, the system starts.

Anyone had such an issue?

Lundin
  • 195,001
  • 40
  • 254
  • 396
Adrien
  • 79
  • 1
  • 6
  • 1
    What power source do you use? I think it is difficult to answer without a schematic of the custom board. – Tom Apr 11 '17 at 13:14
  • Indeed I understand, that it is a bit complicated... I use a recom 3V3 DCDC: https://www.distrelec.ch/fr/regulateurs-decoupage-vdc-recom-78hb3/p/16907683?q=78HB3.3-0.5&page=1&origPos=1&origPageSize=50&simi=95.91 However it is working fine when I am in debug and as the ST-Link is only connectected to 3.3V for supervising the target voltage, I was more searching the problem in the configuration side. – Adrien Apr 11 '17 at 13:26
  • The ST-Link powers the board, so it doesn't use (or need) your normal power supply for debugging. Have you tested your board with a multimeter, oscilloscope, etc? – Tom Apr 11 '17 at 20:44
  • not shure because when my board power is off, it is not possible to program the chip. – Adrien Apr 12 '17 at 06:20
  • What about the NRESET pin. Did you pull it up? The N of NRESET means reset is when the pin is pulled down. – Tom Apr 12 '17 at 08:03
  • You might be right, in fact I originally put a pull-up and one guy from St support told me to remove it sayings there is an internal one. Do you put a pull-up on your designs on STM32L152? – Adrien Apr 12 '17 at 10:37
  • I never designed with a STM32L152. But you can check examples like eval boards http://www.st.com/content/ccc/resource/technical/document/user_manual/6f/ce/02/5b/e9/5d/40/71/CD00288880.pdf/files/CD00288880.pdf/jcr:content/translations/en.CD00288880.pdf (page 28) – Tom Apr 12 '17 at 12:40
  • The NRESET does not need to be pulled up since mcu is doing this fine by itself (see RPU in manual table 45), if you still want to pull it up then make sure that you use a resistor (or else soft reset will stop working). Also take a look at the boot0 pin and NJTRST (if running JTAG). The debugger will also activate power for some ports, so if this is forgotten in main software, then infinite loop could be entered due to error as a cause of this. – MathiasE Apr 19 '17 at 17:02

1 Answers1

4

Ok it is a bit stupid but I have to admit that in the stress I got a bit blind.

When I said:

The program is working fine however when I program the chip using ST-Link utility, the program is not starting without the ST-Link connected.

I was actually testing with only the usb removed from the ST-LINK and not removing totally the JTAG. So now I know that the ST-LINK is pulling down the reset when not powered.

Thanks Tom and staringlizard, you noted interesting thinks. Actually the Boot0 was my previous issue...

Adrien
  • 79
  • 1
  • 6