Skip to main content
Visitor II
November 25, 2024
Question

STM32F030 cant be flashed with openOCD

  • November 25, 2024
  • 1 reply
  • 1901 views

I'm tring to work with a STM32F030F4. Unfortunately I didn't manage to flash the application on the controller.

  • I'm using openOCD with a ST-Link.
  • I use the following to start openOCD: openocd.exe -f interface\stlink-v2.cfg -f target\stm32f0x.cfg
  • I now use Telnet to talk to openOCD.

I do the following sequence:

 

 

Open On-Chip Debugger
> halt
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0xc1000003 pc: 0xfffffffe msp: 0xffffffd8
> mdw 0x08000000 30
0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000040: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000060: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff

> flash fillw 0x08000000 0xAA55AA55 4
device id = 0x10006444
flash size = 16kbytes
Verification error address 0x08000000, read back 0xffffffff, expected 0xaa55aa55

> mdw 0x08000000 30
0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000040: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000060: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff

 

 

It seems that everything is fine as the communication with the chip works fine. Never the less I can't flash my application on the chip.

What could be the reason for that?
Could there be something missing on the hardware?

I'm using a selfmade board with:

  • VDD and VDDA connected directly.
  • Rst connected to a RC with 10k and 100nF
  • Boot is connected directly to GND
  • No external cristal

This are the Optionregister: 0x1ffff800: 00ff55aa 00ff00ff 00ff00ff 00ff00ff ffffffff ffffffff ffffffff ffffffff

This is the factory setting!

Thanks,

Drewle

    This topic has been closed for replies.

    1 reply

    Super User
    November 26, 2024

    Which OpenOCD? ST has their own build of OpenOCD, shipped with CubeIDE (part of its debugger). Have you tried that?

    Visitor II
    November 26, 2024

    Thank you for the quick response.

    I used openOCD in the the version: OpenOCD-20201228-0.10.0. This is used to be an official version from the openOCD homepage.

    Will it only work with the ST version of openOCD? What are the differences?

     

    I have a STM32CubeIDE installed and also found openOCD in one of the subfolders. Unfortunately I didn't find a stlink-v2.cfg I used stlink.cfg. When I call this version of openOCD I get some stramge errors. Maybe there are some environment settings missing.

    Could you please tell me how I must call openOCE from the STM32CubeIDE to access my STM32F030 with my ST-Link?

    Super User
    November 26, 2024

    Will it only work with the ST version of openOCD? What are the differences?

    The difference is simple: you use the ST version on STM32 and it works (if not - you can ask for support here). You run other version and waste time (and no support).

    how I must call openOCD from the STM32CubeIDE

    Create any CubeIDE project for your MCU or board. Even take any example from the ST "Cube" firmware package. Then debug it: create a new debug configuration and select OpenOCD as debugger engine. CubeIDE will create all needed configuration files. You then can copy them or edit manually if needed.