stlink-org / stlink

Open source STM32 MCU programming toolset
BSD 3-Clause "New" or "Revised" License
4.42k stars 1.24k forks source link

Case: while using use GPIOA port jtag tools not work. What can I do? #490

Closed kv193 closed 8 years ago

kv193 commented 8 years ago

Hello. I am novice in STM32. But I read all issue carefully and after many attempts to solve my problem write my result. So I adapt 1-st blinky program from STM32-Discovery to my Nucleo-F411RE. I use stlink for burn flash. And 1-st time was success. But no more times, every time I got result some like:

blinky > make burn
/home/kv193/Programs/arm/stlink/build/st-flash --reset write blinky.bin 0x8000000
st-flash 1.2.0-129-gee3f7a1
2016-09-30T18:18:34 INFO /home/kv193/Programs/arm/stlink/src/common.c: Loading device parameters....
2016-09-30T18:18:34 WARN /home/kv193/Programs/arm/stlink/src/common.c: unknown chip id! 0xa05f0000
Makefile:51: recipe for target 'burn' failed
make: *** [burn] Error 255

After spent time I find decision: use STM ST-LINK Utility for Windows. This utility success erase my chip ONLY IN SWD connection settings with mode "Connect Under Reset". In JTAG mode also I had error. After reading documentation I notice that used GPIOA por is include JTAG pins. And result if I config "RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;" then JTAG not work, but SWD work fine. Is it true? And if "yes" how to use SWD in Linux?

xor-gate commented 8 years ago

When you program the STM32F411RE on the nucleo with the onboard programmer there should be no problem. However when you use the SWD pins in your firmware it should also work as texane/stlink will also connect under reset and those pins are available under reset.

When you have access to a linux machine you cloud try openocd: openocd -f <conffile> with conffile:

source [find interface/stlink-v2.cfg]
transport select hla_swd
source [find target/stm32f4.cfg]
reset_config srst_only
xor-gate commented 8 years ago

Closing due to inactivity, feel free to comment.

kv193 commented 7 years ago

Excuse me for long time silence (I work on other project with Cortex-M3 from diff manufacturer ). Now I return to study STM32. And I continue ... Without / with reset I get different errors (see attachments). What is my wrong? console.txt

xor-gate commented 7 years ago

You should try a least the newer released v1.3.1.

kv193 commented 7 years ago

Yes, I am already do it.The ver 1.3.1work fine.Thank you. -- Best wishesKlochkov V. A.email: kv193@yandex.rumob: +7-911-9141440    20.03.2017, 21:24, "Jerry Jacobs" notifications@github.com:You should try a least the newer released v1.3.1.—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread. 

xor-gate commented 7 years ago

@kv193 thank you for your feedback and testing.