Reputation: 1
I am playing with debugging STM32F407
via JTAG protocol and DAP interface etc. I want to use the DHCSR
register to stop the processor (set the C_HALT
bit in this register). And to do this through the interface DAP need to configure the register CSW
, write the address of DHCSR
in the register TAR
and the necessary data in the register DRW
, all this I do but after all this procedure I constantly get an error STICKYERR
in the DAP register CTRL/STAT
and accordingly can not read the register DHCSR
or write to it. What I do wrong?
I attempted to halt the STM32F407 processor using the DHCSR
register via the JTAG protocol and DAP interface. My steps:
0b1010
(the DPACC
register code) into the IR
register.AP
register CSW
need to be configured. To access this register, we need to select the corresponding AP
and register bank in the DP SELECT
register. Write to the DR
register:
0x00
0x00
0x00
0b10
(address of SELECT
register)0b0
CSW
register. Since this is an AP
register, we need to use the APACC
register to access it:
0b1011
(the APACC
register code) into the IR
register.Size[0:2] = 0b010
), disable the auto-increment function of the address (AddrInc[5:4] = 0b00
). Write to DR
:
0x2200 0002
(MasterType=1, Hprot1=1, Size=b010)0b00
(address of CSW
register)0b0
AP
register TAR
. And since this register belongs to the same AP
as CSW
and is in the same bank, we can omit the reference to the DP SELECT
register and immediately write the address value. Write to DR
:
0xE000EDF0
0b01
(address of TAR
register)0b0
DRW
register. Write to DR
W:
0x03
0b11
(address of DRW
register)0b0
After this I got STICKYERR
in the DAP register `CTRL/STAT.
Upvotes: 0
Views: 139