STM32-P207 Openocd Error

(Firma: mumu) #2549335
Lesenswert?

Hallo,

ich habe ein Olimex Board (STM32-P207) mit einem Olimex ARM-USB-TINY-H 
JTAGE Interface.
Kann mir jemand helfen??

Folgendes Problem trifft auf, wenn ich den STM32 flashen möchte:

C:\Users\michi\Desktop\openocd-x64-0.5.0\bin>openocd-x64-0.5.0.exe -f 
olimex-arm
-usb-tiny-h.cfg -f stm32f2x.cfg
Open On-Chip Debugger 0.5.0 (2011-08-09-23:26)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
300 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
Info : max TCK change to: 30000 kHz
Info : clock speed 300 kHz
Info : JTAG tap: stm32f2xxx.cpu tap/device found: 0x4ba00477 (mfg: 
0x23b, part:
0xba00, ver: 0x4)
Info : JTAG tap: stm32f2xxx.bs tap/device found: 0x06411041 (mfg: 0x020, 
part: 0
x6411, ver: 0x0)
Info : stm32f2xxx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection from 3333
Info : device id = 0x20016411
Info : flash size = 1024kBytes
Info : The target is not running when halt was requested, stopping GDB.
undefined debug reason 6 - target needs reset
Info : The target is not running when halt was requested, stopping GDB.
Info : The target is not running when halt was requested, stopping GDB.
Info : The target is not running when halt was requested, stopping GDB.
Info : The target is not running when halt was requested, stopping GDB.
Info : The target is not running when halt was requested, stopping GDB.
Info : The target is not running when halt was requested, stopping GDB.
Info : The target is not running when halt was requested, stopping GDB.
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x40023c08
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x40023c08
Warn : Block write error address 0x40023c04, wcount 0x1
Info : The target is not running when halt was requested, stopping GDB.
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x40023c08
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x40023c08
Warn : Block write error address 0x40023c04, wcount 0x1
Info : The target is not running when halt was requested, stopping GDB.

Info : The target is not running when halt was requested, stopping GDB.
Info : The target is not running when halt was requested, stopping GDB.
Gast #3847808
Lesenswert?

hey ysp,

ich hatte heute auch mit diesem problem zu kämpfen. mein stm32l1 device 
ließ sich plötzlich nicht mehr flashen. ich benutze openocd + gdb mit 
ftdi basiertem adapter.

der knackpunkt liegt bei:
Warn : Block write error address 0x40023c04, wcount 0x1

um der sache näher zu kommen, kann man bei openocd alle debug meldungen 
ausgeben. dazu folgendes im gdb eingeben:
mon debug_level 3

dann kommst du vermutlich auf eine ausgabe wie diese:
Debug: 146 74371 target.c:1930 target_read_u32(): address: 0x40023c18, 
value: 0x0000050c
Error: 147 74371 stm32lx.c:869 stm32lx_wait_until_bsy_clear(): access 
denied / write protected

wenn man im quelltext etwas kramt, kommt man darauf, dass in einem der 
optionsregister FLASH_SR (flash status register, beim stm32l1 @ 
0x40023C18) fehlerbits gesetzt sind: WRPERR (bei mir noch SIZERR), 
welche bei write-protect violation gesetzt werden.

lange rede kurzer sinn, wenn man das read protection level RDP im info 
block von NVM (siehe reference manual 3.5. option byte description) von 
1 auf 0 übergehen lässt, wird der seltsame lese-/schreibschutz 
aufgehoben.

eine beschreibung, wie man diesen übergang von RDP level 1 auf level 0 
manuell realisiert, findest du hier:
https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a%2f%2fmy.st.com%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex_mx_stm32%2fFlash%20Programming%20Locked%20Out&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=1855

(ganz kurz beschrieben: schreibschutz für option-register mittels 
FLASH_OPTKEYR register aufheben laut refman "3.4.1 Unlocking/locking 
memory" ; (gdb) mon mww 0x1ff80000 0xffee0011 (rdp auf level 1); reset ; 
schreibschutz nochma aufheben; (gdb) mon mww 0x1ff80000 0xff5500aa (rdp 
auf level 0))

grüße
flo

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren