Stlink: STM32F031K6 Nucleo: Regression between 1.5.0 and 1.6.0 with minimal linker script

Created on 4 Nov 2020  ·  5Comments  ·  Source: stlink-org/stlink

NOTICE: Please read and follow instructions in #906 before submitting a ticket. This feature request will be deleted without notice when not enough information is provided! So please ensure that all fields are filled out.

  • [x] I made serious effort to avoid creating duplicate or nearly similar issue

  • Programmer/board type: Inbuilt

  • Operating system and version: macOS 15, openSUSE Tumbleweed
  • Stlink tools version and/or git commit hash: v1.6.0
  • Stlink commandline tool name: st-util
  • Target chip (and board if applicable): STM32F031K6, STM32F103C8T6 (Blue pill), STM32F3DISCOVERY

Expected/description:

My issue arose while following the tutorial for a minimal linker script at: https://vivonomicon.com/2018/04/02/bare-metal-stm32-programming-part-1-hello-arm/
The source code for this can also be found at https://github.com/WRansohoff/STM32F0_minimal

The code compiles etc with no problems.
I then run st-util, and connect to the board using arm-none-eabi-gdb main.elf and target extended-remote :4242
Then I load the program using load main.elf.

This is where the behaviour of v1.5.0 and v1.6.0 diverge.
In v.1.5.0, the program can be stepped through using si, and I can enter into the loop and see r0 being incremented.

In v.1.6.0, using si causes the program counter to immediately jump to 0xfffffffe, and the r0 is not incremented.
However, sometimes r7 is successfully set to 0xdeadbeef.

I have also done this using OpenOCD 0.10.0, and was able to step through it fine.
I should note that I built v1.5.0 from source using libusb 1.0.23 and applying the patch #704 .

Please let me know if you need more information.

buneeds-fix buregression componenst-util needinvestigation olinux omacOS programmestlinkv2 programmestlinkv2-1 targestm32f0 targestm32f1 targestm32f3

All 5 comments

Of what hardware-type is your programmer? Please describe it more precisely to complete the set of basic info.
Do later toolset versions work (again)?

I'm using the built in programmers for the Nucleo and Discovery boards, which I believe are ST-Link v2, and a ST-Link v2 usb programmer for the blue pill.

It doesn't work on v1.6.1 - this is the version I was using on macOS, while on openSUSE I was on v1.6.0.

@gcohara Could you try develop branch? I tested it on stm32f07 and it's work.

Just tried it on the develop branch and I can confirm it's working!
Sorry, I really ought to have done that anyway.

Please don't close open tickets as this is working against regular maintenance tasks and tracking. Resolved tickets are closed automatically by the issue tracking system.

Was this page helpful?
0 / 5 - 0 ratings