Skip to content

Commit

Permalink
fix(agdi): fix reg addr used in pdsc patch data
Browse files Browse the repository at this point in the history
The original regsiter address should be used for pdsc patch data.
  • Loading branch information
windowsair committed Aug 18, 2024
1 parent 9c90d18 commit 9f89ff2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions elaphureLinkAGDI/DbgCM/JTAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,9 @@ int JTAG_ReadAP(BYTE adr, DWORD *val)
AP_Bank = adr & APBANKSEL;
}

adr &= 0x0F;

// Read AP Register
status = rddi::DAP_ReadReg(rddi::k_rddi_handle, JTAG_devs.com_no,
DAP_REG_AP_0x0 + (adr >> 2), (int *)val);
DAP_REG_AP_0x0 + ((adr & 0x0F) >> 2), (int *)val);
status = JTAG_CheckStatus(status);
if (status == rddi::RDDI_DAP_ERROR_MEMORY) {
return EU14;
Expand Down
6 changes: 2 additions & 4 deletions elaphureLinkAGDI/DbgCM/SWD.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**************************************************************************/ /**
/**************************************************************************/ /**
* Cortex-M Middle/Upper layer Debug driver Template for µVision
*
* @version V1.1.13
Expand Down Expand Up @@ -405,11 +405,9 @@ int SWD_ReadAP(BYTE adr, DWORD *val)
AP_Bank = adr & APBANKSEL;
}

adr &= 0x0F;

// Read AP Register
status = rddi::DAP_ReadReg(rddi::k_rddi_handle, 0,
DAP_REG_AP_0x0 + (adr >> 2), (int *)val);
DAP_REG_AP_0x0 + ((adr & 0x0F) >> 2), (int *)val);
status = SWD_CheckStatus(status);
if (status == rddi::RDDI_DAP_ERROR_MEMORY) {
return EU14;
Expand Down

0 comments on commit 9f89ff2

Please sign in to comment.