Skip to main content
tomjianchun
Associate II
February 3, 2015
Question

STM32F030K6T6 can only be programed with ST-LINK once

  • February 3, 2015
  • 14 replies
  • 3157 views
Posted on February 03, 2015 at 08:40

my design using STM32F030K6T6, see attached schematics, and using SWD to program, with ST-LINK(Version is at attached picture), I can only program STM32F030K6T6 one time, after code (which is simple toggle one LED on/off) is running, ST-LINK can never connect to STM32F030K6T6 again, what is the reason ?

#stm32
    This topic has been closed for replies.

    14 replies

    tomjianchun
    Associate II
    February 3, 2015
    tomjianchun
    Associate II
    February 3, 2015
    Posted on February 03, 2015 at 08:54

    can anybody help me ?

    Thanks.

    AvaTar
    Senior III
    February 3, 2015
    Posted on February 03, 2015 at 11:03

    Your code is probably buggy and uncooperative.

    Startup your board in the system mode (BOOT0/BOOT1 pin), and use the FlashLoader Demonstrator software (from ST) to do a mass erase.

    There are several descriptions of this procedure here on this forum.

    Tesla DeLorean
    Guru
    February 3, 2015
    Posted on February 03, 2015 at 14:16

    Have you tried the ''Connect Under Reset'' options?

    If your code is broken you can disconnect the SWD pins, or interfere with the GPIO configuration. Pulling BOOT0 High and resetting will stop your broken code from running, and you should be able to reflash the device.
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    tomjianchun
    Associate II
    February 4, 2015
    Posted on February 04, 2015 at 03:17

    Thank you for your help, I am just use STM32Cube to generate one simple LED toggle code. I don't why this code has buggy, and this code looks running corrently in the board, and my ST-LINK has no''Connect Under Reset'' option, in Target ---settings, there are only two options, either ''Normal'' or ''hot plug'' , I am using the latest V3.5 version ST-LINK downloaded from ST web

    ________________

    Attachments :

    3.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0tm&d=%2Fa%2F0X0000000bfI%2F0esgKhlW_IqHE0MHcXJyEIIf4sU7Nm72gXW1PQO1Hbk&asPdf=false
    Tesla DeLorean
    Guru
    February 4, 2015
    Posted on February 04, 2015 at 03:42

    Does setting BOOT0 High allow you to program the part? Yes/No

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    tomjianchun
    Associate II
    February 4, 2015
    Posted on February 04, 2015 at 04:08

    yes, exactly, as I configure BOOT0 as high , My ST-LINK can connect to micro, and programming.

    Thank you very much.

    but what is the root cause ?

    tomjianchun
    Associate II
    February 4, 2015
    Posted on February 04, 2015 at 04:22

    Is my understanding correct ?

    since my code has bug, so in BOOT0=Low, as my code is running, ST-LINK can not connect to micro, and

    as I set BOOT0=high, my code is not running, and ST-LINK can connect to micro ?

    Thanks.

    Tesla DeLorean
    Guru
    February 4, 2015
    Posted on February 04, 2015 at 05:21

    Correct

    There are several things, the most frequent are breaking the GPIO pins used for SWD/JTAG connectivity, or powering down the device.

    Look at if you are doing anything with PA13/PA14

    Look at if you're using WFI or low power modes

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    tomjianchun
    Associate II
    February 4, 2015
    Posted on February 04, 2015 at 06:14

    Thank you for your instructions,

    I did not do anything to PA13/PA14, i am just leave all unused PIN as floating which inlude the PA13/PA14. I will check it further.

    When ST-LINK connect to micro ,does ST-LINK first try to reset the micro ? since ST-LINK has a RESET PIN connect to micro NRST PIN,  and the mode ''connect under reset'', does it mean ST-LINK can connect to micro without reset the micro first ?

    Thanks.