Login

Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.

ARM Community: Serial Wire Debug AP access - ARM Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Serial Wire Debug AP access Rate Topic: -----

#1 User is offline   Theesan 

  • Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 15-March 11

Posted 15 March 2011 - 07:17 PM

Please somebody help me with this issue.
I am trying to program the flash memory using Serial wire Debug in a STM32L152 advanced ARM-based 32-bit MCU.
I will be almost done if this issue gets cleared. I am able to do read and write accesses on each of the DP registers if they actually allow to do so.And when I try to read one of the AP registers, it gives me an 'OK' response. But when I read the value, it gives all zeroes. After that I tried to read the Read Buffer register. Still the same answer. Also when I try to write one of the AP registers, it gives an 'OK' response. Then I sent some 32 bits with a parity bit to be written. But after that the 'STICKYERR' bit got set in the CTRL/STATUS register with the data not being written I hope,which means some bus error has occurred. What may be the problem? At least I should be able to do read and write accesses in the CSW-AP register. Am I right? I thing I may not be aware of some important issue. I would be very much grateful to you if you could spend a little time in clarifying my doubt.

What is the importance of the Clock signal in AP access? Will it be a reason for the above issue?



This post has been edited by Theesan: 16 March 2011 - 11:56 AM

0

#2 User is offline   Theesan 

  • Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 15-March 11

Posted 18 March 2011 - 05:10 AM

Hello! nobody there?
Okay! May be that question doesn't explain the problem understandably.
For example, the sequence was like this for the first case
  • Write AP SELECT register-(10001101,100,000011110000000000000000000000000)
  • Read IDR(AP) - 'OK' response,but no reading-(11111001,100,0000000000000000000000000000000000)
  • Read CTRL/STAT-(10110001,100,100000100000000000000000000000000)

(The last bits are parity bits in all cases)

And for the second case
  • Write AP SELECT Register-(10001101,100,000000000000000000000000000000000)
  • Write CSW(AP) -'OK' response-(11011101,100,1000101000000000000000000000000001)
  • Read CTRL/STAT -STKERR flag set-(10110001,100,100001100000000000000000000000000)
And I have driven the clock signal continuously without driving the clock low when accessing AP registers after writing the AP SELECT register.

This post has been edited by Theesan: 18 March 2011 - 06:28 AM

0

#3 User is offline   falconyang 

  • Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 02-May 11

Posted 02 May 2011 - 09:23 PM

I got the same issue here. Any luck?
0

#4 User is offline   tsh2 

  • Member
  • Pip
  • Group: Members.
  • Posts: 1
  • Joined: 06-May 11

Posted 06 May 2011 - 03:25 PM

Did you make sure to set the CSYSPWRUPREQ and CDBGPWRUPREQ bits in the DP first? I haven't checked the STM32L152 data sheet, but you need to make sure that the AP has a clock before performing an access, and I think that the DP will not even try the access if the power up bits are not set. It is correct that the first AP access is accepted with an OK, that indicates that the command was accepted, then the next access should return a FAULT to indicate that the command caused a problem.
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic