Skocz do zawartości

System Workbench for STM32 - problemy z programowaniem przez interfejs SWD


simba92

Pomocna odpowiedź

Cześć !

Od długie czasu bez żadnych problemów programowałem mikrokontroler STM32f103vct6 przez interfejs SWD i ku mojemu przerażeniu nie mogę go ponownie zaprogramować. W konsoli widnieje następująca lista komunikatów :

Open On-Chip Debugger 0.10.0-dev-00005-g4030e1c-dirty (2017-10-24-08:00)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
none separate
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter_nsrst_delay: 100
adapter speed: 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v27 API v2 M v15 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.243073
Info : Stlink adapter speed set to 950 kHz
Info : STM32F103VCTx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Stlink adapter speed set to 950 kHz
adapter speed: 950 kHz
STM32F103VCTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08003328 msp: 0x2000c000
Info : Stlink adapter speed set to 4000 kHz
adapter speed: 4000 kHz
** Programming Started **
auto erase enabled
Info : device id = 0x10036414
Info : flash size = 256kbytes
STM32F103VCTx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread 
xPSR: 0x41000000 pc: 0x2000003a msp: 0x2000c000
wrote 22528 bytes from file Debug/HUSARZ_SLAM_ver1.0.elf in 1.034059s (21.275 KiB/s)
** Programming Finished **
** Verify Started **
STM32F103VCTx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread 
xPSR: 0x61000000 pc: 0x2000002e msp: 0x2000c000
Error: checksum mismatch - attempting binary compare
diff 0 address 0x080032da. Was 0xff instead of 0x10
diff 1 address 0x080032db. Was 0xf7 instead of 0x21
diff 2 address 0x080032dc. Was 0xff instead of 0x07
diff 3 address 0x080032dd. Was 0xff instead of 0x48
diff 4 address 0x080032de. Was 0xff instead of 0xfd
diff 5 address 0x080032df. Was 0xff instead of 0xf7
diff 6 address 0x080032e0. Was 0xff instead of 0x18
diff 7 address 0x080032e1. Was 0xff instead of 0xfe
diff 8 address 0x080032e2. Was 0xff instead of 0x0a
diff 9 address 0x080032e3. Was 0xff instead of 0x20
diff 10 address 0x080032e5. Was 0xff instead of 0xf7
diff 11 address 0x080032e6. Was 0xff instead of 0x2c
diff 12 address 0x080032e8. Was 0xff instead of 0x00
diff 13 address 0x080032e9. Was 0xff instead of 0x22
diff 14 address 0x080032ea. Was 0xff instead of 0x10
diff 15 address 0x080032eb. Was 0xff instead of 0x21
diff 16 address 0x080032ec. Was 0xff instead of 0x03
diff 17 address 0x080032ed. Was 0xff instead of 0x48
diff 18 address 0x080032ee. Was 0xff instead of 0xfd
diff 19 address 0x080032ef. Was 0xff instead of 0xf7
diff 20 address 0x080032f0. Was 0xff instead of 0x10
diff 21 address 0x080032f1. Was 0xff instead of 0xfe
diff 22 address 0x080032f2. Was 0xff instead of 0xfe
diff 23 address 0x080032f3. Was 0xff instead of 0xf7
diff 24 address 0x080032f4. Was 0xff instead of 0xd5
diff 25 address 0x080032f5. Was 0xff instead of 0xf8
diff 26 address 0x080032f6. Was 0xff instead of 0x00
diff 27 address 0x080032f7. Was 0xff instead of 0xbf
diff 28 address 0x080032f8. Was 0xff instead of 0x80
diff 29 address 0x080032f9. Was 0xff instead of 0xbd
diff 30 address 0x080032fa. Was 0xff instead of 0x00
diff 31 address 0x080032fb. Was 0xff instead of 0xbf
diff 32 address 0x080032fc. Was 0xff instead of 0x00
diff 33 address 0x080032fd. Was 0xff instead of 0x08
diff 34 address 0x080032fe. Was 0xff instead of 0x01
diff 35 address 0x080032ff. Was 0xff instead of 0x40
diff 36 address 0x08003300. Was 0xff instead of 0x80
diff 37 address 0x08003301. Was 0xff instead of 0xb5
diff 38 address 0x08003302. Was 0xff instead of 0x00
diff 39 address 0x08003303. Was 0xff instead of 0xaf
diff 40 address 0x08003304. Was 0xff instead of 0x45
diff 41 address 0x08003305. Was 0xff instead of 0xf2
diff 42 address 0x08003306. Was 0xff instead of 0x55
diff 43 address 0x08003307. Was 0xff instead of 0x50
diff 44 address 0x08003308. Was 0xff instead of 0xfd
diff 45 address 0x08003309. Was 0xff instead of 0xf7
diff 46 address 0x0800330a. Was 0xff instead of 0x5c
diff 47 address 0x0800330c. Was 0xff instead of 0x03
diff 48 address 0x0800330d. Was 0xff instead of 0x20
diff 49 address 0x0800330e. Was 0xff instead of 0xfd
diff 50 address 0x0800330f. Was 0xff instead of 0xf7
diff 51 address 0x08003310. Was 0xff instead of 0x69
diff 52 address 0x08003312. Was 0xff instead of 0x40
diff 53 address 0x08003313. Was 0xff instead of 0xf6
diff 54 address 0x08003315. Was 0xff instead of 0x70
diff 55 address 0x08003316. Was 0xff instead of 0xfd
diff 56 address 0x08003317. Was 0xff instead of 0xf7
diff 57 address 0x08003318. Was 0xff instead of 0x75
diff 58 address 0x0800331a. Was 0xff instead of 0xfd
diff 59 address 0x0800331b. Was 0xff instead of 0xf7
diff 60 address 0x0800331c. Was 0xff instead of 0x83
diff 61 address 0x0800331e. Was 0xff instead of 0xfd
diff 62 address 0x0800331f. Was 0xff instead of 0xf7
diff 63 address 0x08003320. Was 0xff instead of 0x8d
diff 64 address 0x08003322. Was 0xff instead of 0x00
diff 65 address 0x08003323. Was 0xff instead of 0xbf
diff 66 address 0x08003324. Was 0xff instead of 0x80
diff 67 address 0x08003325. Was 0xff instead of 0xbd
diff 68 address 0x08003326. Was 0xff instead of 0x00
diff 69 address 0x08003327. Was 0xff instead of 0x00
diff 70 address 0x08003328. Was 0xff instead of 0x0d
diff 71 address 0x08003329. Was 0xff instead of 0x48
diff 72 address 0x0800332a. Was 0xff instead of 0x85
diff 73 address 0x0800332b. Was 0xff instead of 0x46
diff 74 address 0x0800332c. Was 0xff instead of 0x0d
diff 75 address 0x0800332d. Was 0xff instead of 0x48
diff 76 address 0x0800332e. Was 0xff instead of 0x0e
diff 77 address 0x0800332f. Was 0xff instead of 0x49
diff 78 address 0x08003330. Was 0xff instead of 0x0e
diff 79 address 0x08003331. Was 0xff instead of 0x4a
diff 80 address 0x08003332. Was 0xff instead of 0x00
diff 81 address 0x08003333. Was 0xff instead of 0x23
diff 82 address 0x08003334. Was 0xff instead of 0x02
diff 83 address 0x08003335. Was 0xff instead of 0xe0
diff 84 address 0x08003336. Was 0xff instead of 0xd4
diff 85 address 0x08003337. Was 0xff instead of 0x58
diff 86 address 0x08003338. Was 0xff instead of 0xc4
diff 87 address 0x08003339. Was 0xff instead of 0x50
diff 88 address 0x0800333a. Was 0xff instead of 0x04
diff 89 address 0x0800333b. Was 0xff instead of 0x33
diff 90 address 0x0800333c. Was 0xff instead of 0xc4
diff 91 address 0x0800333d. Was 0xff instead of 0x18
diff 92 address 0x0800333e. Was 0xff instead of 0x8c
diff 93 address 0x0800333f. Was 0xff instead of 0x42
diff 94 address 0x08003340. Was 0xff instead of 0xf9
diff 95 address 0x08003341. Was 0xff instead of 0xd3
diff 96 address 0x08003342. Was 0xff instead of 0x0b
diff 97 address 0x08003343. Was 0xff instead of 0x4a
diff 98 address 0x08003344. Was 0xff instead of 0x0b
diff 99 address 0x08003345. Was 0xff instead of 0x4c
diff 100 address 0x08003346. Was 0xff instead of 0x00
diff 101 address 0x08003347. Was 0xff instead of 0x23
diff 102 address 0x08003348. Was 0xff instead of 0x01
diff 103 address 0x08003349. Was 0xff instead of 0xe0
diff 104 address 0x0800334a. Was 0xff instead of 0x13
diff 105 address 0x0800334b. Was 0xff instead of 0x60
diff 106 address 0x0800334c. Was 0xff instead of 0x04
diff 107 address 0x0800334d. Was 0xff instead of 0x32
diff 108 address 0x0800334e. Was 0xff instead of 0xa2
diff 109 address 0x0800334f. Was 0xff instead of 0x42
diff 110 address 0x08003350. Was 0xff instead of 0xfb
diff 111 address 0x08003351. Was 0xff instead of 0xd3
diff 112 address 0x08003353. Was 0xff instead of 0xf7
diff 113 address 0x08003354. Was 0xff instead of 0xd9
diff 114 address 0x08003355. Was 0xff instead of 0xfa
diff 115 address 0x08003356. Was 0xff instead of 0x00
diff 116 address 0x08003357. Was 0xff instead of 0xf0
diff 117 address 0x08003358. Was 0xff instead of 0x0f
diff 118 address 0x08003359. Was 0xff instead of 0xf8
diff 119 address 0x0800335b. Was 0xff instead of 0xf7
diff 120 address 0x0800335c. Was 0xff instead of 0x91
diff 121 address 0x0800335d. Was 0xff instead of 0xfa
diff 122 address 0x0800335e. Was 0xff instead of 0xfe
diff 123 address 0x0800335f. Was 0xff instead of 0xe7
diff 124 address 0x08003360. Was 0xff instead of 0x00
diff 125 address 0x08003361. Was 0xff instead of 0xc0
diff 126 address 0x08003362. Was 0xff instead of 0x00
diff 127 address 0x08003363. Was 0xff instead of 0x20
More than 128 errors, the rest are not printed.
** Verify Failed **
shutdown command invoked

Czy istnieje podejrzenie, że mikrokontroler padł ???

Ostatnia zmiana jaką robiłem dotyczyła zmiany w obsłudze przerwania od zegara SYSTICK z 10 na 5 ms, no ale przecież to nic wielkiego. Wszystko działało wcześniej, zasilanie do robota jest ok, nawet próbowałem programować innym ST-linkiem, to samo ...

Nigdy wcześniej nie miałem takiego problemu 😞  o co chodzi z tymi komunikatami w konsoli ???

PS : przeszukuje internet w celu znalezienia odpowiedzi na zaistniałą sytuacje, no ale może jakiś guru z tego forum spojrzy zobaczy i coś zasugeruje. Dzięki !!!

PS2 : mógłbym przelutować mikrokontroler na nowy, mam lutownice hotair no ale to już ostateczność...

Edytowano przez simba92
Link do komentarza
Share on other sites

Z konsoli wynika, że są problemy z weryfikacją zawartości pamięci po wgraniu firmware. Dziwne.

Ja na Twoim miejscu spróbowałbym wgrać plik bin przez program ST-LINK Utility (https://www.st.com/en/development-tools/stsw-link004.html).

Druga rzecz, która przychodzi mi do głowy, to uszkodzone przewody (ale to raczej mało prawdopodobne, bo programator wykrywa procka poprawnie). Jak masz podłączony programator do płytki?

  • Lubię! 1
Link do komentarza
Share on other sites

(edytowany)

Przewody nie są uszkodzone, ponieważ programator połączył się z procesorem przez ST-LINK Utility, załączam screeny :

SWD2.thumb.jpg.da66f8d9cbcc99e99ad5ca7faa961ed6.jpg

swd.jpg

Dodatkowy screen z 2 programatora (płytka nucleo - w trybie st link - tj. zworki zdjęte) :

swd3.thumb.jpg.23b4a297e7ec5de51ef9881a63f112df.jpg

Pomimo realizacji następujących kroków : erase chip + zmiana ustawień tj. Software Reset - problem z wgraniem programu jest ten sam ...

EDIT :

jest jeszcze możliwość update' u firmware ale z tego co widzę wersja V2.J27.M15 STM32 Debug+Mass storage jest (NOWSZA ) w porównaniu do V2.J25.M13 (STARSZEJ) wg. indeksów.

swd4.thumb.jpg.348048b02f2a75871ae57dfa390f3c55.jpg

Edytowano przez simba92
Link do komentarza
Share on other sites

No to ostatnia rzecz, jaka przychodzi mi do głowy, to wgranie jakiegoś wcześniejszego firmware'u (albo jakiegoś kodu z miganiem diodą). Ale to jest bez sensu, bo problem jest z samym wgrywaniem softu, a nie z jego uruchomieniem 😕

Dziwne, żeby procek tak sobie umarł. Słaba sprawa. Ale jak procesor jest w jakiejś ludzkiej obudowie (np. TQFP), to bez problemu powinieneś wymienić 🙂

  • Lubię! 1
Link do komentarza
Share on other sites

Zarejestruj się lub zaloguj, aby ukryć tę reklamę.
Zarejestruj się lub zaloguj, aby ukryć tę reklamę.

jlcpcb.jpg

jlcpcb.jpg

Produkcja i montaż PCB - wybierz sprawdzone PCBWay!
   • Darmowe płytki dla studentów i projektów non-profit
   • Tylko 5$ za 10 prototypów PCB w 24 godziny
   • Usługa projektowania PCB na zlecenie
   • Montaż PCB od 30$ + bezpłatna dostawa i szablony
   • Darmowe narzędzie do podglądu plików Gerber
Zobacz również » Film z fabryki PCBWay

@FlyingDutch tak jak pisałeś zapewne w moim mikrokontrolerze mógł się uszkodzić kontroler interfejsu SWD lub wewn. pamięć flash. W płytce mam zworki od BOOT0 i BOOT1 (docelowo robot miał być programowany opcjonalnie z karty micro SD lub ew. przez BT ( HC06(Master + Slave) + konwerter USB-UART), więc rozwiązanie programowania przez bootloader mógłbym przetestować i napewno zrobię to w przyszłości. Z powodu jednak braku czasu na, którym mi zależy zdecydowałem się wylutować stary mikrokontroler i wlutować nowy. Efekt jest taki, że wymieniłem procesor i wgrałem bez problemów testowy program z migającą diodą, hula aż miło 🙂 Dziękuje @Lukaszm i @FlyingDutch wam za szybką pomoc, wzbogaciłem się o nową wiedzę i doświadczenie. 

  • Lubię! 1
Link do komentarza
Share on other sites

Dołącz do dyskusji, napisz odpowiedź!

Jeśli masz już konto to zaloguj się teraz, aby opublikować wiadomość jako Ty. Możesz też napisać teraz i zarejestrować się później.
Uwaga: wgrywanie zdjęć i załączników dostępne jest po zalogowaniu!

Anonim
Dołącz do dyskusji! Kliknij i zacznij pisać...

×   Wklejony jako tekst z formatowaniem.   Przywróć formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Twój link będzie automatycznie osadzony.   Wyświetlać jako link

×   Twoja poprzednia zawartość została przywrócona.   Wyczyść edytor

×   Nie możesz wkleić zdjęć bezpośrednio. Prześlij lub wstaw obrazy z adresu URL.

×
×
  • Utwórz nowe...

Ważne informacje

Ta strona używa ciasteczek (cookies), dzięki którym może działać lepiej. Więcej na ten temat znajdziesz w Polityce Prywatności.