Hallo, ich habe ein Problem mit einem STM32L431KB, bin allerdings Neuling in Bezug auf STM. Der uC ist neu und wird prinzipiell vom ST-Link-Utility / STM32CubeProgrammer erkannt (Device, Typ, ID, Flash Size, CPU, Target Vdd, ...) Allerdings lässt er sich nicht programmieren. Nach einigen Versuchen mit dem ST-Link Utility bin ich auf den STM32CubeProgrammer gewechselt. Folgendes Fehlerbild: Der uC lässt sich nicht löschen (weder gesamt nich einzelne Sektoren), noch beschreiben. Auch die Option Bytes lassen sich nicht manipulieren. Dazu folgende Ausgaben vom CubeProgrammer: Beim Versuch, dass .elf-File zu flashen wird folgendes gelogt:
1 | 15:18:57:180 : Memory Programming ... |
2 | 15:18:57:181 : Opening and parsing file: Test.elf |
3 | 15:18:57:182 : File : Test.elf |
4 | 15:18:57:182 : Size : 864 Bytes |
5 | 15:18:57:183 : Address : 0x08000000 |
6 | 15:18:57:183 : Erasing Segment <0> Address <0x08000000> Size <864>Bytes |
7 | 15:18:57:183 : Erasing memory corresponding to segment 0: |
8 | 15:18:57:183 : Memory erase... |
9 | 15:18:57:186 : reset ap 0 |
10 | 15:18:57:186 : halt ap 0 |
11 | 15:18:57:186 : w ap 0 reg 15 (0x20000000) |
12 | 15:18:57:188 : w ap 0 reg 17 (0x20000500) |
13 | 15:18:57:188 : w ap 0 reg 16 (0x01000000) |
14 | 15:18:57:195 : w ap 0 @0x20000D00 0x00000200 bytes |
15 | 15:18:57:195 : w ap 0 @0x20000000 0x00000004 bytes |
16 | 15:18:57:220 : w ap 0 @0x20000004 0x000008C8 bytes |
17 | 15:18:57:221 : Erasing internal memory sector 0 |
18 | 15:18:57:221 : Init flashloader... |
19 | 15:18:57:221 : halt ap 0 |
20 | 15:18:57:221 : w ap 0 reg 0 0x00000001 |
21 | 15:18:57:222 : w ap 0 reg 1 0x00000000 |
22 | 15:18:57:222 : w ap 0 reg 2 0x00000000 |
23 | 15:18:57:222 : w ap 0 reg 3 0x00000000 |
24 | 15:18:57:222 : w ap 0 reg 4 0x00000000 |
25 | 15:18:57:222 : w ap 0 reg 5 0x00000000 |
26 | 15:18:57:222 : w ap 0 reg 6 0x00000000 |
27 | 15:18:57:222 : w ap 0 reg 7 0x00000000 |
28 | 15:18:57:222 : w ap 0 reg 8 0x00000000 |
29 | 15:18:57:227 : w ap 0 reg 9 0x00000000 |
30 | 15:18:57:234 : w ap 0 reg 10 0x00000000 |
31 | 15:18:57:237 : w ap 0 reg 11 0x00000000 |
32 | 15:18:57:237 : w ap 0 reg 12 0x00000000 |
33 | 15:18:57:239 : w ap 0 reg 13 0x00000000 |
34 | 15:18:57:239 : w ap 0 reg 14 0x20000001 |
35 | 15:18:57:239 : w ap 0 reg 15 0x20000005 |
36 | 15:18:57:239 : w ap 0 reg 16 0x01000000 |
37 | 15:18:57:241 : w ap 0 reg 17 0x20000CC8 |
38 | 15:18:57:241 : w ap 0 reg 18 0x00000000 |
39 | 15:18:57:241 : run ap 0 |
40 | 15:19:02:004 : halt ap 0 |
41 | 15:19:02:004 : Init function fail with timeout |
42 | 15:19:02:004 : r ap 0 reg 16 0x81000000 |
43 | 15:19:02:004 : Loader sector erase... |
44 | 15:19:02:004 : Error: failed to erase memory |
45 | 15:19:02:037 : Error: failed to erase memory |
Aktiviere ich die Option "Skip flash erase before programming", dann wird folgendes ausgegeben:
1 | 15:19:19:733 : Memory Programming ... |
2 | 15:19:19:733 : Opening and parsing file: Test.elf |
3 | 15:19:19:734 : File : Test.elf |
4 | 15:19:19:735 : Size : 864 Bytes |
5 | 15:19:19:735 : Address : 0x08000000 |
6 | 15:19:19:735 : Download in Progress: |
7 | 15:19:19:735 : Size : 864 Bytes |
8 | 15:19:19:735 : Address : 0x08000000 |
9 | 15:19:19:736 : Buffer program... |
10 | 15:19:19:741 : reset ap 0 |
11 | 15:19:19:741 : halt ap 0 |
12 | 15:19:19:741 : w ap 0 reg 15 (0x20000000) |
13 | 15:19:19:742 : w ap 0 reg 17 (0x20000500) |
14 | 15:19:19:742 : w ap 0 reg 16 (0x01000000) |
15 | 15:19:19:747 : w ap 0 @0x20000D00 0x00000200 bytes |
16 | 15:19:19:747 : w ap 0 @0x20000000 0x00000004 bytes |
17 | 15:19:19:764 : w ap 0 @0x20000004 0x000008C8 bytes |
18 | 15:19:19:765 : Loader write range... |
19 | 15:19:19:771 : w ap 0 @0x20000D00 0x000001B0 bytes |
20 | 15:19:19:771 : W B1 in RAM @0x20000D00 size 0x000001B0 : 0004ms |
21 | 15:19:19:771 : Init flashloader... |
22 | 15:19:19:771 : halt ap 0 |
23 | 15:19:19:772 : w ap 0 reg 0 0x00000001 |
24 | 15:19:19:772 : w ap 0 reg 1 0x00000000 |
25 | 15:19:19:774 : w ap 0 reg 2 0x00000000 |
26 | 15:19:19:779 : w ap 0 reg 3 0x00000000 |
27 | 15:19:19:779 : w ap 0 reg 4 0x00000000 |
28 | 15:19:19:779 : w ap 0 reg 5 0x00000000 |
29 | 15:19:19:779 : w ap 0 reg 6 0x00000000 |
30 | 15:19:19:780 : w ap 0 reg 7 0x00000000 |
31 | 15:19:19:780 : w ap 0 reg 8 0x00000000 |
32 | 15:19:19:780 : w ap 0 reg 9 0x00000000 |
33 | 15:19:19:780 : w ap 0 reg 10 0x00000000 |
34 | 15:19:19:780 : w ap 0 reg 11 0x00000000 |
35 | 15:19:19:781 : w ap 0 reg 12 0x00000000 |
36 | 15:19:19:781 : w ap 0 reg 13 0x00000000 |
37 | 15:19:19:786 : w ap 0 reg 14 0x20000001 |
38 | 15:19:19:786 : w ap 0 reg 15 0x20000005 |
39 | 15:19:19:790 : w ap 0 reg 16 0x01000000 |
40 | 15:19:19:797 : w ap 0 reg 17 0x20000CC8 |
41 | 15:19:19:797 : w ap 0 reg 18 0x00000000 |
42 | 15:19:19:797 : run ap 0 |
43 | 15:19:24:000 : halt ap 0 |
44 | 15:19:24:000 : Init function fail with timeout |
45 | 15:19:24:004 : r ap 0 reg 16 0x41000000 |
46 | 15:19:24:004 : w ap 0 @0x20000EB0 0x000001B0 bytes |
47 | 15:19:24:004 : W B2 in RAM @0x20006500 size 0x000001B0: 4236ms |
48 | 15:19:24:010 : r ap 0 reg 0 0x48000000 |
49 | 15:19:24:012 : reset ap 0 |
50 | 15:19:24:012 : halt ap 0 |
51 | 15:19:24:012 : w ap 0 reg 15 (0x20000000) |
52 | 15:19:24:014 : w ap 0 reg 17 (0x20000500) |
53 | 15:19:24:014 : w ap 0 reg 16 (0x01000000) |
54 | 15:19:24:020 : Loader write range... |
55 | 15:19:24:026 : w ap 0 @0x20000D00 0x000001B0 bytes |
56 | 15:19:24:026 : W B1 in RAM @0x20000D00 size 0x000001B0 : 0004ms |
57 | 15:19:24:027 : halt ap 0 |
58 | 15:19:24:027 : r ap 0 reg 0 0x00000000 |
59 | 15:19:24:027 : Error: failed to download Segment[0] |
60 | 15:19:24:027 : Error: failed to download the File |
61 | 15:19:24:048 : Time elapsed during download operation: 00:00:04.284 |
62 | 15:19:24:048 : Verifying ... |
63 | 15:19:24:048 : Read progress: |
64 | 15:19:24:049 : Reading data... |
65 | 15:19:24:053 : r ap 0 @0x08000000 0x00000360 bytes |
66 | 15:19:24:054 : Error: Data mismatch found at address 0x08000000 (byte = 0xFF) |
67 | 15:19:24:054 : Error: Download verification failed |
Auch die "Option Bytes" kann ich nicht ändern, testweise am BOR-Level probiert:
1 | 15:21:44:241 : Option byte command : -ob BOR_LEV=4 |
2 | 15:21:44:244 : PROGRAMMING OPTION BYTES AREA ... |
3 | 15:21:44:244 : r ap 0 @0x40022040 0x00000004 bytes |
4 | 15:21:44:244 : Bank : 0x00 |
5 | 15:21:44:244 : Address : 0x40022020 |
6 | 15:21:44:244 : Size : 20 Bytes |
7 | 15:21:44:296 : Buffer program... |
8 | 15:21:44:301 : reset ap 0 |
9 | 15:21:44:301 : halt ap 0 |
10 | 15:21:44:301 : w ap 0 reg 15 (0x20000000) |
11 | 15:21:44:302 : w ap 0 reg 17 (0x20000500) |
12 | 15:21:44:302 : w ap 0 reg 16 (0x01000000) |
13 | 15:21:44:308 : w ap 0 @0x20000D00 0x00000200 bytes |
14 | 15:21:44:309 : w ap 0 @0x20000000 0x00000004 bytes |
15 | 15:21:44:327 : w ap 0 @0x20000004 0x000008C8 bytes |
16 | 15:21:44:329 : w ap 0 @0x20000D00 0x00000014 bytes |
17 | 15:21:44:330 : Loader write option bytes... |
18 | 15:21:44:330 : Init flashloader... |
19 | 15:21:44:330 : halt ap 0 |
20 | 15:21:44:334 : w ap 0 reg 0 0x00000001 |
21 | 15:21:44:334 : w ap 0 reg 1 0x00000000 |
22 | 15:21:44:334 : w ap 0 reg 2 0x00000000 |
23 | 15:21:44:335 : w ap 0 reg 3 0x00000000 |
24 | 15:21:44:335 : w ap 0 reg 4 0x00000000 |
25 | 15:21:44:335 : w ap 0 reg 5 0x00000000 |
26 | 15:21:44:337 : w ap 0 reg 6 0x00000000 |
27 | 15:21:44:342 : w ap 0 reg 7 0x00000000 |
28 | 15:21:44:342 : w ap 0 reg 8 0x00000000 |
29 | 15:21:44:342 : w ap 0 reg 9 0x00000000 |
30 | 15:21:44:342 : w ap 0 reg 10 0x00000000 |
31 | 15:21:44:342 : w ap 0 reg 11 0x00000000 |
32 | 15:21:44:344 : w ap 0 reg 12 0x00000000 |
33 | 15:21:44:344 : w ap 0 reg 13 0x00000000 |
34 | 15:21:44:344 : w ap 0 reg 14 0x20000001 |
35 | 15:21:44:344 : w ap 0 reg 15 0x20000005 |
36 | 15:21:44:344 : w ap 0 reg 16 0x01000000 |
37 | 15:21:44:344 : w ap 0 reg 17 0x20000CC8 |
38 | 15:21:44:344 : w ap 0 reg 18 0x00000000 |
39 | 15:21:44:345 : run ap 0 |
40 | 15:21:49:000 : halt ap 0 |
41 | 15:21:49:000 : Init function fail with timeout |
42 | 15:21:49:003 : r ap 0 reg 16 0x81005800 |
43 | 15:21:49:003 : WriteOB function terminated with connection error due to OB_Launch |
44 | 15:21:49:003 : Reconnecting... |
45 | 15:21:50:103 : STLinkUSBDriver.dll loaded |
46 | 15:21:50:103 : ST-LINK SN : 066BFF504955857567125335 |
47 | 15:21:50:104 : ST-LINK FW : V2J33M25 |
48 | 15:21:50:111 : Voltage : 3.05V |
49 | 15:21:50:115 : SWD freq : 4000 KHz |
50 | 15:21:50:115 : Connect mode: Normal |
51 | 15:21:50:115 : Reset mode : Hardware reset |
52 | 15:21:50:167 : Device ID : 0x435 |
53 | 15:21:50:168 : Reconnected ! |
54 | 15:21:50:168 : Success with Time elapsed during Reconnect: 66 ms |
55 | 15:21:50:223 : UPLOADING OPTION BYTES DATA ... |
56 | 15:21:50:223 : Bank : 0x00 |
57 | 15:21:50:224 : Address : 0x40022020 |
58 | 15:21:50:225 : Size : 20 Bytes |
59 | 15:21:50:225 : Reading data... |
60 | 15:21:50:228 : r ap 0 @0x40022020 0x00000014 bytes |
61 | 15:21:50:228 : OPTION BYTE PROGRAMMING VERIFICATION: |
62 | 15:21:50:228 : Error: Expected value for Option Byte "BOR_LEV": 0x4, found: 0x0 |
63 | 15:21:50:254 : Error: Option Byte Programming failed |
64 | 15:21:50:328 : Option byte refresh |
65 | 15:21:50:399 : UPLOADING OPTION BYTES DATA ... |
66 | 15:21:50:400 : Bank : 0x00 |
67 | 15:21:50:400 : Address : 0x40022020 |
68 | 15:21:50:400 : Size : 20 Bytes |
69 | 15:21:50:400 : Reading data... |
70 | 15:21:50:400 : r ap 0 @0x40022020 0x00000014 bytes |
Die Option Bytes werden wie im Anhang ausgelesen. Hier habe ich nichts geändert (bis auf den fehlgeschlagenen BOR-Test), weiß aber nicht, ob die Einstellungen so richtig sind. An Hardware nutze ich den ST-Link/V2-1 eines Nucleo Boards (Firmware wurde aktualisiert). Der STM selbst ist lediglich mit den Vdd/Vref + Block-Cs beschaltet sowie 4 Leitungen zum SWD-Port (SWDIO, SWCLK, nRST, GND) Hat jemand einen Tipp was ich falsch mache...