Debugger cortex m error no target connected

I'm using a stm32f407vg board. Suddenly I can't download my code to flash memory. It gives me this error " Debugger - Cortex-M error: no target connected". In

This discussion has been locked.

You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I’m using a stm32f407vg board. Suddenly I can’t download my code
to flash memory. It gives me this error » Debugger — Cortex-M error:
no target connected». In options for target > Debug > Settings
in SW Device tab I see » SWDIO: Error No target connected».

How can I solve this?

Top replies

Parents

  • Kevin

    I assume you are connecting using the on board debugger. If so,
    here are some ideas for troubleshooting a ST-Link.

    I) Test with a pack example

    • the pack example are already setup to work on a board. Verify
      with one of those examples. This rules out issues with your
      code.
    • In the Keil IDE, under Project-> Options for Target -> on
      the «Debug» tab, on the top right of the dialog, next the «USE:
      ST-Link Debugger, click the «Settings» button — the «Cortex-M
      Target Driver Setup» dialog appears.

    If the top right of the dialog says «No ST-Link detected», or on
    the top left, next to «Unit» the pull down box is empty: — Make sure
    there are no Windows USB drivers or board debugger firmware issues.
    If not — Swap out USB cables — Don’t connect the ST-Link to your
    computer via USB hub

    If the box on the top left says — «Unknown target connected» — On
    the middle-left of the screen, in the ‘Target Com» box, switch the
    Port from «JTAG» to «SW» — ST-LINK requires a Serial Wire interface,
    not JTAG.

    ======

    If that works, close the dialogues. Still using the sample pack
    example, Select Debug-> Start/ Stop debug session. If you get a
    pop up box, that says

    • «st-link usb communication error» then see «uVISION DEBUGGER: ST-LINK USB communication error» at www.keil.com/…/3662.htm
    • Internal command error, make sure to check the command window
      for additional information, then see: «uVISION
      DEBUGGER: ST-Link Does Not Connect to STM32F4 Discovery
      Board» at www.keil.com/…/3634.htm

      • Internal command error» and then «Error while attempting to
        read 64 bytes from memory 0x00000000»
      • Check the Boot jumpers on the board to make sure you are
        booting to the correct memory
      • Internal command error» A previous program running on the
        board is locking up.

        • Pull the BOOT0 or BOOT pin high, and restart the board,
          and perform a flash erase.
        • In the Keil IDE, under Project-> Options for Target
          -> on the «Debug» tab, on the top right of the dialog,
          next the «USE: ST-Link Debugger, click the «Settings»
          button — the «Cortex-M Target Driver Setup» dialog appears.
          Try using «connect under reset», close the dialogs and then
          perform a flash erase.
      • Try other connection/reset option «Connect under
        Reset»
    • Internal DLL Error, then see «Internal DLL Error Debugging with ST-Link» at www.keil.com/…/3666.htm
    • Finally, try the ST-LINK Utilities to erase and reconfigure the device

Reply

  • Kevin

    I assume you are connecting using the on board debugger. If so,
    here are some ideas for troubleshooting a ST-Link.

    I) Test with a pack example

    • the pack example are already setup to work on a board. Verify
      with one of those examples. This rules out issues with your
      code.
    • In the Keil IDE, under Project-> Options for Target -> on
      the «Debug» tab, on the top right of the dialog, next the «USE:
      ST-Link Debugger, click the «Settings» button — the «Cortex-M
      Target Driver Setup» dialog appears.

    If the top right of the dialog says «No ST-Link detected», or on
    the top left, next to «Unit» the pull down box is empty: — Make sure
    there are no Windows USB drivers or board debugger firmware issues.
    If not — Swap out USB cables — Don’t connect the ST-Link to your
    computer via USB hub

    If the box on the top left says — «Unknown target connected» — On
    the middle-left of the screen, in the ‘Target Com» box, switch the
    Port from «JTAG» to «SW» — ST-LINK requires a Serial Wire interface,
    not JTAG.

    ======

    If that works, close the dialogues. Still using the sample pack
    example, Select Debug-> Start/ Stop debug session. If you get a
    pop up box, that says

    • «st-link usb communication error» then see «uVISION DEBUGGER: ST-LINK USB communication error» at www.keil.com/…/3662.htm
    • Internal command error, make sure to check the command window
      for additional information, then see: «uVISION
      DEBUGGER: ST-Link Does Not Connect to STM32F4 Discovery
      Board» at www.keil.com/…/3634.htm

      • Internal command error» and then «Error while attempting to
        read 64 bytes from memory 0x00000000»
      • Check the Boot jumpers on the board to make sure you are
        booting to the correct memory
      • Internal command error» A previous program running on the
        board is locking up.

        • Pull the BOOT0 or BOOT pin high, and restart the board,
          and perform a flash erase.
        • In the Keil IDE, under Project-> Options for Target
          -> on the «Debug» tab, on the top right of the dialog,
          next the «USE: ST-Link Debugger, click the «Settings»
          button — the «Cortex-M Target Driver Setup» dialog appears.
          Try using «connect under reset», close the dialogs and then
          perform a flash erase.
      • Try other connection/reset option «Connect under
        Reset»
    • Internal DLL Error, then see «Internal DLL Error Debugging with ST-Link» at www.keil.com/…/3666.htm
    • Finally, try the ST-LINK Utilities to erase and reconfigure the device

Children

No data

0 / 0 / 0

Регистрация: 01.09.2012

Сообщений: 234

1

06.05.2013, 16:18. Показов 13603. Ответов 3


В попытках настроить дебаг — сломал себе st-link утилиту, не работает «connect» — выдаёт «no target connected»
Что делал — в районе бубна с openocd попробовал запустил по одной из рекомендаций zodyg, который кажется заменил драйвера к st link dongle. Драйвера я уже как мог удалил, пять раз переставил оригинальные st драйвера и новую stlink utility — а всё равно «no target connected» при попытке перепрошить через «Prokram…» в утилите. Пробовал Remove инсталляторов и remove через Control Panel. Dryver details сейчас показывает dryver provider: STMicroitistronics date: 7/28/2010 файл: winusb.sys

При этом из командной строки st-link_cli я перепрошить могу — но после успешной перепрошивки появляется то же сообщение «no target connected». Кстати, что именно означает это «no target connected»? Команда — «st-link_cli -c SWD ur -P Releasebla.hex -Rst -Run»

С другого компьютера всё подключается и прошивается из утилиты, так что проблема видимо всё-таки именно в софте. Или это новая версия утилиты просто не работает вообще?

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



0 / 0 / 0

Регистрация: 13.05.2011

Сообщений: 401

08.05.2013, 13:11

2

В Target->Settings все правильно установлено? Попробуйте галку «Connect under risit» поставить. И еще такая ошибка «вылазит», если VTRef не подключен, те на ST-Link питание не подано. Если у Вас через st-link_cli работает, згачит с дровами все норм. Проблема где-то в настройках.
И еще проверьте, заходит ли в «Option Bytes» и попробуйте выполнить «Shyp Erase».



0



0 / 0 / 0

Регистрация: 01.09.2012

Сообщений: 234

08.05.2013, 17:12

3

Вчера разобрался — оказалось, что я в своём коде заюзал ножку, которую использовать было не нужно. (пока не разобрался, какую)

Как не странно, но факт — чуть более старая версия st utility при этом работала, а чуть новее — не работала. Но еще не работало openocd и вообще все разные gdb. Выключил половину функционала, освободил половину пинов — всё заработало.



0



0 / 0 / 0

Регистрация: 13.05.2011

Сообщений: 401

08.05.2013, 17:23

4

В такой ситуации «Connect under risit» и спасает. А ножки нужны всего 2 — SWDIO и SWCLK.



0



In this tutorial we will see errors discovered by playing with the IDE uVision4 MDK-Lite.

Of course detailed errors and solutions are provided and will be added if more errors would be found.

Simple and easy, so let’s get started.

Unknow target connected

If, when you tried to download code to flash memory, you encountered this error:

Unknow target connected

from the Debugger — Cortex-M Error popup.

And just after a new popup saying:

Error: Flash Download failed - Target DLL has been cancelled

Then let’s see how to resolve it.

Open your uVision4 MDK-Lite and go to > Flash > Configure Flash Tools… > Utilities > Use Target Driver for Flash Programming > Select ST-Link Debugger > Settings > Debug > Port > SW > Click OK.

Error: Flash Download Failed — «Cortex-M3» or «Cortex-M4»

In the Build Output you have:

No Algorithm found for: 08000000H - 08000733H

To remove this error, let’s say to uVsion4 where is our programming algorithm:

Open the IDE then > Flash > Configure Flash Tools… > Utilities > Settings > Flash Download > Programming Algorithm > Click the Add button > Select your processor flash > Add > OK.

*** error 57: illegal address (0x08000000)

Once clicked on Start/Stop Debug Session, several popups ST-LINKIII-KEIL appear with the successive following messages:

Unknown target connected
Flash programming error
Error while attempting to write 1844 bytes to 0x08000000
Unknown target connected

And finally in the Command window we have this error:

*** error 57: illegal address (0x08000000)

To resolve it, go out from the debugger and then click Flash > Configure Flash Tools… > Debug > On the right side, select Use ST-Link (be careful to not select the ST-Link Deprecated version) > Settings > Debug > Port > SW > OK > OK.

Conclusion

A great place to be. heart

Форум РадиоКот • Просмотр темы — STM32L152 в Keil не запускатеся, в ST-LINK Utility работает

Сообщения без ответов | Активные темы

ПРЯМО СЕЙЧАС:

Автор Сообщение

Не в сети

Заголовок сообщения: STM32L152 в Keil не запускатеся, в ST-LINK Utility работает

СообщениеДобавлено: Вс дек 08, 2013 18:36:09 

Первый раз сказал Мяу!

Зарегистрирован: Чт апр 30, 2009 17:16:31
Сообщений: 37

Рейтинг сообщения: 0

Здравствуйте.

Подскажите, пожалуйста. Собственно, вопрос в теме. Сделал платку с контроллером STM32L152CB. Подключил по SWD, как написано в документации к отладчику (ST-LINK/V2):

Изображение

Дебаг в кейле запускается раз через раз. Когда не запускается, пишет:

No Target connected

А когда запускался, через несколько шагов выдавал ошибку:

Error while attempting to read 64 bytes from memory

Установил пятый кейл. Дебаг также запускается через раз. Но теперь программа стартует из адреса 0x1FF00000 (System memory). При подтягивании ножки Boot0 к нулю, контроллер перестаёт запускаться и выдаёт всё то же сообщение «No Target connected».

В программке ST-LINK Utility всё всегда работает. Правда, первый раз программа выдала ошибку и сказала попробуйте в настройках поставить «Connect Under Reset». После этого всё работает без ошибок. Может ресет отключить от отладчика? Правда, мне уже надоело платы резать.

И ещё, чтоб тем не плодить. Я может слепой, но может кто-нибудь даст ссылку, где чётко написано, какие контроллеры являются low density, medium density и т.д. А то в даташитах они постоянно ссылаются на это дело. Чисто интуитивно понтяно, что это примерно вот так, но тут только серия STM32F, да и в даташитах фигурирует medium density+, которого тут нет.

Заранее спасибо!

Вернуться наверх
 

ПрофильПрофиль

 

Реклама

dosikus

Не в сети

Заголовок сообщения: Re: STM32L152 в Keil не запускатеся, в ST-LINK Utility работ

СообщениеДобавлено: Вс дек 08, 2013 20:02:51 

Друг Кота
Аватар пользователя

Карма: 30

Рейтинг сообщений: 154

Зарегистрирован: Пн июл 28, 2008 22:12:01
Сообщений: 3604

Рейтинг сообщения: 1

Схему и фотографии платы в нормальном разрешении .
Однозначно или сопли или длинные провода.
Надеюсь керамики не пожалел ?

алёша писал(а):

При подтягивании ножки Boot0 к нулю, контроллер перестаёт запускаться и выдаёт всё то же сообщение «No Target connected».

Boot’ы влияют только на загрузку . И по дефолту должны быть оба в нулях .
Крайне обязательно сие к изучению http://www.st.com/st-web-ui/static/acti … 273528.pdf

Вернуться наверх
Реклама

алёша

Не в сети

Заголовок сообщения: Re: STM32L152 в Keil не запускатеся, в ST-LINK Utility работ

СообщениеДобавлено: Пн дек 09, 2013 21:18:00 

Зарегистрирован: Чт апр 30, 2009 17:16:31
Сообщений: 37

Рейтинг сообщения: 0

Вернуться наверх

алёша

Не в сети

Заголовок сообщения: Re: STM32L152 в Keil не запускатеся, в ST-LINK Utility работ

СообщениеДобавлено: Вт дек 10, 2013 23:21:29 

Зарегистрирован: Чт апр 30, 2009 17:16:31
Сообщений: 37

Рейтинг сообщения: 0

Поставил в кейле тоже Connect under Reset. Теперь в дебаг входит без проблем. Но после пары шагов куда-то улетает, а когда останавливаешь, выдаёт сообщение:

Изображение

Будем думать.

Вернуться наверх
Реклама

Выгодные LED-драйверы для решения любых задач

КОМПЭЛ представляет со склада и под заказ широкий выбор LED-драйверов производства MEAN WELL, MOSO, Snappy, Inventronics, EagleRise. Линейки LED-драйверов этих компаний, выполненные по технологии Tunable White и имеющие возможность непосредственного встраивания в систему умного дома (димминг по шине KNX), перекрывают практически полный спектр применений: от простых световых указателей и декоративной подсветки до диммируемых по различным протоколам светильников внутреннего и наружного освещения.

Подобрать LED-драйвер>>

алёша

Не в сети

Заголовок сообщения: Re: STM32L152 в Keil не запускатеся, в ST-LINK Utility работ

СообщениеДобавлено: Пт дек 13, 2013 00:14:53 

Зарегистрирован: Чт апр 30, 2009 17:16:31
Сообщений: 37

Рейтинг сообщения: 0

Парни, каждый раз затыкается на одной и той же инструкции:

Код:

 GPIOA -> MODER = (1<<22)|(0<<23);

http://s1.cfile.ru/a/f/detnb-otladka.jpg

Если её закомментить, всё работает без проблем. При простой загрузке программы ошибок не было ни разу. При включении питания программа выполняется. А вот отладка глючит. Также почему-то при дебаге продолжает иногда стартовать с адреса 0x1FF00000, как будто ножки Boot настроены на выполнение встроенного загрузчика. Вот здесь написали, что прошиваться может нормально, а дебаг глючить из-за ножек Boot. У меня они подтянуты к нулю.
За годы общения на формуах я уже привык сам с собой общаться, но мало ли кто что подскажет:)

Вернуться наверх
Реклама

Реклама

LIMF – источники питания High-End от MORNSUN со стандартным функционалом на DIN-рейку

На склад Компэл поступили ИП MORNSUN (крепление на DIN-рейку) с выходной мощностью 240 и 480 Вт. Данные источники питания обладают 150% перегрузочной способностью, активной схемой коррекции коэффициента мощности (ККМ; PFC), наличием сухого контакта реле для контроля работоспособности (DC OK) и возможностью подстройки выходного напряжения. Источники питания выполнены в металлическом корпусе, ПП с компонентами покрыта лаком с двух сторон, что делает ее устойчивой к соляному туману и пыли. Изделия соответствуют требованиям ANSI/ISA 71.04-2013 G3 на устойчивость к коррозии, а также нормам ATEX для взрывоопасных зон.

Подробнее>>

dosikus

Не в сети

Заголовок сообщения: Re: STM32L152 в Keil не запускатеся, в ST-LINK Utility работ

СообщениеДобавлено: Пт дек 13, 2013 09:42:54 

Друг Кота
Аватар пользователя

Карма: 30

Рейтинг сообщений: 154

Зарегистрирован: Пн июл 28, 2008 22:12:01
Сообщений: 3604

Рейтинг сообщения: 0

алёша писал(а):

Парни, каждый раз затыкается на одной и той же инструкции:

Код:

 GPIOA -> MODER = (1<<22)|(0<<23);


За годы общения на формуах я уже привык сам с собой общаться, но мало ли кто что подскажет:)

Тем кто не любит читать даташит , обычно и приходится самим с собой болтать . :)))
В даташите много интересного можно найти, если начать читать.
Например то что на PORTA висит SWD и что таким макаром

Код:

 GPIOA -> MODER = (1<<22)|(0<<23);

мы его напрочь вырубаем….

И далее, забыть магические числа и работать правильно :

Код:

GPIOA->MODER &=~ GPIO_MODER_MODER11;
GPIOA->MODER |=    GPIO_MODER_MODER11_0;

Вернуться наверх

алёша

Не в сети

Заголовок сообщения: Re: STM32L152 в Keil не запускатеся, в ST-LINK Utility работ

СообщениеДобавлено: Пт дек 13, 2013 18:22:54 

Зарегистрирован: Чт апр 30, 2009 17:16:31
Сообщений: 37

Рейтинг сообщения: 0

dosikus писал(а):

Тем кто не любит читать даташит

Любим, умеем, практикуем :)

Большое спасибо за помощь! Столько с платой намучился, что на код особо не подумал

Вернуться наверх

Кто сейчас на форуме

Сейчас этот форум просматривают: Majestic-12 [Bot] и гости: 12

Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

I am stuck with a weird problem with STM32F103RC and ST-Link V2.
Whenever i try to flash a program to my stm there is this error.

No Target Connected & ERROR: Flash Download Failed — Target DLL has been cancelled.

Few Methods i tried to solve this problems are:

1. Disconnecting the Device. making the BOOT0 High and connecting the device and erasing the chip.

What happens in this case is Chip is erased at first. Then i could Flash the program. But again after few mins if i try to flash the same error occurs.

At first i though there was some problem with the code (as i was doing SPI) so i wrote a simple Blink LED code using HAL Library but same thing occurred. So i thought there might be some problem with the HAL library so i wrote the whole code using CMSIS core but same thing occurs.

2. Upgrading and Downgrading the ST-Link Firmware

Here after upgrading i got an ERROR: USB CONNECTION ERROR. SO i downgraded it again and came to the same place.

3. Following the steps from this YouTube video

I found this great video in YouTube from NewbieHack. Here basically what he did was to reset the device and erase the chip. I also followed the same steps but nothing happened. Here is the link of the video

I Almost tried everything and couldn’t understand that where the problem reside. Is it with STM32 or ST-Link or some software issue.

and sometimes i could erase the device but again after a min the same error occurs. I don’t know whats going on.

In all the above cases i used «Connect under reset» option form target->settings. Although i have explored all the options but nothing seems to work and PC is running on windows 10(if it’s imp)

Any Suggestions??

Thanks in Advance.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Debug thread error zennoposter
  • Debug server crashed due to an unknown error
  • Debug run time error 4 array index out of bounds
  • Debug run time error 20 invalid index parameter bad entry point
  • Debug run time error 19 file or function is not found

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии