Skip to main content
Explorer
June 4, 2022
Question

STM32 CubeProgrammer only works every other time

  • June 4, 2022
  • 6 replies
  • 1095 views

I am using STM32 CubeProgrammer to program a Nucleo F-103RB via the OBD. When I power up the board, I can connect to ST-LINK and program the board. However, if I try to program it a second time, I get some errors:

0693W00000NrCTrQAN.jpgand it doesn't program. If I do nothing else but close those error messages and try to program again, it successfully completes. This is 100% repeatable.

Is there something I need to do before re-programming a board to avoid those errors?

    This topic has been closed for replies.

    6 replies

    June 4, 2022

    First things first, which CubeProgrammer version do you use?

    Then, do some checks.

    1) On your board if the NRST or JTAG reset are connected.

    2) On your board Boot0 and Boot1 pins status.

    3) The flash lock status before reprogramming.

    Graduate II
    June 8, 2022

    All ST boards have NRST connected to the onboard ST-LINK.

    SHobb.1Author
    Explorer
    June 6, 2022

    Thanks for the response.

    1. STM32CubeProgrammer API v2.10.0 | Windows-64Bits
    2. Standard Nucleo-64 (Nucle-F103RB)
      1. I've not had a ton of luck finding actual schematics of the Nucleo boards. However, based on UM1724, I believe Boot0 is ground. Can't find reference to Boot1
      2. I have not changed any of the solder bridge settings on the board (still in factory default setting). That means SB12 is on and SB11 is off. I believe that means the OBD can reset the STM, but I'm not certain.
    3. What is flash lock status?

    To reiterate - I am able to program the STM32 on the board - I just have to run click on "download" twice.

    Super User
    June 6, 2022

    What does the program you are programming into target, do? Try a plain blinky with no changes in clocks ie. default HSI clock, no PLL).

    Try STLink Utility instead of Cube programmer.​

    > I've not had a ton of luck finding actual schematics of the Nucleo boards.

    On ST web, in the Nucleo web folder, under CAD Resources.

    JW​

    SHobb.1Author
    Explorer
    June 7, 2022

    The program does many things. But it seems to be irrelevant to the behavior I described. If I change a single thing (like the duty cycle on a blinking LED), it will do exactly what I described above.

    I will try STLink Utility.

    Thanks for the pointer to the schematics.

    Graduate II
    June 8, 2022

    GPIO configuration for SWD/JTAG pins, low-power modes, watchdogs and option bytes definitely can have an impact on debugger.

    Also set both of these for the debugger:

    • Connection mode: Under reset.
    • Reset mode: Hardware.
    SHobb.1Author
    Explorer
    June 8, 2022

    @Piranha: Thanks for the response. I already had reset mode to hardware. I changed Connection mode to "Under reset" -- but it did not have any impact.

    0693W00000NrNFbQAN.jpg