EmbDev.net

Forum: µC & Digital Electronics Eclipse & OpenOCD: AHBAP; Sticky und Mem Read Error


von Kenan Ö. (gladio)


Rate this post
useful
not useful
Hi everyone,

I'm using the STM32-P103 board with Eclipse and oocd 0.2.0.

my problem is that I can't use debugging.

I use this for OpenOCD:

gdb_port 3333


# Work-area size (RAM size) = 20kB for STM32F103RB device
set _WORKAREASIZE 0x5000

interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG TINY A"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0003

# script for stm32

if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME stm32
}

if { [info exists ENDIAN] } {
set _ENDIAN $ENDIAN
} else {
set _ENDIAN little
}

# JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use 
F_JTAG = 1MHz
#jtag_khz 1000
jtag_speed 3

#jtag_device 4 0x1 0xf 0xe

jtag_nsrst_delay 100
jtag_ntrst_delay 100

#use combined on interfaces or targets that can't set TRST/SRST 
separately
reset_config trst_and_srst

#jtag scan chain
if { [info exists CPUTAPID ] } {
set _CPUTAPID $CPUTAPID
} else {
# See STM Document RM0008
# Section 26.6.3
set _CPUTAPID 0x3ba00477
}
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf 
-expected-id $_CPUTAPID

if { [info exists BSTAPID ] } {
set _BSTAPID $BSTAPID
} else {
# See STM Document RM0008
# Section 26.6.2
# Low density devices, Rev A
set _BSTAPID1 0x06412041
# Medium density devices, Rev A
set _BSTAPID2 0x06410041
# Medium density devices, Rev B and Rev Z
set _BSTAPID3 0x16410041
# High density devices, Rev A
set _BSTAPID4 0x06414041
# Connectivity line devices, Rev A and Rev Z
set _BSTAPID5 0x06418041
}
jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 
-expected-id $_BSTAPID1 -expected-id $_BSTAPID2 -expected-id $_BSTAPID3 
-expected-id $_BSTAPID4 -expected-id $_BSTAPID5

set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position 
$_TARGETNAME

$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 
-work-area-size $_WORKAREASIZE -work-area-backup 0

flash bank stm32x 0 0 0 0 0

init
reset halt


For GDB:
target remote localhost:3333
break main


I got following Errors:

Open On-Chip Debugger 0.2.0 (2009-10-13-15:06) Release
$URL: http://svn.berlios.de/svnroot/repos/ope ... /openocd.c $
For bug reports, read 
http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
jtag_speed: 3
jtag_nsrst_delay: 100
jtag_ntrst_delay: 100
Info : device: 4
Info : deviceID: 364511236
Info : SerialNumber: FTS92Y5TA
Info : Description: Olimex OpenOCD JTAG TINY A
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, 
part: 0xba00, ver: 0x3)
Info : JTAG Tap/device matched
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, 
part: 0x6410, ver: 0x1)
Info : JTAG Tap/device matched
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, 
part: 0xba00, ver: 0x3)
Info : JTAG Tap/device matched
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, 
part: 0x6410, ver: 0x1)
Info : JTAG Tap/device matched
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x20000010
Info : accepting 'gdb' connection from 0
Warn : acknowledgment received, but no packet pending
Info : device id = 0x20036410
Info : flash size = 128kbytes
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000012, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x202d0dd4
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000012, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x202d0dd4
Warn : Block read error address 0x202d0dd0, count 0x1
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f64f
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f650
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000012, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x202d0dd4
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000012, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x202d0dd4
Warn : Block read error address 0x202d0dd0, count 0x1
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f64f
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f650
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f653
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f654
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f657
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f658
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f65b
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f65c
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f65f
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f660
Error: AHBAP Cached values: dp_select 0x0, ap_csw 0xa2000010, ap_tar 
0xffffffff
Error: SWJ-DP STICKY ERROR
Error: Read MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x5214f663


I tried a to reduce the JTAG speed but it didn't worked out for me.. I 
Have no Idea what else I should do..

So any help would be much appreciated!

von Markus M. (Company: EleLa - www.elela.de) (mmvisual)


Rate this post
useful
not useful
You can look here:
http://www.mikrocontroller.net/articles/STM32#Demo-Projekte

There is a link to "ChaN's FAT-Module with STM32 SPI"
In this project is a complete Eclipse configurationwhere is working 
fine.

von Kenan Ö. (gladio)


Rate this post
useful
not useful
Thanks for that, but I need to know where the error might be..

von Kenan Ö. (gladio)


Rate this post
useful
not useful
Anyone else with an idea?

von Markus M. (Company: EleLa - www.elela.de) (mmvisual)


Rate this post
useful
not useful
Load and open this project, there are all configurations, OpenOCD and so 
included and ist works. Then you can look what is the different from 
this project and your configuration.

von Kenan Ö. (gladio)


Rate this post
useful
not useful
If I try to build this project I got this error:

make: *** [FLASH_RUN/main.o] Error 1  project    0  C/C++ Problem

how can I solve it?

von Markus M. (Company: EleLa - www.elela.de) (mmvisual)


Rate this post
useful
not useful
are this all messages from make?

von Kenan Ö. (gladio)


Rate this post
useful
not useful
Yes.. There was a line in the makefile which was causing this error.. so 
i just deleted it and run build with success.. but I got the same error 
messages.. So there must be something else, but what?

von Markus M. (Company: EleLa - www.elela.de) (mmvisual)


Rate this post
useful
not useful
Also, the project was finish and without errors translated?

In Eclipse gives the external tools, with them you can start the 
openocd.
In Debug gives the commands for load reset run

You have install the tools GDB Hardware Debugging?

von Kenan Ö. (gladio)


Rate this post
useful
not useful
Yes there were no errors at all and it was translated successfully..

these are the two steps on my way to run the code:

1) Build project
2) Run OpenOCD over external Tools in Eclipse
3) Run GDB over external Tools in Eclipse

and each time, I got the same error messages like above

I don't know why but sometimes it works but this is only in maybe 0,1 % 
at all tries i made the whole day :(

I have no idea what else to do, so I keep checking my makefile, cfg-file 
and so on, but as I said, I have no idea what else I should try..

So any help is really appreciated..

von Markus M. (Company: EleLa - www.elela.de) (mmvisual)


Rate this post
useful
not useful
Part 1) and 2) are right
Part 3) must configurated into Debug. 2 Icons left from External Tools 
is the debug Icon.
And there open the Debug Configurations...
And in the demo Project under the line GDB Hardware Debugging are 5 
entrys.

von Kenan Ö. (gladio)


Rate this post
useful
not useful
I already put it right there in the right place. Sorry for the 
misunderstanding.

So I have to leave to catch my train.. So if you got any other ideas let 
me read them..

Have a nice day..

p.s. I will take a look at this site later :)

von Markus M. (Company: EleLa - www.elela.de) (mmvisual)


Rate this post
useful
not useful
Can you take ScreenShots from External run tool and debug configuration?

von Kenan Ö. (gladio)


Attached files:

Rate this post
useful
not useful
I'm actually not at work so it's kind of hard to get screenshots. So I 
tried to find some screenshots fromother people.

here they are..

von Kenan Ö. (gladio)


Attached files:

Rate this post
useful
not useful
this is the same like i have in my code, the only difference is the GDB 
debugger is from Yagarto, the commands are the same like above

target remote localhost:3333
break main

I also use the zylin embedded debug nativ version..

von Markus M. (Company: EleLa - www.elela.de) (mmvisual)


Rate this post
useful
not useful
Can you use the GDB Hardware Debugging tool?

I have problems with zylin, but the other have work better.

von Kenan Ö. (gladio)


Rate this post
useful
not useful
This worked for me a couple of times. I think there is a problem with 
the AHB Bus but I dont know what. Maybe I have to set or reset 
something.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.