Need help!
Плата: STM32F103C8
Программатор: ST-Link v.2 (версия V2J36S7)
Среда: STM32CubeIDE (версия 1.3.0)
Проблема:
Раньше в STM32CubeIDE прошивал платы STM32F4Discovery, все было хорошо. Сейчас взял программатор ST-Link, обновил в нем прошивку, создал в STM32CubeIDE проект мигания диодом под плату STM32F103C8, прошил и тоже все хорошо. Потом, случайно зашел в старый проект под плату STM32F4Discovery и им прошил плату STM32F103C8. После этого возникла проблема, что больше никак не могу прошивать плату STM32F103C8, всегда пишет:
И в консоле:
Код:
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
Target no device found
Error in initializing ST-LINK device.
Reason: No device found on target.
Вопрос: Что сделать чтобы плата STM32F103C8, которая была случайно прошита при настройках на плату STM32F4Discovery, опять начала прошиваться? (С новыми платами STM32F103C8 программатор ST-Link v.2 работает нормально в STM32CubeIDE, прошивает то, что создано в проекте под плату STM32F103C8)
Добавлено after 1 hour 36 minutes 54 seconds:
Проблема решилась очень просто. Добрые люди подсказали (спасибо, stD).
Нужно переставить джампер BOOT-0 в положение единицы, прошить, а потом вернуть в положение нуля и снова можно прошивать STM32F103C8 в STM32CubeIDE через ST-Link v.2
т.е. из этого первоначального положения дажмперов у STM32F103C8:
переставить в это положение:
после прошивки, вернуть в первоначальное положение BOOT-0
Ура!
Помогла эта статья, тут шикарно про BOOT-0 и BOOT-1 написано и про значение Reset у STM32F103C8
Про джамперы и bootloader (c) stD
P.S.
кто хочет поблагодарить автора статьи stD, то вот, сюда
Содержание
- Can’t flash code after using Standby mode. Error in initializing ST-LINK device. Reason: (4) No device found on target
- ST-Link & Blue Pill Development board
- Connecting the ‘Blue Pill’
- Software tooling
- The problem
- The symptoms
- Success
- The solution
- Bottom line
- Error in initializing ST-Link Device — Failed to connect to device
- 6 Answers 6
- Unable to flash a stm32 (STEVAL-PTOOL1V1) : No device found on target
- Error in initializing st link device reason no device found on target
- Кто сейчас на форуме
Can’t flash code after using Standby mode. Error in initializing ST-LINK device. Reason: (4) No device found on target
I’m experimenting with standby mode. IDE is STM32CubeIDE, mcu stm32f407vgt9. So I read in datasheet that mcu leave standby mode if one of following condition are fullfiled:
WKUP pin rising edge, RTC alarm (Alarm A and Alarm B), RTC wake-up, tamper event, time-stamp event, external reset in NRST pin, IWDG reset.
MCU get into standby mode by this function HAL_PWR_EnterSTANDBYMode() if I well understand. I do that and I expect if mcu got high on WKUP pin (PA0) mcu will exit standby mode. I want this simple code to exacute.
MCU go into standby mode but leaving standby mode never occur. I try to connect PA0 with high but nothing is happen.
I want to flash another code but that is now not possible because I go this error from STM32CubeIDE:
Error in final launch sequence:
Error in initializing ST-LINK device.
Reason: (4) No device found on target.
How I can solve this problem? Before experimenting with standby I got this error several times and I was successful solve him by connecting NRST pin with GND (hardware restart mcu) but now it doesn’t work because after reset code will be automatically execute. Connecting NRST with GND and trying to flash code it is not possible (new error will occur which indicate that currently is activated hardware reset: Error in initializing ST-LINK device. Reason: (8) Target held under reset.).
Источник
ST-Link & Blue Pill Development board
The ST-Link/v2 is an in-circuit debugger and programmer for the STM32 and STM8 microcontroller families. Due to its capabilities, it is an extremely popular device and clones are available from your preferred Chinese trading platform for less than 5 euros. I recently ordered a few of these cheap ST-Link/v2 clones for a new project. However, making them work was pretty frustrating. Read on to learn about the problem, the symptoms, and the (super) easy fix.
Connecting the ‘Blue Pill’
Over the years I’ve used occasionally the ‘Blue Pill’ which is a little development board, comparable in size with the better known Arduino Nano, but with a modern and more capable ARM Cortex M3 CPU (STM32F103C8T6).
Figure 1: ST-Link/v2 knock-off connected to a ‘Blue Pill’ development board
In the past, I used an original ST-Link/V2, but it became a victim of my last move. I couldn’t find it anymore. So I ordered a few clones on Aliexpress along with a bunch of ‘Blue Pill’ boards. The boards are certainly also knock-offs, although the CPU appears to be genuine.
I’m a big fan of Microsoft’s free and cross-platform Editor/IDE Visual Studio Code, but when it comes to ST microcontrollers I prefer to use their STM32CubeIDE. ST has come a long way integrating their stuff into Eclipse, but in 2020 it’s now working well, even on MacOS 😅.
ST provides also some optional software tools for their microcontrollers. In particular, I found the STM32 ST-Link Utility (STSW-LINK004) to be quite helpful — although it’s only available for Windows.
Figure 2: Screenshot of the STM32 ST-Link Utility
The problem
The ST-Link/v2 has a 10 pin interface through which it interfaces with the development board. The pin-out diagram is printed on top of the ST-Link/v2. After connecting the two devices, I tried to upload a simple test program, but it just wouldn’t work and the error messages were also rather cryptic.
The symptoms
Despite that the ST-Link/v2 was properly recognized, I wasn’t able to connect or upload anything to the development board. Poking around with the ST-Link/v2 settings I was confronted with the following error messages over time:
To ensure that this wasn’t a hardware issue, I tried of course several combinations of ST-Link/v2s and development boards. Unfortunately, none of them worked.
Success
Since none of my ‘Blue Pill’ development boards were recognized by none of the ST-Link/v2 programmers, I suspected a rather systematic error. Needless to say that I tried to google the error messages above, but none of the shown links were conclusive.
After some further digging through the box in which I store my microcontroller stuff, I found to my surprise another ST-Link/v2 knockoff which I must have purchased some years ago (and since forgotten about it — hi).
Figure 3: Two ST-Link/v2 knockoffs
After swapping the blue ST-Link for the black one, I was suddenly able to connect to the ‘Blue Pill’ development board!
The solution
With a working setup, I investigated why the blue ST-Links didn’t work. The most obvious difference is the pin-out diagrams printed on the respective ST-Link knock-off. Opening the blue ST-Link revealed the following:
Figure 5: ST-Link/v2 PCB bottom side
The pin names on the PCB differ from the diagram printed on the ST-Link/v2 enclosure.
After re-wiring, the blue ST-Link/v2 also worked as expected.
For the sake of completeness, here the correct pin-out:
Pin | Row | Name |
---|---|---|
1 | Upper | RST |
3 | Upper | SWIM |
5 | Upper | GND |
7 | Upper | 3.3V |
9 | Upper | 5.0V |
2 | Bottom | SWCLK |
4 | Bottom | SWDIO |
6 | Bottom | GND |
8 | Bottom | 3.3V |
10 | Bottom | 5.0V |
Bottom line
Out of curiosity, I checked Amazon, eBay, and a few of the Chinese trading platforms and to my surprise, almost all of the ST-Link/v2s shown have the wrong pin-out diagram printed on the enclosure. I hope that the manufactures will correct the diagram in the future. In the meanwhile, I hope this article was helpful and saved you from falling into the same trap 😜.
Источник
Error in initializing ST-Link Device — Failed to connect to device
I am currently using the ST-Link debugger to program my STM32F3 Discovery Board. The IDE that I am using is Atollic TrueStudio 5.5.2. Now I am facing a very weird problem which is I keep on getting the message
Error in initializing ST-Link Device. Reason : (-1) Failed to connect to device . Please check power and cabling to target.
whenever I want to download the program into my STM32. I have tried some solutions that I found from internet but the problem still exists. Has anyone faced this problems before? Any suggestions will help.
6 Answers 6
I had same situation on Ubuntu. I solved this, using STM32CubeProgrammer.
On the ST-LINK configuration area:
- Serial number -> refresh to get your stlink serial
- Mode: Under reset
- Reset mode: Core reset
try to connect asap when power your board. When you connect you can do «full chip erease». It suppose to be ready for next usage. I hope it helps
Not an expert in the whole PC stuff but I found out in windows 10 using external ST-LINK V2 from aliexpress that the PC machine might select the wrong driver per device by default and what you do to fix that is to simply change the corresponding driver for the device.
Here’s how you do it:
And that pretty much fixed all my problems.
You could try the following.
Make sure that you have installed the right version of the driver (32 or 64 bits).
If you are using an external ST-Link, make sure that you connect VCC, GND, RESET, SWDIO and SWDCLK.
If you are using an external ST-Link, make sure that Atollic is using the right one. You may have 2 ST-link connected (the external and the embedded one).
Ensure that the ST-Link is setup in SWD mode and not in JTAG.
In Atollic, you could also change how the ST-Link connects to your target. Try different combinations, for example Connect under hardware reset.
In the debugger tab, make sure to select SWD , not JTAG .
From the documentation of a Nucleo-144 board, it can be few problems:
Before connecting the Nucleo-144 board to a Windows® 7, Windows® 8 or Windows® 10 PC via USB, a driver for ST-LINK/V2-1 must be installed. It can be downloaded from the www.st.com website. In case the STM32 Nucleo-144 board is connected to the PC before installing the driver, the PC device manager may report some Nucleo interfaces as “Unknown”. To recover from this situation, after installing the dedicated driver, the association of “Unknown” USB devices found on the STM32 Nucleo-144 board to this dedicated driver, must be updated in the device manager manually It is recommended to proceed using USB Composite Device, as shown in the image
To program and debug the on-board STM32, place the two jumpers marked in red on the connector CN4, as shown in the image. The CN6 connector must not be used, since it could disturb the communication with the STM32 microcontroller of the Nucleo-144 board.
Источник
The board is a STEVAL-PTOOL1V1. The setup was tried on different boards.
The programmer board used is a STLINK-V3SET.
I followed the instructions on the Getting started document of the STEVAL-PTOOL1V1.
I power the board through J1 and J2 with a power supply supplying 12V.
I connected J8 with a jumper.
I connected the SWD pins to the STLINKS.
Here is the setup and the documentation for the SWD connector of the PTOOL1V1.
The pin at the bottom (with the red cable) is the first one. It has a square-shaped weld.
In order to communicate with the board, I tried:
Uploading the example project of the STEVAL-PTOOL1V1 by clicking on the debbuger icon of the CubeIDE
Clicking «Connect» in STM32CubeProgrammer
Clicking «Connect to the target» in STM32 ST-LINK Utility
Using the Open source version of the STMicroelectronics STLINK Tools : stlink
Here are the errors messages for each:
In STM32CubeProgrammer, I tried changing the configuration of the STLINK. The port is at SWD . I tried Hardware , Core and Software for the reset mode. I tried Normal , Under Reset and Hot plug for the mode. Same result with every configurations.
When the board is powered, I have a tension of 3.3V on the VDD of the SWD connector.
Any idea why the flashing process is not working ?
Источник
Error in initializing st link device reason no device found on target
Всем привет! Ребята, кричу HELP. Возникла проблема, с которой уже неделю сижу, никак не могу решить ее, что я только не делал.
В общем, купил я года так 3-4 назад stm32f103c8c6 у одного чувака, взял новый, но он их тоже с алиэкпресс, помойму, скупает.
И начал работать с этой платой. Работаю я в CubIDE, все прекрасно работало, писал себе проект. Потом этот микроконтроллер начал работать с косяками, начались какие-то мигания не нужные и тд и тп, я подумал что ему хана, не полностью, но хана. Заказал новые, и тут все началось! Они не прошиваются! Сначала заказал 2 штуки с алиэкспрес, не прашиваются, потом еще заказал и они тоже не прошиваются, выходит следующая ошибка:
«Error in final launch sequence:
Failed to start GDB server
Failed to start GDB server
Error in initializing ST-LINK device.
Reason: (18) Could not verify ST device! Abort connection.»
Но через утилиту «STM32 ST-LINK Utility» они все прошиваются! Без проблем!
Программатор ST-LINK V2 (китайский). Проблема скорее всего не внем, ведь первый микроконтроллер прошивается же. В утилите он тоже конектится:
Как я пытался решить эту проблему:
1)Были мысли, что в CubIDE есть защита от китайских микроконтроллеров, но ведь первый, который прошивается, он то тоже из китая. Но наверное это не так!
2) Делал «Firmware update» через утилиту «STM32 ST-LINK Utility»
3) В файле «stm32f1x.cfg» изменял «0x1ba01477» на «0x2ba01477»
4) Менял настройки на «ST-LINK(Open OCD)»
https://disk.yandex.ru/i/-bTJeWabcyBcUQ
Здесь я выложил документ, где полностью все расписано и имеются все фото, в том числе фото самих микроконтроллеров один из которых прошивается, другой нет, для визуальной оценки. Кот не позволяет здесь загружать фото больше 5 штук.
Я уже теряюсь в догадках, не знаю что и делать. Закупил 10 штук таких STM32, неужели мне их придется выкидывать, и забыть про эти бюджетные варинты и работать только с дорогими оригиналами? Кто сталкивался с этим подскажите пожалуйста.
Реклама |
ART_ME |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Карма: -22 |
|
0 / 0 / 0 Регистрация: 22.04.2020 Сообщений: 23 |
|
1 |
|
31.03.2022, 15:35. Показов 2960. Ответов 50
Здравствуйте. Начал использовать плату NUCLEO STM32H745IQ. Проверяю на ней самые простые проекты, по типу переключения светодиода или использования таймера для прерывания. Для создания начального кода использую CubeMX. Но после прошивки скетча c считыванием АЦП, стало выдавать ошибку в CubeIDE для любого прошиваемого скетча (переключение светодиода и т.д.): Target no device found Error in initializing ST-LINK device. А в CubeProgrammer пишет это: ST-LINK error (DEV_CONNECT_ERR) Пробовал прошивать разными способами (различные режимы и программы, например, CubeProgrammer и ST-LINK Utility) и на разных платах (если быть точным на трёх платах NUCLEO STM32H745IQ и одной плате NUCLEO STM32F411RE, все оригинальные), но ничего в итоге не дало результата. Может проблема в самом CubeIDE (никаких начальных настроек в ней не производил)? Подскажите, пожалуйста, в чём может быть проблема.
__________________
0 |
Модератор 8759 / 6549 / 887 Регистрация: 14.02.2011 Сообщений: 22,972 |
|
31.03.2022, 22:43 |
2 |
CubeIDE попробуй STM32 ST-LINK Utility, может обновить нужно прошивку программатор.
Target no device found а в «диспетчере оборудование» что показывает?
0 |
68 / 60 / 11 Регистрация: 09.02.2016 Сообщений: 801 Записей в блоге: 15 |
|
01.04.2022, 07:03 |
3 |
Проверяю на ней самые простые проекты, по типу переключения светодиода или использования таймера для прерывания 9 из 10- что вы затронули прошивкой пины SWD… скорее всего порт А последние пины (13, 14) (сам этого железа не имею, но симптомы схожи) кода инициализации gpio вашего не вижу, поэтому точно сказать не могу.. делайте что нить не затрагивающее GPIOA и заливайте через usb (DFU) и будет вам счастье… или заливайте через SWD с RST (это я не пробовал, но кто то писал что так тоже работает)
0 |
0 / 0 / 0 Регистрация: 22.04.2020 Сообщений: 23 |
|
01.04.2022, 09:21 [ТС] |
4 |
попробуй STM32 ST-LINK Utility, может обновить нужно прошивку программатор. Через ST-LINK Utility я пробовал прошивать и обновлять неоднократно (+чип через него стирал)
0 |
0 / 0 / 0 Регистрация: 22.04.2020 Сообщений: 23 |
|
01.04.2022, 09:33 [ТС] |
5 |
а в «диспетчере оборудование» что показывает? В нём вроде всё нормально, виртуальный COM-порт и ST-LINK Debug определяется Миниатюры
0 |
samurai_jke 0 / 0 / 0 Регистрация: 22.04.2020 Сообщений: 23 |
||||
01.04.2022, 09:52 [ТС] |
6 |
|||
9 из 10- что вы затронули прошивкой пины SWD… скорее всего порт А последние пины (13, 14) (сам этого железа не имею, но симптомы схожи) Так и есть, но эти пины должны использоваться (по крайней мере так говорится в статьях и видео, по которым учусь)
кода инициализации gpio вашего не вижу, поэтому точно сказать не могу.. По сути, кроме самого АЦП, GPIO ничто не использует (прикреплю код на всякий случай) Кликните здесь для просмотра всего текста
делайте что нить не затрагивающее GPIOA и заливайте через usb (DFU) и будет вам счастье… или заливайте через SWD с RST (это я не пробовал, но кто то писал что так тоже работает) Нужно будет попробовать через DFU, спасибо за подсказку. Я пробовал прошить через UART (использовав переходник USB2TTL и программу STMFlashLoader), но тоже не помогло (Выдает ошибку, как на втором скриншоте). Миниатюры
0 |
68 / 60 / 11 Регистрация: 09.02.2016 Сообщений: 801 Записей в блоге: 15 |
|
01.04.2022, 14:26 |
7 |
Так и есть, но эти пины должны использоваться (по крайней мере так говорится в статьях и видео, по которым учусь) ну вот и представьте — чтобы работал ст линк эти пины должны быть настроены по умолчанию… посмотрите в референсе там указан moder GPIOA (и GPIOB — но он вас не коснулся пока я точно не помню, но помоему если соединить RST программатора и микроконтроллера — то когда поставите галочку Core Reset в настройках st-link может что и выйдет (то есть st-link сбросит микроконтроллер и начнет его программировать) — но это чисто предположение… больше ничего.. сам я не пробовал.. и когда доводил mcu до такого как у вас — просто через usb при помощи dfu перепрошивал на нормальную прошивку… вообще PA13 PA14 стараюсь в своих прошивках не пользовать на этапе тестов.. это уж когда совсем ног не хватает.. а то без отладки бывает очень тяжело отлаживаться… Добавлено через 7 минут
По сути, кроме самого АЦП, GPIO ничто не использует (прикреплю код на всякий случай) кроме включения тактирования gpioa не увидел кода настройки… ох уж этот куб…
0 |
0 / 0 / 0 Регистрация: 22.04.2020 Сообщений: 23 |
|
04.04.2022, 10:04 [ТС] |
8 |
Настроил пины PA13 и PA14 по умолчанию, но всё равно та же ошибка. Никаких дополнительных настроек делать не нужно?
кроме включения тактирования gpioa не увидел кода настройки… ох уж этот куб… Тут скорее я виноват, а не куб. Прикрепил не тот код. Вот вроде бы нужный Кликните здесь для просмотра всего текста Код /* Includes ------------------------------------------------------------------*/ #include "stm32h7xx_hal.h" /** @addtogroup STM32H7xx_HAL_Driver * @{ */ /** @defgroup GPIO GPIO * @brief GPIO HAL module driver * @{ */ #ifdef HAL_GPIO_MODULE_ENABLED /* Private typedef -----------------------------------------------------------*/ /* Private defines ------------------------------------------------------------*/ /** @addtogroup GPIO_Private_Constants GPIO Private Constants * @{ */ #if defined(DUAL_CORE) #define EXTI_CPU1 (0x01000000U) #define EXTI_CPU2 (0x02000000U) #endif /*DUAL_CORE*/ #define GPIO_NUMBER (16U) /** * @} */ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /** @defgroup GPIO_Exported_Functions GPIO Exported Functions * @{ */ /** @defgroup GPIO_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim =============================================================================== ##### Initialization and de-initialization functions ##### =============================================================================== [..] This section provides functions allowing to initialize and de-initialize the GPIOs to be ready for use. @endverbatim * @{ */ /** * @brief Initializes the GPIOx peripheral according to the specified parameters in the GPIO_Init. * @param GPIOx: where x can be (A..K) to select the GPIO peripheral. * @param GPIO_Init: pointer to a GPIO_InitTypeDef structure that contains * the configuration information for the specified GPIO peripheral. * @retval None */ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) { uint32_t position = 0x00U; uint32_t iocurrent; uint32_t temp; EXTI_Core_TypeDef *EXTI_CurrentCPU; #if defined(DUAL_CORE) && defined(CORE_CM4) EXTI_CurrentCPU = EXTI_D2; /* EXTI for CM4 CPU */ #else EXTI_CurrentCPU = EXTI_D1; /* EXTI for CM7 CPU */ #endif /* Check the parameters */ assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); assert_param(IS_GPIO_PIN(GPIO_Init->Pin)); assert_param(IS_GPIO_MODE(GPIO_Init->Mode)); /* Configure the port pins */ while (((GPIO_Init->Pin) >> position) != 0x00U) { /* Get current io position */ iocurrent = (GPIO_Init->Pin) & (1UL << position); if (iocurrent != 0x00U) { /*--------------------- GPIO Mode Configuration ------------------------*/ /* In case of Output or Alternate function mode selection */ if (((GPIO_Init->Mode & GPIO_MODE) == MODE_OUTPUT) || ((GPIO_Init->Mode & GPIO_MODE) == MODE_AF)) { /* Check the Speed parameter */ assert_param(IS_GPIO_SPEED(GPIO_Init->Speed)); /* Configure the IO Speed */ temp = GPIOx->OSPEEDR; temp &= ~(GPIO_OSPEEDR_OSPEED0 << (position * 2U)); temp |= (GPIO_Init->Speed << (position * 2U)); GPIOx->OSPEEDR = temp; /* Configure the IO Output Type */ temp = GPIOx->OTYPER; temp &= ~(GPIO_OTYPER_OT0 << position) ; temp |= (((GPIO_Init->Mode & OUTPUT_TYPE) >> OUTPUT_TYPE_Pos) << position); GPIOx->OTYPER = temp; } if ((GPIO_Init->Mode & GPIO_MODE) != MODE_ANALOG) { /* Check the Pull parameter */ assert_param(IS_GPIO_PULL(GPIO_Init->Pull)); /* Activate the Pull-up or Pull down resistor for the current IO */ temp = GPIOx->PUPDR; temp &= ~(GPIO_PUPDR_PUPD0 << (position * 2U)); temp |= ((GPIO_Init->Pull) << (position * 2U)); GPIOx->PUPDR = temp; } /* In case of Alternate function mode selection */ if ((GPIO_Init->Mode & GPIO_MODE) == MODE_AF) { /* Check the Alternate function parameters */ assert_param(IS_GPIO_AF_INSTANCE(GPIOx)); assert_param(IS_GPIO_AF(GPIO_Init->Alternate)); /* Configure Alternate function mapped with the current IO */ temp = GPIOx->AFR[position >> 3U]; temp &= ~(0xFU << ((position & 0x07U) * 4U)); temp |= ((GPIO_Init->Alternate) << ((position & 0x07U) * 4U)); GPIOx->AFR[position >> 3U] = temp; } /* Configure IO Direction mode (Input, Output, Alternate or Analog) */ temp = GPIOx->MODER; temp &= ~(GPIO_MODER_MODE0 << (position * 2U)); temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2U)); GPIOx->MODER = temp; /*--------------------- EXTI Mode Configuration ------------------------*/ /* Configure the External Interrupt or event for the current IO */ if ((GPIO_Init->Mode & EXTI_MODE) != 0x00U) { /* Enable SYSCFG Clock */ __HAL_RCC_SYSCFG_CLK_ENABLE(); temp = SYSCFG->EXTICR[position >> 2U]; temp &= ~(0x0FUL << (4U * (position & 0x03U))); temp |= (GPIO_GET_INDEX(GPIOx) << (4U * (position & 0x03U))); SYSCFG->EXTICR[position >> 2U] = temp; /* Clear Rising Falling edge configuration */ temp = EXTI->RTSR1; temp &= ~(iocurrent); if ((GPIO_Init->Mode & TRIGGER_RISING) != 0x00U) { temp |= iocurrent; } EXTI->RTSR1 = temp; temp = EXTI->FTSR1; temp &= ~(iocurrent); if ((GPIO_Init->Mode & TRIGGER_FALLING) != 0x00U) { temp |= iocurrent; } EXTI->FTSR1 = temp; temp = EXTI_CurrentCPU->EMR1; temp &= ~(iocurrent); if ((GPIO_Init->Mode & EXTI_EVT) != 0x00U) { temp |= iocurrent; } EXTI_CurrentCPU->EMR1 = temp; /* Clear EXTI line configuration */ temp = EXTI_CurrentCPU->IMR1; temp &= ~(iocurrent); if ((GPIO_Init->Mode & EXTI_IT) != 0x00U) { temp |= iocurrent; } EXTI_CurrentCPU->IMR1 = temp; } } position++; } } /** * @brief De-initializes the GPIOx peripheral registers to their default reset values. * @param GPIOx: where x can be (A..K) to select the GPIO peripheral. * @param GPIO_Pin: specifies the port bit to be written. * This parameter can be one of GPIO_PIN_x where x can be (0..15). * @retval None */ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) { uint32_t position = 0x00U; uint32_t iocurrent; uint32_t tmp; EXTI_Core_TypeDef *EXTI_CurrentCPU; #if defined(DUAL_CORE) && defined(CORE_CM4) EXTI_CurrentCPU = EXTI_D2; /* EXTI for CM4 CPU */ #else EXTI_CurrentCPU = EXTI_D1; /* EXTI for CM7 CPU */ #endif /* Check the parameters */ assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); assert_param(IS_GPIO_PIN(GPIO_Pin)); /* Configure the port pins */ while ((GPIO_Pin >> position) != 0x00U) { /* Get current io position */ iocurrent = GPIO_Pin & (1UL << position) ; if (iocurrent != 0x00U) { /*------------------------- EXTI Mode Configuration --------------------*/ /* Clear the External Interrupt or Event for the current IO */ tmp = SYSCFG->EXTICR[position >> 2U]; tmp &= (0x0FUL << (4U * (position & 0x03U))); if (tmp == (GPIO_GET_INDEX(GPIOx) << (4U * (position & 0x03U)))) { /* Clear EXTI line configuration for Current CPU */ EXTI_CurrentCPU->IMR1 &= ~(iocurrent); EXTI_CurrentCPU->EMR1 &= ~(iocurrent); /* Clear Rising Falling edge configuration */ EXTI->FTSR1 &= ~(iocurrent); EXTI->RTSR1 &= ~(iocurrent); tmp = 0x0FUL << (4U * (position & 0x03U)); SYSCFG->EXTICR[position >> 2U] &= ~tmp; } /*------------------------- GPIO Mode Configuration --------------------*/ /* Configure IO in Analog Mode */ GPIOx->MODER |= (GPIO_MODER_MODE0 << (position * 2U)); /* Configure the default Alternate Function in current IO */ GPIOx->AFR[position >> 3U] &= ~(0xFU << ((position & 0x07U) * 4U)) ; /* Deactivate the Pull-up and Pull-down resistor for the current IO */ GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPD0 << (position * 2U)); /* Configure the default value IO Output Type */ GPIOx->OTYPER &= ~(GPIO_OTYPER_OT0 << position) ; /* Configure the default value for IO Speed */ GPIOx->OSPEEDR &= ~(GPIO_OSPEEDR_OSPEED0 << (position * 2U)); } position++; } } /** * @} */ /** @defgroup GPIO_Exported_Functions_Group2 IO operation functions * @brief GPIO Read, Write, Toggle, Lock and EXTI management functions. * @verbatim =============================================================================== ##### IO operation functions ##### =============================================================================== @endverbatim * @{ */ /** * @brief Reads the specified input port pin. * @param GPIOx: where x can be (A..K) to select the GPIO peripheral. * @param GPIO_Pin: specifies the port bit to read. * This parameter can be GPIO_PIN_x where x can be (0..15). * @retval The input port pin value. */ GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) { GPIO_PinState bitstatus; /* Check the parameters */ assert_param(IS_GPIO_PIN(GPIO_Pin)); if ((GPIOx->IDR & GPIO_Pin) != 0x00U) { bitstatus = GPIO_PIN_SET; } else { bitstatus = GPIO_PIN_RESET; } return bitstatus; } /** * @brief Sets or clears the selected data port bit. * * @note This function uses GPIOx_BSRR register to allow atomic read/modify * accesses. In this way, there is no risk of an IRQ occurring between * the read and the modify access. * * @param GPIOx: where x can be (A..K) to select the GPIO peripheral. * @param GPIO_Pin: specifies the port bit to be written. * This parameter can be one of GPIO_PIN_x where x can be (0..15). * @param PinState: specifies the value to be written to the selected bit. * This parameter can be one of the GPIO_PinState enum values: * @arg GPIO_PIN_RESET: to clear the port pin * @arg GPIO_PIN_SET: to set the port pin * @retval None */ void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState) { /* Check the parameters */ assert_param(IS_GPIO_PIN(GPIO_Pin)); assert_param(IS_GPIO_PIN_ACTION(PinState)); if (PinState != GPIO_PIN_RESET) { GPIOx->BSRR = GPIO_Pin; } else { GPIOx->BSRR = (uint32_t)GPIO_Pin << GPIO_NUMBER; } } /** * @brief Toggles the specified GPIO pins. * @param GPIOx: Where x can be (A..K) to select the GPIO peripheral. * @param GPIO_Pin: Specifies the pins to be toggled. * @retval None */ void HAL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) { uint32_t odr; /* Check the parameters */ assert_param(IS_GPIO_PIN(GPIO_Pin)); /* get current Output Data Register value */ odr = GPIOx->ODR; /* Set selected pins that were at low level, and reset ones that were high */ GPIOx->BSRR = ((odr & GPIO_Pin) << GPIO_NUMBER) | (~odr & GPIO_Pin); } /** * @brief Locks GPIO Pins configuration registers. * @note The locked registers are GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR, * GPIOx_PUPDR, GPIOx_AFRL and GPIOx_AFRH. * @note The configuration of the locked GPIO pins can no longer be modified * until the next reset. * @param GPIOx: where x can be (A..K) to select the GPIO peripheral for STM32H7 family * @param GPIO_Pin: specifies the port bit to be locked. * This parameter can be any combination of GPIO_PIN_x where x can be (0..15). * @retval None */ HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) { __IO uint32_t tmp = GPIO_LCKR_LCKK; /* Check the parameters */ assert_param(IS_GPIO_LOCK_INSTANCE(GPIOx)); assert_param(IS_GPIO_PIN(GPIO_Pin)); /* Apply lock key write sequence */ tmp |= GPIO_Pin; /* Set LCKx bit(s): LCKK='1' + LCK[15-0] */ GPIOx->LCKR = tmp; /* Reset LCKx bit(s): LCKK='0' + LCK[15-0] */ GPIOx->LCKR = GPIO_Pin; /* Set LCKx bit(s): LCKK='1' + LCK[15-0] */ GPIOx->LCKR = tmp; /* Read LCKK register. This read is mandatory to complete key lock sequence*/ tmp = GPIOx->LCKR; /* read again in order to confirm lock is active */ if ((GPIOx->LCKR & GPIO_LCKR_LCKK) != 0x00U) { return HAL_OK; } else { return HAL_ERROR; } } /** * @brief Handle EXTI interrupt request. * @param GPIO_Pin: Specifies the port pin connected to corresponding EXTI line. * @retval None */ void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin) { #if defined(DUAL_CORE) && defined(CORE_CM4) if (__HAL_GPIO_EXTID2_GET_IT(GPIO_Pin) != 0x00U) { __HAL_GPIO_EXTID2_CLEAR_IT(GPIO_Pin); HAL_GPIO_EXTI_Callback(GPIO_Pin); } #else /* EXTI line interrupt detected */ if (__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != 0x00U) { __HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin); HAL_GPIO_EXTI_Callback(GPIO_Pin); } #endif } /** * @brief EXTI line detection callback. * @param GPIO_Pin: Specifies the port pin connected to corresponding EXTI line. * @retval None */ __weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { /* Prevent unused argument(s) compilation warning */ UNUSED(GPIO_Pin); /* NOTE: This function Should not be modified, when the callback is needed, the HAL_GPIO_EXTI_Callback could be implemented in the user file */ } /** * @} */ /** * @} */ #endif /* HAL_GPIO_MODULE_ENABLED */ /** * @} */ /** * @} */ И подскажите ещё, пожалуйста, с какими настройками лучше прошивать скетч Миниатюры
0 |
68 / 60 / 11 Регистрация: 09.02.2016 Сообщений: 801 Записей в блоге: 15 |
|
04.04.2022, 16:03 |
9 |
не совсем понимаю код что вы приводите давайте сначала — при помощи dfu удалось оживить swd ? при помощи какой нить любой прошивки которая не портит эти пины… ? я к сожалению не могу вам помочь с такой прошивкой потому что этот микроконтроллер просто не использую Добавлено через 1 минуту
Нужно будет попробовать через DFU вам нужно dfu через usb (камень у вас жирный, так что по usb должна быть возможность записать прошивку) Добавлено через 3 минуты Как правильно прошить BlackPill но все остальное у него очень похоже на ваши проблемы (перенастройка pa1314)
0 |
205 / 143 / 27 Регистрация: 14.02.2013 Сообщений: 1,086 |
|
04.04.2022, 17:44 |
10 |
У меня была такая проблема. Собираеш проект в HAL Cube и в нём конфгуришь вот так на плате зажимаешь с начало кнопку reset потом не опуская ёё нажимаешь кнопку boot и прошиваешь.
0 |
68 / 60 / 11 Регистрация: 09.02.2016 Сообщений: 801 Записей в блоге: 15 |
|
04.04.2022, 20:20 |
11 |
на плате зажимаешь с начало кнопку reset потом не опуская ёё нажимаешь кнопку boot и прошиваешь. вы бы дописали через что прошивать (usb swd), а то ответ опять на половину…
0 |
205 / 143 / 27 Регистрация: 14.02.2013 Сообщений: 1,086 |
|
04.04.2022, 21:23 |
12 |
вы бы дописали через что прошивать (usb swd), а то ответ опять на половину… Наверное разобрался уже. На картинке подразумевается swd
0 |
399 / 73 / 7 Регистрация: 29.01.2018 Сообщений: 1,244 |
|
05.04.2022, 00:23 |
13 |
отличный у тебя MK. Шей для начала через stm32cubeprogrammer. опкатаешь, а потом уже……. и да st-flash не умеет с stm32H7. кто-бы что там не говорил. может через годит допилят. на гите была инфа вроде о том что вроде умеет, но кто-то писал на форуме, что сначала начали, а когда посмотрели что работы много, и за это никто не заплатит-бросили.
0 |
0 / 0 / 0 Регистрация: 22.04.2020 Сообщений: 23 |
|
05.04.2022, 15:23 [ТС] |
14 |
не совсем понимаю код что вы приводите Я привёл не тот код (это драйвер для gpio библиотеки HAL (1 скриншот), подумал вы это имеет ввиду).
давайте сначала — при помощи dfu удалось оживить swd ? при помощи какой нить любой прошивки которая не портит эти пины… ? Через dfu не удалось, CubeProgrammer не видит плату, если пробовать подключать через usb(2 скриншот). Миниатюры
0 |
0 / 0 / 0 Регистрация: 22.04.2020 Сообщений: 23 |
|
05.04.2022, 15:26 [ТС] |
15 |
на плате зажимаешь с начало кнопку reset потом не опуская ёё нажимаешь кнопку boot и прошиваешь. Я пробовал так делать, только вместо кнопки boot(у меня её нет), соединял перемычкой пины boot0 и VDD(3.3V) и как видите, это не помогло
0 |
68 / 60 / 11 Регистрация: 09.02.2016 Сообщений: 801 Записей в блоге: 15 |
|
05.04.2022, 15:30 |
16 |
что то я вас не понимаю… мы с вами точно об одном и том же говорим ? ставите dfu demo tool с ней идут дрова… вот тут вроде есть ссылка http://wiki.amperka.ru/js:ide:dfu-firmware (а то не знаю пролезет ли в форум файл установки) дальше сбрасываете плату кнопкой rst удерживая кнопку boot0 (ну или с перемычкой на + питания)… микроконтроллер должен быть определен в виндовс как устройство
0 |
68 / 60 / 11 Регистрация: 09.02.2016 Сообщений: 801 Записей в блоге: 15 |
|
05.04.2022, 15:42 |
17 |
вот что вы должны увидеть в итоге… boot0 кстати надо держать после сброса.. старт иногда происходит с задержкой… иногда может быть ошибка дескриптора — ну не знаю — кабель смените, платы руками не касайтесь… Миниатюры
0 |
68 / 60 / 11 Регистрация: 09.02.2016 Сообщений: 801 Записей в блоге: 15 |
|
05.04.2022, 15:43 |
18 |
у утилиты есть дрова — в каталоге bindriver те что для win8.1 встают на 10-ку… я ставлю x64 дрова, там в папке есть exe для запуска
0 |
0 / 0 / 0 Регистрация: 22.04.2020 Сообщений: 23 |
|
05.04.2022, 15:57 [ТС] |
19 |
дальше сбрасываете плату кнопкой rst удерживая кнопку boot0 (ну или с перемычкой на + питания)… Дело в том, что плата при подключении определяется, как составное устройство USB, а не STM Device in DFU Mode. Соответственно, DfuSe не видит контроллер и я не могу продвинуться дальше.
http://wiki.amperka.ru/js:ide:dfu-firmware Миниатюры
0 |
68 / 60 / 11 Регистрация: 09.02.2016 Сообщений: 801 Записей в блоге: 15 |
|
05.04.2022, 16:00 |
20 |
как составное устройство USB а драйвера то ставили ? у меня это путь C:Program Files (x86)STMicroelectronicsSoftwareDfuSe v3.0.5BinDriverWin8.1 не подключая устройство ставите драйвер запуском файла выделенного на скриншоте потом подключаете и смотрите…. p.s. и старый драйвер я бы на всякий случай удалил на этом устройстве… Миниатюры
0 |
IT_Exp Эксперт 87844 / 49110 / 22898 Регистрация: 17.06.2006 Сообщений: 92,604 |
05.04.2022, 16:00 |
Помогаю со студенческими работами здесь Ошибка инициализации Ошибка инициализации error C2064: term does not evaluate to a function… Ошибка инициализации #include <iostream>
Ошибка инициализации Ошибка инициализации Искать еще темы с ответами Или воспользуйтесь поиском по форуму: 20 |
right now I am trying to program on the STM32G0-Disco-board with the program stm32cubeide on WIN10.
This worked fine until it didn’t.
My problem right now is that I can’t debug/run it anymore. This is the first day I used this program, which doesn’t mean it didn’t worked at the beginning. Building, Debugging and Running worked just fine.
But now I get this error message:
Error in final launch sequence:
Failed to start GDB server
Failed to start GDB server
Error in initializing ST-LINK device.
Reason: (4) No device found on target.
I already tried multiple usb-ports, the jumper on the board. I even looked in this Batchfile:
C:STSTM32CubeIDE_1.3.0STM32CubeIDEpluginscom.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_1.3.0.202002181050toolsbin
ST_LINK_gdbserver because it was mentioned in other threads and i just got this:
ERROR: Couldn’t locate STM32CubeProgrammer in ‘..STM32CubeProgrammerbin’, use -cp
GDB server exited.
And oh yeah i already looked into the device manager and everything looks good to me.
Help is much appreciated!
Comments
I have bought the blue pill STM32F103C8T6 using ST-LINK V.2. I have downloaded the required software to run ST-LINK V.2. So the issue I am having it that it appears the chip is not recognised when running st-util or any other st-* command.
When using the St-Link GUI on Arch Linux I can connect it seems but it appears the chip is a unknown device and Core = 0x0.
Using Atollic Studio and attempting to connect the debugger I am getting this output.
STMicroelectronics ST-LINK GDB server. Version 5.1.0
Copyright (c) 2018, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
Target no device found
Error in initializing ST-LINK device.
Reason: No device found on target.
RUNNING $ st-util
^C[travjav@rey]: ~/Development/Invictus-board/STM32F103C8T6>$ st-util
st-util 1.5.1
2019-06-26T23:41:46 INFO usb.c: -- exit_dfu_mode
2019-06-26T23:41:46 INFO common.c: Loading device parameters....
2019-06-26T23:41:46 WARN common.c: Invalid flash type, please check device declaration
2019-06-26T23:41:46 INFO gdb-server.c: Chip ID is 00000000, Core ID is 00000000.
2019-06-26T23:41:46 INFO gdb-server.c: Listening at *:4242...
Running st-chipid
0x0000
in conclusion I am essentially not able to do anything and this is preventing me from setting up my environment. Should be noted, when plugging other ARM devices in and connecting them properly according to the datasheet I am getting the same error so something is missing in terms of libs or there must be some file that needs to be edited?
When the original tooling of ST doesn’t work there must be some kind of hardware problem. And st-util does a readout and reads only zeroes. Which could be something wrong with SWD.
@xor-gate how do I proceed with my set up then?
and SWD? drivers you mean?
I believe you’re referring to one of the pins actually that are used by the St Link v2 programmer. Okay so if this is the case is there an alternative pin I can use that accomplishes the same function?
I have the very same setup. st-link —probe gives
serial: 543f7106656754533850093f
openocd: "x54x3fx71x06x65x67x54x53x38x50x09x3f"
flash: 65536 (pagesize: 1024)
sram: 20480
chipid: 0x0410
descr: F1 Medium-density device
I can flash it using st-flash, but with st-util I get this error:
2019-06-27T18:26:58 INFO common.c: Attempting to write 1024 (0x400) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2019-06-27T18:26:58 INFO common.c: Finished erasing 1 pages of 1024 (0x400) bytes
2019-06-27T18:26:58 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2019-06-27T18:26:58 INFO flash_loader.c: Successfully loaded flash loader in sram
2019-06-27T18:26:58 INFO common.c: Starting verification of write complete
2019-06-27T18:26:58 INFO common.c: Flash written and verified! jolly good!
2019-06-27T18:26:58 INFO common.c: Attempting to write 1024 (0x400) bytes to stm32 address: 134218752 (0x8000400)
Flash page at addr: 0x08000400 erased
2019-06-27T18:26:58 INFO common.c: Finished erasing 1 pages of 1024 (0x400) bytes
2019-06-27T18:26:58 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2019-06-27T18:26:58 INFO flash_loader.c: Successfully loaded flash loader in sram
2019-06-27T18:26:58 ERROR flash_loader.c: write error, count == 511
2019-06-27T18:26:58 ERROR common.c: stlink_flash_loader_run(0x8000400) failed! == -1
2019-06-27T18:26:58 ERROR gdb-server.c: cannot recv: -2
The cdcacm.c usb virtual com port example (https://github.com/libopencm3/libopencm3-examples/tree/master/examples/stm32/f1/stm32-h103/usb_cdcacm where LED changed to PC13) with loopback does not work though, I get this error in dmesg
[30770.719644] usb 1-10: new full-speed USB device number 30 using xhci_hcd
[30770.719807] usb 1-10: Device not responding to setup address.
[30770.927734] usb 1-10: Device not responding to setup address.
[30771.135665] usb 1-10: device not accepting address 30, error -71
My makefile is
DEVICE = STM32F103C8
OPENCM3_DIR = libopencm3
OBJS += cdcacm.o
CFLAGS += -Os -ggdb3
CPPFLAGS += -MD
LDFLAGS += -static -nostartfiles
LDLIBS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
include $(OPENCM3_DIR)/mk/genlink-config.mk
include $(OPENCM3_DIR)/mk/gcc-config.mk
.PHONY: clean all
all: binary.elf binary.bin
clean:
$(Q)$(RM) -rf binary.* *.o
include $(OPENCM3_DIR)/mk/genlink-rules.mk
include $(OPENCM3_DIR)/mk/gcc-rules.mk
I should also note when checking kernel messages with
$ dmesg | tail
$[42220.561649] usb 1-2: Product: STM32 STLink
[42220.561651] usb 1-2: Manufacturer: STMicroelectronics
[42220.561653] usb 1-2: SerialNumber: UÿorfHH g
[42277.382320] usb 1-2: USB disconnect, device number 5
[42459.313228] usb 1-1: new full-speed USB device number 6 using xhci_hcd
[42459.454959] usb 1-1: New USB device found, idVendor=0483, idProduct=3748, bcdDevice= 1.00
[42459.454964] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[42459.454966] usb 1-1: Product: STM32 STLink
[42459.454969] usb 1-1: Manufacturer: STMicroelectronics
[42459.454971] usb 1-1: SerialNumber: UÿorfHH g
Results of running the below command
$ st-util -v99
st-util 1.5.1
2019-06-28T00:37:40 DEBUG common.c: stlink current mode: dfu
2019-06-28T00:37:40 INFO usb.c: -- exit_dfu_mode
2019-06-28T00:37:40 DEBUG common.c: *** stlink_exit_dfu_mode ***
2019-06-28T00:37:40 DEBUG common.c: stlink current mode: mass
2019-06-28T00:37:40 DEBUG common.c: *** stlink_enter_swd_mode ***
2019-06-28T00:37:40 DEBUG common.c: *** looking up stlink version
2019-06-28T00:37:40 DEBUG common.c: st vid = 0x0483 (expect 0x0483)
2019-06-28T00:37:40 DEBUG common.c: stlink pid = 0x3748
2019-06-28T00:37:40 DEBUG common.c: stlink version = 0x2
2019-06-28T00:37:40 DEBUG common.c: jtag version = 0x21
2019-06-28T00:37:40 DEBUG common.c: swim version = 0x7
2019-06-28T00:37:40 DEBUG common.c: *** stlink_jtag_reset ***
2019-06-28T00:37:40 DEBUG common.c: *** stlink_reset ***
2019-06-28T00:37:40 DEBUG common.c: *** stlink_write_debug32 5fa0004 to 0xe000ed0c
2019-06-28T00:37:40 INFO common.c: Loading device parameters....
2019-06-28T00:37:40 DEBUG common.c: *** stlink_core_id ***
2019-06-28T00:37:40 DEBUG common.c: core_id = 0x00000000
2019-06-28T00:37:40 DEBUG common.c: *** stlink_read_debug32 0 is 0xe0042000
2019-06-28T00:37:40 DEBUG common.c: *** stlink_read_debug32 0 is 0x40015800
2019-06-28T00:37:40 WARN common.c: Invalid flash type, please check device declaration
2019-06-28T00:37:40 DEBUG common.c: *** set_swdclk ***
2019-06-28T00:37:40 DEBUG common.c: *** stlink_reset ***
2019-06-28T00:37:40 DEBUG common.c: *** stlink_write_debug32 5fa0004 to 0xe000ed0c
2019-06-28T00:37:40 INFO gdb-server.c: Chip ID is 00000000, Core ID is 00000000.
2019-06-28T00:37:40 INFO gdb-server.c: Listening at *:4242..
AND
Results of running the below command
st-info --probe
Found 1 stlink programmers
serial: 553f6f067266484820190467
openocd: "x55x3fx6fx06x72x66x48x48x20x19x04x67"
flash: 0 (pagesize: 0)
sram: 0
chipid: 0x0000
descr: unknown device
@xor-gate I think this board has r/w permissions do you have a command that can wipe the board so I may flash and debug it? the more I read the more I am convinced it’s showing symptoms of this, i’m just not familiar with the args that go in.
Have you tried to remove the cover of the st-link dongle that may touch the components inside? So remove it and then try st-info —probe agian. Also check if the soldering of the swclk and swdio pins is ok
I think I found the solution to your problem: I flashed an arduino bootloader (https://github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/bootloader_only_binaries/generic_boot20_pc13.bin) and then I got the same output like you for st-info —probe. I then set the upper jumper to 1 to enable the intermal bootloader and thereby disable the arduino bootloader. Then st-info —probe looked normal again. I was able to flash the bootloader again, then changed the jumper back to 0. The arduino bootloader seems to work, no errors in dmesg and lsusb shows device 1eaf:0004, even after recompiling it with my installed gcc (6.3.1). I still have to find out why cdcacm.c does not work.
@Jochen0x90h
Like this correct? I did this last night actually and noticed the green blinking light was not present anymore instead; it just had the solid red light. I ran the above commands again and it still can’t find the chip. Odd thing is I installed the needed software on my Mac as well and I end up with the same result on both machines.
also, plugging in my rasp pi to the correct connectors and another board yields the same error i described
when trying to flash using the procedure with st-flash I get this with the jumpers in the same position as the photo«`
[travjav@rey]: ~/Development/Invictus-
board/STM32F103C8T6>$ st-flash write main.bin 0x08000000
st-flash 1.5.1
2019-06-28T11:23:24 INFO common.c: Loading device parameters….
2019-06-28T11:23:24 WARN common.c: Invalid flash type, please check device declaration
core status: unknown
Unknown memory region
I sent above
The blinking light disappeared because now the internal serial bootloader (factory programmed) is now active. But if it didn’t do the trick then I unfortunately can’t help you. Did you remove the cover of the st-link dongle?
The blinking light disappeared because now the internal serial bootloader (factory programmed) is now active. But if it didn’t do the trick then I unfortunately can’t help you. Did you remove the cover of the st-link dongle?
Can you please clarify this: so moving the pins to the position shown in the last image I included, these need to remain in this position when debugging always? then can be put back to 0 position when the program is executing/ live?
The jumper can also be set back to 0 when debugging, it only has to be set to 1 if there is some program flashed that somehow prevents flasing over swd, for example by using these pins as output.
But great that you found the problem
I looked up a lot of information, and finally got the answer here. It was the reverse of the text of the boot jumper!
Thank you very much.
@TravJav @Jochen0x90h
stlink-org
locked as resolved and limited conversation to collaborators
Apr 27, 2020
The board is a STEVAL-PTOOL1V1. The setup was tried on different boards.
The programmer board used is a STLINK-V3SET.
I followed the instructions on the Getting started
document of the STEVAL-PTOOL1V1.
I power the board through J1 and J2 with a power supply supplying 12V.
I connected J8 with a jumper.
I connected the SWD pins to the STLINKS.
Here is the setup and the documentation for the SWD connector of the PTOOL1V1.
The pin at the bottom (with the red cable) is the first one. It has a square-shaped weld.
In order to communicate with the board, I tried:
-
Uploading the example project of the STEVAL-PTOOL1V1 by clicking on the debbuger icon of the CubeIDE
-
Clicking «Connect» in STM32CubeProgrammer
-
Clicking «Connect to the target» in STM32 ST-LINK Utility
-
Using the Open source version of the STMicroelectronics STLINK Tools : stlink
Here are the errors messages for each:
STMicroelectronics ST-LINK GDB server. Version 5.9.1
Copyright (c) 2021, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Target no device found
Error in initializing ST-LINK device.
Reason: No device found on target.
09:04:16 : STM32CubeProgrammer API v2.8.0
09:21:46 : Warning: Device changed, refreshing...
09:21:46 : ST-LINK SN : 002C00343156501620323443
09:21:46 : ST-LINK FW : V3J8M3B5S1
09:21:46 : Board : STLINK-V3SET
09:21:46 : Voltage : 3.21V
09:21:46 : No STM32 target found!
09:21:46 : ST-LINK SN : 002C00343156501620323443
09:21:46 : ST-LINK FW : V3J8M3B5S1
09:21:46 : Board : STLINK-V3SET
09:21:46 : Voltage : 3.23V
09:21:46 : Error: No STM32 target found!
09:22:17 : Can not connect to target!
If you're trying to connect to an STM32W1xx device, please select Normal or HotPlug mode from Target->Settings menu.
If you're trying to connect to a low frequency application , please select a lower SWD Frequency mode from Target->Settings menu.
09:22:23 : No target connected
$ st-flash --connect-under-reset reset
st-flash 1.7.0
2021-10-11T14:54:45 INFO usb.c: Unable to match requested speed 1800 kHz, using 1000 kHz
2021-10-11T14:54:45 WARN common.c: NRST is not connected
2021-10-11T14:54:45 ERROR common.c: Can not connect to target. Please use 'connect under reset' and try again
Failed to connect to target
$ st-flash --freq=50 --connect-under-reset reset
st-flash 1.7.0
2021-10-11T14:54:39 WARN common.c: NRST is not connected
2021-10-11T14:54:40 ERROR common.c: Soft reset failed: timeout
2021-10-11T14:54:40 ERROR common.c: Can not connect to target. Please use 'connect under reset' and try again
Failed to connect to target
In STM32CubeProgrammer, I tried changing the configuration of the STLINK. The port is at SWD
. I tried Hardware
, Core
and Software
for the reset mode. I tried Normal
, Under Reset
and Hot plug
for the mode. Same result with every configurations.
When the board is powered, I have a tension of 3.3V on the VDD of the SWD connector.
Any idea why the flashing process is not working ?